Saturday, June 8, 2013

Phase 5 - Implement Sliding Window (Part 1)

What to do
1) Implement Sliding Windows - Part 1
  • For the various sliding windows protocol, we decide to implement Selective Repeat. (Check Help_Sess3_B05.pdf, the textbook and Data_Link_Layer_S12.pdf for pseudo code)
  • In order for the Selective Repeat to work, we need to use the function select(). select() allows a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation (e.g., input possible) http://linux.die.net/man/2/select. In our case, we need select() to listen to the pipes between Datalink Layer and Application Layer, and the socket between client and server. In phase 5, let's use select() on both client and server side to listen to the reading end of the socket. We will use select() to listen to the pipes between Datalink Layer and Application Layer in the next phase. (Attached is the code snippet select_on_socket.c in my google drive folder)
Phase 5 Goal
Based on the code of phase 4, implement the function select() on both client and server end to listen to the reading end of the socket. The use of select() guarantees that the receiver will read the frame from the socket only if the socket is ready for reading, thus keeping the receiver from reading undesired number of bytes. 

No comments:

Post a Comment