Title: Error Detection, Correction and Control
1Error Detection, Correction and Control
- Rong Wang
- CGS3285
- Spring 2004
2RECOMMENDED READING
- From textbooks
- Page 117 123 of Data Communications From
Basics to Broadband, 3rd Edition by William J.
Beyda (ISBN 0-13-096139-6) - Chapter 10 11 of Data Communications and
Networking, 3rd Edition, Behrouz A. Forouzan
(ISBN 0-07-251584-8)
3TRANSMISSION ERROR
- A bit is altered between transmission and
reception - Where does errors come from?
- Electrical Interference
- Power surges
- Noise, static, echoes, cross-talk
- Signal degradation
- Type of error
- Single-bit error isolated, does not affect
nearby error (e.g., white noise) - Burst error a cluster of bits involved (faded
signal)
4ERROR DETECTION METHODS
- Echo Checking
- Receiver returns copy of data back to sender
- Ignore Parity Checking
- Used if sender or receiver unable to process
parity bits - Primitive Parity Checking
- Mark - Always send a 1
- Space - Always send a 0
- 12.5 chance of detecting a 1-bit error
- Simple Parity Checking
- Even - Make of 1s in character even
- Odd - Make of 1s in character odd
- 50 chance of detecting a 1-bit error
5ASCII CHARACTER TRANSMISSION WITH DIFFERENT
PARITIES
6EVEN PARITY CHECKING AND BIT ERRORS
7ERROR DETECTION METHODS (cont.)
- Multi-bit Parity
- Cyclical Parity
- Uses two (2) parity bits
- Fooled only by errors in certain bit combinations
- Increases overhead in both data transmitted and
processing time
8FIGURE 6-3 CYCLICAL ODD PARITY CHECKING
9ERROR DETECTION METHODS (cont.)
- Multi-bit Parity (continued)
- Hamming Code (forward error correction)
- Form of forward error correction
- Can detect and repair single-bit errors
- Uses seven (7) data bits
- Bit Positions 3, 5, 6, 7, 9, 10, 11
- Uses four (4) parity bits
- Bit Position 1 Bits 3, 5, 7, 9, 11
- Bit Position 2 Bits 3, 6, 7, 10, 11
- Bit Position 4 Bits 5, 6, 7
- Bit Position 8 Bits 9, 10, 11
- Sum of parity bits with errors is bad data bit
- Increases overhead in both data transmitted and
processing time
10FIGURE 6-4 HAMMING w/ EVEN PARITY
11ERROR DETECTION METHODS (cont.)
- Synchronous Block Methods
- Checksum
- Use simple arithmetic to generate a checksum
remainder which is appended to end of message - Sender creates checksum as block is transmitted
then appends to end of block - Receiver generates checksum as block is received
then compares with senders checksum - If error, receiver asks for re-transmission of
block - Requires checksum and block sequence number
- Cyclical Redundancy Check (CRC)
- Similar to check sum but uses more complex
mathematical formulas to catch/exaggerate errors
12ERROR DETECTION / CORRECTION SUMMARY
- Error detection correction designed to preserve
the INTEGRITY of transmitted data -- not SECURITY - Detection is relatively easy
- Correction is harder
- Retransmission is simplest approach
- Both sender and receiver must use same
detection/correction method - Type of method and algorithms specified by
protocol
13DATA LINK ERROR CONTROL (CONT)
- Error control
- Based on automatic repeat request, which is the
retransmission of data - Type of error handled
- Lost frame
- Damaged frame
- Techniques for error control
- Error detection
- Positive acknowledgement
- Retransmission after timeout
- Negative acknowledgement and retransmission
- Note data link layer divides the stream of bits
received into manageable data units called
frames.
14DATA LINK ERROR CONTROL (CONT)
- Stop Wait ARQ (Half Duplex)
- Receiver responds to each block (ACK / NAK /
WACK) - Sender waits for response before sending further
blocks - Continuous ARQ (Full Duplex)
- Blocks sent continuously without waiting for
confirmation - If error message returned to sender,
- Types of continuous ARQ
- Go-Back-N restart transmission at the Nth frame
- Selective Repeat retransmit the selected frame
only
15STOP-AND-WAIT ARQ
- Note To avoid duplication, data frames are
alternately labeled with 0 or 1, thus
acknowledgement (ACK) frames are also numbered 0
and 1 alternately. - Normal Operation
- Sender sends frame 0 and waits to receive ACK 1
- When ACK 1 is received, it sends frame 1 and then
waits to receive ACK0 - repeat from step 1 and 2 and so on.
- The ACK must be received before the time set for
each frame expires
16STOP-AND-WAIT ARQ (CONT)
- Lost or Damaged Frame
- A lost or damaged frame is handled in the same
way by the receiver - When the receiver receives a damaged frame, it
discards it - The receiver remains silent about a lost frame
and keeps its value of R - After the timer at the sender site expires,
another copy of frame 1 is sent
17STOP-AND-WAIT ARQ (CONT)
- Lost or Damaged Acknowledgement
- If the sender receives a damaged ACK, it discards
it. - When the timer for a frame expires, the sender
retransmits the frame.
18STOP-AND-WAIT ARQ (CONT)
- Delayed Acknowledgement
- An acknowledge can be delayed at the receiver or
by some problem with the link - If receiver receives a duplicated frame, it
discards the duplicated frame
19STOP-AND-WAIT ARQ (CONT)
- Piggybacking
- A method to combine a data frame with an
acknowledgement in case both sender and the
receiver have data to send.
20GO-BACK-N ARQ
- Sequence Numbers
- Frame from a sending station are numbered
sequentially. If the header of the frame allows m
bits fro the sequence number, the sequence
numbers range from 0 - Sender Sliding Window
- Sender uses window to hold the outstanding frames
until they are acknowledged - Frames to the left of the window are those that
have already been acknowledged and can be purged - Frames to the right of the window can not be sent
until the window slides them
21GO-BACK-N ARQ (CONT)
- Receiver Sliding Window
- Size of the window is always 1
- The receiver is always looking for a specific
frame to arrive in a specific order
22GO-BACK-N ARQ (CONT)
- Control Variables
- The sender has three variables
- S holds the sequence number of the recently sent
frame - holds the sequence number of the last
frame in the window - Holds the sequence number of the first
frame in the window - Size of the window
- The receiver only has one variable R, that holds
the sequence number of the frame it expects to
receive
23GO-BACK-N ARQ (CONT)
24GO-BACK-N ARQ (CONT)
25GO-BACK-N ARQ(CONT)
26GO-BACK-N ARQ(CONT)
- Problem
- No out-of-order frames
- Not efficient
- Multiple frame may be retransmitted
27SELECTIVE REPEAT ARQ
- Only damaged frame is resent
- Sender and receiver windows
- Size of the senders window must be one half of
- Size of the receivers window must be same as the
senders - Negative acknowledgement (NACK) is used to define
damaged frame
28SELECTIVE REPEAT ARQ (CONT)
29SELECTIVE REPEAT ARQ (CONT)