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

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

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

CSE 123A Computer Networks

Some portions courtesy Robin Kravets and Steve Lumetta

Data Link Layer. Srinidhi Varadarajan

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

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

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

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

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

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

CSE 123: Computer Networks

Links. CS125 - mylinks 1 1/22/14

CSE 123: Computer Networks

CS321: Computer Networks Error Detection and Correction

Ch. 7 Error Detection and Correction

Lecture 5: Data Link Layer Basics

CSE 461: Framing, Error Detection and Correction

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

Chapter 10 Error Detection and Correction 10.1

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

Where we are in the Course

Inst: Chris Davison

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

Link Layer: Error detection and correction

CSCI-1680 Link Layer Reliability John Jannotti

CSE123A discussion session

CSE123A discussion session

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

CSCI-1680 Link Layer I Rodrigo Fonseca

Lecture / The Data Link Layer: Framing and Error Detection

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

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

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

Data Link Layer (1) Networked Systems 3 Lecture 6

Computer and Network Security

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

EE 6900: FAULT-TOLERANT COMPUTING SYSTEMS

Lecture 2 Error Detection & Correction. Types of Errors Detection Correction

Data Link Layer Overview

4. Error correction and link control. Contents

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

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

(Refer Slide Time: 2:20)

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

Introduction to Computer Networks. 03 Data Link Layer Introduction

Data Link Layer Overview

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

Data Link Layer Overview

ENEE x Digital Logic Design. Lecture 3

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

Data Link Layer Overview

LECTURE #34. Data Communication (CS601)

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

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

Communication Fundamentals in Computer Networks

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

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

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

FAULT TOLERANT SYSTEMS

Fault-Tolerant Computing

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

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

CSEP 561 Error detection & correction. David Wetherall

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

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.

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

CS422 Computer Networks

Chapter 3. The Data Link Layer

Lecture 9: Internetworking

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

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

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

CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems

Fault Tolerance & Reliability CDA Chapter 2 Additional Interesting Codes

COMPUTER NETWORKS UNIT-3

Networking Link Layer

Achieving Reliable Digital Data Communication through Mathematical Algebraic Coding Techniques

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

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

The Data Link Layer. CS158a Chris Pollett Feb 26, 2007.

Implementing CRCCs. Introduction. in Altera Devices

Computer Networking. Lecture 4 - Coding and Error Control

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

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

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

SPM90 MODBUS PROTOCOL AND REGISTER LIST V1.0

Computer Networks. Shyam Gollakota

The Data Link Layer Chapter 3

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

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

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

DATA LINK LAYER UNIT 7.

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

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

CSC 401 Data and Computer Communications Networks

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

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Basic Communication Concepts

Transcription:

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

Error handling through redundancy Adding extra bits to the frame Hamming Distance When we can detect When we can correct Checksum Cyclic Remainder Check (CRC) CSE 123 Lecture 4: Error Handling! 2

Implemented at many layers We ll mainly focus on link-layer techniques today CSE 123 Lecture 4: Error Handling! 3

The problem is data itself is not self-verifying Every string of bits is potentially legitimate Hence, any errors/changes in a set of bits are equally legit The solution is to reduce the set of potential bitstrings Not every string of bits is allowable Receipt of a disallowed string of bits means the original bits were garbled in transit Key question: which bitstrings are allowed? CSE 123 Lecture 4: Error Handling! 4

Let s start simple, and consider fixed-length bitstrings Reduce our discussion to n-bit substrings E.g., 7-bits at a time, or 4 bits at a time (4B/5B) Or even a frame at a time We call an allowable sequence of n bits a codeword Not all strings of n bits are codewords! The remaining n-bit strings are space between codewords Rephrasing previous question: how many codewords with how much space between them? CSE 123 Lecture 4: Error Handling! 5

000000 000001 000011 000111 001111 011111 111111 d Distance between legal codewords Measured in terms of number of bit flips Efficient codes are of uniform Hamming Distance All codewords are equidistant from their neighbors CSE 123 Lecture 4: Error Handling! 6

Can detect up to 2d bit flips The next codeword is always 2d+1 bit flips away Any fewer is guaranteed to land in the middle Can correct up to d bit flips We just move to the closest codeword Unfortunately, no way to tell how many bit flips» E.g., 1, or (2d+1)-1? d d 000000 000001 000011 000111 001111 011111 111111 2d+1 CSE 123 Lecture 4: Error Handling! 7

We re going to send only codewords Non-codewords indicate errors to receiver But we want to send any set of strings Need to embed arbitrary input into sequence of codewords We ve seen this before: 4B/5B We want more general schemes CSE 123 Lecture 4: Error Handling! 8

001 011 00 01 000 010 101 111 10 11 100 110 Code with Hamming Distance 2 Can detect one bit flip (no correction capability) Add extra bit to ensure odd(even) number of ones Code is 66% efficient (need three bits to encode two) Note: Even parity is simply XOR CSE 123 Lecture 4: Error Handling! 9

001 011 000 010 0 1 101 111 100 110 Simply send each bit n (3 in this example) times Code with Hamming Distance 3 (d=1) Can detect 2 bit flips and correct 1 Straightforward duplication is extremely inefficient We can be much smarter about this CSE 123 Lecture 4: Error Handling! 10

Parity Bits Start with normal parity 0101001 1 n data bits, 1 one parity bit Data Parity Byte 001 1011110 0001110 000 1011111 0 1 1 1 0 111 0 Do the same across rows m data bytes, 1 parity byte Can detect up to 3 bit errors Even most 4-bit errors Can correct any 1 bit error Why? CSE 123 Lecture 4: Error Handling! 11

Header Payload EDC Want to add an error detection code per frame Frame is unit of transmission; all or nothing. Computed over the entire frame including header! Why? Receiver checks EDC to make sure frame is valid If frame fails check, throw it away We could use error-correcting codes But they are less efficient, and we expect errors to be rare CSE 123 Lecture 4: Error Handling! 12

Simply sum up all of the data in the frame Transmit that sum as the EDC Extremely lightweight Easy to compute fast in hardware Fragile: Hamming Distance of 2 Also easy to modify if frame is modified in flight Happens a lot to packets on the Internet IP packets include a 1 s compliment checksum CSE 123 Lecture 4: Error Handling! 13

1 s compliment of sum of words (not bytes) Final 1 s compliment means all-zero frame is not valid 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); CSE 123 Lecture 4: Error Handling! 14

+ Compute checksum in Modulo-2 Arithmetic Addition/subtraction is simply XOR operation Equivalent to vertical parity computation Need only a word-length shift register and XOR gate Assuming data arrives serially All registers are initially 0 CSE 123 Lecture 4: Error Handling! 15

0101001100101011000100011110 01010011 0010 Data 1011 0001 0001 10111110 Parity Byte 1110 CSE 123 Lecture 4: Error Handling! 16

0101001100101011000100011110 0 0 0 0 0 0 0 0 + 0101 Data Parity Byte CSE 123 Lecture 4: Error Handling! 17

0101001100101011000100011110 0 0 0 0 0 0 0 0 + 1010 Data 0 CSE 123 Lecture 4: Error Handling! 18

0101001100101011000100011110 0 0 0 0 0 0 0 1 + 0100 Data 01 CSE 123 Lecture 4: Error Handling! 19

0101001100101011000100011110 0 0 0 0 0 0 1 0 + 1001 Data 010 CSE 123 Lecture 4: Error Handling! 20

0101001100101011000100011110 0 0 0 0 0 1 0 1 + 0011 Data 0101 CSE 123 Lecture 4: Error Handling! 21

0101001100101011000100011110 0 1 0 1 0 0 1 1 + Data 01010011 CSE 123 Lecture 4: Error Handling! 22

0101001100101011000100011110 1 0 1 0 0 1 0 1 + 1010 Data Parity Byte 01010011 1 1 CSE 123 Lecture 4: Error Handling! 23

0101001100101011000100011110 0 1 0 0 1 0 1 0 + 0100 Data Parity Byte 01010011 11 10 CSE 123 Lecture 4: Error Handling! 24

0101001100101011000100011110 1 0 0 0 0 0 0 1 + 1011 Data Parity Byte 01010011 0010 10000001 CSE 123 Lecture 4: Error Handling! 25

0101001100101011000100011110 0 0 0 0 0 0 1 0 + 0111 01010011 Data 0010 1 Parity Byte 0 CSE 123 Lecture 4: Error Handling! 26

0101001100101011000100011110 1 1 1 1 0 1 1 0 + 01010011 0010 Data 1011 0001 0001 10111110 Parity Byte 1110 CSE 123 Lecture 4: Error Handling! 27

Checksums are easy to compute, but very fragile In particular, burst errors are frequently undetected We d rather have a scheme that smears parity Need to remain easy to implement in hardware So far just shift registers and an XOR gate We ll stick to Modulo-2 arithmetic Multiplication and division are XOR-based as well Let s do some examples CSE 123 Lecture 4: Error Handling! 28

Multiplication Division 110 110 101110 0000 0 00 101110 110 111 110 011 000 110 CSE 123 Lecture 4: Error Handling! 29

Idea is to divide the incoming data, D, rather than add The divisor is called the generator, g We can make a CRC resilient to k-bit burst errors Need a generator of k+1 bits Divide 2 k D by g to get remainder, r Remainder is called frame check sequence Send 2 k D+r Note 2 k D is just D shifted left k bits Remainder must be at most k bits Receiver checks that (2 k D+r)/g = 0 CSE 123 Lecture 4: Error Handling! 30

We re actually doing polynomial arithmetic Each bit is actually a coefficient of corresponding term in a k th - degree polynomial is (1 * X 3 ) + (1 * X 2 ) + (0 * X 1 ) + (1 * X 0 ) Why do we care? Can use the properties of finite fields to analyze effectiveness Says any generator with two terms catches single bit errors CSE 123 Lecture 4: Error Handling! 31

x 3 + x 2 + 1 = Generator x 7 + x 4 + x 3 + x = 1000 Message k + 1 bit check sequence g, equivalent to a degree-k polynomial Remainder D mod g 1000000 Message plus k zeros (*2 k ) 1001 1000 1011 1100 1000 101 Result: Transmit message followed by remainder: 1000101 CSE 123 Lecture 4: Error Handling! 32

1 1 0 1 + + Key observation is only subtract when MSB is one Recall that subtraction is XOR No explicit check for leading one by using as input to XOR Hardware cost very similar to checksum We re only interested in remainder at the end Only need k registers as remainder is only k bits CSE 123 Lecture 4: Error Handling! 33

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 g, equivalent to a degree-k polynomial Remainder D mod g 1000101 Received 1001 1000 1011 1100 0 message, no errors Result: CRC test is passed CSE 123 Lecture 4: Error Handling! 34

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 g, equivalent to a degree-k polynomial 1001001 Received message 1000 Two bit errors 1011 0101 Result: CRC test failed Remainder D mod g CSE 123 Lecture 4: Error Handling! 35

CRC-8 x 8 + x 2 + x 1 + 1 CRC-10 x 10 + x 9 + x 5 + x 4 + x 1 + 1 CRC-12 x 12 + x 11 + x 3 + x 2 + x 1 + 1 CRC-16 x 16 + x 15 + x 2 + 1 CRC-CCITT x 16 + x 12 + x 5 + 1 CRC-32 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 CSE 123 Lecture 4: Error Handling! 36

Add redundant bits to detect if frame has errors A few bits can detect errors Need more to correct errors Strength of code depends on Hamming Distance Number of bitflips between codewords Checksums and CRCs are typical methods Both cheap and easy to implement in hardware CRC much more robust against burst errors CSE 123 Lecture 4: Error Handling! 37

Read 2.5, 5.1 in P&D Homework 1 due at the beginning of class CSE 123 Lecture 4: Error Handling! 38