Coursify

Network Theory

Cyclic Redundancy Check (CRC)

CRC is a highly efficient and widely used error detection mechanism in networks (like Ethernet). It treats binary data as a polynomial, divides it by a predefined divisor polynomial using Modulo-2 arithmetic, and appends the remainder to the frame. A non-zero remainder at the receiver signals a corrupted frame.

Learning Goals

  • Introduction to Cyclic Codes.
  • CRC Mechanism: Generator polynomial, hardware implementation, and polynomial division.
  • CRC Encoder (Modulo-2 binary division at the transmitter) and CRC Decoder (checking the remainder at the receiver).
  • Perform binary Modulo-2 division to calculate the CRC checksum for a given dataword and generator polynomial.
  • Analyze how the choice of the generator polynomial affects the error detection capability of CRC.

Cyclic Redundancy Check (CRC) is a fundamental error-detection code used in the Data Link Layer to detect accidental bit corruption in frames before they are accepted by the receiver.2 In network protocols such as Ethernet and HDLC, the sender computes a short Frame Check Sequence (FCS) from the outgoing frame and appends it to the transmitted bits.2 The receiver repeats the same computation or, equivalently, divides the received codeword by the same generator polynomial; a zero remainder indicates that no detectable error has occurred.2

CRC is called a cyclic code because bit strings are interpreted as polynomials over GF(2)GF(2), where addition and subtraction are both implemented as XOR, with no carries or borrows.2 This algebraic structure makes CRC both mathematically analyzable and highly efficient in hardware, especially with shift registers and XOR gates.2 Compared with simple parity or additive checksums, CRC provides much stronger detection of common line errors, especially burst errors that affect adjacent bits in a frame.2

Within Network Theory, CRC should be understood as a practical instance of cyclic codes used for link-level integrity, not for cryptographic security. Its goals are to detect noise-induced corruption, framing faults, and many multi-bit error patterns at line speed.2

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection. 2 3 4 5

  2. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division. 2 3

  3. Data Link Layer PDF - Lists common CRC polynomials and notes properties such as odd-bit and burst-error detection.

  4. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators. 2 3

  5. Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded Networks - Discusses polynomial selection, Hamming distance, hardware taps, and detection strength for given frame lengths. 2

  6. What Is a Cyclic Redundancy Check? | Everpure - Summarizes practical CRC operation and notes efficiency in hardware implementations.

CRC - Cyclic Redundancy Check

Where CRC Fits in the Network Stack

CRC is typically attached to the frame trailer at the Data Link Layer, especially in technologies such as Ethernet and HDLC, to detect transmission errors before higher layers process the payload.2

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

  2. Data Link Layer PDF - Lists common CRC polynomials and notes properties such as odd-bit and burst-error detection.

Mathematical Model of CRC

A binary message can be represented as a polynomial whose coefficients are either 00 or 11.2 For example, the bit string 1001101010011010 corresponds to

D(x)=x7+x4+x3+xD(x) = x^7 + x^4 + x^3 + x

if the leftmost bit is the coefficient of the highest power. Likewise, a generator bit pattern such as 11011101 corresponds to

G(x)=x3+x2+1G(x) = x^3 + x^2 + 1

The degree of G(x)G(x) is rr, so the CRC field has exactly rr bits.2 To form the transmitted codeword, the sender computes a remainder R(x)R(x) such that

T(x)=xrD(x)+R(x)T(x) = x^r D(x) + R(x)

is exactly divisible by G(x)G(x) over GF(2)GF(2).2 Since arithmetic is modulo 22, subtraction is identical to addition:

11=0,1+1=01 - 1 = 0,\quad 1 + 1 = 0

which is why modulo-2 long division uses XOR rather than ordinary subtraction.2

A compact way to express CRC encoding is

R(x)=(xrD(x))modG(x)R(x) = \left(x^r D(x)\right) \bmod G(x)

and then

T(x)=xrD(x)+R(x)T(x) = x^r D(x) + R(x)

At the receiver, the test is simply

T(x)modG(x)T'(x) \bmod G(x)

If the remainder is nonzero, an error is detected.2

Key technical ideas in this section include polynomial code, GF(2), remainder, and degree.2

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection. 2 3

  2. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division. 2 3 4

  3. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators. 2 3 4

  4. Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded Networks - Discusses polynomial selection, Hamming distance, hardware taps, and detection strength for given frame lengths. 2

CRC Encoder at the Transmitter

  1. 1
    Step 1

    Select an agreed binary divisor G(x)G(x) whose leftmost and rightmost bits are 11. If the generator has degree rr, the CRC field will contain rr bits.2

    Footnotes

    1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

    2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

  2. 2
    Step 2

    Take the original dataword DD and append rr zeros, which is equivalent to multiplying by xrx^r in polynomial form.

    Footnotes

    1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

  3. 3
    Step 3

    Divide the padded dataword by the generator using XOR in place of subtraction. The quotient is discarded, and only the rr-bit remainder is kept.2

    Footnotes

    1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

    2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

  4. 4
    Step 4

    Replace the appended zeros with the computed remainder RR. The transmitted frame becomes T=DRT = D || R, chosen so that it is divisible by G(x)G(x).2

    Footnotes

    1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

    2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

  5. 5
    Step 5

    The resulting bits are placed into the frame trailer as the FCS before transmission over the link.2

    Footnotes

    1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

    2. Data Link Layer PDF - Lists common CRC polynomials and notes properties such as odd-bit and burst-error detection.

CRC Decoder at the Receiver

  1. 1
    Step 1

    Read the incoming protected frame, including both payload and CRC bits.

    Footnotes

    1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

  2. 2
    Step 2

    Use the identical generator polynomial G(x)G(x) and perform modulo-2 division on the received bit sequence.2

    Footnotes

    1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

    2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

  3. 3
    Step 3

    If the remainder is all zeros, the frame passes the CRC check. If any bit in the remainder is 11, the frame is declared corrupted.2

    Footnotes

    1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

    2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

  4. 4
    Step 4

    Protocols usually accept frames that pass and discard or request retransmission for frames that fail, depending on the link protocol design.2

    Footnotes

    1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

    2. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

Worked Example: Binary Modulo-2 Division

Consider the dataword D=100100D = 100100 and generator G=1101G = 1101, which represents x3+x2+1x^3 + x^2 + 1. Since the degree is 33, append 33 zeros:

100100000100100000

Now divide 100100000100100000 by 11011101 using XOR-based long division. The remainder is 001001. Therefore, the transmitted codeword is

T=100100001T = 100100001

because the sender replaces the appended zeros with the remainder.

To verify at the receiver, divide 100100001100100001 by 11011101 again. The remainder is 000000, so the frame is accepted as error-free under the CRC test.

A compact summary is shown below.

ItemValue
Dataword DD100100100100
Generator GG11011101
Polynomial formx3+x2+1x^3 + x^2 + 1
Degree rr33
Padded dataword100100000100100000
CRC remainder RR001001
Codeword TT100100001100100001

This example illustrates modulo-2 division, codeword, syndrome, and FCS.2

Footnotes

  1. Cyclic Redundancy Check and Modulo-2 Division - GeeksforGeeks - Provides a worked binary division example with dataword 100100100100 and generator 11011101. 2 3 4 5

  2. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

  1. Align 11011101 with the leftmost 11 of the current dividend.
  2. XOR where the leading bit is 11; otherwise shift right.
  3. Bring down the next bit and continue until all bits are processed.
  4. Keep only the final rr bits as the CRC remainder.

Footnotes

  1. Cyclic Redundancy Check and Modulo-2 Division - GeeksforGeeks - Provides a worked binary division example with dataword 100100100100 and generator 11011101. 2 3

  2. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

Hardware Implementation of CRC

CRC is especially attractive because the same polynomial logic maps naturally onto linear feedback shift register (LFSR) hardware.2 In a typical implementation, incoming bits are shifted through a register, and XOR feedback taps correspond to the nonzero coefficients of the generator polynomial. Each clock cycle updates the register state, so the final register contents after the last data bit represent the CRC remainder.2

This makes CRC computation suitable for line-rate implementation in network interface hardware and storage controllers.2 Historically, many practical polynomials were chosen partly because they required relatively few feedback taps, making early hardware simpler. Modern systems may also provide instruction-level acceleration for some standardized CRCs.

In conceptual terms, the encoder and checker are almost identical circuits: one computes the remainder before transmission, while the other verifies that the received codeword produces the expected zero remainder or known residue, depending on the implementation convention.2

Footnotes

  1. Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded Networks - Discusses polynomial selection, Hamming distance, hardware taps, and detection strength for given frame lengths. 2 3 4 5 6

  2. What Is a Cyclic Redundancy Check? | Everpure - Summarizes practical CRC operation and notes efficiency in hardware implementations. 2 3 4

  3. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

Fast Mental Rule

In manual CRC division, never use ordinary subtraction. Every subtraction step is XOR, so 11=01 \oplus 1 = 0 and 10=11 \oplus 0 = 1.2

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

  2. Cyclic Redundancy Check and Modulo-2 Division - GeeksforGeeks - Provides a worked binary division example with dataword 100100100100 and generator 11011101.

Error Detection Capability and the Role of the Generator Polynomial

The quality of CRC depends heavily on the choice of generator polynomial.2 All CRC polynomials detect all single-bit errors, but stronger guarantees for double-bit, odd-bit, and burst errors depend on algebraic properties of G(x)G(x).2

Several widely cited design rules are important in link-layer CRC selection:3

  1. If G(x)G(x) has at least two nonzero terms, all single-bit errors are detected.
  2. If G(x)G(x) does not divide xk+1x^k + 1 for relevant frame lengths, many double-bit errors are also detected.2
  3. If (x+1)(x + 1) is a factor of G(x)G(x), then all error patterns with an odd number of flipped bits are detected.
  4. If the generator has degree rr, then all burst errors of length r\leq r are detected, and for longer bursts the undetected fraction is approximately 2r2^{-r}, so the detected fraction is approximately 12r1 - 2^{-r}.2

This burst-error property is especially important in the Data Link Layer because real channels often exhibit correlated disturbances rather than isolated random bit flips. For example, a 32-bit CRC can detect every burst error up to length 3232 bits, which is why CRC-32 is widely used in LAN technologies such as Ethernet.2

The choice of polynomial also affects Hamming distance over a given maximum frame length, which in turn determines guaranteed detection of certain multi-bit error patterns. Research by Koopman and others has shown that some newer polynomials outperform older legacy choices for specific packet sizes, meaning the “best” generator depends on both degree and protected message length.2

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection. 2 3 4

  2. Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded Networks - Discusses polynomial selection, Hamming distance, hardware taps, and detection strength for given frame lengths. 2 3 4 5 6

  3. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators. 2 3 4

  4. Data Link Layer PDF - Lists common CRC polynomials and notes properties such as odd-bit and burst-error detection. 2 3

  5. Double Burst Error Detection Capability of Ethernet CRC - IEEE 802 - Notes the Ethernet CRC-32 polynomial and its guaranteed burst-detection capability up to 3232 bits.

  6. What Is a Cyclic Redundancy Check? | Everpure - Summarizes practical CRC operation and notes efficiency in hardware implementations.

Typical Guaranteed Burst-Error Detection by CRC Degree

A degree-rr CRC detects all burst errors of length up to rr bits.2

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

  2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

Generator Polynomial Insights

CRC Processing Lifecycle in a Frame Transmission

Frame Preparation

Step 1

The sender forms the data link frame payload and selects the agreed generator polynomial."

Footnotes

  1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

CRC Encoding

Step 2

The sender appends rr zeros, performs modulo-2 division, and inserts the rr-bit remainder as the FCS.2"

Footnotes

  1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

  2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

Transmission

Step 3

The codeword traverses the medium, where noise or interference may flip bits."

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

Receiver Checking

Step 4

The receiver divides the full received bitstream by the same generator polynomial.2"

Footnotes

  1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

  2. Lecture 3: Framing and Error Detection - Presents CRC goals, modulo-2 division, and the burst-error guarantee for degree-rr generators.

Decision

Step 5

A zero remainder leads to acceptance; a nonzero remainder triggers rejection or retransmission logic."

Footnotes

  1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division.

Standard CRC Polynomials in Networking Context

Several generator polynomials appear frequently in communication systems.2 Examples include CRC-16, CRC-CCITT, and CRC-32. Their names typically refer to the degree of the polynomial, which equals the number of CRC bits appended to the frame.

NamePolynomialCommon context
CRC-16x16+x15+x2+1x^{16} + x^{15} + x^2 + 1HDLC and related link contexts
CRC-CCITTx16+x12+x5+1x^{16} + x^{12} + x^5 + 1Telecom and WAN contexts2
CRC-32x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1x^{32} + x^{26} + x^{23} + x^{22} + x^{16} + x^{12} + x^{11} + x^{10} + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1Ethernet/LANs2

The practical lesson is that a larger CRC degree generally improves random error detection probability, but the exact protection depends on polynomial structure and frame length, not only on the number of bits in the checksum.2

Footnotes

  1. Data Link Layer PDF - Lists common CRC polynomials and notes properties such as odd-bit and burst-error detection. 2 3 4 5

  2. Untitled Document - Gives standard networking CRC polynomials such as CRC-16, CRC-CCITT, and CRC-32. 2

  3. Double Burst Error Detection Capability of Ethernet CRC - IEEE 802 - Notes the Ethernet CRC-32 polynomial and its guaranteed burst-detection capability up to 3232 bits.

  4. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

  5. Cyclic Redundancy Code (CRC) Polynomial Selection For Embedded Networks - Discusses polynomial selection, Hamming distance, hardware taps, and detection strength for given frame lengths.

CRC Is Not Encryption

CRC detects accidental corruption but does not protect against intentional tampering. Because it is linear and predictable, it should never be confused with a cryptographic integrity mechanism.

Footnotes

  1. Cyclic redundancy check - Wikipedia - Overview of CRC theory, GF(2)GF(2) arithmetic, burst-error detection, and generator selection.

Exam-Oriented Problem-Solving Strategy

When asked to compute a CRC by hand in a Network Theory course, use a disciplined procedure.2

  1. Convert the generator bits into its polynomial form only if conceptual explanation is required.
  2. Let the generator length be mm; then append m1m-1 zeros to the dataword.
  3. Perform XOR long division from left to right, only when the current leading bit is 11.
  4. The final m1m-1 bits are the CRC checksum.
  5. Append that checksum to the original dataword, not to the padded one.
  6. To verify, divide the full transmitted codeword by the same generator; the remainder should be all zeros.2

A common source of mistakes is using decimal subtraction, forgetting to append the correct number of zeros, or appending the remainder incorrectly.

Footnotes

  1. Lesson 5 - The Data Link Layer - Explains CRC encoding and decoding in the Data Link Layer using polynomial division. 2 3

  2. Cyclic Redundancy Check and Modulo-2 Division - GeeksforGeeks - Provides a worked binary division example with dataword 100100100100 and generator 11011101. 2 3 4 5

Knowledge Check

Question 1 of 5
Q1Single choice

In CRC, what is the purpose of the generator polynomial G(x)G(x)?