0% found this document useful (0 votes)
14 views48 pages

2-CN - Error Control - V2

The document discusses error detection and correction techniques in the Data Link Layer, focusing on types of errors, block coding, cyclic redundancy check (CRC), and checksums. It explains how errors can occur during data transmission and the methods used to detect and correct these errors, including simple parity checks and checksums. The document also outlines the processes for implementing these techniques at both sender and receiver ends.
Copyright
© © All Rights Reserved
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)
14 views48 pages

2-CN - Error Control - V2

The document discusses error detection and correction techniques in the Data Link Layer, focusing on types of errors, block coding, cyclic redundancy check (CRC), and checksums. It explains how errors can occur during data transmission and the methods used to detect and correct these errors, including simple parity checks and checksums. The document also outlines the processes for implementing these techniques at both sender and receiver ends.
Copyright
© © All Rights Reserved
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/ 48

COMPUTER NETWORKS

Unit-2: Data Link Layer


Block Coding, Cyclic Redundancy Check and
Checksum
Presentation Outline
• Error
- Types of Errors
• Block Coding
- Simple Parity Check
- Hamming Codes
- Minimum Hamming Distance
• Cyclic Codes
- Cyclic Redundancy Check
- Hardware Implementation
- Polynomials
- Cyclic Code Analysis
- Checksum
Introduction
Let us first discuss some issues related, directly or
indirectly, to error detection and correction.

Topics
• Types of Errors
• Redundancy
• Detection Versus Correction
• Forward Error Correction Versus Retransmission
• Coding
• Modular Arithmetic
Errors
Note

Data can be corrupted


during transmission.

Some applications require that


errors be detected and corrected.
Types of Errors
A Single-Bit Error

Note

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


changed.
A Single-Bit Error
A Burst Error

Note

A burst error means that 2 or more bits in the


data unit have changed.
Burst Error of Length 8
To Detect or Correct Errors

Note

To detect or correct errors, we need to send extra


(redundant) bits with data.
Error detection

• Error detection means to decide whether the received


data is correct or not without having a copy of the
original message.

• Error detection uses the concept of redundancy,


which means adding extra bits for detecting errors at
the destination.
Redundancy
• To detect or correct errors, we need to send extra
(redundant) bits with data.
Error Detection
Simple Parity Check
• A simple parity-check code is a single-bit error-
detecting code in which n = k + 1.
Simple Parity-Check Code C(5, 4)
Simple Parity Check
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:

•No error occurs; the received codeword is 10111. The


syndrome is 0. The dataword 1011 is created.

•One single-bit error changes a1 . The received codeword is


10011. The syndrome is 1. No dataword is created.

•single-bit error changes r0 . The received codeword is 10110.


The syndrome is 1. No dataword is created.
Simple Parity Check
• 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.

• Three bits—a3, a2, and a1—are 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.
Simple Parity Check

Note

A simple parity-check code can detect an odd number


of errors.
Two-Dimensional Parity-Check Code
Two-Dimensional Parity-Check Code
Two-Dimensional Parity-Check Code
Performance
• 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.
Performance
• 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.
Checksum
Checksum is an error-detecting technique that can be
applied to a message of any length.

In the Internet, the checksum technique is mostly


used at the network and transport layer rather than
the data-link layer.

However, to make our discussion of error detecting


techniques complete, we discuss the checksum.
Checksum
Checksum
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.
Checksum
We can make the job of the receiver 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.
Checksum
Checksum
Let us redo Exercise using one’s complement arithmetic. Its
shows the process at the sender and at the receiver. The sender
initializes the checksum to 0 and adds all data items and the
checksum (the checksum is considered as one data item and is
shown in color).

The result is 36. However, 36 cannot be expressed in 4 bits. The


extra two bits are wrapped and added with the sum to create the
wrapped sum value 6. In the figure, we have shown the details in
binary. The sum is then complemented, resulting in the checksum
value 9 (15 − 6 = 9). The sender now sends six data items to the
receiver including the checksum 9.
Checksum
The result is 36. However, 36 cannot be expressed in 4 bits.

The extra two bits are wrapped and added with the sum to create
the wrapped sum value 6.

36=100100 ; (0100+10)= 0110=6

The sum is then complemented, resulting in the checksum value


9 (15 − 6 = 9).

The sender now sends six data items to the receiver including the
checksum 9.
Checksum
The receiver follows the same procedure as the sender. It adds
all data items (including the checksum); the result is 45.

45=101101; (1101+10=1111=15)

The sum is wrapped and becomes 15.

The wrapped sum is complemented and becomes 0(15-15).


Since the value of the checksum is 0, this means that the data is
not corrupted.

The receiver drops the checksum and keeps the other data
items. If the checksum is not zero, the entire packet is dropped.
Checksum
Checksum
Note
Sender site:
1.The message is divided into 16-bit words.
2.The value of the checksum word is set to 0.
3.All words including the checksum are added using
one’s complement addition.
4.The sum is complemented and becomes the
checksum.
5.The checksum is sent with the data.
Checksum
Note

Receiver site:
1.The message (including checksum) is divided into
16-bit words.
2.All words are added using one’s complement
addition.
3.The sum is complemented and becomes the new
checksum.
4.If the value of checksum is 0, the message is
accepted; otherwise, it is rejected.
Summary
• 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.
Checksum
Checksum is an error-detecting technique that can be
applied to a message of any length.

In the Internet, the checksum technique is mostly


used at the network and transport layer rather than
the data-link layer.

However, to make our discussion of error detecting


techniques complete, we discuss the checksum.
Checksum
Checksum
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.
Checksum
We can make the job of the receiver 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.
Checksum
Checksum
Let us redo Exercise using one’s complement arithmetic. Its
shows the process at the sender and at the receiver. The sender
initializes the checksum to 0 and adds all data items and the
checksum (the checksum is considered as one data item and is
shown in color).

The result is 36. However, 36 cannot be expressed in 4 bits. The


extra two bits are wrapped and added with the sum to create the
wrapped sum value 6. In the figure, we have shown the details in
binary. The sum is then complemented, resulting in the checksum
value 9 (15 − 6 = 9). The sender now sends six data items to the
receiver including the checksum 9.
Checksum
The result is 36. However, 36 cannot be expressed in 4 bits.

The extra two bits are wrapped and added with the sum to create
the wrapped sum value 6.

36=100100 ; (0100+10)= 0110=6

The sum is then complemented, resulting in the checksum value


9 (15 − 6 = 9).

The sender now sends six data items to the receiver including the
checksum 9.
Checksum
The receiver follows the same procedure as the sender. It adds
all data items (including the checksum); the result is 45.

45=101101; (1101+10=1111=15)

The sum is wrapped and becomes 15.

The wrapped sum is complemented and becomes 0(15-15).


Since the value of the checksum is 0, this means that the data is
not corrupted.

The receiver drops the checksum and keeps the other data
items. If the checksum is not zero, the entire packet is dropped.
Checksum
Checksum
Note
Sender site:
1.The message is divided into 16-bit words.
2.The value of the checksum word is set to 0.
3.All words including the checksum are added using
one’s complement addition.
4.The sum is complemented and becomes the
checksum.
5.The checksum is sent with the data.
Checksum
Note

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

You might also like