Data link layer functions. 2 Computer Networks Data Communications. Framing (1) Framing (2) Parity Checking (1) Error Detection

Similar documents
William Stallings Data and Computer Communications. Chapter 7 Data Link Control

Data Link Control Protocols

Data and Computer Communications

Chapter 7: Data Link Control. Data Link Control Protocols

Chapter 7: Data Link Control. CS420/520 Axel Krings Page 1


This Lecture. BUS Computer Facilities Network Management. Line Discipline. Data Link Layer

INTERNET ARCHITECTURE & PROTOCOLS

Flow control: Ensuring the source sending frames does not overflow the receiver

Chapter 3. The Data Link Layer. Wesam A. Hatamleh

4. Error correction and link control. Contents

3. Data Link Layer 3-2

(Sicherungsschicht) Chapter 5 (part 2) [Wa0001] HDLC - 1.

Data Link Layer (cont.) ( h h h ) (Sicherungsschicht) HDLC - 1.

Data Link Control. Claude Rigault ENST Claude Rigault, ENST 11/3/2002. Data Link control 1

SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY COMPUTER NETWORKS UNIT - II DATA LINK LAYER

Data Link Layer. Learning Objectives. Position of the data-link layer. MCA 207, Data Communication & Networking

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

I. INTRODUCTION. each station (i.e., computer, telephone, etc.) directly connected to all other stations

Transmission SIGNALs

The University of Sydney AUSTRALIA. Advanced Communication Networks

Data Link Layer (part 2)

Chapter 3. The Data Link Layer

Telecom Systems Chae Y. Lee. Contents. Flow Control Error Detection/Correction Link Control (Error Control) Link Performance (Utility)

Advanced Computer Networks. Rab Nawaz Jadoon DCS. Assistant Professor COMSATS University, Lahore Pakistan. Department of Computer Science

Data Link Control Protocols

The data link layer has a number of specific functions it can carry out. These functions include. Figure 2-1. Relationship between packets and frames.

DATA LINK LAYER UNIT 7.

TYPES OF ERRORS. Data can be corrupted during transmission. Some applications require that errors be detected and corrected.

CSE 123: Computer Networks

Outline. EEC-484/584 Computer Networks. Data Link Layer Design Issues. Framing. Lecture 6. Wenbing Zhao Review.

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

Data Link Layer: Overview, operations

HDLC. King of the Link 2005/03/11. (C) Herbert Haas

DATA LINK LAYER: NEED

Inst: Chris Davison

CEG3185 TUT6. Prepared by Zhenxia Zhang Revisited by Jiying Zhao

Data Link Protocols DATA LINK PROTOCOLS. Asynchronous Protocols. Types of Data Link Protocols XMODEM. Asynchronous Protocols.

HDLC (High level Data Link Control)

Line Protocol Basics. HDLC (High level Data Link Control) Agenda. Additional Issues

HDLC. Telecom Systems Chae Y. Lee

Lecture / The Data Link Layer: Framing and Error Detection

Department of Computer and IT Engineering University of Kurdistan. Data Communication Netwotks (Graduate level) Data Link Layer

PART III. Data Link Layer MGH T MGH C I 204

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

Data and Computer Communications

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 4. September 09 CMSC417 Set 4 1

Overview. Data Link Technology. Role of the data-link layer. Role of the data-link layer. Function of the physical layer

Chapter 5 Data-Link Layer: Wired Networks

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

DATA LINK CONTROL PROTOCOLS

Data Link Control Layer, Error Detection, Error Correction, and Framing

COMPUTER NETWORKS UNIT I. 1. What are the three criteria necessary for an effective and efficient networks?

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. Nov 1,

The Data Link Layer Chapter 3

CS 4453 Computer Networks Winter

Protocol Principles. Framing, FCS and ARQ 2005/03/11. (C) Herbert Haas

CS422 Computer Networks

Other Data Link Protocols: Computer Networks by Prof Kamal K Mehta Associate Professor Dept of Computer Science & Engineering

Chapter Six. Errors, Error Detection, and Error Control. Data Communications and Computer Networks: A Business User s Approach Seventh Edition

Data Link Control. Surasak Sanguanpong Last updated: 11 July 2000

Chapter 6 Digital Data Communications Techniques

INF Data Communication Data Link Layer

Appendix. Pioneering Protocols

INTERNATIONAL TELECOMMUNICATION UNION. SERIES X: DATA COMMUNICATION NETWORKS: SERVICES AND FACILITIES, INTERFACES Interfaces

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

Data Link Layer, Part 4. Exemplary Protocols

EITF25 Internet Techniques and Applications L3: Data Link layer. Stefan Höst

Computer Network : Lecture Notes Nepal Engineering College Compiled by: Junior Professor: Daya Ram Budhathoki Nepal Engineering college, Changunarayan

Lecture 5: Data Link Layer Basics

Data and Computer Communications. Protocols and Architecture

INTERNATIONAL TELECOMMUNICATION UNION. SERIES X: DATA NETWORKS AND OPEN SYSTEM COMMUNICATION Public data networks Interfaces

Chapter 11 Data Link Control 11.1

CSCI-1680 Link Layer I Rodrigo Fonseca

Telematics. 5rd Tutorial - LLC vs. MAC, HDLC, Flow Control, E2E-Arguments

Error Detection Codes. Error Detection. Two Dimensional Parity. Internet Checksum Algorithm. Cyclic Redundancy Check.

Institute of Computer Technology - Vienna University of Technology. L02 - Protocol Principles

INTERNATIONAL TELECOMMUNICATION UNION. SERIES Q: DIGITAL SUBSCRIBER SIGNALLING SYSTEM No. 1 (DSS 1), DATA LINK LAYER

Network management and QoS provisioning - revise. When someone have to share the same resources is possible to consider two particular problems:

OSI Reference Model. Application Layer. Presentation Layer. Session Layer. Chapter 4: Application Protocols. Transport Layer.

EE 122: Error detection and reliable transmission. Ion Stoica September 16, 2002

Jaringan Komputer. Data Link Layer. The Data Link Layer. Study the design principles

HDLC PROTOCOL. Michel GARDIE

William Stallings Data and Computer Communications 7 th Edition. Chapter 10 Circuit Switching and Packet Switching

CSE 461: Framing, Error Detection and Correction

The flow of data must not be allowed to overwhelm the receiver

Introduction to Computer Networks. 03 Data Link Layer Introduction

Lecture 3: Data Link. (A. Pattavina, Chapter 4 and 15) Ilenia Tinnirello

Comparison of ISO-OSI and TCP/IP Suit. Functions of Data Link Layer:

CONNECTION-ORIENTED & CONNECTIONLESS NETWORKS

Chapter 5 Peer-to-Peer Protocols. School of Info. Sci. & Eng. Shandong Univ..

Chapter 11 Data Link Control 11.1

High Level View. EE 122: Error detection and reliable transmission. Overview. Error Detection

(Refer Slide Time: 2:20)

06/05/2008. Chapter 3. The Data Link Layer. Data Link Layer Design Issues. Services Provided to the Network Layer. Error Control Flow Control

CS254 Network Technologies. Lecture 2: Network Models & Error Detection and Correction. Dr Nikos Antonopoulos

Data Link Layer. Srinidhi Varadarajan

Packet/Frame, Error Detection How to send data efficiently & reliably?

Data Link Layer. Goals of This Lecture. Engineering Questions. Outline of the Class

Transcription:

2 Computer Networks Data Communications Part 6 Data Link Control Data link layer functions Framing Needed to synchronise TX and RX Account for all bits sent Error control Detect and correct errors Flow control TX must not overwhelm RX, so Have well-defined rules for TX and RX Efficient transfer Part 6 - Data Link Control Part 6 - Data Link Control 2 Framing () Start and ending characters with character stuffing IF DLE is part of the data, add a DLE before it A DLE B STX DLE A DLE DLE B DLE ETX A DLE B Data send by the network layer after character stuffed by the data link layer Data passed the network layer on the receiving side Part 6 - Data Link Control 3 Framing (2) Starting and ending flags with bit stuffing Each frame starts and ends with the special bit pattern to avoid the special bit pattern in the data stream, the sender inserts a after every five s in data stream Receiver removes the. This works for arbitrary sized characters Physical layer coding violations E.g: Manchester encoding =, = Part 6 - Data Link Control 4 Error Detection Additional bits added by transmitter for error detection Hamming distance number of bit positions two codewords differ To detect d errors need a distance of d+ Parity Value of parity bit is such that character has even (even parity) or odd (odd parity) number of ones Even number of bit errors goes undetected Parity Checking () Single Bit Parity: Detect single bit errors Transmitted character/byte time Stop bit(s) Parity bit Start bit Part 6 - Data Link Control 5 Part 6 - Data Link Control 6

Parity Checking (2) Two Dimensional Bit Parity: Detect and correct single bit errors no error column parity d, d 2, d i, d i+, parity error parity error correctable single bit error row parity d,j d,j+ d 2,j d 2,j+ d i,j d i,j+ d i+,j d i+,j+ Cyclic Redundancy Check () For a block of k bits transmitter generates r bit sequence frame check sequence Transmit k+r bits which is exactly divisible by some number the generator polynomial Receiver divides frame by that number If no remainder, assume no error If remainder, error has occurred Part 6 - Data Link Control 7 Part 6 - Data Link Control 8 Cyclic Redundancy Check (2) Checksum computation done in hardware using simple circuits Example: Frame:, Gen: CRC-6, generates 6-bit checksum X 6 + x 5 + x 2 + is commonly used for 8-bit chars Part 6 - Data Link Control 9 Remainder (3) Frame: Generator: x 4 +x+ Message after appending 4 zero bits: Step: Check degree of polynomal if fourth degree polynomal add four 's Step2: Divide the modified bit string from step by the generator Step3: Append the remainder to the initial bit string Transmitted frame: Step4: The destination node receives the transmitted frame from step3 and performs same division No remainder no error remainder error has occurred Error Control Must deal with: Lost frames Damaged frames Automatic repeat request (ARQ) Error detection Positive acknowledgment Retransmission after timeout Negative acknowledgement and retransmission Flow Control Ensuring the sending entity does not overwhelm the receiving entity Preventing buffer overflow Transmission time Time taken to emit all bits into medium Propagation time Time for a bit to traverse the link Part 6 - Data Link Control Part 6 - Data Link Control 2

Model of Frame Transmission Stop and Wait Flow Control Source transmits frame Destination receives frame and replies with acknowledgement Source waits for ACK before sending next frame Destination can stop flow by not send ACK Works well for a few large frames Part 6 - Data Link Control 3 Part 6 - Data Link Control 4 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 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 Receiver gets two copies of frame Use ACK and ACK Part 6 - Data Link Control 5 Part 6 - Data Link Control 6 Stop and Wait - Pros and Cons Stop and Wait Diagram Simple The sender must wait a total time Tt of: Tt= Tix+ Tip + Tp + Tax + Tap + Tp Tt Tix +2Tp Efficiency, U = Tix/ (Tix + 2Tp) = /(+2a) a = Propagation time/transmission time (d/c)/(l/r)=rd/cl Inefficient Part 6 - Data Link Control 7 Part 6 - Data Link Control 8

Sliding Window Flow Control () Sliding Window Flow Control (2) Allow multiple frames to be in transit Receiver has buffer W long Transmitter can send up to W frames without ACK Each frame has a Sequence Number ACK includes number of next frame expected Sequence number bounded by size of field (k) Frames are numbered modulo 2 k Part 6 - Data Link Control 9 Send Window sequence number of frames transmitter is allowed to send without acknowledgement Retransmission list size is the max of this window Window size varies as acks arrive and frames are sent Receive Window sequence numbers of frames receiver is prepared to accept Size varies as ACK s are sent, but has max size Sequence numbers of frames received & not yet acknowledged kept Part 6 - Data Link Control 2 Sliding Window Flow Control (3) Sliding Window Diagram Send and receive windows sizes depends on Max frame size, buffer storage size, tp, and R Receive window also depends on Rx processing rate Part 6 - Data Link Control 2 Example Sliding Window Sliding Window Enhancements Receiver can acknowledge frames without permitting further transmission (Receive Not Ready) Must send a normal acknowledge to resume If duplex, use piggybacking If no data to send, use acknowledgement frame If data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP) Part 6 - Data Link Control 24

Automatic Repeat Request (ARQ) Continuous ARQ Stop and wait Go back N Selective reject (selective retransmission) Part 6 - Data Link Control 25 Sliding-window flow control technique sometimes referred to as continuous ARQ. Link utilization improved % link utilization if no errors and frame unrestricted Error occur Go-Back N Selective Reject (selective retransmission) Part 6 - Data Link Control 26 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 Go Back N - Damaged Frame Receiver detects error in frame i Receiver sends rejection-i Transmitter gets rejection-i Transmitter retransmits frame i and all subsequent Part 6 - Data Link Control 27 Part 6 - Data Link Control 28 Go Back N - Lost Frame () Frame i lost Transmitter sends i+ Receiver gets frame i+ out of sequence Receiver sends reject i Transmitter goes back to frame i and retransmits Go Back N - Lost Frame (2) Frame i lost and no additional frame sent Receiver gets nothing and returns neither acknowledgement nor rejection Transmitter times out and sends acknowledgement frame(rr) with P bit set to Receiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) Transmitter then retransmits frame i Part 6 - Data Link Control 29 Part 6 - Data Link Control 3

Go Back N Damaged Acknowledgement Receiver gets frame i and send acknowledgement (i+) which is lost Acknowledgements are cumulative, so next acknowledgement (i+n) may arrive before transmitter times out on frame i If transmitter times out, it sends acknowledgement (RR) with P bit set as before This can be repeated a number of times before a reset procedure is initiated Go Back N Damaged Rejection As for lost frame (2) Part 6 - Data Link Control 3 Part 6 - Data Link Control 32 Selective Reject Go Back N - Diagram 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 Part 6 - Data Link Control 33 Part 6 - Data Link Control 34 High Level Data Link Control Selective Reject - Diagram HDLC ISO 339, ISO 4335 Part 6 - Data Link Control 35 Part 6 - Data Link Control 36

HDLC Station Types Primary station Controls operation of link Frames issued are called commands Maintains separate logical link to each secondary station Secondary station Under control of primary station Frames issued called responses Combined station May issue commands and responses HDLC Link Configurations Unbalanced One primary and one or more secondary stations Supports full duplex and half duplex Balanced Two combined stations Supports full duplex and half duplex Part 6 - Data Link Control 37 Part 6 - Data Link Control 38 HDLC Transfer Modes () Normal Response Mode (NRM) Unbalanced configuration Primary initiates transfer to secondary Secondary may only transmit data in response to command from primary Used on multi-drop lines Host computer as primary Terminals as secondary HDLC Transfer Modes (2) Asynchronous Balanced Mode (ABM) Balanced configuration Either station may initiate transmission without receiving permission Most widely used No polling overhead Part 6 - Data Link Control 39 Part 6 - Data Link Control 4 HDLC Transfer Modes (3) Asynchronous Response Mode (ARM) Unbalanced configuration Secondary may initiate transmission without permission form primary Primary responsible for line rarely used HDLC Frame Structure Synchronous transmission All transmissions in frames Single frame format for all data and control exchanges Part 6 - Data Link Control 4 Part 6 - Data Link Control 42

HDLC - Frame Structure Diagram HDLC Frame: Flag Fields () 8 8 8 or 6 variable 6 or 32 8 bits extendable Delimit frame at both ends Single flag may close one frame and open another Receiver hunts for flag sequence to synchronize Part 6 - Data Link Control 43 Part 6 - Data Link Control 44 HDLC Frame: Flag Fields (2) Bit stuffing used to avoid confusion with data containing inserted after every sequence of five s If receiver detects five s it checks next bit If, it is deleted If and seventh bit is, accept as flag If sixth and seventh bits, sender is indicating abort Bit Stuffing Example with possible errors Part 6 - Data Link Control 45 Part 6 - Data Link Control 46 HDLC Frame: Address Field Identifies secondary station that sent or will receive frame Usually 8 bits long May be extended to multiples of 7 bits Leftmost bit of each octet indicates that it is the last octet () or not () All ones () is broadcast HDLC Frame: Control Field Different for different frame type Information frames- data to be transmitted to user (next layer up) Flow and error control piggybacked on information frames Supervisory frames- ARQ when piggyback not used Unnumbered frames- supplementary link control First one or two bits of control filed identify frame type Part 6 - Data Link Control 47 Part 6 - Data Link Control 48

HDLC Frame: Control Field Diagram HDLC Frame: Poll/Final Bit 8-bit controlled field format: 2 I: Information S: Supervisory U: Unnumbered 6-bit controlled field format: Information Supervisory 2 3 S 3 N(S) 4 S M 5 4 N(S) 5 P/F P/F P/F 6 7 6 7 N(R) N(R) 8 M 9 P/F P/F 8 N(S)= Send sequence number N(R)= Receive sequence number S= Supervisory function bits M= Unnumbered function bits P/F= Poll/final bit 2 3 4 5 6 N(R) N(R) Part 6 - Data Link Control 49 Use depends on context Command frame P bit to solicit (poll) response from peer Response frame F bit indicates response to soliciting command Part 6 - Data Link Control 5 HDLC Frame: Information Field HDLC Frame: Frame Check Sequence Field Only in information and some unnumbered frames Must contain integral number of octets Variable length FCS Error detection 6 bit CRC Optional 32 bit CRC Part 6 - Data Link Control 5 Part 6 - Data Link Control 52 HDLC Operation Examples of HDLC Operation () Exchange of information, supervisory and unnumbered frames Three phases Initialization of data link so that frames can be exchanged in order Data transfer after initialization Disconnect Part 6 - Data Link Control 53 Part 6 - Data Link Control 54

Examples of HDLC Operation (2) Other DLC Protocols (LAPB,LAPD) Link Access Procedure, Balanced (LAPB) Part of X.25 (ITU-T) Subset of HDLC - ABM Point to point link between system and packet switching network node Link Access Procedure, D-Channel ISDN (ITU-D) ABM Always 7-bit sequence numbers (no 3-bit) 6 bit address field contains two sub-addresses One for device and one for user (next layer up) Part 6 - Data Link Control 55 Part 6 - Data Link Control 56 Other DLC Protocols (LLC) Logical Link Control (LLC) IEEE 82 Different frame format Link control split between medium access layer (MAC) and LLC (on top of MAC) No primary and secondary - all stations are peers Two addresses needed Sender and receiver Error detection at MAC layer 32 bit CRC Destination and source access points (DSAP, SSAP) Part 6 - Data Link Control 57 Other DLC Protocols - Frame Relay () Streamlined capability over high speed packet witched networks Used in place of X.25 Uses Link Access Procedure for Frame- Mode Bearer Services (LAPF) Two protocols Control - similar to HDLC Core - subset of control Part 6 - Data Link Control 58 Other DLC Protocols - Frame Relay (2) ABM 7-bit sequence numbers 6 bit CRC 2, 3 or 4 octet address field Data link connection identifier (DLCI) Identifies logical connection More on frame relay later Other DLC Protocols (ATM) Asynchronous Transfer Mode Streamlined capability across high speed networks Not HDLC based Frame format called cell Fixed 53 octet (424 bit) Details later Part 6 - Data Link Control 59 Part 6 - Data Link Control 6