0% found this document useful (0 votes)
2 views30 pages

Chapter 2 - DataComm - Part5

The document discusses error detection and correction in data communications, emphasizing the importance of ensuring data accuracy during transmission. It describes types of errors, including single-bit and burst errors, and various techniques for error detection and correction, such as parity-check codes, Hamming codes, cyclic redundancy checks, and checksums. The document also explains the concepts of redundancy, Hamming distance, and the methods of forward error correction and retransmission.

Uploaded by

muhd shahzwan
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)
2 views30 pages

Chapter 2 - DataComm - Part5

The document discusses error detection and correction in data communications, emphasizing the importance of ensuring data accuracy during transmission. It describes types of errors, including single-bit and burst errors, and various techniques for error detection and correction, such as parity-check codes, Hamming codes, cyclic redundancy checks, and checksums. The document also explains the concepts of redundancy, Hamming distance, and the methods of forward error correction and retransmission.

Uploaded by

muhd shahzwan
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/ 30

2.

9 Error Detection and Correction


 Network must be able to transfer data from one device to another with
acceptable accuracy.
 For most application, a system must guarantee that the data received are
identical to the data transmitted.
 An electromagnetic signal is subject to interference from heat, magnetism, and
other forms of electricity
 Data can be corrupted during transmission and some applications require that
errors be detected and corrected.
 Some application can tolerate a small level of error – random errors in audio or
video
 Some need very high level of accuracy - text

Chapter 2 : Data Communications 1


2.9 Error Detection and Correction
 Types of Errors

 Single-bit Error
 Single-bit error: 0  1 or 1  0
 Only one bit of a given data unit is changed
 The least likely type of error in serial transmission. Why ?
 Single-bit error can happen in parallel transmission

Chapter 2 : Data Communications 2


2.9 Error Detection and Correction
 Single-bit Error

 Burst Error
 Two or more bits in the data unit have changed
 Burst error does not necessarily mean that the errors occur in consecutive bits
 Most likely to happen in a serial transmission
 Number of bits affected depends on the data rate and duration of noise

Chapter 2 : Data Communications 3


2.9 Error Detection and Correction
 Burst Error
 Ex : If the data is sent at 1 kbps, a noise of 1/100 s can affect 10 bits.
 Ex : If the data is sent at 1 Mbps, a noise of 1/100 s can affect 10000 bits.

Chapter 2 : Data Communications 4


2.9 Error Detection and Correction
 Redundancy
 Error detection uses the concept of redundancy, which means adding extra
(redundant) bits for detecting errors at the destination

Chapter 2 : Data Communications 5


2.9 Error Detection and Correction
 Detection vs. Correction
 Detection: error ? yes or no
 Correction: Need to know the exact number of bits that are corrupted, and their
location in the message
 Ex : one error in 8 bits sequence – 8 possible location.
 Ex : 10 errors in 1000 bits sequence ?

 Forward Error Correction vs. Retransmission


 2 main methods of error correction :
 Forward Error Correction – the receiver tries to guess the message by using
redundant bits (in the case the number of errors is small).
 Retransmission – the receiver detects the occurrence of an error and ask the sender
to resend the message. This process is repeated until a message arrives that the
receiver believes is error-free.

Chapter 2 : Data Communications 6


2.9 Error Detection and Correction
 Hamming Distance
 The Hamming distance between two words is the number of differences between
corresponding bits.
 Easily found by applying the XOR operation on the two words and count the number
of 1s in the result.
 Ex : Hamming distance d (000,011)
 Ex : Hamming distance d (10101, 11110)

 Minimum Hamming Distance


 The minimum Hamming distance is the smallest Hamming distance between all
possible pairs in a set of words
 Ex : Find the minimum Hamming distance of the coding scheme in below table.

Chapter 2 : Data Communications 7


2.9 Error Detection and Correction
 Minimum Hamming Distance
 Ex : Find the minimum Hamming distance of the coding scheme in below table.

 3 parameters to define the coding scheme


 Codeword size n
 Dataword size k
 The minimum Hamming distance dmin

Chapter 2 : Data Communications 8


2.9 Error Detection and Correction
 Relation between Hamming Distance and Error
 When a codeword is corrupted during transmission, the Hamming distance between
the sent and received codewords is the number of bits affected by the error.
 In other words, the Hamming distance between the received codeword and the sent
codeword is the number of bits that are corrupted during transmission.
 Ex : if the codeword 00000 is sent and 01101 is received, 3 bits are in error and the
Hamming distance between the two is d (00000, 01101) = 3.

 Minimum Distance for Error Detection


 If s errors occur during transmission, the Hamming distance between the sent
codeword and the received codeword is s.
 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.
 Examples

Chapter 2 : Data Communications 9


2.9.1 Error Detection & Correction Common Techniques
 Simple Parity-Check Code
 A k-bit dataword is changed to an n-bit codeword where n = k + 1.
 The extra bit (called the parity bit), is selected to make the total number of 1s in the
codeword even.
 The minimum Hamming distance dmin = 2, which means that the code is a single-bit
error-detecting code.
 Example of parity-check code with k = 4, n = 5; C (5,4) :

Chapter 2 : Data Communications 10


2.9.1 Error Detection and Correction Common Techniques
 Encoder and Decoder for Parity-Check Code

Chapter 2 : Data Communications 11


2.9.1 Error Detection & Correction Common Techniques
 Encoder and Decoder for Parity-Check Code
 The encoder uses a generator that takes a copy of a 4-bit dataword (a0, a1, a2 and
a3) and generates a parity bit r0.
 The dataword bits and the parity bit create the 5-bit codeword.
 The parity bit that is added make the number of 1s in the codeword even.
 This is done by adding the 4 bits of the dataword (modulo-2) where the result is the
parity bit.
r0 = a3 + a2 + a1 + a0

 The sender sends the codeword which may be corrupted during transmission and the
receiver receives a 5-bit word.
 The checker at the receiver does the same thing as the generator at the sender, but
the addition is done over all 5 bits.

s0 = b3 + b2 + b1 + b0 + q0

Chapter 2 : Data Communications 12


2.9.1 Error Detection & Correction Common Techniques
 Encoder and Decoder for Parity-Check Code
 The result which is called the syndrome, is just 1 bit.
 The syndrome is passed to the decision logic analyzer.
 If the syndrome = 0 = no error in the received codeword; the data portion of the
received codeword is accepted as the dataword.
 If the syndrome = 1 = error in the received codeword; the data portion of the
received codeword is discarded and no dataword is created.

Chapter 2 : Data Communications 13


2.9.1 Error Detection & Correction Common Techniques
 Two-dimensional parity-check code

Chapter 2 : Data Communications 14


2.9.1 Error Detection & Correction Common Techniques
 Two-dimensional parity-check code

Chapter 2 : Data Communications 15


2.9.1 Error Detection & Correction Common Techniques
 Error Correcting Code : Hamming Codes C (7,4)

Chapter 2 : Data Communications 16


2.9.1 Error Detection & Correction Common Techniques
 Encoder and decoder for a Hamming Code

Chapter 2 : Data Communications 17


2.9.1 Error Detection & Correction Common Techniques
 Logical Decision made by the correction logical analyzer of the decoder :

 Examples

Chapter 2 : Data Communications 18


2.9.1 Error Detection & Correctioon Common Techniques
 The use of Hamming Code in burst error correction
 A Hamming code can only correct a single error and detect a double error.
 But there is a way to make it detect a burst error :

Chapter 2 : Data Communications 19


2.9.1 Error Detection & Correction Common Techniques
 The use of Hamming Code in burst error correction

 When a burst of error of size 4 corrupts the frame, only 1 bit from each codeword is
corrupted – the corrupted bit can be easily be corrected at the receiver.

Chapter 2 : Data Communications 20


2.9.1 Error Detection & Correction Common Techniques
 Cyclic Codes
 Cyclic codes are special linear block code – if a codeword is cyclically shifted
(rotated), the result is another codeword
 Ex : 1011000 is a codeword and if cyclically left-shifted, the result 0110001 is also a
codeword.

Chapter 2 : Data Communications 21


2.9.1 Error Detection & Correction Common Techniques
 Cyclic Redundancy Check
 The use of cyclic codes to detect and correct error
 CRC encoder and decoder

Chapter 2 : Data Communications 22


2.9.1 Error Detection & Correction Common Techniques
 CRC encoder and decoder
 In the encoder, the dataword has k
bits (4 bits)
 The size of dataword is augmented
(increased) by adding n – k (3 bits)
0s to the right-hand side of the word.
 The n-bits is then fed to the
generator.
 The generator uses a pre-defined
divisor to divide the dataword
(modulo-2 division).
 The quotient of the division is
discarded, the remainder (r2r1r0) is
appended to the dataword to create
the codeword.

Chapter 2 : Data Communications 23


2.9.1 Error Detection & Correction Common Techniques
 CRC encoder and decoder
 The decoder receives the possibly
corrupted codeword.
 A copy of all n bits is fed to the
checker to do the same step as the
generator.
 The remainder produced by the
checker is a syndrome of n – k (3
bits) which is fed to the decision
logic analyzer.
 If the syndrome bits are all 0s, the 4
leftmost bits of the codeword are
accepted as a dataword.
 Otherwise, the 4 bits are discarded
(error).

Chapter 2 : Data Communications 24


2.9.1 Error Detection & Correction Common Techniques
 Example : Division in CRC Encoder

Chapter 2 : Data Communications 25


2.9.1 Error Detection & Correction Common Techniques
 Example : Division in CRC Decoder

Chapter 2 : Data Communications 26


2.9.1 Error Detection & Correction Common Techniques
 Checksum
 The idea as in ex 10.18.
 It can made easier as in ex 10.19

Chapter 2 : Data Communications 27


2.9.1 Error Detection & Correction Common Techniques
 Actual implementation of checksum
 Ex : The sender initializes the checksum to 0 and adds all data items and the
checksum. 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. The sum is
then complemented, resulting in the checksum value 9 (15 − 6 = 9).

Chapter 2 : Data Communications 28


2.9.1 Error Detection & Correction Common Techniques
 Internet checksum
 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.
 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.

Chapter 2 : Data Communications 29


2.9.1 Error Detection & Correction Common Techniques
 Internet checksum : Examples

Chapter 2 : Data Communications 30

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