3. 10.3
Data link layer duties
ā¼ Packetizing: move data packets or frames from one hop to the next within the
same LAN or WAN
ā¼ Addressing: uses physical addresses (MAC Addresses) that are assigned for
and used to find the next hop in the hop-to-hop delivery
ā¼ Error Control: uses error detection and correction to reduce the severity of
error occurrence
ā¼ Flow Control: controls how much data a sender can transmit before it must
wait for an acknowledgement from the receiver in order not to overwhelm it
ā¼ Medium Access Control (MAC): controls how the nodes should access a
shared media in a way to prevent packet collisions
4. 10.4
Data can be corrupted
during transmission.
Some applications require that
errors be detected and corrected.
Note
5. 10.5
10-1 INTRODUCTION
Let us first discuss some issues related, directly or
indirectly, to error detection and correction.
ā¢ Types of Errors
ā¢ Redundancy
ā¢ Detection Versus Correction
ā¢ Forward Error Correction Versus Retransmission
ā¢ Coding
ā¢ Modular Arithmetic
Topics discussed in this section:
8. 10.8
A burst error means that 2 or more bits
in the data unit have changed.
Note
9. 10.9
Figure 10.2 Burst error of length 8
ā¼ The length of the burst is measured from the 1st to the last corrupted bits
ā¼ The burst error doesnāt necessarily mean that errors occur in consecutive bits
ā¼ Burst errors are most likely to occur in serial transmission
ā¼ The noise duration is usually longer than the duration of one bit
ā¼ The severity of burst errors are dependent on the data rate & the noise duration
ā¼ For example: a noise duration of 0.01 sec would corrupt 10 bits of a 1Kbps
transmission and 10,000 bits of a 1Mbps source
10. 10.10
Error Detection & Correction Concepts
ā¼ Error detection: find out whether an errors has occurred
ā¼ Error correction: find the exact number of corrupted bits
and their exact location within the message
ā¼ Error detection is the first step towards error correction
ā¼ Error detection and correction use the concept of
redundancy, which is adding extra bits to the data unit
ā¼ The extra bits carry information about the data unit that
help find out whether any change may have happened to
the data unit at the receiver side
ā¼ The extra bits are discarded as soon as the accuracy of
the transmission has been determined
11. 10.11
To detect or correct errors, we need to
send extra (redundant) bits with data.
Note
12. 10.12
Forward Error Correction vs. Retransmission
ā¼ Error correction by retransmission
ā¼ If error is detected, the sender is asked to retransmit
ā¼ Forward Error Correction (FEC):
ā¼ The receiver uses an error correcting code, which automatically
corrects certain types of errors
ā¼ Theoretically, any error can be automatically corrected
ā¼ Error correction is harder than error detection and needs more
redundant bits
ā¼ The secret of error correction is to locate the invalid bits
ā¼ To locate a single-bit error in a data unit, you need enough
redundant bits to cover all states of change in the data bits as
well as the redundant bits and the no-change case
13. 10.13
Coding
ā¼ Redundancy is achieved via coding schemes as follows:
ā¼ Sender adds extra bits to the data bits based on a certain relationship (e.g.
CRC circuit)
ā¼ Receiver checks the relationship in order to detect and/or correct errors
ā¼ Two factors of coding schemes to observe:
ā¼ The ratio of the redundant (r) bits to the data bits (d)ā (r/d)
ā¼ The robustness of the whole process (does not give false info)
ā¼ Categories of coding schemes:
1. Block coding ( we cover it in this chapter)
2. Convolution coding (not covered here)
14. 10.14
Modular Arithmetic (X mod-N)
ā¼ Use a limited number of integers
ā¼ Define an upper limit called modulus, N
ā¼ Use only the integers from 0 to N-1, inclusive
ā¼ This is called modulo-N arithmetic
ā¼ If a number is greater than N, it is divided by N and
the remainder is the result
ā¼ If a number is negative, add as many Nās as needed to
make it positive
ā¼ There is no carry out when numbers are added or
subtracted
ā¼ In modulo-2 arithmetic, the addition and subtraction
are similar and are performed using the bit-wise XOR
function
16. 10.16
10-2 BLOCK CODING
In block coding,
ā¢ we divide our message into blocks, each of k bits,
called datawords.
ā¢ Then, we add r redundant bits to each block to
make the length n:
ā¢ n = k + r. The resulting n-bit blocks are called
codewords.
ā¢ Error Detection
ā¢ Error Correction
ā¢ Hamming Distance
ā¢ Minimum Hamming Distance
Topics discussed in this section:
k: dataword;
r: redundant bits
n: codeword
18. 10.18
The 4B/5B block coding discussed in Chapter 4 is a good
example of this type of coding.
In this coding scheme, k = 4 and n = 5,
ā¢ No. of datawords=2k = 16
ā¢ No. of codewords= 2n = 32.
We saw that 16 out of 32 codewords are used for message
transfer and the rest are either used for other purposes or unused.
Example 10.1
20. 10.20
Let us assume that k = 2 and n = 3. Table 10.1 shows the list of datawords and
codewords. Later, we will see how to derive a codeword from a dataword.
Assume the sender encodes the dataword 01 as 011 and sends it to the receiver.
Consider the following cases:
1. The receiver receives 011. āIt is a valid codewordā The receiver extracts the
dataword 01 from it.
2. The codeword is corrupted during transmission, and 111 is received. This is
not a valid codeword and is discarded.
3. The codeword is corrupted during transmission, and 000 is received. This is a
valid codeword. The receiver incorrectly extracts the dataword 00.
Two corrupted bits have made the error undetectable.
Example 10.2
Table 10.1 A code for error detection (Example 10.2)
21. 10.21
ā¢ An error-detecting code can detect
only the types of errors for which it is
designed;
ā¢ other types of errors may remain
undetected.
Note
23. 10.23
ā¢ Let us add more redundant bits to Example 10.2 to see if the
receiver can correct an error without knowing what was actually
sent.
ā¢ We add 3 redundant bits to the 2-bit dataword to make 5-bit
codewords. Table 10.2 shows the datawords and codewords.
ā¢ So, k=2, r=3,ān=2+3=5 bits
Example 10.3
24. 10.24
ā¢ Assume the dataword is d= 01. The sender creates the codeword
01011.
ā¢ The codeword is corrupted during transmission, and 01001 is
received.
ā¢ First, the receiver finds that the received codeword is not in the
table.
ā¢ This means an error has occurred. The receiver, assuming that
there is only 1 bit corrupted, uses the following strategy to guess
the correct dataword.
Example 10.3
25. 10.25
ā¼ Codeword sent = 01011, Codeword received = 01001
ā¼ 01001 vs. 00000 ā 2 bit difference ļ
ā¼ 01001 vs. 10101 ā 3 bit difference ļ
ā¼ 01001 vs. 11110 ā 4 bit difference ļ
ā¼ 01001 vs. 01011 ā 1 bit difference āŗ
1. The receiver will compare received code word with all the valid
codewords looking number of difference in bits.
2. It will choose the least difference
Compare 01001
with all
codewords
difference=
Hamming
distance
26. 10.26
The Hamming distance between two
words is the number of differences
between the corresponding bits.
Note
d=Hamming
distance
27. 10.27
Let us find the Hamming distance between two pairs of
words.
1. The Hamming distance d(000, 011) is 2 because
Example 10.4
2. The Hamming distance d(10101, 11110) is 3 because
d=Hamming
distance
28. 10.28
The minimum Hamming distance (dmin) is
the smallest Hamming distance between
all possible pairs in a set of words.
Note
29. 10.29
Find the minimum Hamming distance of the coding
scheme in Table 10.1.
Solution
We first find all Hamming distances.
Example 10.5
The dmin in this case is 2.
30. 10.30
Find the minimum Hamming distance of the coding
scheme in Table 10.2.
Solution
We first find all the Hamming distances.
The dmin in this case is 3.
Example 10.6
31. 10.31
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.
Note
32. 10.32
The minimum Hamming distance for our first code scheme (Table
10.1) is 2. This code guarantees detection of only a single error.
ā¢ For example, if the third codeword (101) is sent and one error
occurs, the received codeword does not match any valid
codeword.
ā¢ e.g. send 101āreceived 111 (detected ābecause not a valid
code),
ā¢ If two errors occur, however, the received codeword may match a
valid codeword and the errors are not detected.
āe.g: send 101āreceived 000 (considered validā not detetcted)
Example 10.7
dmin = s + 1.
s=1
33. 10.33
Our second block code scheme (Table 10.2) has dmin = 3. This code
can detect up to two errors. Again, we see that when any of the
valid codewords is sent, two errors create a codeword which is not
in the table of valid codewords. The receiver cannot be fooled.
However, some combinations of three errors change a valid
codeword to another valid codeword. The receiver accepts the
received codeword and the errors are undetected.
Example 10.8
dmin = s + 1.
s=2
34. 10.34
To guarantee correction of up to t errors
in all cases, the minimum Hamming
distance in a block code
must be dmin = 2t + 1.
Note
35. 10.35
A code scheme has a Hamming distance dmin = 4. What
is the error detection and correction capability of this
scheme?
Solution
This code guarantees the detection of up to three errors
(s = 3), but it can correct up to one error. In other words,
if this code is used for error correction, part of its
capability is wasted.
ā¢ Error correction codes need to have an odd
minimum distance (3, 5, 7, . . . ).
Example 10.9
dmin = s + 1.
s=3
dmin = 2t + 1.
t=?
36. 10.36
10-3 LINEAR BLOCK CODES
ā¢ Almost all block codes used today belong to a
subset called linear block codes.
ā¢ A linear block code is a code in which the
exclusive OR (addition modulo-2) of two valid
codewords creates another valid codeword.
ā¢ Codeword1 (xor) codeword2ācodeword3
1. Minimum Distance for Linear Block Code
2. Example of Linear Block Codes
Topics discussed in this section:
37. 10.37
In a linear block code, the exclusive OR
(XOR) of any two valid codewords
creates another valid codeword.
Note
38. 10.38
1. The scheme in Table 10.1 is a linear block code because
ā¢ the result of XORing any codeword with any other
codeword is a valid codeword.
ā¢ For example, the XORing of the second and third codewords
creates the fourth one.
ā¢ 101 + 011 = 110 (cod #4 in the table)
2. The scheme in Table 10.2 is also a linear block code. We can
create all four codewords by XORing two other codewords.
Example 10.10
39. 10.39
Note: The minimum Hamming distance for a linear block code is the
smallest number of 1ās in the nonzero codewords
In (Table 10.1), the numbers of 1s in the nonzero codewords are 2, 2,
and 2. So the minimum Hamming distance is dmin = 2.
In (Table 10.2), the numbers of 1s in the nonzero codewords are 3, 3,
and 4. So in this code we have dmin = 3.
Example 10.11
40. 10.40
A simple parity-check code is a single-bit
error-detecting code in which n = k + 1
with dmin = 2.
āi.e. #. of r bits= 1 bit extra
ā Even parityā add 1ās so total numbers of 1ās is even
parity-check code
43. 10.43
How it works?
To send (a3 a2 a1 a0 : 1011)ā p=1ācodeword = (a3 a2 a1 a0 r0 10111)-----> sent to
the receiver. We examine five cases:
1. No error occurs;
āthe received codeword is (b3 b2 b1 b0 q0: 10111. āsyndrome S= 0 (no
error) āextracted dataword 1011.
2. One error a1 is changed.
ā received codeword is 10011 ā S= 1 (error)ā discard data.
3. One error: r0 is changed:
āreceived codeword is 10110āS=1 (error)ā discard data.
4. Two errors: r0 & a3 are changed:
āreceived codeword is 00110ā S=0 (no error: false!) ā dataword 0011 is
created at the receiver.
āNote that here the dataword is wrongly created due to the syndrome
value.
5. Three errors: a3, a2, a1 are changed āThe received codeword is 01011.
āS=1 (error) āThe dataword is not created.
****This shows that the simple parity check, guaranteed to detect one single
error, can also find any odd number of errors.
Example 10.12
45. 10.45
Figure 10.11 Two-dimensional parity-check code
ā¼ Data words are organized in a table (rows & columns)
ā¼ For each row and each column, a parity-check bit is
added
Parity bits
47. 10.47
Performance of the Two-Dimensional
Parity Check
Two-Dimensional Parity Check can do the following
ā¼ Guarantee to detect single error
ā¼ Increases the likelihood of detecting burst errors
ā¼ It fails if the error bits are in exactly the same positions
in two different data units
ābecause the changes will cancel each other in this case
48. 10.48
The Hamming Error Correction Codes
Hamming codes can be used in Error Detection and correction
ā¼ The category of Hamming codes discussed here is with
dmin= 3:
ā2-bit detection & 1-bit correction
ā¼ We need to choose an integer mā„3 such that:
ā¼ n=2m-1 & k=n-m (i.e. n=k+m)
ā¼ The number of check bits r=m
ā¼ For example:
ā¼ If m=3, then n=7 & k=4
ā¼ This is Hamming Code C(7,4) with dmin= 3
ā¼ Each code word = a3 a2 a1 a0 r2 r1 r0
51. 10.51
Table 10.5 Logical decision made by the correction logic analyzer
ā¼ The 3-bit syndrome represent 1 out 8 different error conditions
as shown in the table
ā¼ The decoder is only concerned with the conditions in the table
that are not shaded (i.e. data:b3b2b1b0), in which a data bit has
been flipped
s2 s1 s0
s2 s1 s0 =001āq0
q0 in 1st equation
s2 s1 s0 =111āb1
b1 in all equations
52. 10.52
Let us check some cases:
1. No error: d=dataword 0100 ā c=codeword= 0100011.
āreceived: b=0100011. S=000 (no error)ā dataword = 0100.
2. One error: d=0111 ā c=0111001
āreceived b=0011001, S=011 (error in b2)ācorrect(flip b2)
āthe final dataword is 0111 (correct).
3. Two errors: d=1101ā c= 1101000.
āreceived b= 0001000, S=101 (error b0), correct(flip b0)
āthe final dataword is 0000 (false data)
āThis shows that our code detects 2 errors, but cannot correct
Example 10.13
53. 10.53
We need a dataword of at least k>=7 bits. Calculate values
of k and n that satisfy this requirement.
Solution
We need to make k = n ā m >=7, or (2m ā 1) ā m ā„ 7.
1. If we set m = 3, ān = 23 ā 1, and k = 7 ā 3=4, which is
not acceptable.
2. If we set m = 4,ān = 24 ā 1 = 15 and k = 15 ā 4 = 11,
which satisfies the condition. So the code is
Example 10.14
C(15, 11)
C(n, k)
54. 10.54
Performance of the Hamming Code
ā¼ It can detect a 2-bit error
ā¼ It can correct a 1-bit error
ā¼ It can be modified in order to detect burst
errors of size N:
ā¼ It is based on splitting the burst error between N
codewords
ā¼ Convert the frame into N codewords
ā¼ Rearrange the codewords in the frame from row-wise
to column-wise (see the example)
56. 10.56
10-4 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.
ā¢ Cyclic Redundancy Check (CRC)
ā¢ Hardware Implementation
ā¢ Polynomials
ā¢ Cyclic Code Analysis
ā¢ Advantages of Cyclic Codes
ā¢ Other Cyclic Codes
Topics discussed in this section:
60. 10.60
Cyclic Redundancy Check (CRC)
ā¼ At the encoder of the sender:
ā¼ The k-bit dataword is augmented by
appending (n-k) zeros to the right
hand side of it
ā¼ The n-bit result is fed into the
generator
ā¼ The generator uses an agreed-upon
divisor (checker) of size (n-k+1)
ā¼ The generator divides the
augmented dataword by the divisor
using modulo-2 division
ā¼ The quotient of the division is
discarded
ā¼ The remainder is appended to the
dataword to create the codeword
61. 10.61
Cyclic Redundancy Check (CRC)
ā¼ At the decoder of the receiver:
ā¼ The received codeword is divided by the same divisor to create the
syndrome, which has a size of (n-k) bits
ā¼ If all the syndrome bits are zeros, then no error is detected
ā¼ Otherwise, an error is detected and the received dataword is
discarded
62. 10.62
Figure 10.21 A polynomial to represent a binary word
ā¼ The 1ās and 0ās represent the coefficients of the polynomial
ā¼ The power of each term represents the position of the bit
ā¼ The degree of the polynomial is the highest power of it
ā¼ Adding and subtracting the polynomials are done by adding
and subtracting the coefficients of the same-power terms
72. 10.72
Cyclic Code Analysis
ā¼ Define the following cyclic code parameters as
polynomials:
ā¼ Dataword: d(x)
ā¼ Codeword: c(x)
ā¼ Generator: g(x)
ā¼ Syndrome: s(x)
ā¼ Error: e(x)
ā¼ Received codeword = c(x) + e(x)
ā¼ Received codeword/g(x) = c(x)/g(x) + e(x)/g(x)
ā¼ c(x)/g(x) does not have a remainder by definition
ā¼ s(x) is the remainder of e(x)/g(x)
ā¼ If s(x)ā 0, then an error is detected
ā¼ If s(x)=0, then either no error has occurred or the error has not
been detected
ā¼ If e(x) is divisible by g(x), then e(x) canāt be detected
73. 10.73
In a cyclic code,
If s(x) ā 0, one or more bits is corrupted.
If s(x) = 0, either
a. No bit is corrupted. or
b. Some bits are corrupted, but the
decoder failed to detect them.
Note
74. 10.74
In a cyclic code, those e(x) errors that
are divisible by g(x) are not caught.
Note
75. 10.75
Single-Bit Error
ā¼ A single-bit error is e(x)=xi, where i is the
position of the bit
ā¼ If a single-bit error is caught, then xi is not
divisible by g(x) (i.e.; there is a
remainder)
ā¼ If g(x) has, at least, two terms and the
coefficient of x0 is not zero, then e(x) canāt
be divided by g(x). That is, all single-bit
errors will be caught
76. 10.76
If the generator has more than one term
and the coefficient of x0 is 1,
all single errors can be caught.
Note
77. 10.77
Which of the following g(x) values guarantees that a
single-bit error is caught? For each case, what is the error
that cannot be caught?
a. x + 1 b. x3 c. 1
Solution
a. No xi can be divisible by x + 1. Any single-bit error can
be caught.
b. If i is equal to or greater than 3, xi is divisible by g(x).
All single-bit errors in positions 1 to 3 are caught.
c. All values of i make xi divisible by g(x). No single-bit
error can be caught. This g(x) is useless.
Example 10.15
78. 10.78
Figure 10.23 Representation of two isolated single-bit errors using polynomials
ā¼ Two isolated single-bit errors are represented as
ā¼ e(x)= xj + xi = xi (xj-i + 1) = xi (xt + 1)
ā¼ If g(x) has, at least, two terms and the coefficient of x0 is
not zero, then xi canāt be divided by g(x)
ā¼ Therefore, if g(x) is to detect e(x), it must not divide (xt + 1)
where t is the distance between the two error bits and t
should be between 2 and n-1 (n is the degree of g(x))
79. 10.79
If a generator cannot divide xt + 1
(t between 2 and n ā 1),
then all isolated double errors
can be detected.
Note
80. 10.80
Find the status of the following generators related to two
isolated, single-bit errors.
a. x + 1 b. x4 + 1 c. x7 + x6 + 1 d. x15 + x14 + 1
Solution
a. This is a very poor choice for a generator. Any two
errors next to each other cannot be detected.
b. This generator cannot detect two errors that are four
positions apart.
c. This is a good choice for this purpose.
d. This polynomial cannot divide (xt + 1) if t is less than
32,768]
15. A codeword with two isolated errors up to
32,768 15 bits apart can be detected by this generator.
Example 10.16
81. 10.81
A generator that contains a factor of
(x + 1) can detect all odd-numbered
errors.
Note
82. 10.82
ā All burst errors with L ā¤ r will be
detected. (r is the degree of g(x))
ā All burst errors with L = r + 1 will be
detected with probability 1 ā (1/2)rā1.
ā All burst errors with L > r + 1 will be
detected with probability 1 ā (1/2)r.
Note
83. 10.83
Find the suitability of the following generators in relation
to burst errors of different lengths.
a. x6 + 1 b. x18 + x7 + x + 1 c. x32 + x23 + x7 + 1
Solution
a. This generator can detect all burst errors with a length
less than or equal to 6 bits;
3 out of 100 burst errors with length 7 will slip by;
1 ā (1/2)6ā1 = 1 - 1/32 = 0.97
16 out of 1000 burst errors of length 8 or more will slip by. 1 ā
(1/2)6 = 1 ā 1/64 = 0.984
Example 10.17
84. 10.84
b. This generator can detect all burst errors with a length
less than or equal to 18 bits;
8 out of 1 million burst errors with length 19 will slip by;
4 out of 1 million burst errors of length 20 or more will
slip by.
c. This generator can detect all burst errors with a length
less than or equal to 32 bits;
5 out of 10 billion burst errors with length 33 will slip by;
3 out of 10 billion burst errors of length 34 or more will
slip by.
Example 10.17 (continued) Reading
only
85. 10.85
A good polynomial generator needs to
have the following characteristics:
1. It should have at least two terms.
2. The coefficient of the term x0 should
be 1.
3. It should not divide xt + 1, for t
between 2 and n ā 1.
4. It should have the factor x + 1.
Note
86. 10.86
Performance of Cyclic Codes
ā¼ Detect single-bit errors
ā¼ Detect double-bit isolated errors
ā¼ Detect odd number of errors
ā¼ Detect burst errors of length less than or
equal to the degree of the generator
ā¼ Detect, with a very high probability, burst
errors of length greater than the degree of
the generator
ā¼ Can be implemented in either SW or HW
88. 10.88
10-5 CHECKSUM
ā¢ The last error detection method we discuss here is
called the checksum.
ā¢ The checksum is used in the Internet by several
protocols although
ā¢ not used at the data link layer.
ā¢ we briefly discuss it .
ā¢ Idea
ā¢ Oneās Complement
ā¢ Internet Checksum
Topics discussed in this section:
90. 10.90
The concept of check sum as follows:
ā¢ 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.
ā¢ Send : We want to sedn : (7, 11, 12, 0, 6),
āsend (7, 11, 12, 0, 6, -36),
note : -36= -Sum (7, 11, 12, 0, 6), . T
ā¢ The receiver adds (7, 11, 12, 0, 6, -36)=result,
ā If result=0, No errorā accept data
ā else if result ā 0 ā error occurs
ādata are not accepted.
Example 10.18: Concept
91. 10.91
If we we use 4-bit numbers, how can we represent the
number 21 in oneās complement arithmetic using
only four bits?
Solution
The number 21 in binary is 10101 (it needs five bits).
We can wrap the leftmost bit and add it to the four
rightmost bits.
We have (0101 + 1) = 0110 or 6.
Example 10.20
92. 10.92
How can we represent the number ā6 in oneās
complement arithmetic using only four bits?
Solution
ā¢ oneās complement (x)= inverting all bits(x).
ā¢ Positive 6 is 0110; negative 6 is 1001.
ā¢ If we consider only unsigned numbers, this is 9.
ā¢ In other words, the complement of 6 is 9.
ā¢ Another way to find the complement of a number in
oneās complement arithmetic is to subtract the
number from 2n ā 1 (16 ā 1 in this case n=4).
Example 10.21
Checksum = INV (data 1 ā data 2 ā ... ā data n)
96. 10.96
The Internet Checksum
ā¼ The checksum generator subdivides the data unit into
equal-length data units of 16-bit each
ā¼ The data units are added using the 1ās complement
arithmetic such that the total is always n-bit long
ā¼ The data units are binary added normally to give the partial sum
ā¼ The outer carry out is added to the partial sum to give the sum
ā¼ The result is 1ās complemented to give the checksum
ā¼ The checksum is appended to the data unit
ā¼ The checksum checker performs the same operation
including the checksum:
ā¼ If the result is zero, then the data unit has not been altered
97. 10.97
Sender site: (Internet Checksum)
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.
Note
98. 10.98
Receiver site: (Internet Checksum)
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.
Note
101. 10.101
ā Let us calculate the checksum for a text of 8 characters
(āForouzanā).
ā The text needs to be divided into 2-byte (16-bit) words. We use
ASCII (see Appendix A) to change each byte to a 2-digit
hexadecimal number.
ā E.g. F = 0x46 ASCII, o= 0x6F.
ā Figure 10.25 shows how the checksum is calculated at the sender
and receiver sites.
ā In part a of the figure, the value of partial sum for the first
column is 0x36.
ā We keep the rightmost digit (6) and insert the leftmost digit (3) as
the carry in the second column.
ā The process is repeated for each column.
Example 10.23
103. 10.103
Performance of the Checksum
ā¼ Detect all odd number of errors
ā¼ Detect most even number of errors
ā¼ If corresponding bits in different data units of
opposite values are affected, the error will not
be detected
ā¼ Generally weaker than the CRC