Sub topic 1
Why frames get corrupted: single-bit and burst errors
Prerequisites
This chapter assumes you know the following:
- The layered network model, and that the data link layer moves frames between directly connected nodes.
- Binary numbers and bitwise XOR.
- Bandwidth (bits per second) and the difference between transmission delay and propagation delay.
- Basic probability, such as the chance of independent events.
Where errors come from
A physical medium does not deliver bits perfectly. The receiver samples a voltage, light level or radio signal and decides whether it is a 0 or a 1. Anything that moves the signal across the decision threshold flips a bit.
The common causes are:
- Thermal noise. Random electron motion in the medium and the receiver. It is always present and affects bits independently.
- Impulse noise. A short, strong spike, such as a nearby motor switching on, lightning, or a relay closing. It lasts for a period of time and damages every bit sent during that period.
- Crosstalk. Signal energy leaking from one wire pair into a neighbouring pair.
- Attenuation and distortion. The signal weakens and spreads out over distance, so adjacent bits blur into each other (intersymbol interference).
- Fading and interference. In wireless links, multipath reflections and other transmitters cancel or overwhelm the signal for a short time.
- Synchronisation loss. If the receiver's clock drifts, it samples at the wrong moments.
The link layer cannot prevent these causes. It can only detect that a frame arrived damaged, and sometimes repair it.
Single-bit errors
A single-bit error means exactly one bit in the frame changed, and every other bit is intact. A 1 becomes a 0, or a 0 becomes a 1.
Single-bit errors are the pattern you get when noise is independent from bit to bit. The usual model is a bit error rate (BER) p, the probability that any one bit is flipped. If errors are independent, a frame of n bits arrives with no error with probability (1 - p)^n. The probability of at least one error is therefore:
P(frame damaged) = 1 - (1 - p)^n
Even a tiny BER matters for long frames. The program below computes this for a 1500-byte frame (12 000 bits) at p = 10^-6.
import math
def frame_error_probability(p: float, n_bits: int) -> float:
# 1 - (1 - p)^n, written with log1p/expm1 to stay accurate for tiny p
return -math.expm1(n_bits * math.log1p(-p))
print(round(frame_error_probability(1e-6, 12_000), 4)) # 0.0119About 1.2% of these frames are damaged, even though only one bit in a million is bad. For small p, the approximation n * p gives almost the same figure (0.012).
Burst errors
A burst error means that two or more bits in a data unit were corrupted within a short stretch. The length of a burst is measured from the first corrupted bit to the last corrupted bit, inclusive. Bits inside that span can still be correct.
For example, if bits 3 and 7 (counting from 0) are flipped and bits 4, 5 and 6 are unchanged, the burst length is 7 - 3 + 1 = 5. Only two bits are wrong, but the burst is 5 bits long.
Bursts are the dominant pattern on real links, because their causes (impulse noise, fading, crosstalk) last for a duration, not for a single bit time. The number of bits a noise event can damage depends on the data rate:
bits affected ≤ data rate × noise duration
A 1 ms noise spike corrupts up to 1000 bits at 1 Mbps, but up to 10 000 bits at 10 Mbps. Faster links lose more bits to the same disturbance. Not every bit in the span is necessarily flipped, because a corrupted bit may happen to equal the original one. That is why the span, not the count of flipped bits, defines burst length.
The next program finds the number of bit errors and the burst length by comparing a sent frame with a received frame.
def error_report(sent: str, received: str):
if len(sent) != len(received):
raise ValueError("frames must have the same length")
diff = [i for i, (a, b) in enumerate(zip(sent, received)) if a != b]
if not diff:
return 0, 0
return len(diff), diff[-1] - diff[0] + 1
sent = "1011001001110101"
single = "1011001000110101" # bit 9 flipped
burst = "1010001101110101" # bits 3 and 7 flipped
print(error_report(sent, single)) # (1, 1)
print(error_report(sent, burst)) # (2, 5)The result is a pair (bits in error, burst length). A single-bit error is the special case where both numbers are 1.
Why the distinction matters
Error-detecting codes are judged by which patterns they catch, so you need both models.
| Property | Single-bit error | Burst error |
|---|---|---|
| Bits damaged | Exactly 1 | 2 or more, within one span |
| Typical cause | Thermal noise | Impulse noise, fading, crosstalk |
| Grows with data rate? | No | Yes, for the same noise duration |
| Ease of detection | Easiest | Harder, since several bits may cancel each other |
Two consequences come up repeatedly in GATE questions and in the chapters that follow:
- A code that catches all single-bit errors can still miss some bursts. A single parity bit catches every odd number of flips but misses every even number. A burst that flips exactly two bits passes the check.
- Codes are designed around burst length. A CRC with
rcheck bits is built to catch every burst of length up tor, which is why it is the standard choice on real links.
Correction is more expensive than detection. A code that can fix errors needs many more redundant bits, so links with a low error rate (such as fibre and wired Ethernet) usually only detect errors and rely on retransmission. Links with a high error rate or long delays (wireless, satellite) often add forward error correction, which repairs errors without waiting for a retransmission.
Summary of the model
- Noise changes bits. The link layer detects the resulting damage with redundant bits added to each frame.
- Independent noise produces single-bit errors, and a frame's error probability is
1 - (1 - p)^n. - Noise that lasts for a duration produces burst errors, and the number of bits at risk is the data rate times the duration.
- Burst length is measured from the first to the last corrupted bit, inclusive.
- Later chapters (parity, Hamming distance, checksum, CRC) are compared by which of these two patterns they detect.
Exercise
A 10 Mbps link suffers a 2 ms burst of impulse noise. (a) What is the maximum number of bits that can be corrupted? (b) A receiver compares a sent frame with the received one and finds that only bits 12 and 40 (counting from 0) differ. How many bits are in error, and what is the burst length?
Show answer
(a) Bits affected ≤ data rate × duration = 10 × 10^6 bits/s × 2 × 10^-3 s = 20 000 bits. (b) Two bits are in error. The burst length is 40 - 12 + 1 = 29, because it is measured from the first to the last corrupted bit, inclusive.
Exercise
A link has an independent bit error rate of 10^-5 and sends frames of 1000 bits. Roughly what fraction of frames are damaged? Explain whether the real fraction is likely to be higher or lower if the errors actually arrive in bursts.
Show answer
P = 1 - (1 - 10^-5)^1000 ≈ 1000 × 10^-5 = 0.01, so about 1% of frames. If the same average BER arrives in bursts, the bad bits are concentrated in fewer frames, so the fraction of damaged frames is lower than 1%, although each damaged frame has more bit errors.