Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • How to Read the Diagrams
  • Part 0: What Is a Protocol?10
  • Part 1: Timing and Clocking11
  • Part 2: Encoding and Framing12
  • Part 3: Handshakes13
  • Part 4: Flow Control17
  • Part 5: Transactions19
  • Part 6: Concurrency and Performance17
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
  • Part 9: Deadlock and Liveness13
  • Part 10: Reliability and Recovery20
    • Error Models
    • Parity
    • Hamming Distance
    • CRC
    • ECC and SECDED
    • Forward Error Correction
    • Error Responses
    • Poison and Containment
    • ACK and NAK
    • Sequence Numbers
    • Replay Buffers
    • Go-Back-N or Selective Repeat
    • Idempotency and Safe Replay
    • Link-Level or End-to-End Protection
    • Error Classes and Reporting
    • Recovery and Degradation
    • Interface Protection and Safety
    • The Reliability Budget
    • Protocols Compared: Reliability and Recovery
    • Drills: Reliability and Recovery
  • Part 11: Bring-Up and Link Management10
  • Part 12: Power8
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 10: Reliability and Recovery
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 10: Reliability and Recovery
  4. Forward Error Correction

Part 10 · Reliability and Recovery · Senior (S)

Forward Error Correction

Forward error correction adds enough redundancy for the receiver to fix errors without asking for a resend. When FEC beats replay, what it costs in bandwidth and latency, and why the fastest links now need both.

On this page

    Note

    Level: Senior (S) · Answers: What if bits go wrong?

    Before this: ECC and SECDED, Replay Buffers

    A link doubles its speed by switching from two signal levels to four. The price is a raw bit error rate thousands of times worse. With replay alone, packets would now be resent constantly, and each replay costs a round trip of bandwidth and latency. The link needs to fix most errors where they land, without asking the sender for anything.

    When should a link correct errors itself instead of asking for a resend?

    The obvious answer, and why it breaks

    The obvious recovery is detection plus replay: a CRC catches the bad packet and the sender resends it (lesson 10.11). That is cheap when errors are rare: almost no bandwidth is spent on redundancy, and the occasional replay costs one round trip. As the error rate rises, replays become frequent, each one stalling the link for a round trip, and at a high enough error rate the link spends more time replaying than delivering.

    The idea: correct at the receiver

    Forward error correction (FEC) adds redundancy so the receiver can locate and fix errors itself, like ECC on a link. It costs bandwidth on every block, whether or not an error occurs, and it adds decoding latency to every block. In return, most errors cost nothing extra: no round trip, no stall.

    Detect + replay

    FEC

    Bandwidth overhead

    Small (a CRC per packet), plus a round trip per error

    Fixed (parity symbols on every block)

    Latency

    None normally; a round trip per error

    Decoder latency on every block

    Best when

    Errors are rare

    Errors are frequent enough that replays would hurt

    Handles

    Any error the CRC detects

    Errors up to the code's correcting power; beyond that, must still detect and replay

    Link FEC usually works on symbols of several bits (for example Reed-Solomon codes with 10-bit symbols): a burst that corrupts many bits inside a few symbols costs only a few symbol corrections.

    Worked numbers: when replay stops being cheap

    Illustrative: 256-byte packets, a 500 ns replay round trip at 32 Gb/s.

    Diagram
    Packets per second:                    32e9 / (280 x 8)       ~ 14.3 million
    Raw BER 1e-12: packet errors/s          ~ 0.03     replay time lost: ~0.000002 %
    Raw BER 1e-6:  packet error probability ~ 1 - (1-1e-6)^2240    ~ 0.22%
                   replays per second       ~ 32,000   x 500 ns    = 1.6% of the time stalled
    Raw BER 1e-5:  packet error probability ~ 2.2%    replays/s ~ 320,000  -> 16% stalled
    With FEC correcting nearly all raw errors, replay is again rare; FEC costs a few % of bandwidth and tens of ns

    How real links chose

    Link

    Protection

    PCI Express Gen1 to Gen5

    CRC (LCRC) and replay only.

    PCI Express Gen6

    PAM4 signalling with fixed 256-byte flits: FEC corrects errors inside each flit, a CRC detects what FEC cannot fix, and flit-level replay recovers the rest.

    25G and faster Ethernet

    Reed-Solomon FEC: RS(528,514) with 10-bit symbols (corrects up to 7 symbols) for 25G lanes, RS(544,514) (up to 15) for 50G and 100G PAM4 lanes; frames that are still bad are dropped.

    The pattern of the fastest links is all three layers: FEC fixes the common errors, a CRC catches what FEC missed or miscorrected, and replay (or a higher layer) recovers those rare cases.

    What breaks

    A design (illustrative) added FEC to a link and removed its CRC to save bandwidth, reasoning that FEC fixed everything. Occasionally a burst exceeded the code's correcting power, the decoder miscorrected, and wrong data flowed on with no check left to catch it. FEC reduces errors; it does not replace detection.

    Why this matters

    Principal lens. Choose between replay, FEC, or both from the raw error rate at the target speed, the round-trip time, and the latency budget. Model the replay stall fraction across the error-rate range (lesson 10.18); where it becomes significant, FEC pays for itself. Always keep detection behind FEC, because a correcting code that is overwhelmed fails silently by miscorrecting.

    Interview

    Asked: "Why did PCIe 6 add FEC?"

    Weak answer: To be more reliable.

    Strong answer: Because moving to PAM4 to double the rate raised the raw bit error rate by orders of magnitude, and with replay alone, packets would be resent so often that the round trips would eat a large share of the bandwidth and latency. So Gen6 groups data into fixed 256-byte flits with FEC that corrects most errors in place for a small fixed cost, keeps a CRC to detect what FEC can't fix, and replays only those rare flits. It's the trade between a fixed overhead on every block and a round trip per error.

    Follow-ups: (1) Why keep a CRC behind the FEC? (2) Why do link FECs work on symbols rather than bits?

    Check yourself With 2,240-bit packets and BER 1e-6, roughly what fraction of packets are bad?

    About 2,240 × 1e-6 ≈ 0.22%.

    Check yourself What does FEC cost even when there are no errors?

    The parity symbols on every block (bandwidth) and the decoder's latency on every block.

    Key takeaways

    • FEC corrects errors at the receiver: a fixed bandwidth and latency cost on every block, but no round trip per error.

    • Replay is cheaper while errors are rare; FEC wins once replays would stall the link noticeably.

    • Fast links layer FEC, a CRC behind it, and replay for what FEC cannot fix.

    Keep going

    Next: Lesson 10.7, Error Responses. Telling the requester something went wrong: target errors and decode errors.

    Related topics

    • Part 10 overview: Reliability and Recovery

    Previous

    147 / 234

    Next: Error Responses

    Up next

    Up nextError Responses

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Error Models
    • Parity
    • Hamming Distance