Data Link Layer and Medium Access Sub Layer · Computer Networks

Error Detection and Correction Fundamentals

Watch lectures
SVGVector Architecture Diagram (SVG)
COMPUTER NETWORKS · Module 2★ High PriorityError Detection and CorrectionIT Sem 6 · Code 100602 · Parity, 2D parity, checksum, FECMNEMONICAdd r redundant bits: n = k + r. Detect and retransmit (ARQ), or correct on the spot (FEC).Parity: odd errors only. 2D parity fixes 1 bit. Checksum: ones complement. CRC: strongest.Core BreakdownError typesSingle-bit: one bit flips. Burst: 2+ bits, length = first to last bad bit.Noise outlasts a bit time: 1 ms of noise at 10 Mbps corrupts up to 10,000 bits.RedundancyAppend r redundant bits to k data bits: codeword n = k + r.Detect: discard and resend (ARQ). Correct (FEC): fix bits, no resend needed.ParitySimple parity: 1 bit makes the count of 1s even (or odd); r = 1.Catches all odd-count errors; misses any even count since two flips cancel out.2D parityRow parity bit per byte plus a column parity byte over all rows.Detects 1-3 bit errors; one bad bit sits where the bad row meets the bad column.ChecksumSplit into 16-bit words, add in ones complement (wrap the carry), then invert.Receiver adds everything including the checksum: all 1s (0xFFFF) means accept.Trade-offDetection + ARQ: few bits (CRC 16-32), cheap, suits LANs that have a return path.FEC (Hamming, Reed-Solomon): more bits, complex, for long-delay or simplex links.Diagram: Redundancy and 2D ParityCodeword: n = k + rk data bitsr redundant2D parity (even), bit (2,3) flipped:10111010001100000011row 2 parity failscol 3 parity fails-> flip bit (2,3)Checksum: add 16-bit words, wrap carry,then invert; receiver sum must be 0xFFFF10011001+11100010 -> 01111100 -> 10000011Parity: catches odd counts, misses even⚠️ Exam Traps & Viva Favorites① Why does parity miss 2 errors?Two flips change the count of 1s by +2, -2 or 0,so the parity stays the same and the erroris invisible to the receiver.② Checksum of 10011001, 11100010?Sum = 101111011 (9 bits), wrap carry:01111011 + 1 = 01111100. Invert it:checksum = 10000011.③ Where is FEC mandatory?Simplex links and deep space: there is no returnpath, or the round trip is too long, so resendingis impractical. The receiver must self-correct.Tip: bursts are common, single bits rareMaster Revision Table(learn it row by row!)MethodRedundancyCatchesFixes errors?Used inSimple parity1 bit per blockAll odd-count errors, no even-countNo, detect onlySerial links, memory2D parity1 per row + 1 byteAll 1, 2, 3 bit errors, most burstsYes, 1 bitTape, older linksInternet checksum16 bitsMost single-word errors; weak on swapsNo, detect onlyIPv4, ICMP, UDP, TCPCRC8 / 16 / 32 bitsBursts up to r bits, all odd countsNo, detect onlyEthernet, Wi-Fi, HDLCHamming coder bits, 2^r >= m+r+1Up to 2 bit errorsYes, 1 bitECC memory, FECReed-Solomon2t check symbolsBurst errors in symbolsYes, t symbolsCD, DVD, QR codes, satellitesQUICK FACTSCodeword n = k + r · a 1 ms noise burst at 10 Mbps corrupts up to 10,000 bitsParity bit r = 1 · checksum is 16 bit · CRC-32 adds 32 bits to Ethernet framesEven parity: total 1s even · ones complement sum of 0xFFFF means no error foundVERIFIED★ Golden rule: redundancy buys detection;more redundancy buys correction.

Error Detection and Correction Fundamentals


1. Introduction: Transmission Errors

During transmission over physical media, electromagnetic noise, thermal interference, attenuation, and line cross-talk can alter the signal, flipping bits from 0 to 1 or 1 to 0.

MermaidDiagram
Rendering diagram…

Types of Errors:

  1. Single-Bit Error:
    • Only one bit in the entire data unit (byte or packet) has changed from 1 to 0 or 0 to 1.
    • Rare in serial data communication because noise duration (TnoiseT_{\text{noise}}) is typically much longer than the duration of a single bit (TbitT_{\text{bit}}).
  2. Burst Error:
    • Two or more bits in the data unit have changed.
    • Length of Burst: Measured from the first corrupted bit to the last corrupted bit (some intermediate bits in between may not be corrupted).
    • Example: In a 10 Mbps10\text{ Mbps} link (Tbit=0.1 μsT_{\text{bit}} = 0.1\text{ }\mu\text{s}), a brief static noise burst lasting 1 ms1\text{ ms} affects up to 10,00010{,}000 bits!
MermaidDiagram
Rendering diagram…

2. Redundancy Principle

To detect or correct errors without seeing the original source message, extra bits called Redundant Bits (rr) are appended to the data bits (kk), creating a longer transmission unit called a Codeword (nn):

n=k+rn = k + r
MermaidDiagram
Rendering diagram…
  • Error Detection: The receiver detects that errors occurred, discards the corrupted frame, and requests retransmission (Automatic Repeat Request - ARQ).
  • Error Correction (Forward Error Correction - FEC): The receiver deduces the exact positions of corrupted bits and flips them back without requiring retransmission (vital for simplex links or high-latency satellite channels).

3. Basic Error Detection Schemes

A. Simple Parity Check

Appends a single redundant parity bit (r=1r = 1) to a data block of kk bits to make the total number of 1s either even or odd.

  • Even Parity: Parity bit is set such that the count of 1s in the codeword is even.
  • Odd Parity: Parity bit is set such that the count of 1s in the codeword is odd.
  • Limitation: Can detect all single-bit errors and any odd number of errors. It fails completely to detect any even number of bit errors (e.g., if two bits flip, the parity remains unchanged).

B. Two-Dimensional (2D) Parity Check

Organizes data into a table (rows and columns). A parity bit is calculated for each row, and a parity byte is calculated for all columns.

SVGVector Architecture Diagram (SVG)
Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Row Parity Byte 1: 1 0 1 1 0 0 1 (0) Byte 2: 0 1 1 0 1 0 0 (0) Byte 3: 1 1 0 1 1 1 0 (1) [Col]: 0 0 0 0 0 1 1 (1) Parity Byte
  • Detection Capability: Detects all 1-bit, 2-bit, and 3-bit errors, and most burst errors.
  • Correction Capability: If a single bit flips, the intersection of the corrupted row and corrupted column pinpoints the exact erroneous bit, allowing 1-bit error correction.

C. Internet Checksum

Used by network/transport layer protocols (IPv4, ICMP, UDP, TCP).

  • Algorithm (Sender):
    1. Data unit is divided into 16-bit words.
    2. All 16-bit words are added using One's Complement Arithmetic (if an overflow carry occurs past 16 bits, it wraps around and is added to the least significant bit).
    3. The final sum is inverted (complemented bitwise) to form the Checksum.
    4. The checksum is sent along with the data.
  • Algorithm (Receiver):
    1. Receiver sums all received 16-bit words including the checksum in one's complement.
    2. If the result is all 1s (0xFFFF, or 0 after complement), the data is accepted as error-free; otherwise, it is rejected.

4. Detection vs. Correction Trade-offs

Parameter Error Detection (with ARQ) Error Correction (FEC)
Redundancy Bits (rr) Very small (16 to 3216\text{ to }32 bits for CRC) Much larger (Hamming, Reed-Solomon)
Bandwidth Overhead Minimal High
Computation Complexity Fast, simple hardware shift registers Complex decoding matrices
Channel Suitability Channels with feedback & low error rate (LANs) Channels with long round-trip delay (Satellites) or no feedback

Frequently Asked Questions

QCalculate the checksum for two 8-bit bytes using 1's complement arithmetic.
  • Byte 1: 10011001, Byte 2: 11100010
  • Sum:
    \begin{array}{r@{\quad}l} & 10011001 \\ + & 11100010 \\ \hline & 101111011 \quad (\text{9-bit result, carry } = 1) \end{array}
  • Wrap-around carry:
    01111011+1=0111110001111011 + 1 = 01111100
  • One's complement (Checksum):
    ∼(01111100)=10000011\sim(01111100) = 10000011
QWhy does Simple Parity fail to detect double-bit errors?

Flipping two bits changes the count of 1s by +2+2, −2-2, or 00. In all cases, the parity (evenness or oddness) remains unchanged, leaving the error completely invisible to the receiver.

QWhat is Forward Error Correction (FEC) and where is it mandatory?

FEC is an error control method where the receiver detects and corrects errors without retransmission. It is mandatory in simplex links (no return path) and deep-space communications where round-trip propagation delay makes retransmission impractical.

QWhat is the difference between a single-bit error and a burst error?

A single-bit error changes exactly one bit in the data unit. A burst error changes two or more bits, and its length is measured from the first to the last corrupted bit. Burst errors are far more common because noise usually lasts longer than one bit time.

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.

← All Computer Networks modules