CSC 335 Data Communications and Networking Lecture 5: Error Detection, Error Correction, and Data Security Dr. Cheer-Sun Yang.

Slides:



Advertisements
Similar presentations
Introduction to Information Technologies
Advertisements

Reliability & Channel Coding
Chapter 6 Errors, Error Detection, and Error Control
Chapter 6 Errors, Error Detection, and Error Control.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
Fundamentals of Computer Networks ECE 478/578 Lecture #4: Error Detection and Correction Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
CSCI 4550/8556 Computer Networks Comer, Chapter 7: Packets, Frames, And Error Detection.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 12 Introduction to Computer Networks.
EE 122: Error detection and reliable transmission Ion Stoica September 16, 2002.
The OSI Reference Model
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
Chapter 6: Errors, Error Detection, and Error Control
1 Part II: Packet Transmission Packets on a Network Packets, Frames, LAN, WAN, Hardware Addresses, Bridges, Switches, Routing and Protocols Fall 2005 Qutaibah.
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Error Control.
Chapter 6 Errors, Error Detection, and Error Control
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
Chapter 10 Error Detection and Correction
Rutvi Shah1 ERROR CORRECTION & ERROR DETECTION Rutvi Shah2 Data can be corrupted during transmission. For reliable communication, errors must be detected.
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Error Detection and Correction : Data Link Layer.
Transmission Errors Error Detection and Correction
Data Link Layer - 1 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
British Computer Society
CIT 307 Online Data Communications Error Detection Module 11 Kevin Siminski, Instructor.
Data and Computer Communications
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.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
Cyclic Code. Linear Block Code Hamming Code is a Linear Block Code. Linear Block Code means that the codeword is generated by multiplying the message.
Data Link Layer: Error Detection and Correction
Data and Computer Communications by William Stallings Eighth Edition Digital Data Communications Techniques Digital Data Communications Techniques Click.
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.
Data Integrity © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
Data Communications & Computer Networks, Second Edition1 Chapter 6 Errors, Error Detection, and Error Control.
Chapter 7 - Packets, Frames and Error Detection 1. Concepts of Packets 2. Motivation for Packet Switching 3. Framing 4. Frame Formats 5. Transmission Errors.
Data Link and Flow Control Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific.
COMPUTER NETWORKS Ms. Mrinmoyee Mukherjee Assistant Professor St. Francis Institute of Technology, Mount Poinsur, S.V.P Road, Borivli (west), Mumbai
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.
CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
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.
Data Link Layer 1. 2 Single-bit error 3 Multiple-bit error 4.
Chapter Nine: Data Transmission. Introduction Binary data is transmitted by either by serial or parallel methods Data transmission over long distances.
CS4470 Computer Networking Protocols
Dr. Clincy Professor of CS
Introduction to Information Technologies
Data Link Layer.
Error Detection and Correction
CIS 321 Data Communications & Networking
Part III Datalink Layer 10.
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
EEC-484/584 Computer Networks
Introduction to Information Technologies
EEC-484/584 Computer Networks
COMPUTER NETWORKS CS610 Lecture-5 Hammad Khalid Khan.
Error Detection and Correction
Data Link Layer. Position of the data-link layer.
Presentation transcript:

CSC 335 Data Communications and Networking Lecture 5: Error Detection, Error Correction, and Data Security Dr. Cheer-Sun Yang

Motivation Error can occur during transmission. Signal can be distorted and cause sampling errors. Sender sends a 1101, receiver can receive How can a receiver be aware of that an error has occurred? Can the position of a single bit error be identified? The techniques are called error detection and single bit error correction.

Transmission Errors External electromagnetic signals - noise Transmission errors - attenuation Lost data – timing But, before we talk about errors, we have to understand how messages are actually organized and sent.

Protocol Data Unit Messages are transmitted in a unit called protocol data unit (PDU). The data unit at data link layer is called a frame which is a block of data bits enclosing in a beginning and ending character. The beginning character is called the start of header (SOH) and the ending character is called the end of transmission (EOT) in our textbook.

Data Frame In fact, the header contains a FLAG, the address, and some control information. There are also several kinds of frames: information, supervisory, and others. Each information frame is also identified by a sequence number.

Data Frame Advantages: If error occurs at the sender side, the receiver will never receive the ending character. When the sender sends the header again, the receiver can synchronize easily. Disadvantages: overhead what if the data portion includes a character identical to either the header or the ending character?

Bit Stuffing and Byte Stuffing Ideally, the frame header or the ending character won’t occur in the data block. But, it could happen. Bit-oriented protocol uses bit stuffing to solve the problem.

Bit Stuffing Header = In any data character, if there are 6 continuous 1 bits, the transmitter inserts an extra 1 bit after the fifth 1 bit; the receiver will reverse the procedure.

Byte Stuffing If any data block contains a SOH, EOT, or ESC (escape), the transmitter also does the following: –SOH in data becomes ESC + X. –EOT in data becomes ESC + Y. –ESC in data becomes ESC + Z.

Error Detection The ability to detect when a transmission error has occurred is called error detection. Additional bits should be added by the transmitter for detecting errors at the receiving side. Parity Bit –Value of parity bit is such that character has even (even parity) or odd (odd parity) number of ones –Disadvantage: Even number of bit errors goes undetected

Parity Checking Analysis Single bit error can be detected by a single parity bit. For example, the original data bits include , the parity (even) bit is then 0. The data bits and the parity bit will be sent together as a unit to the receiver. If there is an error at the second bit, the receiver receives The total number of 1’s is not an even number. The receiver can claim that the message is incorrect.

Parity Checking (cont’d) Single bit error can be detected by a single parity bit. However, if two bits are transmitted incorrectly, the parity checking may not detect them. For example, data=1101, parity bit = 1; If incorrect data= 1011, parity bit = 1; the receiver cannot tell that this message is incorrect.

Any Problem? Parity checking will detect any single-bit error. Is there any glitch? Yes. What?

Single-Bit Error Suppose an error occurred because of a brief power surge or static electricity whose duration is a hundredth of a second. If the data rate is 64 Kbps, approximately 640 bits will be affected. When many bits are damaged, we call this a burst error. Single-bit parity checking is very likely to fail!!

Single-Bit Error (cont’d) In general, if an odd number of bits change, parity checking will detect the error. If an even number of bits change, parity checking will not detect the error. The error detection rate is 50% which is not acceptable for a communications network. Does this mean that parity checking is useless? – Well, No! It is the basis of more complex techniques. It is also useful when single-bit error could happen.

Double-Bit Error Detection How about using two parity bits – one checks for the bits in odd positions and another checks for bits in even positions? It is better but still not good enough – Why? A:_____________________________. (Exercise)

Burst Error Detection Perhaps we should take a look at how data bits are actually transmitted. A block of data bits are transmitted in a unit called frame. We will talk about the concept of data frame more in next lecture. Let’s assume that a frame looks like this for now.

Data Frame with Parity Bits

Rather than sending all bits from one frame together, we send them separately. Transmitting just one bit of information is not very efficient, however. If there are more frames to be sent together, we can send one bit from each frame together with the parity bit of the new data frames. Fig 4.3 illustrates this principle.

Instead of sending 10 5-bit frames with a parity bit, we send each column (6 10-bit frames). Now, suppose a burst error occurs and interferes with one transmission. At most, one bit from each original data frame is actually changed, and the parity check will detect them. How successful is this approach?

The only way a burst error affecting two columns can go undetected is when either two bits or no bits are actually changed in each (old) frame. What is the probability that this error can occur and will not be detected? Suppose column i and j were affected. Suppose that the bits from column i are affected randomly. Now consider any bit from column j, it is either correct or it is incorrect. Therefore there is a ½ chance that an error occurs to two bits in the same row.

If there are n bits in a column, there is a probability of (1/2) n that either two or no bits are changed in each row and the error goes undetected. If n=20, the probability that the error will not be detected = 1/

Cyclic Redundancy Check A major disadvantage of previous method is the cost of assembling and reassembling of the frames. Also, the error can only be detected after all frames are received. Then resending all frames is very costly. Is there a way to send a frame and determine immediately whether there was an error? Yes. CRC is more efficient although more difficult to understand.

Bit String Representation The bit string is interpreted as

CRC Method We assume all computations are done using modulo 2. 1.Given a bit string, append several 0s to the end of it (we will specify how many and why later) and call it B. Let B(x) be the polynomial corresponding to B. 2.Divide B(x) by some agreed-on polynomial G(x) (generator polynomial) and determine the remainder R(x).

CRC Method (cont’d) 3.Define T(x) = B(x) – R(x). Later we will show that T(x)/G(x) generates a 0 remainder and that the subtraction can be done by replacing the previously appended 0 bits with the bit string corresponding to R(x). 4.Transmit T, the bit string corresponding to T(x). 5.Let T’ represent the bit stream that receiver receives and T’(x) the associated polynomial. The receiver divides T’(x) by G(x). If there is a 0 remainder the receiver concludes T=T’ and no error occurred. Otherwise, the receiver concludes an error occurred.

Modulo 2 Addition = = = = 0 (with no carry) “Modulo 2” means “to take the remainder after dividing by 2.” 2 mod 2 = 0

Modulo 2 Subtraction 0 – 0 = 0 0 – 1 = 1 (with no carry) (why?) 1 – 0 = 1 1 – 1 = 0

Exclusive OR and Modulo 2 Addition and Subtraction

How CRC works? Suppose that we need to send the bit string , and the generator polynomial is G(x) = x 4 +x Step 1: Append 0’s to the end of the string. The number of 0’s is the same as the degree of the the generator polynomial. Thus the string is (B=)

How CRC works? (cont’d) Step 2: Divide B(x) by G(x). Find the corresponding bit representation of the remainder polynomial R(x). In our case Step 3: Find T(x) = B(x) – R(x). (Remember using modulo 2 subtraction). Transmit the string T = B – 1010 = R = T (FACT)

How CRC works? (cont’d) Step 4: At the receiving side, receiver divides the string (received) by G(x). If the remainder is not 0, the string is incorrect.

Summary of Cyclic Redundancy Check For a block of k bits transmitter generates n bit sequence Transmit k+n bits which is exactly divisible by some number Receive divides frame by that number –If no remainder, assume no error –For math, see Section 4.3

Hamming Code Retransmission takes time and is costly if retransmission also fails. Due to R. W. Hamming Single-bit error correction : identifies the position of the error bit Multiple-bit error detection : only detects that multiple-bit error has occurred

General Concept Insert some parity checking bit at in the bit string instead of at the end. The parity bits check the parity in some specific location If there is a single-bit error, the location can be identified by the combination of these parity bits.

A Guessing Game You can think of one number from 1 to 15 (Don’t tell me what it is.) Is the number in one of the following? 1, 3, 5, 7, 9, 11, 13, 15 Is the number in one of the following? 2, 3, 6, 7, 10, 11, 14, 15 Is the number in one of the following? 4, 5, 6, 7, 12, 13, 14, 15 Is the number in one of the following? 8, 9, 10, 11, 12, 13, 14,15

An Example Data to send : m 1 m 2 m 3 m 4 m 5 m 6 m 7 m 8 Hamming Code p 1 p 2 m 1 p 3 m 2 m 3 m 4 p 4 m 5 m 6 m 7 m 8 P 1 : even parity for positions 1,3,5,7,9,11 P 2 : even parity for positions 2,3,6,7,10,11 P 3 : even parity for positions 4,5,6,7,12 P 4 : even parity for positions 8,9,10,11,12

Position of Extra Bits 2 0 = 1 the 1 st position 2 1 = 2 the 2 nd position 2 2 = 4 the 4 th position 2 3 = 8 the 8 th position 2 4 =16 the 16 th position

Error Detection vs. Error Correction Which one is better? A: Neither. Error correction requires more overhead – time and extra bits Error detection requires retransmission.

Error Control (next lecture) Detection and correction of errors Lost frames Damaged frames Automatic repeat request –Error detection –Positive acknowledgment –Retransmission after timeout –Negative acknowledgement and retransmission

Data Security Encryption and Decryption Key Distribution and Protection Public Key Encryption Viruses, Worms, and Hackers

Encryption and Decryption The idea is to disguise information so that even if it does fall into the wrong hands, it cannot be understood. Caesar Cipher Poly-alphabetic Cipher Transposition Cipher Bit-Level Ciphering Data Encryption Standard Clipper Chip

Key Distribution and Protection Merkler’s Puzzles Shamir’s Method

Public Key Encryption RSA Algorithm Digital Signatures Authentication Using Hash-Bashed Schemes

Viruses, Worms, and Hackers Infecting Files Memory-Resident Viruses Virus Evolution Virus Sources The Internet Worm Computer Hackers

Assignments Read Section Section 4.4. Homework: