Retransmission Flow Control Link Protocol Functions

42 Communication Networks Copyright © 2005 PragSoft 100101 0100010 100101 1110 remainder r = 1110 3. Add r to p to produce q: q = 1001011101010000 + 1110 = 1001011101011110 The effectiveness of CRC depends to a large extent on the choice of the generator polynomial. In practice, polynomials of order 16 are widely used. Hence 16 bits two octets 3 are needed for storing the remainder, which appears as the checksum field in the frame see Figure 3.1. Such polynomials are more than 99 effective in catching a variety of errors.

3.2.4. Retransmission

Data link layer’s approach to dealing with corrupted or lost frames is to retransmit them. Two different methods exist for this purpose. In the first method, called Selective Reject , upon encountering a faulty frame, the receiver requests the retransmission of that specific frame. Since additional frames may have followed the faulty frame, the receiver needs to be able to temporarily store these frames until it has received a corrected version of the faulty frame, so that frame order is maintained. A simpler method, Go-Back-N, involves the transmitter requesting the retransmission of the faulty frame as well as all succeeding frames i.e., all frames transmitted after the faulty frame. In other words, the receiver will not accept frames out of order and hence requires no additional means of storing them. The advantage of Selective Reject over Go-Back-N is that it leads to better throughput, because only the erroneous frames are retransmitted. Go-Back-N, however, has the advantage of being simpler to implement and requiring less memory. To obtain the best of both worlds, sometimes a hybrid method is used. It behaves the same as Selective Reject, unless two consecutive frames are in error, in which case it behaves as in Go-Back-N.

3.2.5. Flow Control

The various stations in a network may operate at different speeds. One of the tasks of the data link layer is to ensure that slow devices are not swamped with data from fast devices. Flow control refers to the regulating of the rate of data flow from one 3 An octet consists of eight consecutive bits. In most systems this is the same as a byte, but there are also systems, where a byte has seven, or nine, or some other number of bits. www.pragsoft.com Chapter 3: The Data Link Layer 43 device to another so that the receiver has enough time to consume the data in its receive buffer, before it overflows. In character-oriented protocols, flow control is usually based on two control characters: XON and XOFF. When the receiver senses that it can no longer accept incoming data, it sends an XOFF character to the transmitter, which causes the latter to stop transmitting. Once the receiver has consumed enough of the data in its receive buffer so that it can receive more, it sends an XON character to the transmitter, causing it to resume transmission. In bit-oriented protocols, flow control is handled through the use of ACK frames. Since the transmitter needs to keep a copy of its transmitted but yet unacknowledged frames in a buffer in case they are corrupted and need to be retransmitted, the size of the buffer imposes an upper limit on the number of such frames. When necessary, the receiver can use this fact to slow down the transmitter by withholding ACK frames. The protocol described in the next section uses exactly such a strategy.

3.3. Sliding Window Protocol