1/14 Data Link Control Surasak Sanguanpong nguan@ku.ac.th http://www.cpe.ku.ac.th/~nguan Last updated: 11 July 2000 Flow Control 2/14 technique for controlling the data transmission so that s have sufficient buffer space to accept before processing common flow control schemes : X-ON and X-OFF Stop-and-Wait Sliding Windows 1
X-On and X-OFF 3/14 transmit stop transmit dddddd dddddd X-OFF X-ON sends X-OFF (DC3) if its buffer is full stops sending when receives X-OFF sends X-ON (DC1) when buffer space becomes available s starts sending when receives X-ON Stop-and-Wait Flow Control 4/14 transmits aframe data i ACK sends back an acknowledgement to the frame just received wait until it receives ACK before sending the next frame data i+1 2
Sliding-Window Flow Control 5/14 Sender s buffer frames already transmitted frames that may be transmitted frame sequence number lower window pointer upper window pointer s buffer frames already received frames that may be accepted frame sequence number lower window pointer upper window pointer Sliding-Window example 6/14 0,1,2 ACK3 ACK4 3,4,5,6 3
Error Detection 7/14 Parity check oddorevenparity undetected error, it two or any even number of bits are inverted CRC uses dynamic bit pattern attached with data can detect various errors with appropriated code all single bit error all double bit errors any odd number of errors CRC concepts M k-bit F n-bit 8/14 T T=2 n M+F What should be F? 2 n M P = Q+ R P Q,R quotient, remainder P is predetermine divisor T=2 n M+R let F equals R T P = 2n M+R divides T by R P P R = Q+ + R = Q T is divisible by P P P Given a k-bit block of bits (M), the transmitter generates an n-bit sequence (F), so that the resulting frame, consisting of k+n bits (T), is exactly divisible by some predetermine divisor (P). The then divides the incoming frame (T) by that number (P), if there is no remainder, assume there was no error. 4
CRC in polynomials 9/14 M = 110011 then M(X) = X 5 +X 4 +X+1 P = 1101 then P(X) = X 3 +X+1 Standard P(X) CRC-16 = X 16 +X 15 +X 2 +1 CRC-CCITT = X 16 +X 12 +X 5 +1 CRC-32 = X 32 +X 26 +X 23 +X 22 +X 16 +X 12 +X 11 + X 10 +X 8 +X 7 +X 5 +X 4 ++X 2 +1 Error Control 10/14 What is error control detect and correct errors occurs in transmission Type of errors loss frame damaged frame 5
Error Control Techniques 11/14 Error control techniques error detection positive ACK Retransmission after timeout Negative ACK Standard techniques Stop-and-wait ARQ Go-back-N ARQ Selective Repeat ARQ } known as Automatic Repeat Request (ARQ) Stop-and-Wait ARQ 12/14 time out time out frame I+1 frame I+2 frame I+2 frame I+3 frame I+3 frame i ACK i ACK I+1 ACK I+2 ACK I+3 ACK I+3 frame lost retransmit ACK lost retransmit & duplicate discard 6
Go-back-N ARQ 13/14 6, 7 and 8 retransmitted frame 3 frame 2 frame 1 ACK 4 frame 5 frame 4 ACK 6 frame 7 frame 8 NACK 6 frame 7 frame 8 ACK 9 error 7and8 will be discarded Selective-repeat ARQ 14/14 only 6 is retransmitted frame 3 frame 2 frame 1 ACK 4 frame 5 frame 4 ACK 6 frame 7 frame 8 frame 9 NACK 6 frame 10 ACK 9 error 7