To design and develop a sender function (sender_subroutine.c) to implement the Go-Back-N ARQ protocol.
Note that this Go-Back-N ARQ protocol is a revised version, and it uses both ACK and NAK packets to simplify the implementation. So it does not implement the timeout mechanism.
- Applys the “IntroduceError.c” routine to the entire packet. Passes the BER value to the program as an argument in the command line.
- The sender initially sends all packets within its send window. Any time a packet is sent, the packet is printed accordingly.
- When the sender gets an ACK from the receiver, it (1) displays an indication of the received ACK, (2) adjusts the send window and (3) sends any new packets in its send window.
- When the sender gets a NAK from the receiver, it (1) displays an indication of the received NAK and (2) retransmits all the packets in the send window.
- If the packet is received error free and in sequence, it displays the packet content and sequence number, then sends back an ACK.
- If the packet is received error free but out of sequence, it does not display the packet content but displays the sequence number, then sends back an ACK.
- If the packet is received in error, it does not display the packet content but displays the sequence number if possible, then sends back a NAK.
A makefile is included which compiles both the sender
and receiver
binaries. You may then run the receiver and sender. The below example uses the port 5000, though you may use any un-privileged port.
make
./receiver 5000
./sender 127.0.0.1 5000 0.01
sender.o
andreceiver.o
already set up the TCP connection between the sender and receiver.