Part III. Data Link Layer

Slides:



Advertisements
Similar presentations
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Advertisements

10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction to Information Technologies
Chapter 10 Error Detection and Correction
PART III DATA LINK LAYER. Position of the Data-Link Layer.
The Data Link Layer Chapter 3. Position of the data-link layer.
1 ITC242 – Introduction to Data Communications Week 10 Topic 16 Data link control.
Error Detection and Correction
Chapter 10 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.
1 Kyung Hee University Data Link Layer PART III. 2 Kyung Hee University Position of the data-link layer.
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.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
British Computer Society
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 1 Communication Reliability Asst. Prof. Chaiporn Jaikaeo, Ph.D.
CIT 307 Online Data Communications Error Detection Module 11 Kevin Siminski, Instructor.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 10. Error Detection and Correction
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Error Detection and Correction
COMPUTER NETWORKS Ms. Mrinmoyee Mukherjee Assistant Professor St. Francis Institute of Technology, Mount Poinsur, S.V.P Road, Borivli (west), Mumbai
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.
Error Detection and Correction
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
Lecture Focus: Data Communications and Networking  Data Link Layer  Error Control Lecture 19 CSCS 311.
CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.
Error Detection.
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.
1 Kyung Hee University Position of the data-link layer.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
1 Kyung Hee University Error Detection and Correction.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
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.
Part III: Data Link Layer Error Detection and Correction
Data Link Layer 1. 2 Single-bit error 3 Multiple-bit error 4.
ERROR DETECTION AND CORRECTION Chapter 8 Data Communications & Networking ERROR DETECTION AND CORRECTION Chapter 8 First Semester 2007/2008.
10.1 Types of Errors 10.2 Detection 10.3 Error Correction.
Error Detection and Correction
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
ERROR DETECTION AND CORRECTION
Data Link Layer.
Error Detection and Correction
Subject Name: COMPUTER NETWORKS-1
DATA COMMUNICATION AND NETWORKINGS
CIS 321 Data Communications & Networking
Part III Datalink Layer 10.
Data Link Layer.
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.
Chapter 10 Error Detection And Correction
Packetizing Error Detection
Net 221D : Computer Networks Fundamentals
Packetizing Error Detection
PART III Data Link Layer.
Basic concepts Networks must be able to transfer data from one device to another with complete accuracy. Data can be corrupted during transmission. For.
Chapter 7 Error Detection and Correction
Introduction to Information Technologies
Packetizing Error Detection
DATA COMMUNICATION Lecture-33.
Error Detection and Correction
Error Detection and Correction
Error Detection and Correction
Error Detection and Correction
Types of Errors Data transmission suffers unpredictable changes because of interference The interference can change the shape of the signal Single-bit.
Data Link Layer. Position of the data-link layer.
Presentation transcript:

Part III. Data Link Layer Chapter 10. Error Detection COMP 3270 Computer Networks Computing Science Thompson Rivers University

Learning Objectives Describe the general idea of error detection, using redundancy Determine parity bit with a given data word. Determine CRC redundancy with a given data word and divisor. Determine checksum with a given data word.

Position of the data-link layer ☺ Main responsibility/role: ? [Reliable] node-to-node delivery of packets called frames

Data link layer duties Framing Physical address or MAC address Slow receiver Shared medium Error detection and retransmission Error control is used in the network layer and the transport layer as well. Flow control is used in the transport layer as well.

LLC and MAC sublayers Hardware independent Not standardized in the Internet society Then where? Hardware dependent

IEEE standards for LANs Connectionless service: - No flow and error control, or - Just acknowledgement Connection-oriented service: - ARQ for flow and error controls Ethernet 802.11: 2.4GHz; 2Mbps 802.11a: 5GHz; 54 Mbps 802.11b: 2.4GHz; 11Mbps; Wi-Fi 802.11g: 2.4GHz; 54Mbps

Some applications require that errors be detected and retransmitted. Data can be corrupted during transmission due to attenuation, distortion and noise. Some applications require that errors be detected and retransmitted.

Chapter Outline Introduction Parity check Cyclic codes Checksum

1. INTRODUCTION Topics discussed in this section: Let us first discuss some issues related, directly or indirectly, to error detection. Topics discussed in this section: Redundancy Detection

☺ What is the basic idea to detect errors? Redundancy To detect or correct errors, we need to send extra (redundant) bits with data. ☺ What does this mean? ☺ What is the basic idea to detect errors?

Basic Idea of Error Detection Algorithm Same algorithm

Codeword is defined as dataword + redundancy

Error Detection Methods Serial line Ethernet, hardware Internet protocols software

3. PARITY CHECK

Parity Check To make the number of bit 1s even

In parity check, a parity bit is added to every data unit so that the total number of 1s is even (or odd for odd-parity).

Example: Suppose the sender wants to send the word world. In ASCII the five characters are coded as 1110111 1101111 1110010 1101100 1100100 When even parity check is used, the actual bits sent: 1110111? 1101111? 11100100 1101100? 1100100? When odd parity check is used, the actual bits sent: 1110111? 1101111? 11100101 1101100? 1100100?

Example: Assuming even parity check, now suppose the word world in the previous Example is received by the receiver without being corrupted in transmission. 11101110 11011110 11100100 11011000 11001001 The receiver counts the 1s in each character and comes up with even numbers (6, 6, 4, 4, 4). The data are accepted.

Example: Assuming even parity check, now suppose the word world in the previous Example is corrupted during transmission. 11111110 11011110 11101100 11011000 11001001 The receiver counts the 1s in each character and comes up with even and odd numbers (7, 6, 5, 4, 4). The receiver knows that the data are corrupted. How to correct? Then, the receiver discards them, and asks for retransmission somehow.

Simple parity check can detect all single-bit errors. It can detect burst errors only if the total number of errors in each data unit is odd. Simple, but not powerful algorithm

4. CYCLIC CODES

Cyclic Redundancy Check CRC encoder and decoder With a leading bit 1

Division in CRC encoder XOR X xor 1...1 ??? X xor 0...0 ??? X or 1...1 ??? X or 0...0 ??? X and 1...1 ??? X and 0...0 ???

Division in the CRC decoder for two cases

Example: Suppose the following dataword is sent: 1 0 1 0 1 0 0 1 0 0 1 1 1 0 0 1 Find the CRC redundancy when the divisor 1 0 1 1 is used. 1011 | 1010100100111001000 1011 1100

Standard polynomials Divisors 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1

5. CHECKSUM Topics discussed in this section: The last error detection method we discuss here is called the checksum. The checksum is used in the Internet by several protocols (IP, UDP, TCP) although not at the data link layer. However, we briefly discuss it here to complete our discussion on error checking. Topics discussed in this section: Idea One’s Complement Internet Checksum

Idea Suppose our data is a list of five 4-bit numbers that we want to send to a destination. In addition to sending these numbers, we send the sum of the numbers. For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12, 0, 6, 36), where 36 is the sum of the original numbers. The receiver adds the five numbers and compares the result with the sum. If the two are the same, the receiver assumes no error, accepts the five numbers, and discards the sum. Otherwise, there is an error somewhere and the data are not accepted.

We can make the job of the receiver a bit easier if we send the negative (complement) of the sum, called the checksum. In this case, we send (7, 11, 12, 0, 6, −36). The receiver can add all the numbers received (including the checksum). If the result is 0, it assumes no error; otherwise, there is an error.

One’s Complement 1 1 1

Internet Checksum Sender site: The message is divided into 16-bit words. The value of the checksum word is set to 0. All words including the checksum are added using one’s complement addition. The sum becomes the checksum. The checksum is sent with the data.

Receiver site: The message (including checksum) is divided into 16-bit words. All words are added using one’s complement addition. The sum is complemented and becomes the new checksum. If the value of checksum is 0, the message is accepted; otherwise, it is rejected.

Example: Suppose the following block of 16 bits is to be sent using a checksum of 8 bits. 10101001 10111001 The codeword is:

Example: Now suppose the receiver receives the pattern sent in the previous example and there is no error. 10101001 10111001 10011100 When the receiver adds the three sections, it will get all 1s, which, after complementing, is all 0s and shows that there is no error. 10101001 10111001 10011100 Sum 11111111 Complement 00000000 means that the pattern is OK.

Example: Now suppose there is a burst error of length 5 that affects 3 bits. 10101001 10111001 10011100 10101111 11111001 10011100 When the receiver adds the three sections, it gets 10101111 11111001 10011100 Sum 01000100 Complement 10111011 the pattern is corrupted.

Example: some very useful bit operations How to check if the 18th bit from the right is 1 or 0? How to make a 16 bit integer from two bytes? How to store a 16 bit integer into two bytes? How to reset the right 14 bits from a 32 bit integer? How to obtain the 24th, 23rd, 22nd, and 21st bits?

C code – 16 bit checksum: Can you complete it? (Play the slide to see the code!) int checksum = 0; unsigned char data[MAX]; // even number of bytes unsigned short delta; // 16 bits int i; ... // checksum  for (i = 0; i < MAX/2; i++) { delta = (data[2*i] << 8) + data[2*i + 1]; checksum += delta; if (checksum & 0x10000) { // if there is a carry       checksum &= 0xffff; // reset the carry       checksum++; // add 1 } } checksum = ~checksum; // 1’s complement // store the checksum into a packet packet[i] = (unsigned char)((checksum >> 8) & 0xff); packet[i+1] = (unsigned char)(checksum & 0xff);

Can you write C code of 8 bit checksum?