data link control
play

Data Link Control Surasak Sanguanpong nguan@ku.ac.th - PDF document

1/14 Data Link Control Surasak Sanguanpong nguan@ku.ac.th http://www.cpe.ku.ac.th/~nguan Last updated: 10 Feb 2001 Applied Network Research Group Department of Computer Engineering, Kasetsart University 2/14


  1. 1/14 Data Link Control Surasak Sanguanpong nguan@ku.ac.th http://www.cpe.ku.ac.th/~nguan Last updated: 10 Feb 2001 Applied Network Research Group Department of Computer Engineering, Kasetsart University 2/14 Data Link Layer functions Frame Synchronization Addressing To identify the beginning To identify the nodes end of data frame by ID number Data Link Control Link Management Flow Control Error Control Regulation of the transmission rate Procedures for management of to avoid overwhelming receiver Detection and correction of errors link setup, maintenance and terminate Applied Network Research Group Department of Computer Engineering, Kasetsart University 1

  2. 3/14 Flow Control Stop-and-Wait Stop-and-Wait Send one frame at a time Flow Control Flow Control technique for controlling the data transmission so that receivers have sufficient buffer space to Sliding Windows accept before processing Sliding Windows Send several frames at a time Applied Network Research Group Department of Computer Engineering, Kasetsart University 4/14 X-On and X-OFF transmit transmit stop dddddd dddddd sender receiver X-OFF X-ON � receiver sends X-OFF (DC3) if its buffer is full � sender stops sending when receives X-OFF � receiver sends X-ON (DC1) when buffer space becomes available � senders starts sending when receives X-ON Applied Network Research Group Department of Computer Engineering, Kasetsart University 2

  3. 5/14 Stop-and-Wait Flow Control receiver sender transmit d a t a a frame sends back an acknowledgement to ACK the frame just wait until it receives received ACK before sending data the next frame ACK Applied Network Research Group Department of Computer Engineering, Kasetsart University 6/14 Sliding-Window Flow Control Windows of frames that Sender’s frames already may be transmitted transmitted buffer 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 frame sequence number upper window pointer lower window pointer Windows of frames that Receiver’s frames already may be accepted received buffer 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 frame sequence number upper window pointer lower window pointer Applied Network Research Group Department of Computer Engineering, Kasetsart University 3

  4. 7/14 Sliding-Window example 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0,1,2 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 ACK 3 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 3,4,5,6 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 ACK 4 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Applied Network Research Group Department of Computer Engineering, Kasetsart University 8/14 Error Detection Checksum Checksum Summation of data and attached � Error Detection Error Detection CRC 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 � Applied Network Research Group Department of Computer Engineering, Kasetsart University 4

  5. 9/14 Checksum data + + + + + = Sum and complement data checksum + + + + + + = 00..00 complement Applied Network Research Group Department of Computer Engineering, Kasetsart University 10/14 CRC concept M F k-bit n-bit T T=2 n M+F What should be F ? Given a k-bit block of bits (M), Given a k-bit block of bits (M), the transmitter generates an the transmitter generates an 2 n M R Q ,R quotient, remainder n-bit sequence (F), so that the n-bit sequence (F), so that the Q+ = resulting frame, consisting of resulting frame, consisting of P P P is predetermine divisor k+n bits (T), is exactly divisible k+n bits (T), is exactly divisible by some predetermine divisor (P). T =2 n M+R let F equals R by some predetermine divisor (P). The receiver then divides the The receiver then divides the = 2 n M+R divides T by R incoming frame (T) by that number incoming frame (T) by that number T (P), if there is no remainder, (P), if there is no remainder, P P P assume there was no error. assume there was no error. R R Q T is divisible by P + = Q+ = P P Applied Network Research Group Department of Computer Engineering, Kasetsart University 5

  6. 11/14 CRC in polynomials M = 110011 then M(X) = X 5 + X 4 + X+1 then P(X) = X 3 +X+1 P = 1101 Standard P(X) = X 16 + X 15 + X 2 +1 CRC-16 CRC-CCITT = X 16 + X 12 + X 5 +1 = X 32 + X 26 +X 23 + X 22 + X 16 + X 12 + X 11 + CRC-32 X 10 + X 8 + X 7 + X 5 + X 4 + + X 2 +1 Applied Network Research Group Department of Computer Engineering, Kasetsart University 12/14 Error Control � What is error control � detect and correct errors occurs in transmission � Type of errors � loss frame � damaged frame Applied Network Research Group Department of Computer Engineering, Kasetsart University 6

  7. 13/14 Error Control Techniques � Error control techniques � error detection known as } � positive ACK Automatic Repeat Request � Retransmission after timeout (ARQ) � Negative ACK � Standard techniques � Stop-and-wait ARQ � Go-back-N ARQ � Selective Repeat ARQ Applied Network Research Group Department of Computer Engineering, Kasetsart University 14/14 Stop-and-Wait ARQ retransmit retransmit time out time out sender f f f r f r r r f a a a r f a r a m m m 1 m a 3 m 2 m + + e e e e i + I e 3 I e K I I I I I + + K + + K + I i C + K I 1 C 3 3 C 2 A 2 C K A A A C A receiver frame lost Receiver discards ACK lost duplicate frame Applied Network Research Group Department of Computer Engineering, Kasetsart University 7

  8. 15/14 Go-back-N ARQ 6, 7 and 8 retransmitted sender f f f f f f f f f f r f r r r r r r r r r r a a a a a a a a a a a m m m m m m m m m m m e e e e e e e e e e e 1 5 8 2 3 4 6 8 6 6 7 7 4 6 K 9 K C K K C A C C A A N A receiver error 7 and 8 will be discarded Applied Network Research Group Department of Computer Engineering, Kasetsart University 16/14 Selective-repeat ARQ only 6 is retransmitted sender f f f f f f f f r f f f r r r r r r r r r a a a a r a a a a a a a m m m m m m m m m m m e e e e e e e e e e e 6 1 1 4 5 8 6 2 3 7 6 9 4 0 6 K 9 K K C K C A C C A N A A receiver error Applied Network Research Group Department of Computer Engineering, Kasetsart University 8

Recommend


More recommend