Earn Higher Grades With Instant Assignment Help.Ask Question!

C++ Programming
(5/5)

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
Attachments:
(5/5)

Related Questions

CSI 1420 Introduction to C Programming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu

The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

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. The LineItem class will represent an individual

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

SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Assignment To Be Done By Our ExpertsGet A+ Grade Solution Guaranteed

expert
joyComputer science
(4/5)
12 Answers Hire Me
expert
Robert DLaw
(4.8/5)
550 Answers Hire Me
expert
Dr Samuel BarberaStatistics
(5/5)
665 Answers Hire Me
expert
Tutor For YouEconomics
(5/5)
960 Answers Hire Me