-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreceived_file.txt
1 lines (1 loc) · 1.92 KB
/
received_file.txt
1
Note that the provided code emulates an unreliable channel in its udt.py file. It also includesa config.py file, where you can vary the packet error probability and the message loss probabilityof the emulated unreliable channel. You can also vary the timeout parameter used by the reliabledata transfer protocols in that file. Please test the different protocols (including the SR protocolyou are going to implement) by varying these parameters. You are encouraged to compare theperformance of SR, GBN, and the simple stop-and-wait protocols under different conditions.2 Selective Repeat (SR) ProtocolAs you have probably observed in your GBN protocol experiments, a single packet error can causeGBN to retransmit multiple packets, many of which are unnecessary if the receiver can buffer out-of-order packets. As its name suggested, a Selective Repeat (SR) protocol avoids unnecessaryretransmissions by having the sender retransmit only those packets that it suspects were lost orreceived in error at the receiver. This individual retransmission is supported by letting the receiverindividually acknowledge correctly received packets and letting the sender keep individual timerfor each transmitted packet. The SR sender and receiver views of the sequence-number space isshown in the figure below.Figure 1: Selective repeat (SR): sender and receiver views of sequence-number space.The main events and actions at the SR sender include:•Data received from above: When data is received from above, the SR sender checks thenext available sequence number for the packet. If the sequence number is within the sender’swindow, the data is packetized and sent; otherwise, as in the reference GBN implementation,you can choose to return to the upper layer for later transmission.•Timeout: Timers are used to deal with lost packets. However, different from the GBN imple-mentation, each packet must now have its own logical timer, since only a single packet will2