logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Charles BrackenFinance
(5/5)

852 Answers

Hire Me
expert
Bryan KAccounting
(5/5)

559 Answers

Hire Me
expert
Persimmon BissoondathhCriminology
(5/5)

878 Answers

Hire Me
expert
Norman RoxManagement
(4/5)

645 Answers

Hire Me
C++ Programming

Demonstrate TCP 3-way handshake and closing a TCP connection using a client-server architecture.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Objective:

Demonstrate TCP 3-way handshake and closing a TCP connection using a client-server architecture.

Requirements:

  1. Create a C based client-server architecture using sockets
  2. The server should run on cse01.cse.unt.edu machine and the client should run on cse02.cse.unt.edu machine
  3. The client should be able to communicate with the server using TCP segments
  4. The client should be able to demonstrate a 3-way TCP handshake with the server
  5. The client should be able to demonstrate closing a TCP connection.

Procedure:

  1. Create a C-based server that can runs on cse01.cse.unt.edu and accepts single client’s request on using sockets
  2. Create a C-based client that runs on cse02.cse.unt.edu and connects to the server
  3. On the client side, create a TCP segment as shown in Figure Create a C structure with the following fields
    1. 16-bit source and destination port [Type: unsigned short int]
    2. 32-bit sequence number [Type: unsigned int]
    3. 32-bit acknowledgement number [Type: unsigned int]
  1. 4-bit data offset or header length (in multiples of 32-bit)
  2. 6-bit reserved section
  3. 6-bit flags [Type: unsigned short int for combined fields of d, e, and f]
  4. 16-bit receive window for flow control [Type: unsigned short int, set to zero]
  5. 16-bit checksum [Type: unsigned short int, computed after the header and data is populated]
  6. 16-bit urgent data pointer [Type: unsigned short int, set to zero]
  7. 32-bit Options [Type: unsigned int, set to zero]
  1. The variable length payload or the data field is assumed it to be of 0 bytes, as we are going to demonstrate opening and closing a TCP connection
  2. Find the source port, destination port, and header length and populate the corresponding fields of all the client and server TCP segments created below
  3. Demonstrate opening of a TCP connection by following the below steps. Refer to Figure
    1. Create a connection request TCP segment as follows
      1. Assign an initial client sequence number with a zero acknowledgement number
      2. Set the SYN bit to 1
  • Compute the 16-bit checksum of the entire TCP segment and populate the checksum field
  1. The server responds to the request by creating a connection granted TCP segment. Create a connection granted response as follows
    1. Assign an initial server sequence number with an acknowledgement number equal to initial client sequence number + 1
    2. Set the SYN bit and ACK bit to 1
  • Compute the 16-bit checksum of the entire TCP segment and populate the checksum field
  1. The client responds back with an acknowledgement TCP segment. Create an acknowledgement TCP segment as follows
    1. Assign a sequence number as initial client sequence number + 1 with an acknowledgement number equal to initial server sequence number + 1
    2. Set the ACK bit to 1
  • Compute the 16-bit checksum of the entire TCP segment and populate the checksum field
  1. Demonstrate closing of a TCP connection by following the below steps. Refer to Figure
    1. Create a close request TCP segment as follows
      1. Assign an initial client sequence number with a zero acknowledgement number

 

  1. Set the FIN bit to 1
  • Compute the 16-bit checksum of the entire TCP segment and populate the checksum field
  1. The server responds back with an acknowledgment TCP segment. Create an acknowledgement TCP segment as follows
    1. Assign a initial server sequence number with an acknowledgement number equal to initial client sequence number + 1
    2. Set the ACK bit to 1
  • Compute the 16-bit checksum of the entire TCP segment and populate the checksum field
  1. The server again sends another close acknowledgement TCP segment. Create the TCP segment as follows
    1. Assign an initial server sequence number with an acknowledgement number equal to initial client sequence number + 1
    2. Set the FIN bit to 1
  • Compute the 16-bit checksum of the entire TCP segment and populate the checksum field
  1. The client responds back with an acknowledgement TCP segment. Create an acknowledgement TCP segment as follows
    1. Assign a sequence number as initial client sequence number + 1 with an acknowledgement number equal to initial server sequence number + 1
    2. Set the ACK bit to 1
  • Compute the 16-bit checksum of the entire TCP segment and populate the checksum field
  1. Assume client and server has no timeout constraints
  2. Write to a file (server.out and client.out) and print to the console the TCP segments transmitted and received (on both server side and client side).
  3. An example code (cksum.c) to compute the checksum is given on

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme