0% found this document useful (0 votes)
9 views31 pages

Week 7

The document discusses error detection and correction in data communication, emphasizing the importance of redundancy in ensuring data integrity during transmission. It outlines various types of errors, coding techniques, and methods such as block coding, cyclic codes, and checksums for detecting and correcting errors. Additionally, it explains the concepts of forward error correction and retransmission, along with the significance of Hamming distance in error detection and correction.

Uploaded by

irbazmoy08
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)
9 views31 pages

Week 7

The document discusses error detection and correction in data communication, emphasizing the importance of redundancy in ensuring data integrity during transmission. It outlines various types of errors, coding techniques, and methods such as block coding, cyclic codes, and checksums for detecting and correcting errors. Additionally, it explains the concepts of forward error correction and retransmission, along with the significance of Hamming distance in error detection and correction.

Uploaded by

irbazmoy08
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/ 31

CE3240 Data Communication and Networks

Week 7

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Error Detection and Correction
➢ Data can be corrupted during transmission. Some
applications require that errors be detected and corrected.
➢ Error detection and correction are implemented either at
data link layer or the transport layer of the OSI model.
➢ Whenever bits flow from one point to another, they are
subject to unpredictable changes because of interference.
➢ This interference can change the shape of the signal.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Types of Errors
➢ Single-Bit Error: In a single-bit error, only 1 bit in the data unit has changed.

➢ Burst Error: A burst error means that 2 or more bits in the data unit have
changed

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Error Detection
➢ Error detecting code is to include only redundancy to allow the
receiver to deduce than an error occurred, but not which error, and
have it request a re-transmission.
➢ Error detection uses the concept of redundancy, which means adding
extra bits for detecting error at the destination.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Redundancy

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Redundancy
➢ The central concept in detecting or correcting errors is redundancy.
➢ To be able to detect or correct errors, we need to send some extra
bits with our data.
➢ These redundant bits are added by the sender and removed by the
receiver.
➢ Their presence allows the receiver to detect or correct corrupted bits.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Error Detection v/s Correction

Error Detection Error Correction


➢ The correction of errors is more ➢ In error correction, we need to know
difficult than the detection. the exact number of bits that are
➢ In error detection, we are looking corrupted and more importantly,
only to see if any error has their location in the message.
occurred. ➢ The number of the errors and the
➢ The answer is a simple yes or no. size of the message are important
➢ A single-bit error is the same for us factors.
as a burst error.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Coding
➢ Redundancy is achieved through various coding schemes.
➢ The sender adds redundant bits through a process that creates a
relationship between the redundant bits and the actual data bits.
➢ The receiver checks the relationships between the two sets of bits to
detect or correct the errors.
➢ The ratio of redundant bits to the data bits and the robustness of the
process are important factors in any coding scheme.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Block Coding

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


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.
➢ With k bits, we can create a combination of 2k datawords; with n bits,
we can create a combination of 2n codewords.
➢ Since n > k, the number of possible codewords is larger than the
number of possible datawords.
➢ The block coding process is one-to-one; the same dataword is always
encoded as the same codeword.
➢ This means that we have 2n - 2k codewords that are not used.
➢ We call these codewords invalid or illegal.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Block Coding

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Error Detection
If the following two conditions are met, the receiver can detect a change
in the original codeword.
1. The receiver has (or can find) a list of valid codewords.
2. The original codeword has changed to an invalid one.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Error Detection
Sender Receiver
Encoder Decoder

k bits Message Message k bits

Extract
Generator Checker
Discard
Unreliable
transmission
Codeword Codeword
n bits n bits

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Error Correction
Sender Receiver
Encoder Decoder

k bits Message Message

Correct
Generator Checker

Unreliable
transmission
Codeword Codeword
n bits n bits

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Forward Error Correction v/s Retransmission

Forward Error Correction Retransmission


➢ Forward error correction is the ➢ Correction by retransmission is a
process in which the receiver tries technique in which the receiver
to guess the message by using detects the occurrence of an error
redundant bits. and asks the sender to resend the
➢ This is possible if the number of message.
errors is small. ➢ Resending is repeated until a
message arrives that the receiver
believes is error-free (usually, not all
errors can be detected).

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Hamming Distance
➢ The Hamming distance between two words is the number of differences
between corresponding bits.
➢ Minimum Hamming Distance: The minimum Hamming distance is the
smallest Hamming distance between all possible pairs in a set of words.
➢ To guarantee detection of up to s errors in all cases, the minimum Hamming
distance in a block code must be dmin = s + 1.
➢ To guarantee correction of up to t errors in all cases, the minimum Hamming
distance in a block code must be dmin = 2t + 1.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Cyclic Codes

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Cyclic Codes
➢ Cyclic codes are special linear block codes with one extra property.
➢ In a cyclic code, if a codeword is cyclically shifted (rotated), the result is
another codeword.
➢ For example, if 1011000 is a codeword and we cyclically left-shift, then
0110001 is also a codeword.
➢ In this case, if we call the bits in the first word a0 to a6 and the bits in the second
word b0 to b6, we can shift the bits by using the following:

➢ In the rightmost equation, the last bit of the first word is wrapped around and
becomes the first bit of the second word.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Cyclic Redundancy Check
A CRC code with C(7, 4)

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


CRC Encoder – Decoder

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Division in CRC Encoder

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Division in CRC Decoder

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Polynomial
➢ A better way to understand cyclic codes and how they can be analyzed is to
represent them as polynomials.
➢ A pattern of 0s and 1s can be represented as a polynomial with coefficients of
0 and 1.
➢ The power of each term shows the position of the bit; the coefficient shows
the value of the bit.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


CRC Division using Polynomials

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Checksum

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Checksum
➢ The checksum is used in the Internet by several protocols although
not at the data link layer.
➢ Like linear and cyclic codes, the checksum is based on the concept
of redundancy.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


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.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


One’s Complement
➢ The previous example has one major drawback.
➢ All of our data can be written as a 4-bit word (they are less than 15) except for
the checksum.
➢ One solution is to use one's complement arithmetic. In this arithmetic, we can
represent unsigned numbers between 0 and 2n - 1 using only n bits.
➢ If the number has more than n bits, the extra leftmost bits need to be added to
the n rightmost bits (wrapping).
➢ In one's complement arithmetic, a negative number can be represented by
inverting all bits (changing a 0 to a 1 and a 1 to a 0).
➢ This is the same as subtracting the number from 2n - 1.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Internet Checksum
Sender site Receiver site
1. The message is divided into 16-bit 1. The message (including checksum) is
words. divided into 16-bit words.
2. The value of the checksum word is 2. All words are added using one's
set to O. complement addition.
3. All words including the checksum 3. The sum is complemented and
are added using one's complement becomes the new checksum.
addition. 4. If the value of checksum is 0, the
4. The sum is complemented and message is accepted; otherwise, it is
becomes the checksum. rejected.
5. The checksum is sent with the data.

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


Internet Checksum

CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali


CE3240 Data Communication and Networks Engr. Zaib Un Nisa Ali

You might also like