---
title: "Error correction vs detection, bit stuffing"
subject: "Computer Networks and Security"
chapter: 3
key: "semester_7/computer_networks_and_security:error-correct-detect-bitstuff"
source: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/error-correct-detect-bitstuff
site: BCT Engineering
---

# Error correction vs detection, bit stuffing

Computer Networks and Security · Chapter 3: Data Link Layer

- Asked in: 2070 Chaitra, 5+3 marks
- Video: [Lec-28: Introduction to Error detection and Correction | Computer Networks](https://www.youtube.com/watch?v=U7-h2hyM1Dc) — Gate Smashers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/error-correct-detect-bitstuff
- Whole chapter: https://www.bctengineer.com/md/semester_7/computer_networks_and_security/chapter-3

## Question

What is the difference between Error Correcting and Error Detection process? A bit string 01111011111011111110 needs to be transmitted at the data link layer. What is the string actually transmitted after bit stuffing, if the flag pattern is 01111110?

## Short answer

Error detection only identifies errors and requests retransmission; error correction identifies and corrects errors without retransmission. For bit stuffing with flag 01111110, insert a 0 after five consecutive 1s. The transmitted string is 0111101111100111110110.

## Answer

#### Error correction vs error detection
| Point | Error detection | Error correction |
|---|---|---|
| Purpose | Only finds whether an error has occurred | Finds and corrects the error without retransmission |
| Redundancy | Fewer redundant bits | More redundant bits |
| Method | Parity, checksum, CRC | Hamming code, convolutional codes (FEC) |
| Action after error | Discard frame and ask for retransmission (ARQ) | Receiver fixes the bits itself |
| Complexity | Simple | Complex |
| Use | Reliable links (Ethernet) | Noisy links, satellite, where retransmission is costly |

#### Bit stuffing numerical
Rule: with flag 01111110, insert a **0** after every five consecutive 1s of the data.

Data: 01111011111011111110 (20 bits).

```text
 original : 0 1111 0 11111 0 1111111 0
 stuffed  : 0 1111 0 11111[0] 0 11111[0] 11 0
```

| Segment | Result |
|---|---|
| 0 1111 0 | 011110 (no run of five 1s, sent unchanged) |
| 11111 0 | five 1s, so insert 0: 111110, then the original 0 |
| 1111111 0 | after five 1s insert 0: 111110, then 11, then 0 |

Stuffed bit string (22 bits): **0111101111100111110110**

Transmitted frame with flags: 01111110 **0111101111100111110110** 01111110.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which statement is correct?
   A. Detection fixes errors itself
   B. Correction needs more redundant bits than detection
   C. Detection uses Hamming code
   D. Correction is for reliable links only
   Answer: B. Correction (e.g. Hamming) needs more redundancy; detection only finds errors and relies on retransmission. (Key point: Detection vs correction)

2. What happens when an error is detected only?
   A. Receiver corrects it
   B. Frame discarded and retransmission requested (ARQ)
   C. Ignored
   D. Parity added
   Answer: B. Detection-only schemes use ARQ. (Key point: Action after detection)

3. Where is error correction preferred?
   A. Reliable Ethernet
   B. Noisy links like satellite where retransmission is costly
   C. Local loopback
   D. Short cables
   Answer: B. FEC avoids costly retransmissions. (Key point: Where FEC is used)

4. The stuffed string for 01111011111011111110 is:
   A. 0111101111100111110110
   B. 0111101111101111110110
   C. 0111110111110111111010
   D. 0111101111100111111110
   Answer: A. A 0 is inserted after each run of five 1s, giving 22 bits. (Key point: Stuffed output)

## Related in Computer Networks and Security

- [Bit stuffing of a given string (1)](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Abit-stuffing-numerical-1) — Computer Networks and Security, chapter 3
- [Functions of data link layer](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Adll-functions) — Computer Networks and Security, chapter 3, asked 3×
- [Data link layer framing](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aframing-mechanisms) — Computer Networks and Security, chapter 3, asked 3×

## Related in other subjects

- [Error detection vs correction; rate ½ convolutional encoder](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aerror-detect-correct-conv-half-rate) — Communication Systems, chapter 8
- [Short note: Error detection and correction capability](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ashort-note-error-detect-correct-capability) — Communication Systems, chapter 8
- [Error detection in serial data transmission](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aserial-error-detection) — Instrumentation II, chapter 3, asked 2×
