Swap Client and Server Programs Computer Science Worksheet

roject Requirements

In Part 3 of the project, you only need to design and implement the SWAP functions swap_read() and swap_write(). All the other SWAP functions are provided for you in the source files swap_client.c and swap_server.c. These files can be downloaded from the Assessments Overview section or by using the following link:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Project Part 3: Source Code Files

. SDP is already completely implemented in sdp.c, and a checksum function is provided in checksum.c.

The source modules supplied for Part 3 of the project will compile and run, but the program functionality is incomplete. To complete these programs, you should implement the following requirements:

  • Complete the function swap_write() found in the file swap_client.c.
  • Complete the function swap_read() found in the file swap_server.c.
  • Implement error checking for DATA frames as well as ACK frames to provide reliable communications. Use the checksum() function found in the file checksum.c for error checking. This file is posted in the attached zip file below.
  • Add additional print statements to your code to provide information about what the client and server programs are doing when they run.
  • Test your SWAP client and server using the files test_swap_client.c and test_swap_server.c that are posted in the attached zip file below.
  • Note

    The sender should send one frame at a time and wait for an acknowledgement before the next frame is sent.

    Save Time On Research and Writing
    Hire a Pro to Write You a 100% Plagiarism-Free Paper.
    Get My Paper

    Compile and Run the SWAP Client and Server Programs

    You will need to test your programs on two terminals, one terminal for the server and another terminal for the client. The port number and IP address for the client should be specified as command line arguments.

  • # Compile the SWAP server program $gcc test_swap_server.c swap_server.c sdp.c checksum.c -o test_swap_server
  • # Run the SWAP server program from the command line; specify the port number./test_swap_server 8899
  • # Compile the SWAP client program$ gcc test_swap_client.c swap_client.c sdp.c checksum.c -o test_swap_client
  • # Run the client program from the command line; specify the IP address and port number./test_swap_client 127.0.0.1 8899
  • If there are no errors in your implementation of SWAP, then swap_server will print the message sent from swap_client.

    Still stressed from student homework?
    Get quality assistance from academic writers!

    Order your essay today and save 25% with the discount code LAVENDER