The sender has two state variables:

The sender has one state variable:

Give the packet sequence number nextSequenceNumber and send it. Save the packet in case it needs to be resent.

Start the timer.

Start timer nextSequenceNumber.

Increment nextSequenceNumber and stop accepting input from the application layer if the window is full.

Increment nextSequenceNumber and stop accepting input from the application layer.

Advance the window to begin at the first unacknowledged packet.

Accept data from the application layer if the window has advanced.

Advance the window to begin at the first unacknowledged packet.

Accept data from the application layer.

Ignore it. It is an acknowledgment of a resend due to a late acknowledgment.

Send the saved packet and restart the timer.

Send all unacknowledged saved packets and restart the timer.

Send the saved packet associated with the timer and restart the timer.

Send the first unacknowledged saved packet and restart the timer.

Reliable Data Transfer Sender

Alternating Bit Go Back n Selective Repeat Cumulative Acknowledgment
Sender initialization
Response to a packet from the application layer
Response to an acknowledgment with an expected sequence number
Response to an acknowledgment with an unexpected sequence number
Response to a timer firing