Piplined protocols #
Go-back-n #
unacked = unacknowledged = no ACK response, not confirmed for success yet.
The number of bits needed for a -bit sequence numbers is . The window size is .
The packet number that can be used for cumulative ack should be the largest number before any gap.
- Send window size : it can send up to packets on the fly
- Cumulative ACK ( ): means that packet and also every packet before are all received successfully
- Timer: only a single timer, bound to the oldest packet unacked. When timeout, resend all packets in the sender window.
- On receiver side, all packets after the gap are called “out of order”, and they are discarded. Hence, there can only be one gap.
Selective repeat #
For selective repeat, there is still -bit sequence numbers, and a window size of . The largest number is .
- Send up to packets: controlled by sender window size .
- Individual ACK: the particular packet received successfully.
- Timer: there is one timer for each unacked packet. When timeout happens, the sender only resends the particular packet.
- On receiver side: packets after gap are called “out of order”, but this time they are buffered, waiting to be delivered.
So to combat this, if , then the size of the window should be . The largest sequence number is .