两台路由器如何协商CRC生成器?配置不同时该如何处理?
CRC生成多项式不匹配的问题与协商方法
Great question! Let's break down the problems caused by mismatched CRC polynomials and how routers can agree on a common one.
What happens if the CRC polynomial lengths differ?
CRC works by using a generator polynomial (G(x)) of r+1 bits to compute an r-bit checksum for each frame. If two routers use polynomials of different lengths (e.g., 16-bit vs 32-bit), here's what goes wrong:
- Checksum length mismatch: A 16-bit polynomial produces a 16-bit checksum, while a 32-bit one produces a 32-bit checksum. The receiver will expect a checksum of its configured length, so it will either:
- Reject the frame immediately because the total frame length doesn't match its expected size (since the checksum portion is shorter/longer than anticipated), or
- Misinterpret part of the frame: For example, a receiver using a 32-bit polynomial will treat the entire frame (data + 16-bit checksum) as the data payload, then look for an additional 32 bits of checksum that doesn't exist.
- False error detection: Even if the receiver doesn't reject the frame based on length, it will compute the CRC using its own polynomial. Since the checksum was generated with a different polynomial, the resulting remainder will almost never be zero. This means every valid frame will be incorrectly flagged as corrupted and discarded, resulting in a completely broken link.
- Wasted bandwidth: All transmitted frames will be dropped, so no actual data gets through—you'll see constant retransmissions and zero throughput.
How do routers negotiate a common CRC polynomial?
Routers typically use one of these methods to ensure they're using the same polynomial:
- Protocol-enforced defaults: Most standard network protocols (like Ethernet, PPP) specify a fixed CRC polynomial. For example:
- Ethernet uses the 33-bit CRC32 polynomial (
0x04C11DB7), which is non-negotiable. - PPP allows configuration but defaults to CRC32 (or CRC16 as a fallback). Routers will follow the protocol's default unless explicitly configured otherwise.
- Ethernet uses the 33-bit CRC32 polynomial (
- Link-layer negotiation: For protocols that support configurable CRC (like PPP), routers use a control protocol to agree on a polynomial during link setup. For example, PPP's Link Control Protocol (LCP) exchanges "CRC options" between peers. Both routers list the polynomials they support, then select the most capable common option (usually the longest one, like 32-bit, since it has better error-detection capabilities).
- Manual pre-configuration: In closed, private networks, administrators can manually set the same polynomial on both routers. This avoids negotiation overhead and ensures consistency, especially in environments where automatic negotiation might fail.
内容的提问来源于stack exchange,提问作者Anuja
相关产品推荐
相关产品推荐

