Chapter 11 Data Link Control and Protocols.

Slides:



Advertisements
Similar presentations
CH. 7 Data Link Control. Requirements & Objectives of Data Link Control Frame Synchronization Flow Control Error Control Addressing Control and Data on.
Advertisements

Data Link Protocols(HDLC & PPP). Data Link Protocols The set of specifications used to implement the DLL. DLL Protocols Synchronous Protocols Character-oriented.
HIGH-LEVEL DATA LINK CONTROL (HDLC) HDLC was defined by ISO for use on both point-to-point and multipoint data links. It supports full-duplex communication.
William Stallings Data and Computer Communications 7th Edition
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 7 – Data Link Control Protocols.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 Data Link Control
Data and Computer Communications Updated: 2/9/2009.
11-5 NOISY CHANNELS Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Piggybacking A method to combine a data frame with ACK. Station A and B both have data to send. Instead of sending separately, station A sends a data frame.
11-6 HDLC High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links. It implements the.
Two Protocol Case Studies HDLC & Kermit. HDLC A multi-functional protocol. Works in lots of modes. Forms the basis for MANY of the current protocols in.
Data Link Control Protocols Data link control protocol Provides a layer of control between systems on a transmission medium referred to as data link. DLC.
11-6 HDLC High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links. It implements the.
William Stallings Data and Computer Communications 7 th Edition Chapter 7 Data Link Control Protocols.
FLAG-8 bit sequence with a bit pattern (7E) ADDRESS-address of secondary station that is either the originator or destination of the frame (or.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data and Computer Communications Eighth & Ninth Edition by William Stallings Chapter 7 – Data Link Control Protocols.
Data Link Control Protocols
Data Link Control Protocols Dr. Muazzam A. Khan. Flow Control Ensuring the sending entity does not overwhelm the receiving entity —Preventing buffer overflow.
Aegis School of Telecommunication Chapter 7 Data Link Control Protocols Telecom Systems I by Dr. M. G. Sharma, Phd.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Kyung Hee University Chapter 11 Data Link Control.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Control and Protocols.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Kyung Hee University Data Link Protocols. 2 Kyung Hee University 11 장 Data Link Control and Protocols 11.1 Flow and Error Control 11.2 Stop-and-Wait.
Computer Networks Module 3: Data Link Layer (Framing) Dr. Vikram Shete St. Francis Institute of Technology.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
Chapter 11 Data Link Control
Data Link Layer: Data Link Control : Data Communication and Computer Networks Asst. Prof. Chaiporn Jaikaeo, Ph.D.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CIS : Data Link Control. Flow Control Ensuring the sending entity does not overwhelm the receiving entity —Preventing buffer overflow Transmission.
11.1 Flow and Error Control Flow Control Error Control.
1 Reliable stream service--TCP 1.TCP accepts byte stream, segments 2.It is over IP, so out-of-sequence is very common --lost or error frame results in.
FIT – Monash University High-Level Data Link Control
Chapter 11 Data Link Control.
Chapter 11 Data Link Control and Protocols Flow and Error Control Flow Control Error Control.
Data and Computer Communications Data Link Control Protocols.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols 1.
Data Link Control Protocols  need layer of logic above Physical  to manage exchange of data over a link frame synchronization frame synchronization flow.
2.10 Flow and Error Control Before that ...
High level Data Link Layer Protocol - HDLC
HDLC and PPP.
Chapter 9: Data Link Control
William Stallings Data and Computer Communications 7th Edition
Chapter 11 Data Link Control
Chapter 11 Data Link Control and Protocols
Chapter 11 Data Link Control
DATA LINK CONTROL (DLC)
Chapter 11 - Part 2 Data Link Control.
3.2 Data Link Layer : Error & Flow Control
Chapter 3 Data Link Layer.
ICSA 341 Data Communications & Networking
CIS 321 Data Communications & Networking
Subject Name: Computer Communication Networks Subject Code: 10EC71
Data Link Layer: Data Link Control
Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Error control.
Kendali Data Link dan Protokol
Jiying Zhao SITE, University of Ottawa Canada.
Chapter 11 Data Link Control
EEC4113 Data Communication & Multimedia System Chapter 4: Flow Control by Muhazam Mustapha, August 2010.
William Stallings Data and Computer Communications
Chapter 9: Data Link Control
Protocols and the TCP/IP Suite ECE405- Computer Networks
Presentation transcript:

Chapter 11 Data Link Control and Protocols

11.1 Flow and Error Control Flow Control Error Control

Note: Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.

Figure 11.5 Taxonomy of protocols discussed in this chapter

Figure 11.6 The design of the simplest protocol with no flow or error control

Algorithm 11.1 Sender-site algorithm for the simplest protocol

Algorithm 11.2 Receiver-site algorithm for the simplest protocol

Figure 11.7 Flow diagram for Example 11.1

11.2 Stop-and-Wait ARQ Operation: send -> stop & wait Bidirectional Transmission

Normal Operation stop-and-wait Sender Send frame with the number of current frame Frame number: 0 or 1 Used to prevent the case of duplicate frame Wait for acknowledgement (ACK) Check for the correct ACK number Receiver Wait for a frame Receive a frame Check for the correct frame number Send ACK with the number of expected frame to received next Numbered acknowledgments are needed Keep track of Delay ACK and the next frame is lost.

Figure 11.10 Design of the Stop-and-Wait ARQ Protocol

11.1 Normal operation

Errors in transmitting frame Frame error Lost frame Duplicate Frames Lost ACK Duplicate ACK Delay ACK

Frame Error After error detection process If the frame contains errors, 1. Receiver sends NAK and sender retransmits the previous frame or 2. Receiver sends ACK with the number of error frame and sender retransmits the requested frame number 3. Sender timeouts and automatic repeat current frame

Lost Frame Receiver does not receive transmitted frame Sender timeouts Retransmit the current frame

11.2 Stop-and-Wait ARQ, lost frame

Lost ACK Sender does not receive ACK frame Sender timeouts Retransmit the current frame Receiver receives duplicate frame Discard duplicate frame Send ACK with waiting frame number

11.3 Stop-and-Wait ARQ, lost ACK frame

Delay ACK Similar to loss ACK Sender does not receive ACK frame in time Sender timeouts Retransmit the current frame Receiver receives duplicate frame Discard duplicate frame Send ACK with waiting frame number Sender receives delay ACK Transmit next frame (frame number in ACK)

11.4 Stop-and-Wait ARQ, delayed ACK and lost frame

Sender site algorithm While (true) // repeat forever canSend = true // allow first frame to go waitForEvent(); // Sleep until an event occurs If (Event(RequestToSend)) and canSend) GetData(); MakeFrame(Sn); StoreFrame(Sn); // load into buffer SendFrame(Sn); StartTimer(); Sn = Sn+1; canSend = false; WaitForEvent(); If (Event (ArrivalNotification) ReceiveFrame(ackNo); If (no error and ackNo == Sn) StopTimer(); PurgeFrame(Sn-1); // delete frame successfully transmitted canSend=true; If (Event(TimeOut)) ResendFrame(Sn-1);

Receiver Site Algorithm Rn=0; // Frame 0 expected to arrive first While(true) waitForEvent(); If (Event(ArrivalNotification) ReceiveFrame(); If (corrupted(frame)); // frame error If (seqNo == Rn) ExtractData(); DeliverData(); Rn = Rn+1; SendFrameAck(Rn);

Piggybacking: Append ACK at the end of frame when having data frame to send at the same time = Data frame + ACK

11.3 Go-Back-N ARQ Sending a sequence of frames Before waiting for ACK Managing data flow (flow control) Using sliding windows Need controls on variables and times More complicated than Stop-and-Wait But higher efficiency with lower delay

11.6 Sender sliding window: Go-back-N Frame number: 0 : (window size) Sliding window is used to manage frame number to be transmit without waiting for ACK ACK 2 Frame 0,1: OK Sliding window moves after receiving ACK

11.7 Receiver sliding window: Go-back-N Sliding window moves after receiving the correct waiting frame

11.8 Control variables

Figure 11.14 Design of Go-Back-N ARQ

11.9 Go-Back-N ARQ, normal operation

Frame Error After error detection process If the frame contains errors, 1. Receiver sends NAK with the number of error frame sender starts the window with frame number of NAK retransmits starting with the error frame as the first frame in the window or 2. Receiver do nothing no ACK from receiver sender timeouts and automatic repeat starting with the number of the error frame as the first frame in the window

Lost Frame, Out-of-Order frames Receiver does not receive transmitted frame Sender still sends frame until complete all frames in the window or timeouts Receiver receives frames out of order Discard any unexpected frames sender timeouts, retransmit stating with the first frame in the window

11.10 Go-Back-N ARQ, lost frame

Lost ACK 1. Sender still sends frame until complete all frames in the window 2. If sender does not receive any ACK until timeout Retransmit stating with the first frame in the window 3. If sender receive the next ACK before timeout Cannot recognize the problem Normal operation

11.11 Go-Back-N ARQ: sender window size

Note: In Go-Back-N ARQ, the size of the sender window must be less than 2m; the size of the receiver window is always 1.

Algorithm 11.7 Go-Back-N sender algorithm หมดใน window แล้ว หยุดส่ง ยังไม่หมดใน window ส่งต่อได้ ขยับ Sn ไปรอต่ำแหน่งต่อไป ถ้าส่งเป็นเฟรมแรกใน window ให้ตั้งนาฬิกา (continued)

Algorithm 11.7 Go-Back-N sender algorithm (continued) Algorithm 11.7 Go-Back-N sender algorithm

Algorithm 11.8 Go-Back-N receiver algorithm

Figure 11.17 Flow diagram for Example 11.7

11.4 Selective-Repeat ARQ Similar to Go-back-N Sending a sequence of frames (> 1 frame) Before waiting for ACK Managing data flow (flow control) Using sliding windows Need more complicated controls on variables and times Select only error frames to be retransmit More complicated than Go-back-N Reduce the number of duplicated frames to be retransmitted But higher efficiency, lower traffic

11.12 Selective Repeat ARQ, sender and receiver windows

Figure 11.18 Send window for Selective Repeat ARQ

Figure 11.19 Receive window for Selective Repeat ARQ

Figure 11.20 Design of Selective Repeat ARQ

Normal operation Send all frames in the window without waiting for ACK The number of Timers is equal to The window size Each timer is used to keep track of each frame

Frame Error After error detection process If the frame contains errors, Receiver sends NAK with the number of error frame sender retransmits only error frame with the number of NAK frame

Lost Frame, Out-of-Order frames Receiver does not receive waiting frame Receiver receives frames out of order Keep all unexpected frames in window Receiver sends NAK with the number of un-received frame Sender sends only frame with the number of NAK frame and Sender continues sending the remaining frames in the window If not done

11.13 Selective Repeat ARQ, lost frame

Lost ACK 1. Sender still sends frame until 2. Sender timeouts or complete all frames in the window 2. Sender timeouts Retransmit stating with the first frame in the window or Sender receive the next ACK Cannot recognize the problem Normal operation

Algorithm 11.9 Sender-site Selective Repeat algorithm (continued)

Algorithm 11.9 Sender-site Selective Repeat algorithm (continued) Algorithm 11.9 Sender-site Selective Repeat algorithm (continued)

Algorithm 11.9 Sender-site Selective Repeat algorithm (continued) Algorithm 11.9 Sender-site Selective Repeat algorithm

Algorithm 11.10 Receiver-site Selective Repeat algorithm

Algorithm 11.10 Receiver-site Selective Repeat algorithm

Note: In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2m.

11.14 Selective Repeat ARQ, sender window size

Figure 11.23 Flow diagram for Example 11.8

Example 1 In a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link? Solution The bandwidth-delay product is 1  106  20  10-3 = 20,000 bits // round trip The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and then back again. Stop-and-wait: send 1 frame and wait (1 frame = 1000 bits) link utilization is only 1000/20,000, or 5%. not good for a link with high bandwidth or long delay, waste the capacity of the link.

Example 2 What is the utilization percentage of the link in Example 1 if the link uses Go-Back-N ARQ with a 15-frame sequence? Solution bandwidth-delay product is still 20,000 Go-back-N ARQ: send up to 15 frames ( 15 * 1000 = 15,000 bits ) // a round trip. Link utilization is 15,000/20,000, or 75 percent. damaged frames utilization percentage is much less because frames have to be retransmitted.

L2 Protocol requirement Frame format Data frame Control frame Management frame etc. Flow and Error Control Protocol Stop-and-Wait ARQ Go-back-N ARQ Selective Repeat ARQ Media Access Protocol

Configurations and Transfer Modes 11.5 HDLC: High-level Data Link Control Configurations and Transfer Modes Frames Frame Format Examples Data Transparency

Figure 11.25 Normal response mode

Figure 11.26 Asynchronous balanced mode

NRM: Normal Response Mode Unbalanced (Master/ Slave) Primary – Secondary Asymmetric Primary control all communications among all secondary stations in network Command Poll -> Request data from secondary Select -> Select secondary to send data

ARM: Asynchronous Response mode Unbalanced (Master/ Slave) Primary – Secondary Symmetric Primary or secondary Can start communications But secondary cannot directly communicate to another secondary Command Poll -> Request data from secondary Select -> Select secondary to send data

11.16 Transfer Mode: ABM Balanced No Primary – Secondary Equal priority for all stations in network Any station can start communications

Figure 11.27 HDLC frames

11.17 HDLC frame: Frame format Flag ( 8 bits): “01111110”

Common fields in all frame types Flag ( 8 bits ) “ 01111110” Address (>= 1 byte) Receiving address Length 1 byte: last bit in address field = ‘1’ > 1 byte: last bit of each byte = ‘0’ except last bit of last address byte = ‘1’ FCS (Frame Check Sequence) Error detection CRC ( CRC - ITU-T: 16 bits or CRC-32) Error detection for all fields Except Flag

11.18 HDLC frame types 8 bits

Control Field: Specify Type of Frame I-frame : Information frame S-frame : Supervisory frame U-frame : Unnumbered frames

I-Frame Control field 1st bit: ‘0’ N(S) (3 bits): Transmitting Frame number (0-7) Can extend to 7 bits N(R) (3 bits): ACK or NAK Frame number (0-7) P/F bit P bit (Poll bit): Poll Frame from Primary ‘1’: Poll Frame from Primary ‘0’: otherwise F bit (Final bit): Frame from Secondary ‘1’: Last I-frame from Secondary

S-frame Code P/F bit 00: RR (Receive ready) 01: REJ (Reject) -> NAK for Go-back-N 10: RNR (Receive not ready) 11: Selective-reject -> NAK for Selective-reject P/F bit Depend on the condition of Code field

Polling: Asking for data from secondary RR: Receive Ready/ Transmit Not Ready RNR: Receive Not Ready Transmit Ready Control code N(R): Received frame number C P/F bit Receiver Addr S-frame N(R) = 0 P=1 RR A S-frame C RR F=1 N(R) =0 S-frame RR P=1 B N(R) =0 I-frame N(S)=0 F=0 N(R) =0 C N(S)=1 F=1 N(R) =0 C S-frame RR P=1 B N(R) =2

Select: Asking to send data to Secondary RNR P=1 B N(R) =0 S-frame RR F=1 C S-frame N(R) =0 I-frame N(S)=0 F=0 N(R) =0 B N(S)=1 F=1 N(R) =0 B RR F=1 N(R) =2 C S-frame

RR: Receive Ready Use of RR (“00”) ACK (Secondary) Positive response after receiving correct I-frame Expected frame number in N(R) RR code -> Ready to receive new data P/F bit (F bit condition) -> F = 1 ACK (Secondary: Response for Select command) Positive response after receiving Select frame RR code -> Ready to receive data from Primary NAK (Secondary) Negative response after receiving Poll frame RR -> ready to receive data / not ready to transmit Poll frame (Primary: Poll command) Polling command to request data from Secondary RR -> ready to receive data / request for data P/F bit (P bit condition) -> P = 1

RNR: Receive Not Ready Use of RNR (“10”) ACK (Secondary) Positive response after receiving correct I-frame Expected frame number in N(R) RNR code -> Not ready to receive new data After ACK, busy, request to stop communication for a while Continue communication after receiving RR frame from Secondary again P/F bit (F bit condition) -> F = 1 NAK (Secondary) Negative response after receiving Select frame RNR -> Not ready to receive data Select frame (Primary) Select command to request to transmit data to Secondary RNR -> Not ready to receive data / ready to transmit P/F bit (P bit condition) -> P = 0

SREJ: Selective Reject Frame REJ: Reject Frame Use of REJ (“01”) NAK (Secondary: Go-back-N ARQ) Negative response after receiving error frame Retransmit all frames since error frame REJ -> Reject frame number in N(R) P/F bit (F bit condition) -> F = 1 SREJ: Selective Reject Frame Use of SREJ (“11”) NAK (Secondary: Selective-Reject ARQ) Negative response after receiving error frame Retransmit only error frame SREJ -> Reject frame number in N(R) P/F bit (F bit condition) -> F = 1

11.21 U-frame control field in HDLC

Table 11.1 U-frame control command and response Command/response Meaning SNRM Set normal response mode SNRME Set normal response mode (extended) SABM Set asynchronous balanced mode SABME Set asynchronous balanced mode (extended) UP Unnumbered poll UI Unnumbered information UA Unnumbered acknowledgment RD Request disconnect DISC Disconnect DM Disconnect mode RIM Request information mode SIM Set initialization mode RSET Reset XID Exchange ID FRMR Frame reject

Example 3 Figure 11.22 shows an exchange using piggybacking where is no error. Station A begins the exchange of information with an I-frame numbered 0 followed by another I-frame numbered 1. Station B piggybacks its acknowledgment of both frames onto an I-frame ACK 2: N(R) // waiting for frame 2 & Station B’s first I-frame is also numbered 0 N(S) = 0 // sending frame 0 Station B transmits its second and third I-frames numbered 1 and 2 before ACK from station A Station A transmit S-frame (ACK) with no data ACK 3 (RR): N(R) = 3 .

(Full duplex) 11.22 Example 3: Go-back-N I-frame S-frame Frame Type S-frame 0 1 2 Frame 0, ACK 0 0 1 2 N(R) N(S) 0 1 2 Frame 1, ACK 0 0 1 2 1 Frame 0, ACK 2 2 3 0 0 1 2 2 Frame 1, ACK 2 2 3 0 1 0 1 2 2 Frame 2, ACK 2 2 3 0 2 0 1 2 2 2 3 0 3 2 3 0 2 ACK 3

Example 4 In Example 3, suppose frame 1 sent from station B to station A has an error. Station A informs station B to resend frames 1 and 2 (the system is using the Go-Back-N mechanism). Station A sends a reject supervisory frame to announce the error in frame 1. Figure 11.23 shows the exchange.

11.23 Example 4: Go-back-N ARQ Frame 0, ACK 2 2 3 0 0 1 2 2 Frame 1, ACK 2 Frame 2, ACK 2 NAK 1 Frame 1, ACK 2 Frame 2, ACK 2 ACK 3

Example 11.9 Figure 11.29 shows how U-frames can be used for connection establishment and connection release. Node A asks for a connection with a set asynchronous balanced mode (SABM) frame; node B gives a positive response with an unnumbered acknowledgment (UA) frame. After these two exchanges, data can be transferred between the two nodes (not shown in the figure). After data transfer, node A sends a DISC (disconnect) frame to release the connection; it is confirmed by node B responding with a UA (unnumbered acknowledgment).

Figure 11.29 Example of connection and disconnection

Note: Bit stuffing is the process of adding one extra 0 whenever there are five consecutive 1s in the data so that the receiver does not mistake the data for a flag.

11.24 Bit stuffing and removal

11.25 Special Pattern: Bit stuffing in HDLC = 15 > 15