COM342 Networks and Data Communications

Slides:



Advertisements
Similar presentations
Cyclic Code.
Advertisements

10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Lecture 12 Layer 2 – Data Link Layer Protocols
Introduction to Information Technologies
Reliability & Channel Coding
Error Detection and Correction
Transmission Errors Error Detection and Correction
Traceroute Assignment. Base64 Encoding The SMTP protocol only allows 7 bit ASCII data, so how can you send me a picture of Avril Lavigne, which is an.
Fundamentals of Computer Networks ECE 478/578 Lecture #4: Error Detection and Correction Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
1 ITC242 – Introduction to Data Communications Week 10 Topic 16 Data link control.
Chapter 5 Link Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 20.
Data Communications Chapter 7 Error Detection. Despite the best prevention techniques, errors may still happen. To detect an error, something extra has.
Chapter 2 : Direct Link Networks (Continued). So far... Modulation and Encoding Link layer protocols Error Detection -- Parity Check.
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Error Detection and Correction
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Error Detection and Correction : Data Link Layer.
Transmission Errors Error Detection and Correction
CSE331: Introduction to Networks and Security Lecture 3 Fall 2002.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Error Coding Transmission process may introduce errors into a message.  Single bit errors versus burst errors Detection:  Requires a convention that.
Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Lecture 6: Framing and Error Detection-Data Link Layer Functions
4: DataLink Layer1 Chapter 4: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
Data and Computer Communications by William Stallings Eighth Edition Digital Data Communications Techniques Digital Data Communications Techniques Click.
Cyclic Redundancy Check CRC Chapter CYCLIC CODES Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a codeword.
Layer Two Data Link Layer Collects bits from layer 1 and organizes into frames Passes bits that make up frames to layer 1 for transmission Concerned with.
5: DataLink Layer5-1 Error Detection EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields.
Computer Science Division
Computer Networks Lecture 2: Data Link Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn 2015 by S.
Lecture 5 Checksum. 10.2CHECKSUM Checksum is an error-detecting technique that can be applied to a message of any length. In the Internet, the checksum.
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
CSCI 465 D ata Communications and Networks Lecture 9 Martin van Bommel CSCI 465 Data Communications & Networks 1.
Lecture Focus: Data Communications and Networking  Data Link Layer  Error Control Lecture 19 CSCS 311.
1 © Unitec New Zealand CRC calculation and Hammings code.
Error Detection.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Kyung Hee University Position of the data-link layer.
Error Detection and Correction
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
David Wetherall Professor of Computer Science & Engineering Introduction to Computer Networks Error Coding Overview (§3.2)
Transmission Errors Error Detection and Correction.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Network Layer4-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
Part III: Data Link Layer Error Detection and Correction
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Error Correction/Detection.
CS 457 – Lecture 3 Link Layer Protocols Fall 2011.
CS4470 Computer Networking Protocols
Dr. Clincy Professor of CS
Simple Parity Check The simplest form of error detection is the parity check used with ASCII codes, originally on asynchronous modem links Each 7 bit ASCII.
Introduction to Information Technologies
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Subject Name: COMPUTER NETWORKS-1
Cyclic Redundancy Check (CRC)
Advanced Computer Networks
CIS 321 Data Communications & Networking
Part III Datalink Layer 10.
Error Detection Bit Error Rate(BER): It is the ratio of number Ne of errors appearing over a certain time interval t to the number Nt of 1 and 0 pulses.
Introduction to Information Technologies
Transmission Errors Error Detection and Correction
Error Detection Neil Tang 9/26/2008
COMPUTER NETWORKS CS610 Lecture-5 Hammad Khalid Khan.
Error Detection and Correction
Transmission Errors Error Detection and Correction
Presentation transcript:

COM342 Networks and Data Communications Lecture 4D: Further examples of Data encoding for error detection : CRC and Checksums Ian McCrum Room 5B18 Web site: http://www.eej.ulst.ac.uk Tel: 90 366364 voice mail on 6th ring Email: IJ.McCrum@Ulster.ac.uk http://www.eej.ulst.ac.uk/~ian/modules/COM342

Cyclic Redundancy Codes (CRC) The CRC technique is used to protect blocks of data called Frames. Using this technique, the transmitter appends an extra n- bit sequence to every frame called Frame Check Sequence (FCS). The FCS holds redundant information about the frame that helps the transmitter detect errors in the frame. The CRC is one of the most used techniques for error detection in data communications. The technique gained its popularity because it combines three advantages: Extreme error detection capabilities. Little overhead. Ease of implementation. http://www.eej.ulst.ac.uk/~ian/modules/COM342

Basics The basic idea of CRC algorithms is simply to treat the message as an enormous binary number, to divide it by another fixed binary number, and to make the remainder from this division the checksum. Upon receipt of the message, the receiver can perform the same division and compare the remainder with the "checksum" (transmitted remainder). There are a few additional points to bear in mind. The fixed binary number is defined in advance, although several versions exist. The “division” is done in a simplified way, no carries are generated during the subtraction. widely used in practice (ATM, HDLC) ATM 5-byte header uses 8-bit CRC IEEE GCRC-32 , 32-bit CRC for Ethernet, etc. Although simple checksums are also used ,they are less efficient at detecting errors http://www.eej.ulst.ac.uk/~ian/modules/COM342

CRC in Practice International standards (CCITT) are defined for CRC-8, CRC-12, CRC-16, and CRC-32 CRC-8: ATM header error control CRC-10: ATM AAL error detection (recommended) CRC-12: IBM Bisync error control CCITT-16: HDLC, XMODEM, V.41 CCITT-32: IEEE 802, V.42, ATM AAL5 Each standard CRC can detect: ALL burst errors of < r+1 bits, and ALL odd number of bit errors Bursts of > r+1 bits detected with P = 1 – 0.5r http://www.eej.ulst.ac.uk/~ian/modules/COM342

Internet checksum (RFC1071) Goal: detect “errors” (e.g., flipped bits) in transmitted segment (note: in actual practice, used at transport layer only) Receiver: compute checksum of received segment check if computed checksum added to checksum field value gives zero NO - error detected YES - no error detected. But maybe errors nonetheless? Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents sender puts checksum value into UDP checksum field http://www.eej.ulst.ac.uk/~ian/modules/COM342

Cyclic Redundancy Code (CRC) CRCs treat a bit string as a polynomial code with coefficients of 0 and 1. A k-bit frame is regarded as the coefficient list for a polynomial of order k, ranging from xk-1 to x0, said to be of degree k-1. The leftmost bit is xk-1 the next is xk-2 I.e 110001 has 6 bits and is said to be x5+x4+x0 or x5+x4+1 This is only important because the divisor is specified in this way, in practice you convert it to a binary number and do calculation using binary… Binary arithmetic is needed but the division process is simplified. Subtraction is done without carries or borrows and so is actually an XOR operation or just a matter of letting a bit through or inverting it…and when you do the subtraction itself is slightly different http://www.eej.ulst.ac.uk/~ian/modules/COM342

The polynomial code (optional) The transmitter and receiver must agree the polynomial code of the generator, normally called G(x). It will be a binary number that must begin and end with a ‘1’. It will have less bits than the data being protected Basic idea is to add extra bits after the data so that the complete new frame is divisible exactly by G(x). The receiver does the division and if the remainder is zero then all is ok We begin with data of m bits represented by M(x). Add r bits to this, initially zero in value, r is the degree of G(x) Since the early bits are zero we have changed M(x) to xr M(x) We divide xr M(x) by G(x) using module-2 division and http://www.eej.ulst.ac.uk/~ian/modules/COM342

This example from http://www.relisoft.com/Science/CrcNaive.html The CRC algorithm requires the division of the message polynomial by the key polynomial. The straightforward implementation follows the idea of long division, except that it's much simpler. The coefficients of our polynomials are ones and zeros. We start with the leftmost coefficient (leftmost bit of the message). If it's zero, we move to the next coefficient. If it's one, we subtract the divisor. Except that subtraction modulo 2 is equivalent to exclusive or, so it's very simple. Let's do a simple example, dividing a message 100110 by the key 101 also expressed as x2 + 1. Since the degree of the key is 2, we start by appending two zeros to our message. 1 0 1 ) 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 0 0 Remainder is 0 1 so transmit 1 0 0 1 1 0 0 1 http://www.eej.ulst.ac.uk/~ian/modules/COM342 This example from http://www.relisoft.com/Science/CrcNaive.html

Book Example fig 3-7/p189 Replace these 4 zeros with the remainder 1 1 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 1 0 1 1 0 1 1 0 0 0 0 Replace these 4 zeros with the remainder 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 G(x)=x4+x+1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 0 Remainder is 1 1 1 0 1 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 0 0 0 0 Transmit 11010110111110 1 1 1 0 http://www.eej.ulst.ac.uk/~ian/modules/COM342

Cyclic Redundancy Code - Example 1 G 1 PDU r 0's Q \ / 1 1 1 1  1  1  1 R =  T = 110110 http://www.eej.ulst.ac.uk/~ian/modules/COM342

Cyclic Redundancy Code - Generators CRC Generators are subject of design and standardization. The goal here is to let them have strong properties like: Detect all single and double errors Detect all burst of 16 bits and less Example generators are: CRC-8: 100000111 CRC-10: 11000110011 CRC-12: 1100000000101 CRC-16: 11000000000000101 CRC-CCITT (ITU-T): 10001000000100001 CRC-32: 100000100110000010001110110110111 We see why writing e.g CRC-CCITT as x16+x15+x2+1 is less error prone! http://www.eej.ulst.ac.uk/~ian/modules/COM342

Cyclic Redundancy Code - Advantages The capabilities of e.g. CRC-16: All single errors are detected All double errors are detected All burst errors of 16 errors in a row are detected All errors with an odd number of bits There are more… Highly Efficient Codes overhead of e.g. CRC-16 Code for a PDU of size 12000 (1500 bytes) as in Ethernet: 0.14 % http://www.eej.ulst.ac.uk/~ian/modules/COM342

Tutorials for Lecture 4D (CRC) [1] Write the bit pattern 10100001 and 1001 as polynomials [2] What is the result of dividing (modulo-2) the polynomial x7+x5+1 by the generator polynomial x3+1? [3] Using the CRC generator 1001 generate the data to be transmitted if a data block is 1111000. ( answer 1111000110) [4] What data is sent if a CRC of x4+x1+1 is used to protect a data block of 110101101? Answer (1101011011111) http://www.eej.ulst.ac.uk/~ian/modules/COM342