DLL Error Detection
DLL Error Detection
Error Detection
Ashutosh Bhatia
BITS Pilani
[email protected]
Recap
Frame-by-Frame next-hop delivery
Covered framing and overview of error-control
Hamming distance of a code determines the error
detection and correction capabilities
Packets Packets
Frames
Data Link Data Link
Bits
PHY PHY
Node-1 Node-2
General Approach
Add redundant information to a frame
At Sender:
Add k bits of redundant data to a m bit message
k << m; k = 32; m = 12,000 for Ethernet
k derived from original message through some algorithm
At Receiver:
Reapply same algorithm as sender to detect errors; take
corrective action if necessary
Parity Bit
Even Parity: 1100, send 11000
Detects odd number of errors
1101001 0 Used by BISYNC protocol for
1011110 1 ASCII characters
1001000 0
1111001 1
0000110 0
7 bits)
Catches all 1, 2, 3 bit errors and
Parity Bits
most 4 bit errors
Data
Internet Checksum
Used at the network layer (IP header)
Algorithm:
View data to be transmitted as a sequence of 16-bit integers.
Add the integers using 16 bit one's complement arithmetic.
Take the one's complement of the result this result is the
checksum
Receiver performs same calculation on received data and
compares result with received checksum
Example
Sender: IPV4 header in hexadecimal
4500 0073 0000 4000 4011 c0a8 0001 c0a8 00c7 (16-bit words)
Sum up the words (can use 32 bits): 0002 479c
Add carry to the 16-bit sum: 479e
Take the complement: b861 checksum
Receiver:
Sum up the words including checksum (use 32 bits): 2fffd
Add carry to the 16 bit sum: ffff no error
was detected
example values from wikipedia
Internet Checksum
Not very strong in detecting errors
Pair of single-bit errors, one which increments a
word, other decrements a word by same amount
Why is it used still?
Very easy to implement in software
Majority of errors picked by CRC at link-level
(implemented in hardware)
Cyclic Redundancy Check (CRC)
Implies E(1) = 1
If C(x) were a factor of E(x), then C(1) would also have to
be 1
If C(1) = 0, we can conclude C(x) does not divide E(x)
If C(x) has some factor of the form x^i+1, then C(1)=0
Capabilities
All single-bit errors, if xk and x0 have non-zero
coefficients
All double-bit errors, if C(x) has at least three
terms
All odd bit errors, if C(x) contains the factor (x +
1)
Any bursts of length <= k, if C(x) includes a
constant term (x0 term)
CRC is easily implementable on shift registers
Summary
Important to detect errors in frames
Many techniques exist (simple to complex)
Parity, Checksum, CRC
Going Forward: Error Recovery