Chapter 3. The Data Link Layer

Similar documents
The Data Link Layer. Data Link Layer Design Issues

CS422 Computer Networks

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

Chapter 3. The Data Link Layer

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

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

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

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

The Data Link Layer Chapter 3

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

3. Data Link Layer 3-2

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

The Data Link Layer Chapter 3

DATA LINK LAYER UNIT 7.

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

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

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.

Inst: Chris Davison

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

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

Data Link layer (CN chap 3.1, 3.4, 3.6)

Lecture / The Data Link Layer: Framing and Error Detection

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

CSE123A discussion session

CSE 123: Computer Networks

Data Link Layer, Part 4. Exemplary Protocols

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

Chapter 3 The Data Link Layer

Data Link Layer. Indian Institute of Technology Madras

COMPUTER NETWORKS UNIT-3

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

Data Link Layer (1) Networked Systems 3 Lecture 6

1.Write about the Data Link layer design issues.

Lesson Schedule: Class No. Portion covered per hour (An estimate)

Chapter 5 Data-Link Layer: Wired Networks

Lecture 6: Reliable Transmission. CSE 123: Computer Networks Alex Snoeren (guest lecture) Alex Sn

DLL: Flow Control DLL. Simplex. Fast sender / slow receiver scenario. Various protocols used. Simplified examples implemented in C.

2.4 Error Detection Bit errors in a frame will occur. How do we detect (and then. (or both) frames contains an error. This is inefficient (and not

Data Link Control Protocols

Lecture 5. Homework 2 posted, due September 15. Reminder: Homework 1 due today. Questions? Thursday, September 8 CS 475 Networks - Lecture 5 1

CSE 461: Framing, Error Detection and Correction

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

Introduction to Data Communications & Networking

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

Networking Link Layer

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

UNIT-II 1. Discuss the issues in the data link layer. Answer:

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

Lecture 5: Data Link Layer Basics

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

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

CSCI-1680 Link Layer I Rodrigo Fonseca

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

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

Data Link Layer. Srinidhi Varadarajan

Where we are in the Course

Politecnico di Milano Scuola di Ingegneria Industriale e dell Informazione. Link Layer. Fundamentals of Communication Networks

Chapter 10 Error Detection and Correction. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

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

4. Error correction and link control. Contents

C08a: Data Link Protocols

Transmission SIGNALs

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

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

Data Link Control Protocols

Communication Networks. Part I

Data Link Protocols. High Level Data. Control Protocol. HDLC Framing ~~~~~~~~ Functions of a Data Link Protocol. Framing PDUs. Addressing Destination

Introduction to Computer Networks. 03 Data Link Layer Introduction

Data-link. Examples of protocols. Generating polynomials. Example. Error detection in TCP/IP. Multiple Access Links and Protocols


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

Hamming codes can also correct burst of errors by using iterleaving

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

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

UNIT I FUNDAMENTALS & LINK LAYER

CS 4453 Computer Networks Winter

Data Link Layer: Overview, operations

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

Ch. 7 Error Detection and Correction

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

Point-to-Point Links. Outline Encoding Framing Error Detection Sliding Window Algorithm. Fall 2004 CS 691 1

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

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

Data Link Networks. Hardware Building Blocks. Nodes & Links. CS565 Data Link Networks 1

Telecommunication Protocols Laboratory Course

UNIT IV -- TRANSPORT LAYER

EITF25 Internet- - Techniques and Applica8ons Stefan Höst. L4 Data link (part 1)

Framing and Stuffing. Advanced Computer Networks

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

Ad hoc and Sensor Networks Chapter 6: Link layer protocols. Holger Karl

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

Data Link Layer Overview

CS321: Computer Networks Error Detection and Correction

CSE123A discussion session

Links. CS125 - mylinks 1 1/22/14

INTERNET ARCHITECTURE & PROTOCOLS

INF Data Communication Data Link Layer

Transcription:

Chapter 3 The Data Link Layer 1

Data Link Layer Algorithms for achieving reliable, efficient communication between two adjacent machines. Adjacent means two machines are physically connected by a communication channel that acts like a wire (bits are delivered in exactly the same order in which they are sent) 2

Role of the Data Link Layer To provide services to the network layer(3) by enhancing the services provided by the physical layer (1). Several types of services: -reliable service on a link (almost no error, no loss, no reordering) error detection and recovery at the data link layer flow control to protect buffers at receiver -unreliable service on a link (multiple Access) error detection done at the data link layer recovery done at higher layers 3

Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control 4

Functions of the Data Link Layer Provide service interface to the network layer Dealing with transmission errors Regulating data flow Slow receivers not swamped by fast senders 5

Functions of the Data Link Layer (2) Relationship between packets and frames. 6

Services Provided to Network Layer (a) Virtual communication. (b) Actual communication. 7

Services Provided to the Network Layer 1. Unacknowledged Connectionless Service 2. Acknowledged Connectionless Service 3. Acknowledged Connection-oriented Service (Three phases) Connection establishment data transfer disconnection 8

Services to Network layer (1) Unacknowledged connectionless service No connection required and without acknowledgement for data frames Appropriate for low error rate and real-time traffic Error recovery is up to higher layer (or no error recovery e.g. digitized voice) 9

Services to Network layer (2) Acknowledged connectionless service No connection required but each frame is individually acknowledged Useful for unreliable channel, such as wireless systems. Transport layer may do message recovery but is more expensive than frame recovery at data link layer 10

Services to Network layer (3) Acknowledged connection-oriented service Guarantee error-free and in sequence delivery of data frames Consists of three phases Connection set up (variables and buffers initialization) Data frame transmission Connection termination (free of variable and buffers) 11

Services Provided to Network Layer (2) Placement of the data link protocol. 12

Framing Break bit stream from physical layer into frames for error detection and recovery. Four framing methods 1. Byte count 2. Flag bytes with byte (character) stuffing 3. Starting and ending flags, with bit stuffing 4. Physical layer coding violations 13

Framing Approaches (1) Byte Count Indicate the frame boundary by frame length Once an error, frame boundary cannot be recognized and thus recovery is impossible. 14

Framing (1) A byte stream. (a) Without errors. (b) With one error. 15

Framing Approaches (2) Flag bytes with byte stuffing (character stuffing) Delimit the frame by flag bytes Prevent frame boundary from appearing at the data content by character stuffing. Character Stuffing: inserting ESC ahead of accidental flag byte within the data content. 16

Framing Approaches (2) (a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing. 17

Framing Approaches (3) Starting and ending flags, with bit stuffing Begin and end with a flag byte 01111110 Prevent a flag from appearing in data by bit stuffing. Bit stuffing: inserting 0 after five continuous bit 1 data appear. 18

Framing Approaches (3) 6 consecutive 1 s 5 consecutive 1 + 1 0 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. 19

Framing Approaches (4) Physical Layer Coding Violations. Used when physical layer encoding contains redundancy Example: 01 (H), 10 (L) then 00 or 11 can be used to delimit a frame. Note: One or more combination of the approaches may be used to provide extra protection for framing. 20

1 0 0 0 violation violation Neutral versus bipolar bit streams. (a) Alternate 1 s and 0 s transmitted in a neutral mode. (b) Equivalent in a bipolar mode. (c) Framing by coding violation. 21

Error Control Need mechanisms such as Error detection Acknowledgement or NACK Timer Retransmission Sequence numbering 22

Flow Control When receiver processes frames slower than the sender, congestion occurs. Needs some feedback to prevent sender from sending faster than the receiver can process. (or a flow rate agreement in advance for Virtual Circuits) 23

Error Detection and Correction Error-Correcting Codes Error-Detecting Codes 24

Error Detection Codes (1) 1. Hamming codes. 2. Binary convolutional codes. 3. Reed-Solomon codes. 4. Low-Density Parity Check codes. 25

Data Redundant 26

Error Correcting Code Codeword = Data + Check-bit n-bit codeword = m data bit + r check-bit 2 m out of 2 n are legal Hamming distance = The minimum number of bit positions in which two codewords differ. H = d+1 --> detect d errors; H = 2d+1 --> correct d errors. 27

Error-Correcting Codes Parity bit: detect single bit error and H = 2. Example of H = 5 d = (5-1)/2 = 2 0000000000 0000011111 1111100000 1111111111 0000000111 ==> two bit errors in 0000011111 0000000011 ==> three bit errors in 0000011111 but be corrected to be 0000000000 Out of Correcting Capability 28

Error Correcting Codes Correcting single bit error of n-bit codeword requires (m + r + 1) < 2 r (lower bound for r) n n + 1 bit patterns dedicated to one codeword ==> (n+1)2 m < 2 n and n = m + r Each 2 m legal message requires n+1 bit patterns dedicated to it. N possible bit patterns at a distance 1 from it 29

Hamming code Achieve lower bound of r The codeword is numbered consecutively starting from left end as 1. The bits of powers of 2 (1,2,4,8, ) are check bits; the rest (3,5,7, ) are filled with m data bits. A check bit forces the parity of some collection of bits, including itself, to be even (or odd). 30

Hamming Code (2) A bit is checked by just those check bits occurring in its expansion (e.g., bit 11 is checked by bits 1,2, and 8) Checking algorithm Initialize counter == 0 Examine all check bits If check bit k is error, add k into the counter. After all check bits are checked, the counter contains the number of the incorrect bit. 31

ASCII 1 2 3 4 5 6 7 8 9 10 11 Transmitting 1 0 1 1 1 0 0 1 0 0 1 Bit 2 3 1100001 1 0 0 0 1 2 0 0 0 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 0 0 0 7 0 0 0 0 8 1 0 0 0 9 0 0 0 0 10 0 0 0 0 11 1 0 1 1 2 2 1 2 0 2 0 0 0 0 If received 1 1 1 1 1 0 0 1 0 0 1 32

If error occurs 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 Error in second bit! error 33

Error Correcting Codes Example of an (11, 7) Hamming code correcting a single-bit error. 34

Error-Correcting Codes Use of a Hamming code to correct burst errors. 35

Error Detecting Code Parity code detect single or odd # of bit errors detect burst error of n-bit by matrix checksum on each column of n-bit wide and h-bit high data and put the checksum at the h+1 row. Cyclic redundancy code Polynomial code Using Exclusive OR in addition and subtraction. 36

Error Correcting Codes The NASA binary convolutional code used in 802.11. 37

Error-Detecting Codes (1) Linear, systematic block codes 1. Parity. 2. Checksums. 3. Cyclic Redundancy Checks (CRCs). 38

39

40

CRC Algorithm Shift M(x) left by r bits (r is the degree of G(x). Divide x r M(x) by G(x) Subtract x r M(x) by the remainder in last step to obtain the checksumed frame to be transmitted, T(x). T(x) is divisible by G(x) 41

CRC Error Check Receive T (x) Divide T (x)/g(x) if no remainder, the frame is accepted if yes, error is found. T (x) = T(x) + E(x) T (x)/g(x) = T(x)/G(x) + E(x)/G(x) = E(x)/G(x) 42

Error Detection of CRC Single bit error: E(x) = x i Not divisible by G(x) if G(x) has more than one term. Double bit Error: E(x) = x i + x j = x j (x i-j +1) Low degree polynomials the give protection to long frames are known. 15 14 k E.g., x x 1 will not divide x 1 for any k < 32768 Odd # of bits in Error: No polynomial with odd No. of terms contain a factor of (x+1) if G(x) contain (x+1), indivisible for any odd No. of errors. 43

Error Detection of CRC (2) Detect all errors of length < r, if the degree of G(x) is r. Undetectable error of r+1 bit (the first and the last of the r+1 bits must be 1) with prob. 1/2 (r-1) (r+1-2 intermediate bits) Undetected error of longer than r+1 bits with prob. 1/2 r Example of G(x) CRC-12 = x 12 +x 11 +x 3 +x 2 +x 1 +1 44

Error-Detecting Codes Calculation of the polynomial code checksum. Message Checksum 45

General Implementation of the Polynomial Code Checksum by Shift Register and Adder G n n 1 ( x ) a x a x... a x a n n 1 1 0 a a 1 2 0 a a a n 1 n 2 + +. + + + 46

47

48

Utopian Simplex Protocol (No Ack, No Sequence #) (with Ack) ( One-bit Sliding Window ) Re-transmission 49

50

51

Data Link Protocols ARQ: Automatic Repeat request Timer Acknowledgement Sequence number Retransmission ARQ must handle Garbled frames Lost frames Lost acks Duplicate frames 52

Complicate Issue in Full-Duplex Both sides (A and B) can send data simultaneously. Intermix ack and data frame in each direction by piggybacking. How long can an ACK hold before is sent? 53

Sliding Window Protocols Each outbound frame contains a sequence number, ranging from 0 to 2 n - 1 for n-bit field. Sender keeps a sending window represent the frames with the sequence numbers in the list that are sent but as yet not acknowledged. Receiver keeps a receiving window Represent the acceptable frame sequence numbers. 54

Sliding Window Protocols (2) A One-Bit Sliding Window Protocol A Protocol Using Go Back N A Protocol Using Selective Repeat 55

Sliding Window Protocols (3) Stop and Wait: w =1. (One-bit Sliding Window) The sender sends one frame and then waits for an acknowledgement before proceeding. Go back N: w = Corresponding receiving window of size 1. =MAX_SEQ Sender retransmit all packets starting with the damaged or lost one. Selective Repeat: w = Receiver stores all correct frames Sender retransmit the bad frames. 56

Sliding Window Protocols (3) Variable size Fixed size A sliding window of size 1, with a 3-bit sequence number. (a) Initially. (b) After the first frame has been sent. (c) After the first frame has been received. (d) After the first acknowledgement has been received. 57

A One-Bit Sliding Window Protocol (2) Sequence Ack Packet # Duplicate Two scenarios for protocol 4. (a) Normal case. (b) Abnormal case. The notation is (seq, ack, packet number). An asterisk indicates where a network layer accepts a packet. 58

3-16 = MAX_SEQ 59

60

= (MAX_SEQ +1)/2 3-16 61

A Sliding Window Protocol Using Selective Repeat (5) (a) Initial situation with a window size seven. (b) After seven frames sent and received, but not acknowledged. (c) Initial situation with a window size of four. (d) After four frames sent and received, but not acknowledged. 62

63

8 64

3.5 3.5.1 Useful for multi-drop line CRC checksum 65

Example of DLC SDLC (Synchronous Data Link Control) -- IBM ADCCP -- ANSI HDLC (High-level Data Link Control) -- ISO LAP (Link Access Procedure) and LAPB-- CCITT They are all derived from SDLC 66

High-Level Data Link Control (2) Frame sequence number Piggy back ack Control field of (a) An information frame. (b) A supervisory frame. (c) An unnumbered frame. 67

HDLC Flavored DLC Bit-oriented and use bit-stuffing Frame structure (See Fig 3-24) Delimited by flag 01111110 Consists of three kinds of frames Information, supervisory, and unnumbered Sliding window with n=3 bits Full-duplex with piggy back 68

Supervisory Frames Defined by Type field Examples Receive Ready (RR): ACK Reject: NACK Receive No Ready (RNR): ACK with flow control Selective Reject: selective repeat. 69

70

71

72

3.5.2 DLC in the Internet PC dials up an Internet service provider s router and act like a full-blown Internet host. Two protocols: SLIP and PPP. SLIP: Send raw IP packets with a special flag type (0xC0) at the end for framing. Character stuffing with (0xDB, 0xDC) Newer version adds header compression (consecutive TCP, IP tends to have the same header) 73

Problems with SLIP No error detection or correction Support only IP, (a problem for Novell LANs). Must know the other s IP in advance. No dynamic IP assignment is possible. No authentication Not an Internet Standard. 74

The Data Link Layer in the Internet A home personal computer acting as an internet host. 75

PPP Point-to-Point Protocol A DLC protocol to solve all the problems of SLIP Two protocols are used for connection negotiation: LCP (Link Control Protocol) for PPP parameters set up. NCP (Network Control Protocol) for network layer (IP) parameter set up (e.g., IP assignment and release) 76

PPP HDLC like but character-oriented Address and Control fields are default constant and can be omit after negotiation. Protocol: what kinds of packet types in the payload, such as LCP, NCP, IP, IPX, Multiprotoocl framing mechanism Provide error detection, option negotiation, header compression, and optionally, reliable transmission 77

3.5.3 Packet over SONET (1) Packet over SONET. (a) A protocol stack. (b) Frame relationships 78

Packet over SONET (2) PPP Features 1. Separate packets, error detection 2. Link Control Protocol 3. Network Control Protocol 79

The PPP full frame format for unnumbered mode operation. 80

PPP Point to Point Protocol (2) LCP A simplified phase diagram for bring a line up and down. 81

PPP Point to Point Protocol (3) The LCP frame types. 82