SZTUKA
Piękno i dobre samopoczucie
RZEMIOSŁO
KULTURA I HISTORIA
ROZRYWKA
ŚRODOWISKO
JEDZENIE I NAPOJE
INŻYNIERIA ODWROTNA
NAUKI
LEKKOATLETYKA
TECHNOLOGIA
URZĄDZENIA DO NOSZENIA
The Cyclic Redundancy Check
Mark

Autor

Mark

30. sierpień 2026FI
27
0
0
0
0

The Cyclic Redundancy Check

A parity bit notices one flipped bit. Real wires do not flip one bit. They deliver bursts — a relay clicks, a motor starts, lightning strikes three counties away — and forty consecutive bits arrive as noise. Parity catches that only half the time, because half of all bursts contain an even number of flips. Wesley Peterson and Daniel Brown published the fix in 1961, and it is a piece of algebra rather than a piece of engineering. Treat the message as a polynomial whose coefficients are its bits, working over the field with two elements — where one plus one is zero, so addition and subtraction are both exclusive-or and there are no carries anywhere. Divide by a fixed generator polynomial and append the remainder. The receiver divides again; a clean frame leaves nothing. What falls out of that is not a probability but a set of GUARANTEES. A generator of degree r detects every single-bit error, every odd number of errors if the polynomial is chosen well, and — the one that matters — EVERY burst of r bits or fewer. Not usually. Every one. Beyond r bits the guarantee stops and the miss rate steps to about two to the minus r, which for the 32-bit CRC in every Ethernet frame is one in four thousand million. It corrects nothing. That is the trade against the Hamming code this blueprint links to: Hamming repairs a single bit and scales badly as blocks grow, while a CRC only ever says yes or no, costs 32 bits whether the frame is 64 bytes or 1500, and catches the burst that Hamming would not even notice. FULLY BUILDABLE, and the proof is the point: inject every possible burst of every length and count what slips through. The wall sits exactly where the algebra says it does.
Średniozaawansowany
3 hours

Instrukcje

1

What a single-bit code cannot do

Work the Hamming code first. It uses overlapping parity subsets so the pattern of failed checks points at the guilty bit, and it CORRECTS it. That is more than a CRC will ever do. Now take a block it protects and flip six consecutive bits. Hamming's syndrome points confidently at a single bit that is not the problem, and correcting it makes the block worse. A code built for isolated errors does not fail gracefully on bursts — it fails CONFIDENTLY, which is the more dangerous of the two. That is the gap this blueprint fills, and it is why real links carry both: an error-correcting code sized for the expected noise, and a CRC over the whole frame to catch the case where the first code was wrong.
2

Divide by hand, once

Do one division on paper. Message 1101011011, generator 10011 — that is x⁴+x+1, degree 4, so you will get a four-bit remainder. Append four zeros to the message. Then repeatedly: if the leftmost bit under consideration is 1, XOR the generator against it; shift right one place; repeat. No borrowing, no carrying — every step is exclusive-or, because in this field addition and subtraction are the same operation. The four bits left at the end are the CRC. Append them in place of the zeros and divide the whole thing again: the remainder is zero. Now flip any single bit and repeat — it is not zero any more. Do this once by hand and the code in the notebook stops being magic. It is this, in a loop.

Materiały do tego kroku:

Graph PaperGraph Paper2 arkuszy

Potrzebne narzędzia:

Steel RuleSteel Rule
3

Implement it and check it against the standard value

Wczytywanie notatnika Jupyter…

Potrzebne narzędzia:

Desktop ComputerDesktop Computer
4

Compendium: guarantees, not probabilities

WHY THE BURST GUARANTEE IS EXACT. An undetected error is one where the error pattern itself is divisible by the generator. A burst of length L or less is a polynomial of degree less than L, and a polynomial of degree less than r simply cannot be divisible by one of degree r unless it is zero. So every burst up to r bits is caught, by arithmetic, with no appeal to probability. Everything else a CRC promises is a statement about what the chosen generator happens to factor into. AGAINST A CHECKSUM. An internet checksum is a sum, so it is blind to reordering, to a block of zeros inserted or deleted, and to any pair of errors that cancel. It is cheap and it is computed on a CPU with no special hardware, which is exactly why IP uses one and Ethernet does not. A CRC costs a shift register and gives guarantees; a checksum costs an add instruction and gives a hint. The layers use different ones on purpose. AGAINST HAMMING. Hamming corrects one error and needs `log2(n)` parity bits, so its cost grows with block size and its power does not. A CRC corrects nothing and costs a fixed 32 bits whether the frame is 64 bytes or 1500. Correction is worth paying for when retransmission is expensive or impossible — deep space, a disc surface, a compact disc's CIRC. Detection is enough when you can simply ask again, which is what every protocol after this blueprint does.

Materiały

1

Wymagane narzędzia

2

CC0 Domena publiczna

Ten plan jest udostępniany na licencji CC0. Możesz go swobodnie kopiować, modyfikować, rozpowszechniać i wykorzystywać do dowolnych celów, bez konieczności uzyskiwania zgody.

Wesprzyj Makera kupując produkty przez jego plan, za co zarabia Prowizja Makera ustalony przez sprzedawców, lub stwórz nową iterację tego planu i dołącz go jako połączenie w swoim własnym planie, aby dzielić się przychodami.

Dyskusja

(0)

Zaloguj się aby dołączyć do dyskusji

Ładowanie komentarzy...