Error Detection: 2-Dimensional Parity
Error Detection: 2-Dimensional Parity
Outline
Parity
Checksum
CRC
Spring 2007
CSE 30264
2-Dimensional Parity
Parity
bits
0101001 1
1101001 0
1011110 1
Data
0001110 1
0110100 1
1011111 0
Parity
byte
Spring 2007
1111011 0
CSE 30264
CSE 30264
Spring 2007
CSE 30264
CRC (cont)
Transmit polynomial P(x) that is evenly divisible
by C(x)
shift left k bits, i.e., M(x)xk
subtract remainder of M(x)xk / C(x) from M(x)xk
CSE 30264
Selecting C(x)
All single-bit errors, as long as the xk and x0 terms have
non-zero coefficients.
All double-bit errors, as long as C(x) contains 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
See Table 2.5 on page 96 for common C(x)
Spring 2007
CSE 30264
Hardware Implementation
Message
x0
x 1 XOR gate
Spring 2007
x2
CSE 30264
Receiver
Fram
Sender
Receiver
Fram
ACK
ACK
Fram
ACK
(a)
Sender
(c)
Receiver
Fram
Sender
Receiver
Fram
ACK
Fram
Fram
e
ACK
ACK
(b)
Spring 2007
(d)
CSE 30264
Stop-and-Wait
Sender
Receiver
Fram
e0
0
ACK
Fram
e1
1
ACK
Fram
e0
0
ACK
Spring 2007
CSE 30264
Stop-and-Wait
Sender
Receiver
CSE 30264
10
Sliding Window
Allow multiple outstanding (un-ACKed) frames
Upper bound on un-ACKed frames, called window
Sender
Spring 2007
Receiver
CSE 30264
11
SW: Sender
Assign sequence number to each frame (SeqNum)
Maintain three state variables:
send window size (SWS)
last acknowledgment received (LAR)
last frame sent (LFS)
Maintain invariant: LFS - LAR <= SWS
< SWS
LAR
Spring 2007
CSE 30264
LFS
12
SW: Receiver
Maintain three state variables
receive window size (RWS)
largest frame acceptable (LFA)
last frame received (LFR)
Maintain invariant: LFA - LFR <= RWS
<
RWS
LFR
LAF
discarded
CSE 30264
13
CSE 30264
14
CSE 30264
15