CSE 123A Computer Networks

Similar documents
Some portions courtesy Robin Kravets and Steve Lumetta

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

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

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

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

CSCI-1680 Link Layer I Rodrigo Fonseca

Data Link Layer. Srinidhi Varadarajan

Links. CS125 - mylinks 1 1/22/14

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

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

Introduction to Computer Networks. 03 Data Link Layer Introduction

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

ECE 4450:427/527 - Computer Networks Spring 2017

Where we are in the Course

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

CSE 123: Computer Networks

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 2.

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

Data Link Layer Overview

Data Link Layer Overview

Data Link Layer Overview

Computer Networking. Lecture 4 - Coding and Error Control

Lecture 2: Links and Signaling

Lecture / The Data Link Layer: Framing and Error Detection

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

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

CSE 461: Framing, Error Detection and Correction

CS321: Computer Networks Error Detection and Correction

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

Lecture 5: Data Link Layer Basics

Data Link Layer Overview

Computer and Network Security

Inst: Chris Davison

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

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

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

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

Chapter 10 Error Detection and Correction 10.1

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

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.

CS 4453 Computer Networks Winter

CSCI-1680 Physical Layer Link Layer I Rodrigo Fonseca

Ch. 7 Error Detection and Correction

LECTURE #34. Data Communication (CS601)

Data Link Layer (1) Networked Systems 3 Lecture 6

The Data Link Layer Chapter 3

ENEE x Digital Logic Design. Lecture 3

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

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

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

Data Link Layer. Overview. Links. Shivkumar Kalyanaraman

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

FAULT TOLERANT SYSTEMS

Data Link Layer: Overview, operations

UNIT I FUNDAMENTALS & LINK LAYER

5th Slide Set Computer Networks

CS422 Computer Networks

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

Data Link Layer. Indian Institute of Technology Madras

EE 6900: FAULT-TOLERANT COMPUTING SYSTEMS

CSE123A discussion session

CSE 123: Computer Networks

416 Distributed Systems. Errors and Failures, part 2 Feb 3, 2016

CSCI-1680 Link Layer Reliability John Jannotti

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

1/29/2008. From Signals to Packets. Lecture 6 Datalink Framing, Switching. Datalink Functions. Datalink Lectures. Character and Bit Stuffing.

CS 43: Computer Networks The Link Layer. Kevin Webb Swarthmore College November 28, 2017

Overview. Performance metrics - Section 1.5 Direct link networks Hardware building blocks - Section 2.1 Encoding - Section 2.2 Framing - Section 2.

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

Link Layer: Error detection and correction

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

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

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

CSEP 561 Error detection & correction. David Wetherall

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

Problem Statement. Physical and Data Link Layer Overview. Five Tasks Encoding. Make two computers talk to each other

DATA LINK LAYER UNIT 7.

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

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

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

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

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

Lecture 6 Datalink Framing, Switching. From Signals to Packets

(Refer Slide Time: 2:20)

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 Link Layer and LANs. Chapter 6: Link layer and LANs

Implementing CRCCs. Introduction. in Altera Devices

Communication Fundamentals in Computer Networks

Link Layer and LANs 안상현서울시립대학교컴퓨터 통계학과.

COMPUTER NETWORKS UNIT-3

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

CSN Telecommunications. 5: Error Coding. Data, Audio, Video and Images Prof Bill Buchanan

CS 455/555 Intro to Networks and Communications. Link Layer

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

The Data Link Layer Chapter 3

UNIT I FUNDAMENTALS & LINK LAYER

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

CSC 401 Data and Computer Communications Networks

COMP/ELEC 429/556 Introduction to Computer Networks

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

Transcription:

CSE 123A Computer Networks Winter 2005 Lecture 4: Data-Link I: Framing and Errors Some portions courtesy Robin Kravets and Steve Lumetta

Last time How protocols are organized & why Network layer Data-link layer Physical layer January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 2

Today: Data-link layer Framing Error detection/correction Media Access Bridging/Switching January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 3

Framing Goal: separate bitstream into distinct units of transfer (a frame) Why? Synchronization recovery Link multiplexing Efficient error detection Challenges How can we determine exactly what set of bits constitute a frame? How do we determine the beginning and end of a frame? January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 4

Framing Approaches Sentinel (like C strings) Length-based (like Pascal strings) Clock based Characteristics Bit- or byte-oriented Fixed or variable length Data-dependent or data-independent length January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 5

Sentinel-Based Framing Basic idea: identify start/end of frame with special marker Byte pattern, bit pattern, signal pattern Challenge: what if marker is in data stream Solution: stuffing recode data to prevent marker from occurring January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 6

Byte-oriented Sentintels STX start of text ETX end of text Problem: what if ETX appears in the data portion of the frame? Solution If ETX appears in the data, introduce a special character DLE (Data Link Escape) before it If DLE appears in the text, introduce another DLE character before it Efficiency can be only 50% Protocol examples BISYNC, PPP, DDCMP STX HEADER BODY ETX 0x48 ETX 0x69 0x48 DLE ETX 0x69 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 7

Consistent-Overhead Byte Stuffing (COBS) Run length encoding applied to byte stuffing Add implied 0 to end of frame Each 0 is replaced with (number of bytes to next 0) + 1 What if no 0 within 255 bytes? 255 value indicates 254 bytes followed by no zero Worst case no 0 s in packet 1/254 overhead Zero-pair optimization to encode series of 0 s Appropriate for very low-bandwidth links Code Followed by Meaning 0x00 (not applicable) (not allowed) 0x01 No data bytes A single zero byte n (n-1) data bytes Data followed by 0 0xFF 254 data bytes Data, no following 0 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 8

Length-Based Framing End of frame Calculated from length sent at start of frame Challenge: Corrupt length markers Examples DECNET s DDCMP:» Byte-oriented, variable-length RS-232 framing:» Bit-oriented, implicit fixed-length LENGTH HEADER BODY January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 9

Clock-Based Framing Continuous stream of fixed-length frames Clocks must remain synchronized No bit or byte stuffing Example: Synchronous Optical Network (SONET) Problems: Frame synchronization Clock synchronization January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 10

SONET All frames (STS formats) are 125 µsec long Problem: how to recover frame synchronization 2-byte synchronization pattern starts each frame (unlikely in data) Wait until pattern appears in same place repeatedly Problem: how to maintain clock synchronization NRZ encoding, data scrambled (XOR d) with 127-bit pattern Creates transitions Also reduces chance of finding false sync. pattern Overhead 9 rows Payload 90 columns January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 11

SONET Multiplexing FH STS-1 FH STS-1 FH STS-3c FH STS-1 STS-3c has the payloads of three STS-1 s byte-wise interleaved. STS-3 is a SONET link w/o multiplexing For STS-N, frame size is always 125 microsec STS-1 frame is 810 bytes STS-3 frame is 810x3 =2430 bytes January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 12

SONET STS-1 merged bytewise round-robin into STS-3 Unmerged (single-source) format called STS-3c Problem: simultaneous synchronization of many distributed clocks 249B 67B 151B not too difficult to synchronize clocks such that first byte of all incoming flows arrives just before sending first 3 bytes of outgoing flow January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 13

SONET... but now try to synchronize this network s clocks January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 14

Error Detection Goal: validate correctness of frame Idea: send additional redundant data with frame to check if it has been damaged Checked at many layers Physical (e.g. modulation) Datalink (e.g. cyclic redundancy check) Network/Transport (e.g. IP Checksum) Application (e.g. MD5 hash) Today: simple parity, redundancy w/voting, 2 dimensional parity, IP checksum, CRCs January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 15

Error Detection from 10,000 feet EDC= Error Detection bits (redundancy) D = Data protected by error checking, may include header fields Error detection not 100% reliable! Protocol may miss some errors, but rarely Larger EDC field yields better detection January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 16

Parity 1-bit error detection with parity Add an extra bit to a code to ensure an even (odd) number of 1s Every code word has an even (odd) number of 1s Valid code words 01 11 00 10 Parity Encoding: White invalid 000 (error) 001 011 111 010 110 100 101 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 17

Voting 1-bit error correction with voting Every codeword is transmitted n times Valid code words 0 1 Voting: White correct to 1 Blue - correct to 0 011 111 010 110 000 100 001 101 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 18

Hamming Distance The Hamming distance between two code words is the minimum number of bit flips to move from one to the other Example: 00101 and 00010 Hamming distance of 3 The minimum Hamming distance of a code is the minimum distance over all pairs of codewords Minimum Hamming Distance for parity = 2 Minimum Hamming Distance for voting = 3 N-bit error detection No code word changed into another code word Requires Hamming distance of N+1 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 19

Two-Dimensional Parity Data Parity Byte Parity Bits 0101001 1 001 1011110 0001110 000 1011111 0 1 1 1 0 111 0 Use 1-dimensional parity Add one bit to a 7-bit code to ensure an even/odd number of 1s Add 2nd dimension Add an extra byte to frame» Bits are set to ensure even/odd number of 1s in that position across all bytes in frame Comments Catches all 1-, 2- and 3-bit and most 4-bit errors January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 20

Internet Checksum Idea Add up all the words Transmit the sum Internet Checksum Use 1 s complement addition on 16bit codewords Example» Codewords: -5-3» 1 s complement binary: 1010 1100» 1 s complement sum 1000 Comments VERY easy to implement Not very robust January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 21

IP Checksum u_short cksum(u_short *buf, int count) { register u_long sum = 0; while (count--) { sum += *buf++; if (sum & 0xFFFF0000) { /* carry occurred, so wrap around */ sum &= 0xFFFF; sum++; } } return ~(sum & 0xFFFF); } January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 22

Cyclic Redundancy Check (CRC) Polynomial code Treat packet bits a coefficients of n-bit polynomial» Message = 1000» Polynomial = 1 x 7 + 0 x 6 + 0 x 5 + 1 x 4 + 1 x 3 + 0 x 2 + 1 x + 0 = x 7 + x 4 + x 3 + x Choose r+1 bit generator polynomial (well known chosen in advance) Add r bits to packet such that message is divisible by generator polynomial Note: easy way to think of polynomial arithmetic mod 2» Multiplication: binary addition without carries» Division: binary subtraction without carries Better loss detection properties than checksums January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 23

Error Detection CRC View data bits, D, as a binary number Choose r+1 bit pattern (generator), G Goal: choose r CRC bits, R, such that <D,R> exactly divisible by G (modulo 2) Receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! Can detect all burst errors less than r+1 bits Widely used in practice (Ethernet, FDDI, ATM) January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 24

Common Generator Polynomials CRC-8 CRC-10 CRC-12 CRC-16 CRC-CCITT CRC-32 x 8 + x 2 + x 1 + 1 x 10 + x 9 + x 5 + x 4 + x 1 + 1 x 12 + x 11 + x 3 + x 2 + x 1 + 1 x 16 + x 15 + x 2 + 1 x 16 + x 12 + x 5 + 1 x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x 1 + 1 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 25

CRC Example Encoding k + 1 bit check sequence c, equivalent to a degree-k polynomial x 3 + x 2 + 1 = Generator x 7 + x 4 + x 3 + x = 1000 Message Remainder m mod c 1000000 Message plus k zeros 1001 1000 1011 1100 1000 101 Result: Transmit message followed by remainder: 1000101 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 26

CRC Example Decoding No Errors x 3 + x 2 + 1 = Generator x 10 + x 7 + x 6 + x 4 + x 2 + 1 = 1000101 Received Message k + 1 bit check sequence c, equivalent to a degree-k polynomial Remainder m mod c 1000101 Received message, no 1001 errors 1000 1011 1100 0 Result: CRC test is passed January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 27

CRC Example Decoding with Errors x 3 + x 2 + 1 = Generator x 10 + x 7 + x 5 + x 4 + x 2 + 1 = 1001001 Received Message k + 1 bit check sequence c, equivalent to a degree-k polynomial 1001001 Received message 1000 Two bit errors 1011 0101 Result: CRC test failed Remainder m mod c January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 28

Summary Framing Bunching bits into distinct messages (frames) Challenge is in finding where one frame starts and another begins Error detection Determine if frame is corrupted by checking it against redundant data Next time: more on the datalink layer Media access Read 2.6, 2.7, 2.8 January 20, 2005 CSE 123A -- Lecture 4 Datalink I: Framing and Errors 29