Lecture / The Data Link Layer: Framing and Error Detection

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

Digital Communication Networks

Lecture 5: Data Link Layer Basics

Chapter 3. The Data Link Layer

CSE123A discussion session

Inst: Chris Davison

CSE 123A Computer Networks

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

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

CMSC 2833 Lecture 18. Parity Add a bit to make the number of ones (1s) transmitted odd.

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

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

Some portions courtesy Robin Kravets and Steve Lumetta

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

DATA LINK LAYER UNIT 7.

Data Link Layer: Overview, operations

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

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.

Introduction to Computer Networks. 03 Data Link Layer Introduction

CS 4453 Computer Networks Winter

Where we are in the Course

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

Direct Link Networks: Building Blocks (2.1), Encoding (2.2), Framing (2.3)

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

5th Slide Set Computer Networks

Chapter 9: Data Transmission

CSE 461: Framing, Error Detection and Correction

Framing and Stuffing. Advanced Computer Networks

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

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

Data Link Layer. Indian Institute of Technology Madras

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

Transmission SIGNALs

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

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

Ch. 7 Error Detection and Correction

Chapter 6 Digital Data Communications Techniques

Computer Networking. Lecture 4 - Coding and Error Control

Direct Link Networks. Framing. Lecture - Encoding & Framing 1. Problems. Areas for Discussion

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

Chapter 10 Error Detection and Correction 10.1

CS422 Computer Networks

COMPUTER NETWORKS UNIT-3

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

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

ECE 333: Introduction to Communication Networks Fall Lecture 6: Data Link Layer II

ECE 4450:427/527 - Computer Networks Spring 2017

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due Thursday!

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

Fault Tolerance & Reliability CDA Chapter 2 Additional Interesting Codes

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

Introduction to Data Communications & Networking

Data Link Layer. Srinidhi Varadarajan

Data Link Layer (1) Networked Systems 3 Lecture 6

Direct Link Networks. Lecture - Encoding & Framing 1. Areas for Discussion. Problems

CSEP 561 Error detection & correction. David Wetherall

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

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

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

The Data Link Layer Chapter 3

Chapter 5 Data-Link Layer: Wired Networks

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

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

Computer and Network Security

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

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

Fault-Tolerant Computing

CSCI-1680 Link Layer I Rodrigo Fonseca

CSE 123: Computer Networks

CS321: Computer Networks Error Detection and Correction

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

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

Networking Link Layer

From Signals to Packets Computer Networking. Link Layer: Implementation. Datalink Functions. Lecture 5 - Coding and Error Control

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

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

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

ISO/OSI Reference Model. Data Link Layer. 7. Application. 6. Presentation. 5. Session. 4. Transport. 3. Network. 2. Data Link. 1.

The Data Link Layer. Data Link Layer Design Issues

CSE123A discussion session

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

(Refer Slide Time: 2:20)

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 7

CHAPTER 2 Data Representation in Computer Systems

Links. CS125 - mylinks 1 1/22/14

CHAPTER 2 Data Representation in Computer Systems

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

From Signals to Packets Computer Networking. Link Layer: Implementation. Network Delay. 06-datalink.ppt, , Fall

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

Data Link Layer Overview

Fig.12.5 Serial Data Line during Serial Communication

Announcement. (CSC-3501) Lecture 3 (22 Jan 2008) Today, 1 st homework will be uploaded at our class website. Seung-Jong Park (Jay)

EE 6900: FAULT-TOLERANT COMPUTING SYSTEMS

Data Link Layer Overview

Data Link Layer Lecture 7

CompSci 356: Computer Network Architectures. Lecture 4: Link layer: Encoding, Framing, and Error Detection Ref. Chap 2.2, 2.3,2.4

4. Error correction and link control. Contents

Data Link Layer Overview

Pending Issues. Opera,ng Systems and Networks. Network Lecture 3: Link Layer (1) Where we are in the Course. Scope of the Link Layer

Data Link Layer Overview

Transcription:

Lecture 2 6.263/16.37 The Data Link Layer: Framing and Error Detection MIT, LIDS Slide 1

Data Link Layer (DLC) Responsible for reliable transmission of packets over a link Framing: Determine the start and end of packets (sec 2.5) Error Detection: Determine when a packet contains errors (sec 2.3) Error recovery: Retransmission of packets containing errors (sec 2..4) DLC layer recovery May be done at higher layer Slide 2

Framing 010100111010100100101010100111000100 Where is the DATA?? Three approaches to find frame and idle fill boundaries: 1) Character oriented framing 2) Length counts - fixed length 3) Bit oriented protocols (flags) Slide 3

Character Based Framing Frame SYN SYN STX Header Packet ETX CRC SYN SYN SYN is synchronous idle STX is start text ETX is end text Standard character codes such as ASCII and EBCDIC contain special communication characters that cannot appear in data Entire transmission is based on a character code Slide 4

Issues With Character Based Framing Character code dependent How do you send binary data? Frames must be integer number of characters Errors in control characters are messy NOTE: Primary Framing method from 1960 to ~1975 Slide 5

Length field approach (DECNET) Use a header field to give the length of the frame (in bits or bytes) Receiver can count until the end of the frame to find the start of the next frame Receiver looks at the respective length field in the next packet header to find that packet s length Length field must be log 2 (Max_Size_Packet) + 1 bits long This restricts the packet size to be used Issues with length counts Difficult to recover from errors Resynchronization is needed after an error in the length count Slide 6

Fixed Length Packets (e.g., ATM) All packets are of the same size In ATM networks all packets are 53 Bytes Requires synchronization upon initialization Issues: Message lengths are not multiples of packet size Last packet of a message must contain idle fill (efficiency) Synchronization issues Fragmentation and re-assembly is complicated at high rates Slide 7

Bit Oriented Framing (Flags) A flag is some fixed string of bits to indicate the start and end of a packet A single flag can be used to indicate both the start and the end of a packet In principle, any string could be used, but appearance of flag must be prevented somehow in data Standard protocols use the 8-bit string 01111110 as a flag Use 01111111..1110 (<16 bits) as abort under error conditions Constant flags or 1's is considered an idle state Thus 0111111 is the actual bit string that must not appear in data INVENTED ~ 1970 by IBM for SDLC (synchronous data link protocol) Slide 8

BIT STUFFING (Transmitter) Used to remove flag from original data A 0 is stuffed after each consecutive five 1's in the original frame Stuffed bits 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 Original frame Why is it necessary to stuff a 0 in 0111110? If not, then 0111110111 -> 0111110111 011111111 -> 0111110111 How do you differentiate at the receiver? Slide 9

DESTUFFING (Receiver) If 0 is preceded by 011111 in bit stream, remove it If 0 is preceded by 0111111, it is the final bit of the flag. Example: Bits to be removed are underlined below 1001111101100111011111011001111110 flag Slide 10

Overhead In general with a flag 01 K 0 the bit stuffing is require whenever 01 k-1 appears in the original data stream For a packet of length L this will happen about L/2 k times E{OH} = L/ 2 k + (k+ 2) bits For 8 bit flag OH ~ 8 + L/64 For large packets efficiency ~ 1-1/64 = 98.5 (or 1.5% overhead) Optimal flag length If packets are long want longer flag (less stuffing) If packets are short want short flag (reduce overhead due to flag) K opt ~ log 2 (L) Slide 11

Framing Errors All framing techniques are sensitive to errors An error in a length count field causes the frame to be terminated at the wrong point (and makes it tricky to find the beginning of the next frame) An error in DLE, STX, or ETX causes the same problems An error in a flag, or a flag created by an error causes a frame to disappear or an extra frame to appear Flag approach is least sensitive to errors because a flag will eventually appear again to indicate the end of a next packet Only thing that happens is that an erroneous packet was created This erroneous packet can be removed through an error detection technique Slide 12

Error detection techniques Used by the receiver to determine if a packet contains errors If a packet is found to contain errors the receiver requests the transmitter to re-send the packet Error detection techniques Parity check single bit Horizontal and vertical redundancy check Cyclic redundancy check (CRC) Slide 13

Effectiveness of error detection technique Effectiveness of a code for error detection is usually measured by three parameters: 1) minimum distance of code (d) (min # bit errors undetected) The minimum distance of a code is the smallest number of errors that can map one codeword onto another. If fewer than d errors occur they will always detected. Even more than d errors will often be detected (but not always!) 2) burst detecting ability (B) (max burst length always detected) 3) probability of random bit pattern mistaken as error free (good estimate if # errors in a frame >> d or B) Useful when framing is lost K info bits => 2 k valid codewords With r check bits the probability that a random string of length k+r maps onto one of the 2 k valid codewords is 2 k /2 k+r = 2 -r Slide 14

Parity check codes k Data bits r Check bits Each parity check is a modulo 2 sum of some of the data bits Example: c 1 = x 1 + x 2 + x 3 c 2 = x 2 + x 3 + x 4 c 3 = x 1 + x 2 + x 4 Slide 15

Single Parity Check Code The check bit is 1 if frame contains odd number of 1's; otherwise it is 0 1011011 -> 1011011 1 1100110 -> 1100110 0 Thus, encoded frame contains even number of 1's Receiver counts number of ones in frame An even number of 1 s is interpreted as no errors An odd number of 1 s means that an error must have occured A single error (or an odd number of errors) can be detected An even number of errors cannot be detected Nothing can be corrected Probability of undetected error (independent errors) Slide 16 P(un det ected) = N p i (1 p) N i i even i N = packet size p = error prob.

Horizontal and Vertical Parity 1 0 0 1 0 1 0 1 0 1 1 1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0 1 0 1 Horizontal 0 1 1 1 0 1 0 0 checks 1 1 1 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 Vertical checks The data is viewed as a rectangular array (i.e., a sequence of words) Minimum distance=4, any 4 errors in a rectangular configuration is undetectable Slide 17

Cyclic Redundancy Checks (CRC) M R k Data bits r Check bits T T = M 2 r + R M = info bits R = check bits T = codeword A CRC is implemented using a feedback shift register Bits in Bits out Slide 18

Cyclic redundancy checks T = M 2 r + R How do we compute R (the check bits)? Choose a generator string G of length r+1 bits Choose R such that T is a multiple of G (T = A*G, for some A) Now when T is divided by G there will be no remainder => no errors All done using mod 2 arithmetic T = M 2 r + R = A*G => M 2 r = A*G + R (mod 2 arithmetic) Let R = remainder of M 2 r /G and T will be a multiple of G Choice of G is a critical parameter for the performance of a CRC Slide 19

Example r = 3, G = 1001 M = 110101 => M2 r = 110101000 Slide 20 110011 1001 110101000 1001 Modulo 2 01000 Division 1001 0001100 1001 01010 1001 011 = R (3 bits)

Checking for errors Let T be the received sequence Divide T by G If remainder = 0 assume no errors If remainder is non zero errors must have occurred Slide 21 Example: Send T = 110101011 Receive T = 110101011 (no errors) No way of knowing how many errors occurred or which bits are In error 1001 110101011 1001 01000 1001 0001101 1001 01001 1001 000 => No errors

Slide 22 Mod 2 division as polynomial division

Slide 23 Implementing a CRC

Performance of CRC For r check bits per frame and a frame length less than 2 r-1, the following can be detected 1) All patterns of 1,2, or 3 errors (d > 3) 2) All bursts of errors of r or fewer bits 3) Random large numbers of errors with prob. 1-2 -r Standard DLC's use a CRC with r=16 with option of r=32 CRC-16, G = X 16 + X 15 + X 2 +1 = 11000000000000101 Slide 24

Physical Layer Error Characteristics Most Physical Layers ( communications channels) are not well described by a simple BER parameter Most physical error processes tend to create a mix of random & bursts of errors A channel with a BER of 10-7 and a average burst size of 1000 bits is very different from one with independent random errors Example: For an average frame length of 10 4 bits random channel: E[Frame error rate] ~ 10-3 burst channel: E[Frame error rate] ~ 10-6 Best to characterize a channel by its Frame Error Rate This is a difficult problem for real systems Slide 25