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

Error Detection

The document discusses various error detection techniques used in computer systems and communication networks, including: 1) Hamming and Reed-Solomon codes, cyclic redundancy checks (CRCs), checksums, and parity checks which add redundant bits to detect errors. 2) One-dimensional and two-dimensional parity checks which detect single and some multi-bit errors. 3) Cyclic redundancy checks (CRCs) which use polynomial arithmetic to generate a checksum over message bits to detect errors, with the CRC covering more errors than a simple checksum. 4) Properties of CRC codes such as their generator polynomial and their ability to detect all single bit errors and many multi-bit errors.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Error Detection

The document discusses various error detection techniques used in computer systems and communication networks, including: 1) Hamming and Reed-Solomon codes, cyclic redundancy checks (CRCs), checksums, and parity checks which add redundant bits to detect errors. 2) One-dimensional and two-dimensional parity checks which detect single and some multi-bit errors. 3) Cyclic redundancy checks (CRCs) which use polynomial arithmetic to generate a checksum over message bits to detect errors, with the CRC covering more errors than a simple checksum. 4) Properties of CRC codes such as their generator polynomial and their ability to detect all single bit errors and many multi-bit errors.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Error Detection Techniques

Dr. E. Murugavalli
Assistant Professor,
Dept. of ECE,
TCE, Madurai – 15.
Recap Question on framing
• Suppose the following sequence of bits arrives
over a link:
011010111110101001111111011001111110
Show the resulting frame after any stuffed bits
have been removed. Indicate any errors that
might have been introduced into the frame

Dept. of ECE, TCE 2


Recap Question
• Suppose the following sequence of bits arrives
over a link:
011010111110101001111111011001111110
Show the resulting frame after any stuffed bits
have been removed. Indicate any errors that
might have been introduced into the frame
• 011010111110101001111111011001111110
01101011111_101001111111err011001111110eof

Dept. of ECE, TCE 3


Types of Errors

• Single bit Errors


• Burst Errors – multi-bit errors
which are consecutive

Dept. of ECE, TCE 4


ERROR DETECTION
• bit errors are sometimes introduced into frames, because of
electrical interference or thermal noise
• Hamming and Reed-Solomon codes - for dealing with bit
errors in computer systems, (1940s)
• Techniques for detecting transmission errors - cyclic
redundancy check (CRC), Two dimensional parity and
checksums
• The basic idea is to add redundant information to a frame
that can be used to determine if errors have been introduced.
• goal of error detecting codes is to provide a high probability
of detecting errors combined with a relatively low number of
redundant bits (k ≪n)
• On an Ethernet, a frame carrying up to 12,000 bits (1500
Bytes) of data requires only a 32-bit CRC code
• The sender applies the algorithm to the message
to generate the redundant bits.
• It then transmits both the message and those few
extra bits.
• When the receiver applies the same algorithm to
the received message, it should come up with the
same result as the sender.
• It compares the result with the one sent to it by
the sender. If they match, it can conclude that no
errors were introduced in the message during
transmission.
• when the algorithm to create the code is based on
addition, they may be called a checksum.
One -Dimensional Parity
• one-dimensional parity involves adding one
extra bit to a 7-bit code to balance the number
of 1s in the byte.
• odd parity sets the eighth bit to 1 if needed to
give an odd number of 1s in the byte
• even parity sets the eighth bit to 1 if needed to
give an even number of 1s in the byte.
• codeword: 1011001 P  no. of 1s is 4
– odd parity  1011001 1  no. of 1s is an odd
number
One -Dimensional Parity
• one-dimensional parity involves adding one extra bit
to a 7-bit code to balance the number of 1s in the
byte.
• odd parity sets the eighth bit to 1 if needed to give an
odd number of 1s in the byte
• even parity sets the eighth bit to 1 if needed to give
an even number of 1s in the byte.
• codeword: 1011001 P  no. of 1s is 4
– odd parity  10110011  total no. of 1s is an odd number
– Even parity 10110010total no. of 1s is an even number
Problem in 1-Dim. parity
• Assume that TX and RX agree to Even parity
scheme. 1011011 is the message to send.
• 10110111 - no error in receiver [six 1s]
• 00110111 - error is detected in receiver [five 1s]
• 01110111 - ?
• 10110110 - ?

Dept. of ECE, TCE 9


Problem in 1-Dim. parity
• Assume that TX and RX agree to Even parity
scheme. 1011011 is the message to send.
• 10110111 - no error in receiver [six 1s]
• 00110111 - error is detected in receiver [five 1s]
• 01110111 - Rx. Fails to detect double bit
errors using 1-dim. Parity
10110110 - error is detected in receiver [five 1s]

Dept. of ECE, TCE 10


Two-Dimensional Parity
• Two-dimensional parity does a similar
calculation for each bit position across each of
the bytes contained in the frame.
• This results in an extra parity byte for the entire
frame, in addition to a parity bit for each byte.
Two-Dimensional Parity . . .
0101001110100110111100
0011100110100101111111
11011

• two-dimensional parity catches all 1-, 2-, and 3-bit


errors, and most 4-bit errors.
• we have added --14--- bits of redundant
information to a 42-bit message
Internet Checksum
• add up all the words that are transmitted and then transmit
the result of that sum - checksum.
• The receiver performs the same calculation on the received
data and compares the result with the received checksum.
• Consider the data being checksummed as a sequence of 16-
bit integers.
• Add them together using 16-bit ones complement arithmetic
and then take the ones complement of the result.
• a small number of redundant bits —only 16 for a message of
any length
• relatively weak protection against errors
• This algorithm is much easier to implement in software.
• checksum is the last line of defense in an end-to-end
protocol; the majority of errors are picked up by stronger
error detection algorithms, such as CRCs, at the link level.
Cyclic Redundancy Check - CRC
• major goal in designing error detection algorithms is to
maximize the probability of detecting errors using only a
small number of redundant bits.
• Cyclic redundancy checks use some powerful math
(finite fields) to achieve this goal.
• 32-bit CRC gives strong protection against common bit
errors in messages that are thousands of bytes long.
• The message is represented by a polynomial by using the
value of each bit in the message as the coefficient for
each term in the polynomial, starting with the most
significant bit to represent the highest-order term.
• an 8-bit message consisting of the bits 10011010
corresponds to the polynomial M(x) =x7 +x4 +x3 +x1
• sender and receiver have to agree on a divisor
polynomial, C(x). C(x) is a polynomial of degree k.
• C(x) = x3 +x2 +11101. In this case, degree k = 3.
• choice of C(x) has a significant impact on what types of
errors can be reliably detected
• Ethernet standard uses a well-known polynomial of
degree 32.
• When a sender wishes to transmit a message M(x) that is
n+1 bits long, what is actually sent is the (n+1)-bit
message plus k bits, the complete transmitted message,
including the redundant bits, P(x).
• If P(x) is transmitted over a link and there are no errors
introduced during transmission, then the receiver should
be able to divide P(x) by C(x) exactly, leaving a remainder
of zero.
Properties of polynomial arithmetic modulo 2:
• Any polynomial B(x) can be divided by a divisor
polynomial C(x) if B(x) is of higher degree than C(x).
• Any polynomial B(x) can be divided once by a divisor
polynomial C(x) if B(x) is of the same degree as C(x).
• The remainder obtained when B(x) is divided by C(x) is
obtained by performing the exclusive OR (XOR)
operation on each pair of matching coefficients
Polynomial Long division:
1. Multiply M(x) by xk; that is, add k zeros at the end of
the message. Call this zero-extended message P(x).
2. Divide P(x) by C(x) and find the remainder.
3. Subtract the remainder from P(x).
Problem Solving in CRC
• Suppose we want to transmit the message 10011010
and protect it from errors using the CRC-3
polynomial C(x) = x3+x2+1 . Use polynomial long
division to determine the message that should be
transmitted.
1. Multiply M(x) by xk; that is, add k zeros at the end
M(x)=x7+x4 +x3 +x1, 10011010 and C(x)=x3+x2+1 , 1101
K is degree of divisor polynomial = 3
P(x) = M(x) * x3 = x10+x7 +x6 +x4
P(x) = 10011010000

Dept. of ECE, TCE 17


• Consider the M(x)=x7 +x4 +x3 +x1, or 10011010 and C(x)= x3 +x2+1
• We begin by multiplying by x3, since our divisor polynomial is of
degree 3. This gives 10011010000.
• We divide this by C(x) which corresponds to 1101
• the long-division operation proceeds much as it would if we were
dividing integers.
• Thus, in the first step, the divisor 1101 divides once into the first
four bits of the message (1001), since they are of the same degree,
and leaves a remainder of 100 (1101 XOR 1001).
• The next step is to bring down a digit from the message
polynomial until we get another polynomial with the same degree
as C(x), in this case 1001.
• We calculate the remainder again (100) and continue until the
calculation is complete.
• Note that the “result” of the long division is the remainder at the
end that matters.
Dept. of ECE, TCE 18
Problem Solving in CRC …
1. P(x) = M(x) * x3 = 10011010000
2. Divide P(x) by C(x) and find the remainder

Remainder is the CRC


which is loaded into the
trailer (end) of the
data link layer frame

Dept. of ECE, TCE 19


CRC-32 is used in Ethernet-IEEE 802.3 – LAN technology.
Hence, 33 redundant bits are used as error detection bits to
take care of 1500Bytes=12000bits.

Dept. of ECE, TCE 20


Cyclic Redundancy Check (CRC)

• Properties of Generator Polynomial


– Let P(x) represent what the sender sent and P(x) + E(x) is the received
string. A 1 in E(x) represents that in the corresponding position in P(x)
the message the bit is flipped.

– We know that P(x)/C(x) leaves a remainder of 0, but if E(x)/C(x) leaves


a remainder of 0, then either E(x) = 0 or C(x) is factor of E(x).

– When C(x) is a factor of E(x) we have problem; errors go unnoticed.

– If there is a single bit error then E(x) = xi, where i determines the bit in
error. If C(x) contains two or more terms it will never divide E(x), so all
single bit errors will be detected.
Cyclic Redundancy Check (CRC)

• Properties of Generator Polynomial


– In general, it is possible to prove that the following types
of errors can be detected by a C(x) with the stated
properties
• All single-bit errors, as long as the xk and x0 terms have nonzero
coefficients.
• All double-bit errors, as long as C(x) has a factor with at least three
terms.
• Any odd number of errors, as long as C(x) contains the factor (x+1).
• Any “burst” error (i.e., sequence of consecutive error bits) for
which the length of the burst is less than k bits. (Most burst errors
of larger than k bits can also be detected.)
Reliable Transmission

• CRC is used to detect errors.


• Some error codes are strong enough to correct
errors.
• The overhead is typically too high.
• Corrupt frames must be discarded.
• A link-level protocol that wants to deliver frames
reliably must recover from these discarded frames.
• This is accomplished using a combination of two
fundamental mechanisms
– Acknowledgements and Timeouts
Reliable Transmission

• An acknowledgement (ACK for short) is a small


control frame that a protocol sends back to its peer
saying that it has received the earlier frame.
– A control frame is a frame with header only (no data).

• The receipt of an acknowledgement indicates to the


sender of the original frame that its frame was
successfully delivered.
Reliable Transmission

• If the sender does not receive an acknowledgment


after a reasonable amount of time, then it
retransmits the original frame.
• The action of waiting a reasonable amount of time is
called a timeout.
• The general strategy of using acknowledgements and
timeouts to implement reliable delivery is sometimes
called Automatic Repeat reQuest (ARQ).

You might also like