Error Control: An Engineering Approach To Computer Networking
Error Control: An Engineering Approach To Computer Networking
■ Detects
◆ all single bit errors
◆ almost all 2-bit errors
◆ any odd number of errors
◆ all bursts up to M, where generator length is M
◆ longer bursts with probability 2^-m
Implementation
■ Hardware
◆ on-the-fly with a shift register
◆ easy to implement with ASIC/FPGA
■ Software
◆ precompute remainders for 16-bit words
◆ add remainders to a running sum
◆ needs only one lookup per 16-bit block
Software schemes
■ Efficiency is important
◆ touch each data byte only once
■ CRC
■ TCP/UDP/IP
◆ all use same scheme
◆ treat data bytes as 16-bit integers
◆ add with end-around carry
◆ one’s complement = checksum
◆ catches all 1-bit errors
◆ longer errors with prob 1/65536
Packet errors
■ Loss
◆ due to uncorrectable bit errors
◆ buffer loss on overflow
✦ especially with bursty traffic
• for the same load, the greater the burstiness, the more the
loss
✦ loss rate depends on burstiness, load, and buffer size
◆ fragmented packets can lead to error multiplication
✦ longer the packet, more the loss
Types of packet errors (cont.)
■ Duplication
◆ same packet received twice
✦ usually due to retransmission
■ Insertion
◆ packet from some other conversation received
✦ header corruption
■ Reordering
◆ packets received in wrong order
✦ usually due to retransmission
✦ some routers also reorder
Packet error detection and correction
■ Detection
◆ Sequence numbers
◆ Timeouts
■ Correction
◆ Retransmission
Sequence numbers
■ In each header
■ Incremented for non-retransmitted packets
■ Sequence space
◆ set of all possible sequence numbers
◆ for a 3-bit seq #, space is {0,1,2,3,4,5,6,7}
Using sequence numbers
■ Loss
◆ gap in sequence space allows receiver to detect loss
✦ e.g. received 0,1,2,5,6,7 => lost 3,4
◆ acks carry cumulative seq #
◆ redundant information
◆ if no ack for a while, sender suspects loss
■ Reordering
■ Duplication
■ Insertion
◆ if the received seq # is “very different” from what is expected
✦ more on this later
Sequence number size
■ Static scheme
◆ know RTT a priori
◆ timer set to this value
◆ works well when RTT changes little
■ Dynamic scheme
◆ measure RTT
◆ timeout is a function of measured RTTs
Old TCP scheme
■ Somehow find out which packets lost, then only retransmit them
■ How to find lost packets?
◆ each ack has a bitmap of received packets
✦ e.g. cum_ack = 5, bitmap = 101 => received 5 and 7, but not 6
✦ wastes header space
◆ sender periodically asks receiver for bitmap
◆ fast retransmit
Fast retransmit