0% found this document useful (0 votes)
66 views

Data Com

The document discusses error detection and correction techniques including parity checks, cyclic redundancy checks, checksums, and Hamming codes. It explains how these techniques work and their capabilities for detecting and correcting different types of errors like single bit errors and burst errors. Specific topics covered include single and burst errors, parity checks, cyclic redundancy checks, checksums, Hamming distance, and the error detection and correction capabilities of Hamming codes.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Data Com

The document discusses error detection and correction techniques including parity checks, cyclic redundancy checks, checksums, and Hamming codes. It explains how these techniques work and their capabilities for detecting and correcting different types of errors like single bit errors and burst errors. Specific topics covered include single and burst errors, parity checks, cyclic redundancy checks, checksums, Hamming distance, and the error detection and correction capabilities of Hamming codes.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 56

Lecture # 12 & 13 Course Instructor: Engr.

Sana Ziafat

Error Detection and Correction Data Link Control and Protocols Multiple Access Local Area Networks Wireless LANs

OSI vs Internet Model

Error detection and control

Error detection and control

Responsible for taking the data and transforming it into a frame with header, control and address information. Physical path communication Error detection Error correction

Transmission Error

Note

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

Errors occur due to

Noise or interference in the communication channel

Congestion in the network where packets musts be dropped


Attenuation Distortion

To prevent errors from happening, several techniques may be applied:


- Proper shielding of cables to reduce interference - Telephone line conditioning or equalization - Replacing older media and equipment with new, possibly digital components - Proper use of digital repeaters and analog amplifiers - Observe the stated capacities of the media

Why we need it ?
To avoid retransmission of whole packet or message

What to do if error detected ?


Discard, and request a new copy of the frame:
explicitly or implicitly

Try to correct error, if possible

Single Bit Error

Burst Error

In a single-bit error, only 1 bit in the data unit has changed.

A burst error means that 2 or more bits in the data unit have changed.

Number of bits affected depends on data rate and duration of noise. For example, if we are

sending data at 1kbps, a noise of 1/ 100 s can affect 10 bits ;

What if we are sending data at 1 Mbps, and same noise level, then how many bits will be affected?

One mechanism is to send every data unit twice. Another way to add extra bits in transmission is good one and is known as redundancy

To detect or correct errors, we need to send extra (redundant) bits with data.

A simple parity-check code is a single-bit error-detecting code in which n = k + 1.

Let us look at some transmission scenarios. Assume the sender sends the dataword 1011. The codeword created from this dataword is 10111, which is sent to the receiver. We examine five cases:

1. No error occurs; the received codeword is 10111. The syndrome is 0. The dataword 1011 is created. 2. One single-bit error changes a1 . The received codeword is 10011. The syndrome is 1. No dataword is created. 3. One single-bit error changes r0 . The received codeword is 10110. The syndrome is 1. No dataword is created.

4. An error changes r0 and a second error changes a3 . The received codeword is 00110. The syndrome is 0. The dataword 0011 is created at the receiver. Note that here the dataword is wrongly created due to the syndrome value. 5. Three bitsa3, a2, and a1are changed by errors. The received codeword is 01011. The syndrome is 1. The dataword is not created. This shows that the simple parity check, guaranteed to detect one single error, can also find any odd number of errors.

A 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.

Two-dimensional Parity-check Code

0 0 0 0 1 0 1

1 1 1 1 0 1 1

0 1 1 1 0 1 0

0 0 0 0 1 0 1

0 0 1 0 0 1 0

1 0 1 0 0 1 1

1 1 1 0 1 0 0

1 1 1 0 1 0 0

Suppose the following block is sent: 10101001 00111001 11011101 11100111 10101010

However, it is hit by a burst noise of length 8, and some bits are corrupted. 10100011 10001001 11011101 11100111 10101010

When the receiver checks the parity bits, some of the bits do not follow the even-parity rule and the whole block is discarded. 10100011 10001001 11011101 11100111 10101010

2D parity check increases the likelihood of detecting burst errors. As we have seen in the example given in the previous slide, a redundancy of n bits can easily detect a burst error of n bits. There is, however, one pattern of errors that remains un-detectable. If 2 bits in one data unit are damaged and 2 bits in exactly in the same positions in another data unit are also damaged, the checker will not detect an error.

Cyclic Redundancy Check (also called polynomial code) Based on modulo-2 binary division No carries (because it's modulo-2) Subtraction is equivalent to XOR

Division in CRC encoder

Division in the CRC decoder for two cases

It should be divisible by x + 1. It should not be divisible by x.

we can not choose x (binary 10) or 110 As polynomial Where as we can choose binary 11 or 101

A polynomial to represent a binary word

CRC division using polynomials

In a cyclic code, those e(x) errors that are divisible by g(x) are not caught. If the generator has more than one term and the coefficient of x0 is 1, all single errors can be caught. A generator that contains a factor of x + 1 can detect all odd-numbered errors.

All burst errors with L r will be detected. All burst errors with L = r + 1 will be detected with probability 1 (1/2)r1. All burst errors with L > r + 1 will be detected with probability 1 (1/2)r.

A good polynomial generator needs to have the following characteristics: It should have at least two terms. The coefficient of the term x0 should be 1. It should have the factor x + 1.

Table 10.7 Standard polynomials

CRC can detect all burst errors that affect an odd number of bits. CRC can detect all burst errors of length less than or equal to the degree of polynomial. CRC can detect, with a very high propability, burst errors of length greater than the degree of polynomial.

Example:

IP header

1.

2.
3. 4.

The data unit is divided into k sections, each of n bits All sections are added using 1s complement The sum is complemented The checksum is sent with data

Suppose the following block of 16 bits is to be sent using a checksum of 8 bits. 10101001 00111001 The numbers are added using ones complement 10101001 00111001 -----------Sum 11100010 Checksum 00011101 (Take 1s complement of
Sum)

The pattern sent is 00011101

10101001 00111001

Now suppose the receiver receives the pattern sent and there is no error. 10101001 00111001 00011101 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 00111001 00011101 Sum 11111111 Complement 00000000 means that the pattern is OK.

A burst error of length 5 that affects 4 bits. 10101111 11111001 00011101 When the receiver adds the three sections, it gets 10101111 11111001 00011101 Partial Sum 1 11000101 Carry 1 Sum 11000110 => Complement 00111001 !!!??

1. 2.

Correction more difficult than detection In detection just have to find whether error exists or not but in correction two things are required. Number of bits corrupted Their location in message

1.

By retransmission

2.

Forward Error Correction (FEC)

flow and error control protocols

require more redundancy bits receiver tries to get message by using redundant bits should locate the invalid bit or bits n-bit code word contains m data bits + r redundancy bits

m+r+1 bits discoverable by r bits


2r>=m+r+1

n=m+r

Data and redundancy bits


Number of data bits m Number of redundancy bits r Total bits m+r

1
2 3 4 5 6 7

2
3 3 3 4 4 4

3
5 6 7 9 10 11

Hamming codes provide for FEC using a Block Parity


i.e, instead of one parity bit send a block of parity bits

Allows correction of single bit errors This is accomplished by using more than one parity bit Each computed on different combination of bits in the data

Hamming code (Contd.)

Generate hamming code when data is 1010

?????????????

The Hamming distance between two words is the number of differences between corresponding bits.

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

Note

To guarantee the detection of up to s errors in all cases, the minimum Hamming distance in a block code must be dmin = s + 1.

Note

To guarantee correction of up to t errors in all cases, the minimum Hamming distance in a block code must be dmin = 2t + 1.

Example
A code scheme has a Hamming distance dmin = 4. What is the error detection and correction capability of this scheme? Solution This code guarantees the detection of up to three errors (s = 3), but it can correct up to one error. In other words, if this code is used for error correction, part of its capability is wasted. Error correction codes need to have an odd minimum distance (3, 5, 7, . . . ).

Chapter 10 (B.A Forouzan)


Section 10.1, 10.3, 10.4

Chapter 10 (B.A Forouzan)

Section 10.2, 10.3 (Cover only those contents which are related to topics covered in class)

You might also like