2. Error Control
=> There will be errors.
=> Change of one or more bits
=> Some applications can tolerate a small level of
error. => If a frame is corrupted between the two
nodes, it needs to be corrected before it continues its
journey to other nodes.
2
9. => Correction is more difficult.
Detection
=> Looking to see if any error has occurred.
Correction
=> Need to know the exact number of bits that are
corrupted => Their location in the message.
=> Two important factors:
- Number of errors
- Size of the message
8
10. 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.
16. (Example)
=> Assume the sender encodes the 01 as 011
and sends. => Consider the following cases.
- 011 is received.
- 111 is received.
- 000 is received.
13
18. Parity Check
=> Simplest and most common error-detecting
scheme. => Append a parity bit to the end of a block
of data. => Parity refers to the evenness or oddness
of the number of bits.
Even parity
=> The total number of 1’s transmitted must be
even Odd parity
=> The total number of 1’s transmitted must be odd.
15
22. Checksum
=> Error-detection mechanism used to verify the
integrity of data during transmission.
=> Works by calculating a small-sized fixed block of
data (the checksum) from a larger block of data.
=> If a bit(s) changes in the original data, the
checksum will likely be different.
=> Can be applied to a message of any length. => In
the Internet, the checksum technique is mostly used
at the network and transport layer.
25. (Example)
=> Suppose the message is a list of five 4-bit
numbers. => In addition to sending these numbers,
we send the sum of the numbers.
=> 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
26. sum.
21
Checksum
(One’s complement)
=> The above example has one major drawback.
=> Each number can be written as a 4-bit word (each
is less than 15) except for the sum.
=> One solution is to use one’s complement
arithmetic. - If a number has more than m bits, the
27. extra leftmost bits need to be added to the m
rightmost bits (wrapping).
22
Checksum
(One’s complement - Example)
=> In the previous example, 36 in binary is (100100)2. =>
To change it to a 4-bit number we add the extra leftmost
bit to the right four bits.
(10)2 + (0100)2 = (0110)2 → (6)10.
=> Instead of sending 36 as the sum, we can send 6 as
the sum (7, 11, 12, 0, 6, 6).
28. => The receiver can add the first five numbers in
one’s complement arithmetic.
=> If the result is 6, the numbers are accepted; otherwise,
they
are rejected. 23
Checksum
=> We can make the job of the receiver easier if we send the
complement of the sum, the checksum.
One’s complement arithmetic:
=> Complement of a number=changing all 1s to 0s and all 0s
to 1s). => We have two 0s: one positive and one negative.
=> Positive zero= All bits set to 0.
29. => Negative zero= All bits set to 1.
=> If we add a number with its complement, we get a negative zero.
=> When the receiver adds all five numbers (including the
checksum), it gets a negative zero.
=> The receiver can complement the result again to get a positive
zero.
24
Checksu
m
(Example)
31. => Error detecting code used in many standard
protocols. => Makes use of one’s complement
arithmetic. => Provides greater error-detection
capability than a parity bit.
=> Less effective than the CRC.
=>The primary reason for its adoption in Internet
protocols is efficiency.
=> Traditionally, the Internet has used a 16-bit
checksum.
26