Alternating Bit Protocol (ABP) is a data reliability measure that is implemented in reliable data transfer protocols on the network layer protocol stack. It requires data receivers to send acknowledgments (ACKs) to the receiver along with a single-bit value representing a sequence number of the last received transmission unit.
The basic premise of the ABP is that a sender should retransmit data until it receives an acknowledgment from the recipient. A typical sequence of data transfer using the ABP may unfold as such:
- The sender sends data segment A with SEQ 0, starts a timer;
- The Receiver receives data segment A with SEQ 0;
- The receiver sends a packet back to the sender with ACK0;
- The Sender stops the timer for SEQ0 packet; waits for application input to transmit SEQ1;
- The receiver receives data segment B, but determines data corruption, sends ACK0 (for last valid received data);
- Sener receives an ACK for the wrong SEQ number, knows to re-transmit previous data.
In this sequence, a sender sends data across the network, receives a positive response, sends more data, and then receives a negative response. This signals to the sender that the data was not well-received and should be re-transmitted.
This protocol provides error/loss/corruption detection by alternating bit values between
0 for use as sequence numbers. The advantage offered is data reliability however, the disadvantage is the restriction of the number of packets that can be transmitted at any given time.