Assignment #3 - SocketsOSTEP Book, Chapter 48 (Code) Problem 3https://pages.cs.wisc.edu/~remzi/OSTEP/dist-intro.pdfUse the sample code provided in the following...

1 answer below »

Assignment #3 - Sockets




  • OSTEP Book, Chapter 48 (Code) Problem 3
    https://pages.cs.wisc.edu/~remzi/OSTEP/dist-intro.pdf



Use the sample code provided in the following repository:


https://github.com/remzi-arpacidusseau/ostep-code/
Add reliable communication to your burgeoning communication library, in the form of timeout/retry. Specifically, your library should make a copy of any message that it is going to send. When sending it, it should start a timer, so it can track how long it has been since the message was sent. On the receiver, the library should acknowledge received messages. The client send should block when sending, i.e., it should wait until the message has been acknowledged before returning. It should also be willing to retry sending indefinitely. The maximum message size should be that of the largest single message you can send with UDP. Finally, be sure to perform timeout/retry efficiently by putting the caller to sleep until either an ack arrives or the transmission times out; do not spin and waste the CPU!


Hints



  • Clone the ostep-code project from the link above. In the dist-intro folder you will find everything you need to get the client and server up and running. It should compile with a simple "make" command.

  • Run the server and client programs in separate windows. Note that the message is hard-coded into the client. You will not need to process any arguments or console input.




  • Please test the pre-modified code first to make sure it runs in your environment.


  • When you test your code, start up the client first. It should wait. Then start the server. Client should immediately respond.


Expected Output


Server output should remain unchanged from the original.


Client should simply wait for the server and output accordingly.


Server


server:: waiting...
server:: read message [size:1000 contents:(hello world)]
server:: reply
server:: waiting...


Client


client:: send message [hello world]
client:: waiting for reply
client:: got reply [size:1000 contents:(goodbye world)


Submission



  • Upload only your modified C source files.

  • Any explanations, commentary, etc. should be made either in comments or in the text entry portion of the assignment.


Answered Same DayNov 21, 2022

Answer To: Assignment #3 - SocketsOSTEP Book, Chapter 48 (Code) Problem...

Nidhi answered on Nov 21 2022
37 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here