Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a simple HTTP client and a separate HTTP server application in C using the POSIX socket libraries. As soon as the client connects, the

Write a simple HTTP client and a separate HTTP server application in C using the POSIX socket libraries. As soon as the client connects, the client will send 20 bytes of the TCP header simulating the 3-way handshake, the server should respond to it and finally the client completes the handshake.

You must use the POSIX socket functions.

DO NOT implement the server handling multiple requests at the same time

Implement reasonable output messages that show the raw bytes of the header plus each header field in human readable format e.g.etc port numbers should be integers

You will need the following fields in the fake TCP header:

1. Source TCP port number Use a C function call to get this

2. Destination TCP port number The real port you are connecting to

3. Sequence number Create a random Initial Sequence Number

4. Acknowledgment number - You should use the appropriate value

5. TCP data offset - Make it all zeros for now

6. Reserved data Make it all zeros for now

7. Control flags flags should be set correctly for the 3-way handshake

8. Window size Use a reasonable default value e.g. 17520 bytes

9. TCP checksum Make it all ffffs for now

10. Urgent pointer Make it all zeros

Compile and run this program on LINUX as well as UHUNIX.

Submit:

Source code for client and server

Make file

Output of the 3-way handshake (both client and server)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions

Question

What are the HR forecasting techniques?

Answered: 1 week ago

Question

What is a verb?

Answered: 1 week ago