Presentation is loading. Please wait.

Presentation is loading. Please wait.

15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 1 Data Link Control Physical layer is only responsible for data transmission Data link.

Similar presentations


Presentation on theme: "15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 1 Data Link Control Physical layer is only responsible for data transmission Data link."— Presentation transcript:

1 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 1 Data Link Control Physical layer is only responsible for data transmission Data link control is responsible for converting transmission to communication –Line Discipline: Who should send now? –Flow Control: How much data may be sent? –Error Control: How should the errors be detected / corrected?

2 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 2 Line Discipline Determine the direction of communication Make sure that receiver is ready to accept or signal the sender to start Two ways: –Enquiry / Acknowledgment (ENQ/ACK) Dedicated line between hosts –Poll / Select Multipoint connections

3 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 3 ENQ/ACK Dedicated line between hosts, no problem of addressing Coordinates which device may start transmission, and if the receiver is ready and enabled If both hosts have equal ranks, either can initiate the process Otherwise, only higher-ranked host is allowed to start the transmission request Can be run in either half-duplex or full-duplex modes

4 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 4 ENQ/ACK Establishment: Host B responds either with ACK or NAK Host A tries to send ENQ three times before concluding that Host B is down Host AHost B ENQ ACK Data ACK Data ACK EOT … Establishment Data Transfer Termination

5 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 5 Poll / Select Multipoint connections One primary and multiple secondary hosts Communication between secondary devices go over the primary Select mode is used when primary has something to send to a secondary (downstream) Poll mode is used to solicit transmissions from a secondary to the primary (upstream) Address must be contained in all packets

6 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 6 Poll / Select Select mode SEL packet contains address of B B can response either by ACK or NAK Primary sends one or more data packets, which are ACKed by B PrimarySec. A SEL ACK Data ACK … Sec. B Data ACK

7 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 7 Poll / Select Poll mode Poll packet contains address of recipient If the intended secondary has no data to send, replies with NAK Data is ACKed by the primary How to terminate? PrimarySec. A Poll NAK Poll Data Sec. B ACK

8 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 8 Flow Control Restrict the amount of data to send before waiting for acknowledgment Controls the flow of the data as not to overwhelm the receiver Categories: –Stop-and-Wait Wait for an ACK before sending the next frame –Continous (Sliding Window) Can send several windows before requiring an ACK

9 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 9 Stop-and-Wait Send frame, then wait until you get ACK back Advantage: Simplicity Disadvantage: Inefficiency – l-bit frame, b bits/sec transmission speed, R seconds roundtrip time, infinitely short ACK –Utilization = l / (l + bR) –Not suited for high bandwidth-delay product lines

10 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 10 Sliding Window Send multiple frames before waiting for ACK Several frames can be in transit at a time Sender window vs. receiver window Frames can be ACKed without waiting for the receiver window to fill up Frames may be sent as long as there are unsent packets in the sender window

11 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 11 Sliding Window Sliding window scheme uses modulo-n arithmetic The addresses range between 0 and n-1 The size of the window is n-1 to prevent ambiguity in ACKs, which contains sequence number of next frame expected –Assume window size is n-1 –Sender can sends frames 0 to n-2 to start –Receiver ACKs frame 0 –Does it mean that it is ready for the next frames?

12 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 12 Sliding Window Sender window: –Shrink from left as frames are sent –Expand from right as you receive ACKs Receiver window: –Shrink from left as frames are received –Expand from right as ACKs are sent 01234567012345670123456701234567

13 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 13 Error Control Error control in data link layer is based on retransmissions (backward Error Control) Any time an error is detected, a NAK is returned to sender Automatic Repeat Request (ARQ) –Retransmission in case of damaged frame, lost frame, and lost ACK Stop-and-Wait ARQ Sliding Window ARQ –Go-Back-n –Selective Repeat

14 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 14 Stop-and-Wait ARQ Number frames as 0 and 1 alternately Keep a copy of the last sent frame Receiver ACKs the receipt of frame 0 by sending ACK 1 (waiting for frame 1) If NAK is received, resend the last frame (no numbering necessary) –Takes care of damaged data frames Start a timer for every frame sent If it expires before an ACK is received, resend the frame –Takes care of lost data frame and lost ACKs / NAKs –Receiver discards duplicate frames in case ACK is lost

15 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 15 Sliding Window ARQ Number frames modulo n Keep a copy of all unACKed frames Single ACK for multiple frames –If last ACK was for 2 (waiting for 3) and new ACK is for 6, frames 3, 4, 5, and 6 are ACKed Timers are used to signal retransmissions Response to NAKs and expiring timers determine the style of ARQ –Go-Back-n –Selective Repeat

16 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 16 Go-Back-n ARQ All frames after damaged or lost frame are discarded Damaged Frames: –Say, frames 0-5 are sent and all but frame # 3 is correctly received –Receiver sends NAK 3 and discards subsequent frames –This signals to sender that frames 0, 1, and 2 are correctly received and frame 3 is damaged –Sender retransmits frames 3, 4, and 5 –Same procedure for lost data frames

17 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 17 Go-Back-n ARQ Host AHost B Data 0 NAK 3 Data 1 Data 2 Data 3 Data 4 Data 5 Error, discard Data 3 Data 4 Data 5 Discard Window size 7 Error in data frame 3

18 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 18 Go-Back-n ARQ Lost ACK: –When sender reaches window capacity, it starts a timer –If timer expires, it resends all outstanding (unACKed) frames –The receiver discards possible duplicate frames and sends another ACK

19 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 19 Go-Back-n ARQ Host AHost B Data 0 ACK 3 Data 1 Data 2 Data 0 Data 1 Data 2 Lost Window Size 3 Lost ACK case Timer expires

20 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 20 Selective Repeat ARQ Only damaged and lost frames are retransmitted ACK numbers refer to the last correctly received frame, not next frame expected! If go-back-n window size is n-1, SR widow size must be at most n/2 (why?) Damaged Frames: –After receiving a damaged frame, receiver sends a NAK and continues accepting other frames –Sender only retransmits the missing frame

21 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 21 Selective Repeat ARQ Host AHost B Data 0 NAK 3 Data 1 Data 2 Data 3 Data 4 Data 5 Error, discard Data 3 Window size 7 Error in data frame 3 Data 6

22 15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 22 Selective Repeat ARQ Lost Data Frames: –Out-of-sequence delivery is permitted, but out-of-sequence ACK is not –When a lost frame is detected, NAK is sent –If last frame is lost, then receiver does nothing Lost ACK: –Handled the same way as in go-back-n


Download ppt "15 - Winter 2006 ECE ECE 766 Computer Interfacing and Protocols 1 Data Link Control Physical layer is only responsible for data transmission Data link."

Similar presentations


Ads by Google