Welcome to the CRC - Cyclic Redundancy Check.
In this learning activity, you'll be
introduced to what the CRC is, the technology behind it, and how it's performed.
CRC, or cyclic redundancy check, is an error detecting code.
It finds changes in data as it travels from one computer to another by adding a
code to the end of the data string.
The sending computer creates the code and
the receiving computer checks it.
If the codes check out, the data is accurate.
If the codes don't check out, the data is corrupt.
In networking, CRC codes check for errors.
When used correctly, they're capable of detecting over ninety-nine percent of data errors.
They're also simple to implement, as they introduce virtually no latency and
require no outside processing.
CRC - The technology behind it.
CRC works at the data link layer by protocols such as Ethernet.
It's a basic error check and it's easy to implement in hardware with shift feedback registers.
As the message leaves the network card,
it travels through the specially designed feedback register.
What remains in the register as the message leaves is the CRC.
The register attaches this to the tail end of the message.
Both the message and its code travel through the same circuitry as they
arrive at the destination.
If no errors occurred during transmission, the check produces all zeros.
Using simple registers to check for errors is an easy way to ensure there is
no added latency.
CRC: How It's Performed
Think of the data leaving along a conveyor belt with X/OR logic gates
between some pairs of stations.
CRC calculates the code word using a specifically designed generator
polynomial and the values use X/OR logic so they generate either a zero or a one.
We want to send the message 1 0 1 0 0 1 1.
Because our conveyor belt can only hold five numbers, we need to add five zeros
to the end of our message.
These are placeholders for the final code.
As each new number enters our data conveyor belt,
it pushes the other numbers down the line, until one falls off the end.
The register records its value as it falls off the line.
The last five numbers in the conveyor belt generate the CRC and
the register attaches it to the data string.
The registers start with all zeros.
In our example, each space is color coded.
As our message enters our conveyor belt,
we X/OR each pair of numbers and enter the corresponding one or zero.
As a number falls off the end we X/OR its value to the incoming number.
Let's see this in action starting with the last bit at the end as it goes into
the feedback for the X/OR operation.
The feedback 0 and the orange-brown 0 are X/OR'd together,
resulting in a 0 in the last bit.
The green 0 simply shifts to the left because there is no feedback here.
The blue 0 is X/OR'd with the feedback 0, which results in a 0 in the left box.
The dark purple 1 shifts to the left.
Finally, the feedback 0 is X/OR'd with the incoming 0, which results in a 0 in the last bit.
We continue this process of
shuffling our message down the register conveyor belt until we reach the end.
The last five numbers are 1 1 1 0 1. We add this to our original message 1 0 1 0
We add this to our original message 1 0 1 0 0 1 1 to
make a complete message of
1 0 1 0 0 1 1 1 1 1 0 1
The receiving computer runs the complete message through its feedback register.
If the check produces all zeros, the data is accurate.
Today you were introduced to what the CRC is, the technology behind it, and how it's performed.
You learned it's an easy way to detect errors in code.
You've completed: The CRC - Cyclic Redundancy Check.