Acknowledgments Timers Link Protocol Functions

www.pragsoft.com Chapter 3: The Data Link Layer 39

3.2.1. Acknowledgments

Data link layer does not provide end-to-end accountability; this is a responsibility of higher layers. Instead, each station is responsible for ensuring that the data received by it is correctly passed to the next station. This is facilitated by the use of acknowledgments, of which there are two types: • An acknowledgment ACK is sent by a receiver to a transmitter to indicate that a frame has been received seemingly intact. • A negative acknowledgment NAK is sent by a receiver to a transmitter to indicate that a corrupt frame has been received, or that a frame is missing. In character-based protocols, acknowledgments are implemented as control characters. In bit-oriented protocols, they are implemented as acknowledgment frames . The control field of a frame can contain two sequence numbers: a send sequence number and a receive sequence number. The frames dispatched by a transmitter are sequentially numbered using the send sequence number. The receiver compares the send sequence number of a frame against the send sequence numbers of earlier frames to check for lost frames. A NAK frame uses the receive sequence number to identify a corrupted frame, while an ACK frame uses the receive sequence number to identify the next frame it expects to receive, implying that it has correctly received all frames with sequence numbers less than that number. To improve the use of network bandwidth, an acknowledgment method known as piggybacking is often used. In piggybacking, instead of sending a separate acknowledgment frame, the receiver waits until it has data to send to the receiver and embeds the acknowledgment in that frame.

3.2.2. Timers

Timers provide a mechanism for placing a time limit on certain operations to be completed. A timer is set by a process and has a predefined expiry period. When the timer expires, the corresponding process is notified to take appropriate action. Link protocols make use of a number of different timers, the exact number and function of which is protocol-dependent. However, two important timers called T1 and T2 are used by most protocols. T1 is set by a transmitter upon transmitting a frame. The transmitter expects to receive an acknowledgment frame before T1 expires. Otherwise, the transmitter resets T1 and retransmits the frame. The protocol allows a certain number of retries before the problem is propagated to a higher layer. T2 is set by a receiver to ensure that an acknowledgment frame is sent to the transmitter before its T1 timer expires. This is intended to avoid the transmitter having 40 Communication Networks Copyright © 2005 PragSoft to retransmit frames because the receiver has been slow in acknowledging their receipt. When piggybacking is used, the receiver will send a separate acknowledgment frame if T2 expires.

3.2.3. Error Checking