Error Detection and Correction Intro
Error Detection and Correction Intro
Error Detection and Correction Intro
ERROR
• Error is a condition when the output information does not match with
the input information.
• To detect and correct the errors, additional bits are added to the data
bits at the time of transmission.
• The data bits along with the parity bits form a code word.
Parity Checking of Error Detection
• It is the simplest technique for detecting and correcting errors.
• The MSB of an 8-bits word is used as the parity bit and the remaining
7 bits are used as data or message bits.
• The parity of 8-bits transmitted word can be either even parity or odd
parity.
• Even parity -- Even parity means the number of 1's in the given word
including the parity bit should be even (2,4,6,....).
• Odd parity -- Odd parity means the number of 1's in the given word including
the parity bit should be odd (1,3,5,....).
• The parity bit can be set to 0 and 1 depending on the type of the parity
required.
• For even parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the
entire word is even. Shown in fig. (a).
• For odd parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the entire
word is odd. Shown in fig. (b).
How Does Error Detection Take Place?
• Parity checking at the receiver can detect the presence of an error if
the parity of the receiver signal is different from the expected parity.
• If an error is detected, then the receiver will ignore the received byte
and request for retransmission of the same byte to the transmitter.
• error detection and correction or error control are techniques that
enable reliable delivery of digital data over unreliable
communication channels.
• Usually, when the transmitter does not receive the acknowledgment before
the timeout occurs (i.e., within a reasonable amount of time after sending
the data frame), it retransmits the frame until it is either correctly received
or the error persists beyond a predetermined number of retransmissions.
• Three types of ARQ protocols are Stop-and-wait ARQ, Go-Back-N ARQ,
and Selective Repeat ARQ.
• For example, ARQ is used on shortwave radio data links in the form of
ARQ-E, or combined with multiplexing as ARQ-M.
• Forward error correction
• Forward error correction (FEC) is a process of adding redundant data such
as an error-correcting code (ECC) to a message so that it can be recovered
by a receiver even when a number of errors (up to the capability of the
code being used) were introduced, either during the process of
transmission, or on storage.
• Since the receiver does not have to ask the sender for retransmission of
the data, a backchannel is not required in forward error correction, and it
is therefore suitable for simplex communication such as broadcasting.
• Messages are always transmitted with FEC parity data (and error-
detection redundancy). A receiver decodes a message using the parity
information, and requests retransmission using ARQ only if the parity
data was not sufficient for successful decoding (identified through a
failed integrity check).
• Parity bit
• A parity bit is a bit that is added to a group of source bits to ensure that
the number of set bits (i.e., bits with value 1) in the outcome is even or
odd.
• It is a very simple scheme that can be used to detect single or any other
odd number (i.e., three, five, etc.) of errors in the output.
• An even number of flipped bits will make the parity bit appear correct
even though the data is erroneous.
• If this twelve-bit pattern was received as "1010 1011 1011" – where the
first block is unlike the other two – an error has occurred.
• A repetition code is very inefficient, and can be susceptible to
problems if the error occurs in exactly the same place for each group
(e.g., "1010 1010 1010" in the previous example would be detected as
correct).
• Without knowing the key, it is not possible for the attacker to easily
or conveniently calculate the correct keyed hash value for a modified
message.
Checksum
• This is a block code method where a checksum is created based on
the data values in the data blocks to be transmitted using some
algorithm and appended to the data.
• When the receiver gets this data, a new checksum is calculated and
compared with the existing checksum.
• Sender’s End − The sender adds the segments using 1’s complement
arithmetic to get the sum. It then complements the sum to get the
checksum and sends it along with the data frames.
• Receiver’s End − The receiver adds the incoming segments along with
the checksum using 1’s complement arithmetic to get the sum and
then complements it.
• If the result is zero, the received frames are accepted; otherwise they
are discarded.
• Suppose that the sender wants to send 4 frames each of 8 bits, where
the frames are 11001100, 10101010, 11110000 and 11000011.
• After adding all the 4 frames, the sender complements the sum to get
the checksum, 11010011, and sends it along with the data frames.