Project 4 FAQ

From CS415

Q. Receiver-side implementation for stream-oriented protocol: The receiver-side implementation for the reliable communication does not necessarily preserve the message boundaries. How should I implement the receiver ?.

When an user application (e.g an application thread) uses minisocket_receive to receive application data, the application allocates a buffer of max_len bytes. If the minisocket used by the application has some data of lenght minisock_len received earlier from the sender than the minisocket_receive returns to the application min(max_len,minisock_len) bytes. If the used minisocket has not received application data yet, then the user application is blocked until the used minisocket receives some data. Then the minithread system of the receiver-side may wake up the blocked thread in two ways (you need to implement only one alternative):

  1. wakes up the thread when the first packet is received and returns to the application min(max_len,packet_size) bytes where packet_size is the lenght of application data included in the first packet
  2. wakes up the thread when it knows that the sender finishes ending its message or when the minisocket has more data than required by the application. The minisocket_receiver returns to the application min(max_len,minisocket_buff_size) bytes where minisocket_buff_size represents the size of the application data received from the sender since the application thread is blocked.

Hint: the receiver should not preserve packet boundaries. For example, if the application wants 100 bytes and the received packet has 1500 data bytes, then the application receives the first 100 bytes and the rest of the message from the packet is stored in the minisocket. Do not forget that application data is sent in order.

Q. Getting a better grade: How can I get a better grade for project 4?

You can get a good grade for project 4 by satisfying the following requirements:

  1. You should have a documented code and a modular implementation (implementation of minisocket is independent of miniport implementation)
  2. Your code should run all TCP tests provided with the project 4 folder (conn-network*)
  3. You test your code with all corner cases and provide the test programs that you used