Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!


Swap Client and Server Programs Computer Science Worksheet

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: 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:

  1. Complete the function swap_write() found in the file swap_client.c.
  2. Complete the function swap_read() found in the file swap_server.c.
  3. 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.
  4. Add additional print statements to your code to provide information about what the client and server programs are doing when they run.
  5. 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.

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

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.

  1. # Compile the SWAP server program $gcc test_swap_server.c swap_server.c sdp.c checksum.c -o test_swap_server
  2. # Run the SWAP server program from the command line; specify the port number./test_swap_server 8899
  3. # Compile the SWAP client program$ gcc test_swap_client.c swap_client.c sdp.c checksum.c -o test_swap_client
  4. # Run the client program from the command line; specify the IP address and port number./test_swap_client 8899

If there are no errors in your implementation of SWAP, then swap_server will print the message sent from swap_client.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Writers Hero only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Writers Hero are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Writers Hero is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Writers Hero, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.