Chapter 3 THE DATA LINK LAYER

Slides:



Advertisements
Similar presentations
Chapter 3 The Data Link Layer.
Advertisements

The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
CH. 7 Data Link Control. Requirements & Objectives of Data Link Control Frame Synchronization Flow Control Error Control Addressing Control and Data on.
EE 4272Spring, 2003 Chapter 7 Data Link Control Objectives: Effective & reliable data communication between two directly connected transmitting-receiving.
1 Pertemuan 15 Layer Data Link Matakuliah: H0174/Jaringan Komputer Tahun: 2006 Versi: 1/0.
EIE325: Telecommunication TechnologiesMaciej J. Ogorza ł ek, PolyU, EIE Telecommunication Technologies Week 8 Flow Control Error Control.
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.
Data and Computer Communications Updated: 2/9/2009.
Flow and Error Control. Flow Control Flow control coordinates the amount of data that can be sent before receiving acknowledgement It is one of the most.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 1 Data Link Control Chapter 7.
Chapter 7 – Data Link Control Protocols
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.
The Data Link Layer Chapter 3. Position of the data-link layer.
William Stallings Data and Computer Communications 7 th Edition Chapter 7 Data Link Control Protocols.
The OSI Reference Model
1 Comnet 2006 Communication Networks Recitation 8 ARQ Protocols & Performance.
Chapter 9: Data Link Control Business Data Communications, 4e.
CSC 450/550 Part 2: The Data Link Layer. CSC 450/550 Summary Part A Functions (1)Functions of the data link layer (2)Framing (3)Error control (3.1) Error.
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
Example Data Link Protocols Quick review Reference Models? Layers? Flow Control? Bit stuffing? Connection Oriented? Synchronous transmission?
Link-Level Flow and Error Control
D ATA L INK L AYER By Dr. Nawaporn Wisitpongphan.
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.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
William Stallings Data and Computer Communications 7th Edition
Data and Computer Communications Ninth Edition by William Stallings Chapter 7 – Data Link Control Protocols Data and Computer Communications, Ninth Edition.
Data and Computer Communications Tenth Edition by William Stallings Data and Computer Communications, Tenth Edition by William Stallings, (c) Pearson Education.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
THE DATA LINK LAYER Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2.
The data link layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Dealing with transmission errors Error detection.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Frame delineation Dealing with transmission errors.
The Data Link Layer Chapter 3 10/28/2015www.noteshit.com1.
Chapter 11 Data Link Control
Data Link and Flow Control Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific.
Eighth Edition by William Stallings Chapter 7 – Data Link Control Protocols Data Link Control Protocols need layer of logic above Physical to manage exchange.
Data Link Layer: Data Link Control : Data Communication and Computer Networks Asst. Prof. Chaiporn Jaikaeo, Ph.D.
CIS : Data Link Control. Flow Control Ensuring the sending entity does not overwhelm the receiving entity —Preventing buffer overflow Transmission.
The Data Link Layer Chapter 3 1/21/2016www.ishuchita.com1.
1 FIT1005 Topic 6 - Data Link Layer Reference: Chapter 7 -Stallings.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Data Link Layer Chapter 3.
CSCI 465 D ata Communications and Networks Lecture 11 Martin van Bommel CSCI 465 Data Communications & Networks 1.
Data and Computer Communications Data Link Control Protocols.
1 The Data Link Layer A. S. Tanenbaum Computer Networks W. Stallings Data and Computer Communications Chapter 3.
Chapter 9: Data Link Control Business Data Communications, 4e.
Data and Computer Communications Data Link Control Protocols.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
The Data Link Layer RIS 251 Dr. ir. S.S. Msanjila.
Data Link Control Protocols  need layer of logic above Physical  to manage exchange of data over a link frame synchronization frame synchronization flow.
Chapter 3 The Data Link Layer.
Chapter 9: Data Link Control
Data Link Layer Flow Control.
Data link layer (LLC).
Chap. 4 Data link layer 2.
Instructor Mazhar Hussain
Data Link Layer What does it do?
CIS 321 Data Communications & Networking
Rivier College CS575: Advanced LANs Chapter 6: Logical Link Control
Flow and Error Control.
Overview Jaringan Komputer (2)
CS412 Introduction to Computer Networking & Telecommunication
William Stallings Data and Computer Communications
Chapter 9: Data Link Control
Presentation transcript:

Chapter 3 THE DATA LINK LAYER We will study the principles and functions of layer 2, the data link layer. It is the layer above the lowest layer, physical layer, which concern: Physical interface between data transmission device (e.g. computer) and transmission medium or network Characteristics of transmission medium Signal levels Data rates etc. Introduction To Data Communications

Hybrid Model The hybrid reference model to be used in this book. Introduction To Data Communications

Functions of the Data Link Layer The process of Data link layer transfer the data between the network layerand physical layer. It encapsulates data packet from the network layer into frames (header, payload and trailer). Fragmentation Large block of data may be split into small frames Limited buffer size Errors detected sooner (when whole frame received) On error, retransmission of smaller frames is needed Prevents one station occupying medium for long periods Stop and wait becomes inadequate Introduction To Data Communications

Data Link Layer Design Issues Services Provided to the Network Layer Framing (Packetizing) Physical addressing Error Control Flow Control Access control. Framing. The data link layer divides the stream of bits received from the network layer into manageable data units called frames. Physical addressing. If frames are to be distributed to different systems on the network, the data link layer adds a header to the frame to define the physical address of the sender (source address) and/or receiver (destination address) of the frame. If the frame is intended for a system outside the sender's network, the receiver address is the address of the device that connects one network to the next. Flow control. If the rate at which the data are absorbed by the receiver is less than the rate produced in the sender, the data link layer imposes a flow control mechanism to prevent overwhelming the receiver. Error control. The data link layer adds reliability to the physical layer by adding mechanisms to detect and retransmit damaged or lost frames. It also uses a mechanism to prevent duplication of frames. Error control is normally achieved through a trailer added to the end of the frame. Access control. When two or more devices are connected to the same link, data link layer protocols are necessary to determine which device has control over the link at any given time. Introduction To Data Communications

Services Provided to Network Layer Unacknowledged connectionless service. No acknowledgement, no logical connection, used in very low error rate channel and real-time traffic. Acknowledged connectionless service. each frame acknowledged, used in unreliable channel Acknowledged connection-oriented service a connection established, frames are numbed.reliable transmission guaranteed.

Four methods are used to break the bit stream. For the data link layer, break the bit stream up into discrete frames and computer the checksum for each frame (error control). Four methods are used to break the bit stream. Character count. (rarely used) Flag bytes with byte stuffing Starting and ending flags, with bit stuffing. Physical layer coding violations. Introduction To Data Communications

Framing (packetizing) For the data link layer, break the bit stream up into discrete frames and computer the checksum for each frame (error control). Four methods are used to break the bit stream. Character count. Flag bytes with byte stuffing Starting and ending flags, with bit stuffing. Physical layer coding violations. If lost synchronisation, no way to get in control again. Retransmission is helpless. It is rarely used anymore. Introduction To Data Communications

Framing (2) Can resynchronisation after an error by having each frame start and end with special bytes. It is used of 8-bit characters (Bytes). (a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing. Introduction To Data Communications

Framing (3) Flag: 01111110 All more than 5 1-bit string will be inserted a 0-bit to distinguish from the flag – bit stuffing. When the receiver sees 5 consecutive incoming 1 bits, followed by a 0 bit, it delete the 0 bit. (destuffing.) Flag sequence can be used to resynchronisation. Bit stuffing (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in receiver’s memory after destuffing. Introduction To Data Communications

Flow Control Ensuring the sending entity does not overwhelm the receiving entity Feedback-based flow control Rate-based flow control (network layer)

Stop and Wait Only one frame at a time can be in transit. Source transmits frame Destination receives frame and replies with acknowledgement (if it is correct, otherwise send NAK.) Source waits for ACK before sending next frame Destination can stop flow by not send ACK Source can retransmit if got a NAK. Works well for a few large frames Inefficient line utilization for small frames Only one frame at a time can be in transit. Source transmits frame Destination receives frame and replies with acknowledgement (if it is correct, otherwise send NAK.) Source waits for ACK before sending next frame Destination can stop flow by not send ACK Destination can retransmit if got a NAK. Works well for a few large frames Inefficient line utilization for small frames If the frame length is short than than the bit length of the link, serious inefficiencies results. Efficiency can be greatly improved by allowing multiple frames to be in transit at the same time. Consider the noise channel Introduction To Data Communications

Sliding Window Protocols Allow multiple frames to be in transit Receiver has buffer W long Transmitter can send up to W frames without ACK Each frame is numbered ACK includes number of next frame expected Sequence number bounded by size of field (k) Frames are numbered modulo 2k Allow multiple frames to be in transit Receiver has buffer W long Transmitter can send up to W frames without ACK Each frame is numbered ACK includes number of next frame expected Sequence number bounded by size of field (k) Frames are numbered modulo 2k Introduction To Data Communications

Example Sliding Window Let us examine how this might work for two stations, A and B, connected via a full-duplex link. Station B allocates buffer space for W frames. Thus, B can accept W frames, and A is allowed to send W frames without waiting for any acknowledgments. To keep track of which frames have been acknowledged, each is labeled with a sequence number. B acknowledges a frame by sending an acknowledgment that includes the sequence number of the next frame expected. This acknowledgment also implicitly announces that B is prepared to receive the next W frames, beginning with the number specified. This scheme can also be used to acknowledge multiple frames. For example, B could receive frames 2, 3, and 4, but withhold acknowledgment until frame 4 has arrived. By then returning an acknowledgment with sequence number 5, B acknowledges frames 2, 3, and 4 at one time. A maintains a list of sequence numbers that it is allowed to send, and B maintains a list of sequence numbers that it is prepared to receive. Each of these lists can be thought of as a window of frames. The operation is referred to as sliding-window flow control. Several additional comments need to be made. Because the sequence number to be used occupies a field in the frame, it is clearly of bounded size. For example, for a 3-bit field, the sequence number can range from 0 to 7. Accordingly, frames are numbered modulo 8; that is, after sequence number 7, the next number is 0. In general, for a k-bit field the range of sequence numbers is 0 through 2 k - 1, and frames are numbered modulo 2 k, Figure 7.3 is a useful way of depicting the sliding-window process. It assumes the use of a 3-bit sequence number, so that frames are numbered sequentially from 0 through 7, and then the same numbers are reused for subsequent frames. The shaded rectangle indicates the frames that may be sent; in this figure, the sender may transmit seven frames, beginning with frame 0. Each time a frame is sent, the shaded window shrinks; each time an acknowledgment is received, the shaded window grows, Frames between the vertical bar and the shaded window have been sent but not yet acknowledged. As we shall see, the sender must buffer these frames in case they need to be retransmitted. Introduction To Data Communications

Sliding Window Protocols (2) Duplex communication: each station needs to maintain two windows Piggyback: num of frame and num of ack are included in one frame. Sliding-window flow control is more efficient than stop-and-wait flow control. So far, we have discussed transmission in one direction only. If two stations exchange data, each needs to maintain two windows, one for transmit and one for receive, and each side needs to send the data and acknowledgments to the other. To provide efficient support for this requirement, a feature known as piggybacking is typically provided. Each data frame includes a field that holds the sequence number of that frame plus a field that holds the sequence number used for acknowledgment. Thus, if a station has data to send and an acknowledgment to send, it sends both together in one frame, saving communication capacity. Of course, if a station has an acknowledgment but no data to send, it sends a separate acknowledgment frame, such as RR or RNR. If a station has data to send but no new acknowledgment to send, it must repeat the last acknowledgment sequence number that it sent. This is because the data frame includes a field for the acknowledgment number, and some value must be put into that field. When a station receives a duplicate acknowledgment, it simply ignores it. Sliding-window flow control is potentially much more efficient than stop-and-wait flow control. The reason is that, with sliding-window flow control, the transmission link is treated as a pipeline that may be filled with frames in transit. In contrast, with stop-and-wait flow control, only one frame may be in the pipe at a time. Introduction To Data Communications

Detection and correction of errors ERROR CONTROL Detection and correction of errors Lost frames: a frame failed to arrived to the other side. Damaged frames: some bits are in error. Automatic repeat request Error detection Positive acknowledgment Retransmission after timeout Negative acknowledgement A timer is introduced in data link layer to control the interval for the frame to reach the destination, be processed there and then have acknowledgement propogate back to the sender. Introduction To Data Communications

ERROR DETECTION AND ERROR CORRECTION Additional bits added by transmitter for error detection and/or error correction code Error detection is more often used in protocol with ARQ. High code rate, high reliability. Error correction is used in specific situation. (no reverse channel) Hybrid ARQ: combination of error detection and correction.

ERROR CONTROL SCHEME

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 recognise it, Transmitter will retransmit Receive gets two copies of frame Use ACK0 and ACK1 Simple but Inefficient 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 ACK0 and ACK1 Simple but Inefficient Introduction To Data Communications

Go Back N Based on sliding window If no error, ACK as usual with next frame expected Use window to control number of outstanding frames If error, reply with rejection 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 (RETRANSMISSION) Only rejected frames are retransmitted Subsequent frames are accepted by the receiver and buffered Minimizes retransmission Receiver must maintain large enough buffer to reordering. More complex login in transmitter

Example Data Link Protocols HDLC – High-Level Data Link Control The Data Link Layer in the Internet HDLC is an actual protocol designed to support both half-duplex and full-duplex communication over point-to-point and multipoint links. It implements the ARQ mechanisms we discussed in this charpter. Introduction To Data Communications

High-Level Data Link Control HDLC defines three type of frames: Information frames (I-frames) – for user data and control information relating user data, supervisory frames (S-frames) – flow and error control information, and unnumbered frames (U-frames) – system management. Each type of frame works as an envelope for the transmission of a different type of message. Bit-oriented protocols use bit-stuffing. Flag field: 01111110 Address field: used to identify one of the terminals on lines with multiple terminals. For point-to-point lines it is sometimes used to distinguish commands from response. FCS: Frame Check Sequence. 16 bit CRC Optional 32 bit CRC Frame format for bit-oriented protocols. Introduction To Data Communications

High-Level Data Link Control (2) HDLC uses a sliding window, with 3-bit sequence number. Up to seven unacknowledged frames may be outstanding at any instant. N(S): frame sequence number; N(R): piggybacked acknowledgement. P/F: Poll/Final, all the frame sent by the terminal, except the final one, have the P/F bit set to P. The final one is set to F. S: defines the type of supervisor frames. 00: acknowledgement frame (receive ready) used when no piggyback. 01: negative acknowledgement frame (Reject). Error detected, retransmission required. 10: receive not ready. Stop sending until further information. 11: selective reject: call for retransmission of only the frame specified. Introduction To Data Communications

The contents of an HDLC frame are shown in the following table: Flag Address Control Information FCS 8 bits 8 or more bits 8 or 16 bits Variable length, 0 or more bits 16 or 32 bits

The Data Link Layer in the Internet Point-to-point lines play a major role in the internet. PPP is the data link protocol used in Internet for router-to-router traffic and user-to-ISP traffic. PPP (Point-to-point protocol) handles error detection, supports multiple protocols, allows IP addresses to be negotiated at connection time. Introduction To Data Communications

PPP – Point to Point Protocol The PPP full frame format for unnumbered mode operation. Address: PPP is used for a point-to-point connection, it uses the broadcast address of HDLC. Control: uses the format of the U-frame in HDLC. The frame does not contain any sequence numbers and there is no flow and error control. Protocol: what kind of packet is in the payload field. payload: variable length. Introduction To Data Communications

Performance of ARQ Stop-and-Wait Flow Control The total time to send the data as T = n(2tprop + tframe) The utilization, or efficiency, of the line is It is useful to define the parameter a = tprop/tframe . Then Let us assume that the processing time is relatively negligible, and that the acknowledgment frame is very small compared to a data frame, both of which are reasonable assumptions. Then we can express the total time to send the data as   T = n(2tprop + tframe) Of that time, only n * tframe is actually spent transmitting data and the rest is overhead. The utilization, or efficiency, of the line is It is useful to define the parameter a = tprop /tframe . Then This is the maximum possible utilisation of the link. Because the frame contains overhead bits, actual utilization is lower. Introduction To Data Communications

Error-free sliding-window flow control where W is window size Typically, the sequence number is provided for in an n-bit field and the maximum window size is W = 2n – 1. Figure 7.16 shows the maximum utilization achievable for window sizes of 1, 7, and 127 as a function of a. A window size of 1 corresponds to stop and wait. A window size of 7 (3 bits) is adequate for many applications. A window size of 127 (7 bits) is adequate for larger values of a, such as may be found in high-speed WANs. Introduction To Data Communications