1 Data Link Control Protocols Data and Computer

  • Slides: 22
Download presentation
1 Data Link Control Protocols Data and Computer Communications by William Stallings Eighth Edition

1 Data Link Control Protocols Data and Computer Communications by William Stallings Eighth Edition Networks and Communication Department Click to 7 edit Master subtitle style Chapter

Data Link Control Protocols need layer of logic above Physical to manage exchange of

Data Link Control Protocols need layer of logic above Physical to manage exchange of data over a link frame synchronization flow control error control addressing control and data link management

Flow Control ensure sending entity does not overwhelm receiving entity by preventing buffer overflow

Flow Control ensure sending entity does not overwhelm receiving entity by preventing buffer overflow influenced by: transmission time taken to emit all bits into medium propagation time for a bit to traverse the link assume here no errors but varying delays

Model of Frame Transmission

Model of Frame Transmission

Flow Control 1 - stop and wait 2 - sliding window flow control

Flow Control 1 - stop and wait 2 - sliding window flow control

1)Stop and Wait The simplest form of flow control Øsource transmits frame (no need

1)Stop and Wait The simplest form of flow control Øsource transmits frame (no need for seq. #) Ødestination receives frame and replies with acknowledgement (ACK) Øsource waits for ACK before sending next Ødestination can stop flow by not send ACK Øworks well for a few large frames ØStop and wait becomes inadequate if large block of data is split into small frames Ø

Stop and Wait Utilization B = R x (d/V) B: length of the link

Stop and Wait Utilization B = R x (d/V) B: length of the link in bits R: data rate of the link, in bps d: length or distance of the link in meters D: velocity of propagation, in m/s a = B/L a: the propagation delay (with frame tx time = 1) L: the number of bits in the fram

2) Sliding Windows Flow Control allows multiple numbered frames to be in transit Ø

2) Sliding Windows Flow Control allows multiple numbered frames to be in transit Ø receiver has buffer space for W frame Øtransmitter sends up to W frames without ACK ØACK includes number of next frame expected Øsequence number is bounded by size of field (k) frames are numbered from giving max window size of up to Øreceiver can ACK frames without permitting further transmission (Receive Not Ready) Ø

Sliding Window Diagram 3 -bit seq. #, Win size = 7

Sliding Window Diagram 3 -bit seq. #, Win size = 7

Sliding Window Example

Sliding Window Example

Error Control detection and correction of errors such as: lost frames damaged frames common

Error Control detection and correction of errors such as: lost frames damaged frames common techniques use: error detection positive acknowledgment retransmission after timeout negative acknowledgement & retransmission

Automatic Repeat Request (ARQ) collective name for such error control mechanisms, including: 1. stop

Automatic Repeat Request (ARQ) collective name for such error control mechanisms, including: 1. stop and wait 2. go back N 3. selective reject (selective retransmission) Ø

Stop and Wait ARQ source transmits single frame Øwait for ACK Øif received frame

Stop and Wait ARQ source transmits single frame Øwait for ACK Øif received frame damaged, discard it transmitter has timeout if no ACK within timeout, retransmit Øif ACK damaged, transmitter will not recognize it transmitter will retransmit receive gets two copies of frame use alternate numbering and ACK 0 / ACK 1 Ø

Stop and Wait ARQ see example with both types of errors Ø pros and

Stop and Wait ARQ see example with both types of errors Ø pros and cons simple inefficient Ø

Go Back N ARQ based on sliding window Øif no error, ACK as usual

Go Back N ARQ based on sliding window Øif no error, ACK as usual Øuse window to control number of outstanding frames ØSize of sender sliding window= 2 k – 1 ØSize of Receiver sliding window=1 Øif error, discard that frame and all future frames until error frame received correctly transmitter must go back and retransmit that frame and all subsequent frames Ø

Selective Reject ARQ also called selective retransmission Øonly rejected frames are retransmitted Øsubsequent frames

Selective Reject ARQ also called selective retransmission Øonly rejected frames are retransmitted Øsubsequent frames are accepted by the receiver and buffered Øminimizes retransmission Øreceiver must maintain large enough buffer Ømore complex logic in transmitter Øhence less widely used Ø

Go Back N vs Selective Reject

Go Back N vs Selective Reject

Selective-reject ARQ Size of send window = size of receive window ØThe maximum window

Selective-reject ARQ Size of send window = size of receive window ØThe maximum window size is ØThe Only frames retransmitted are those that received negative acknowledgment , in this case called SREJ(NAK). or those that time out. ØMore efficient than Go-back-N because it minimizes the amount of retransmission , but the receiver must maintain a buffer large enough post-SREJ frame until the frame in error is retransmitted Ø Ø Window-size limitation

Selective-reject ARQ Ø Window-size limitation E. g. 3 bit sequence number, window size =

Selective-reject ARQ Ø Window-size limitation E. g. 3 bit sequence number, window size = 7 1. Station A sends frames 0 ~ 6 to station B 2. Station B receives all seven frames and cumulatively acknowledges with RR 7 3. If RR 7 is lost 4. A times out and retransmit frame 0

Selective-reject ARQ (cont) 5. B has already advanced its receive window to accept frames

Selective-reject ARQ (cont) 5. B has already advanced its receive window to accept frames 7, 0, 1, 2, 3, 4, and 5. Thus, it assumes that frame 7 has been lost and that this is a new frame 0 which it accepts. 0 1 2 3 4 5 6 7 0 1 2 3 4 5. . . S retx R RR 7 lost Ö

Selective-reject ARQ (cont) Problem with the foregoing scenario overlay between the sending and receiving

Selective-reject ARQ (cont) Problem with the foregoing scenario overlay between the sending and receiving windows Solution for a k-bit sequence number, the maximum window size is limited to 0 1 2 3 4 5 6 7 0 1 2. . . S retx R RR 4 lost x

Summary introduced need for data link protocols Øflow control Øerror control Ø

Summary introduced need for data link protocols Øflow control Øerror control Ø