0% found this document useful (0 votes)
15 views27 pages

Error Detection

The document discusses error detection and correction in data communication, focusing on the types of errors, redundancy, and coding techniques. It explains various error detection methods, including simple and two-dimensional parity checks, and introduces concepts like Hamming distance. The importance of reliable data transmission and the challenges posed by bit-level and packet-level errors are emphasized.

Uploaded by

AWAIS SARWAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views27 pages

Error Detection

The document discusses error detection and correction in data communication, focusing on the types of errors, redundancy, and coding techniques. It explains various error detection methods, including simple and two-dimensional parity checks, and introduces concepts like Hamming distance. The importance of reliable data transmission and the challenges posed by bit-level and packet-level errors are emphasized.

Uploaded by

AWAIS SARWAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Data Communication and

Computer Networks
Data Link Layer, Error Detection

Munir ahmad

The slides are adapted from the publisher’s material


Data Communications and Networking by Behrouz A. Forouzan, 5 th edition
Data and Computer Communications by William Stallings, 8th Edition
Computer Networking: A Top-Down Approach by J F Kurose, K W Ross, 6th Edition
Computer Networks, by L. Peterson, and B. Davie, 5th edition
Outline
■ Why error detection and correction
■ Types of errors (Single or Burst)
■ Detection Vs Correction
■ What do we mean by redundancy and Coding
■ Hamming Distance
■ Error detection techniques
■ Simple Parity check
■ Two-dimensional Parity check

2
What Goes Wrong in the Network?
Reliability
■ Most important function that network
provide
■ How networks can fail?
■ Bit-level Vs Burst errors (electrical
interference)
■ Packet-level errors (congestion)
■ distinction between lost and late packet
■ Link and node failures
■ distinction between broken and flaky link
3
Why error detection and
correction
■ During data transmission bits are subject to
unpredictable changes because of interference
■ Attenuation, distortion and noise are the main
cause of random bit errors because it can
change the shape of a signal
■ This clearly emphasizes the need for error
detection and correction, and is one of the
service provided by data link layer

4
Single Bit Error

In a single-bit error, only 1 bit in the data


unit has changed.

5
Burst Error of Length 8

A burst error mean that 2 or more bits in


the data unit have changed.

If the bandwidth of a channel is 1Gbps then for how much duration the error should last?

6
■ Redundancy
■ To detect or correct errors, we need to send extra
(redundant) bits with data.
■ Detection versus Correction
■ In error detection, looking only to see if any error has
occurred. Simple yes or no answer.
■ In error correction, need to know the exact number of
bits that are corrupted and more importantly their
location in the message
■ Coding (block/convolution)
■ Redundancy is achieved through various coding
schemes. The sender adds redundant bits through a
process that receiver checks the relationships between
the two sets of bits to detect errors.
7
BLOCK CODING

In block coding, we divide our message into blocks,


each of k bits, called datawords. We add r redundant
bits to each block to make the length n = k + r. The
resulting n-bit blocks are called codewords.

8
Process of error detection in block coding

9
A code for error detection
Assume k=2, n=3

Assume the sender encodes


the dataword 01 as 011 and
sends it to the receiver.
Consider the following
cases:

1. The receiver receives 011. It is a valid codeword. The receiver


extracts the dataword 01 from it.
2. The codeword is corrupted during transmission, and 111 is
received. This is not a valid codeword and is discarded.
3. The codeword is corrupted during transmission, and 000 is
received. This is a valid codeword. The receiver incorrectly
extracts the dataword 00.
4. Two corrupted bits have made the error undetectable.
10
An error-detecting code can detect
only the types of errors for which it is
designed; other types of errors may
remain undetected.

11
A code for error correction
Assume k=2, n=5

The sender creates the


codeword 01011. The
codeword is corrupted
during transmission, and
01001 is received.

1. Comparing the received codeword with the first codeword in the table (01001
versus 00000), the receiver decides that the first codeword is not the one that
was sent because there are two different bits.
2. By the same reasoning, the original codeword cannot be the third or fourth
one in the table.
3. The original codeword must be the second one in the table because this is the
only one that differs from the received codeword by 1 bit. The receiver
replaces 01001 with 01011 and consults the table to find the dataword 01.

12
Figure XORing of two single bits or two words

13
Hamming Distance
■ The Hamming distance between two words
(of the same size) is the number of
differences between the corresponding bits.
■ Represented as d (x, y) for two words x and y
■ Found by applying XOR operation on the two
words and counting number of 1s in the
result

14
Example

Let us find the Hamming distance between two pairs of


words.

1. The Hamming distance d(000, 011) is 2 because

2. The Hamming distance d(10101, 11110) is 3 because

15
The minimum Hamming distance is the
smallest Hamming distance between
all possible pairs in a set of words.

16
Example

Find the minimum Hamming distance of the coding


scheme for error detection.
Solution
We first find all Hamming distances.

The dmin in this case is 2.

17
Example

Find the minimum Hamming distance of the coding


scheme for error correction.

Solution
We first find all the Hamming distances.

The dmin in this case is 3.

18
Error detection techniques
■ Popular techniques
■ Simple Parity check
■ Two-dimensional Parity check
■ Checksum
■ Cyclic redundancy check

19
Simple Parity-Checking
■ Simple Parity Checking or One-dimension
Parity Check
■ The common, simple and least expensive
mechanism
■ In this technique, a redundant bit called
parity bit, is appended to every data unit so
that the number of 1s in the unit (including
the parity becomes even)

20
Even parity checking scheme

21
Possible 4-bit data words and corresponding code words
Decimal Value Data Block Parity bit Code word
0 0000 0 00000
1 0001 1 00011
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111 22
performance
■ Can detect all single bit errors
■ Can detect burst errors if the number of bits
in error is odd
■ Cannot detect if even number of bits are
corrupted

23
Two-dimensional Parity check
■ Performance can be improved by using
two-dimensional parity check, which
organizes the block of bits in the form of a
table
■ Parity check bits are calculated for each row,
which is equivalent to a simple parity check
bit
■ Parity check bits are also calculated for all
columns then both are sent along with the
data
■ At the receiving end these are compared
with the parity bits calculated on the received 24
Figure Two-dimensional parity-check code

25
Figure Two-dimensional parity-check code

26
performance
■ Extra overhead is traded for better error
detection capability
■ It can detect many burst errors but not all

27

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy