Question
IN C please Objective: Create a client-server model that will measure performance of the connection in terms of round-trip time (RTT), end-to-end time, and throughput
IN C please
Objective: Create a client-server model that will measure performance of the connection in terms of round-trip time (RTT), end-to-end time, and throughput by sending and receiving text files. Requirements: 1. Create a C-based client-server architecture using TCP sockets 2. The port number of the server, IP address of the server, input file, and output file should be line arguments to the client program 3. The server should run on any cell machine and the client should be able to connect to the server to compute the performance of the connection 4. The server should accept and service at least one clients requests 5. The client should send a 16 KB text file in chunks of 4 KB or lesser to the server and server should accumulate all the chunks 6. The server should then echo back the accumulated 16 KB data as 4 KB chunks or lesser to the client 7. The client should start a timer just before sending the 16 KB file to the server and stop the timer just after receiving all the chunks from the server to compute the round-trip time in ms 8. The received accumulated data from the server should be stored into an output text file. The input and output text file should be identical
Page 2 of 3 9. The client should then compute the end-to-end time and the throughput 10. Print the round-trip time and end-to-end time in ms and throughput in Mbps on the client side. Make sure all the performance values are rounded off to three decimal places 11. Do not use any string functions to concatenate, copy, or do string manipulations when sending or receiving data on the client side 12. Do not use any string functions to concatenate, copy, or do string manipulations when receiving or sending data on the server side 13. The user will input a 16 KB text file and correct input arguments at the client side. Do not use any Linux shell commands or code from the internet. Procedure: 1. Create a C-based server that can accept at least one clients request using TCP sockets 2. The server should be able to run on any cell machine and the format to start the server is as follows ./prserver
Page 3 of 3 9. The client should accumulate the chunks in a 16 KB buffer without using any string functions and write the buffer to an output file 10. Compare the input file and output file using the diff program to see if the data in files are identical and it should be identical 11. A timer is started just before the file is sent to the server and stopped just after the chunks are accumulated on the client side. Please refer to https://linuxhint.com/gettimeofday_c_language/ for more details 12. When the start time is subtracted from the stop time the round-trip time (RTT) can be computed and half of the RTT gives the end-to-end time. Print the RTT and end-to-end time in ms on the client side. 13. The throughput is computed as the amount of data sent (16 KB) divided by the end-to-end time. Print the throughput in Mbps on the client side 14. Make sure all the performance values are rounded off to three decimal places 15. An example client interaction with the server is shown below. Client-side input/output: ./prclient 10.144.192.223 1234 test_16.txt recv_16.txt Round Trip Time: 2.417 ms End-to-end Time: 1.209 ms Throughput: 108.413 Mbps Deliverables: 1. Commented server and client C code 2. A Makefile to compile (make) the source code and to clean (make clean) the executable 3. A readme file that describes how to compile, execute, and test the code. 4. Create an assignment folder with folder name as euid_PA2 (example: xyz0202_PA2) and add all the source files, Makefile, and the readme file to the folder. Please create a zip archive of your assignment folder and upload the zip file to Canvas.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started