1. CRC and its effectiveness
Part 1
Martin Brenn, 28.04.2012
brenn@depon.net
Depon.Net
2. Messages
• Messages are sent everywhere and
everyday.
• For example:
– CAN (created by automotive industry)
– SPI (Inter-CPU)
– Wired Ethernet (LAN)
– Wireless LAN (IEEE 80211.x)
– And many many more
3. Corruption
• Corruption of messages occurs everywhere and
every day!
• Typical failure modes:
– Loss
– Repetition
– Wrong order of packets (especially in Internet)
– Manipulation of content
• Bit flips (0->1 or 1-0)
• Duplication or omission of bits (11100->1100)
– Disagreement about communication parameters
• „What he says?“ or „Ariane 5 Flight 501“
4. Ariane 5
Result of converting a 64-Bit float to 16-bit Integer
without check for Arithmetic Overflow
• http://en.wikipedia.org/wiki/Ariane_5_Flight_501
Source of images:
1) http://www.capcomespace.net/dossiers/espace_europeen/ariane/ariane
5/AR501/V88%20explosion%2003.jpg
2) http://de.wikipedia.org/wiki/Ariane_5
5. Scope
• Today, we just take care of manipulation of
data
• Competition against systematic failures is
also quite interesting but not in my today‘s
scope.
7. Manipulation types
• Typical Effects:
– Single bit error: Just one bit flips
• 0100 1011 -> 0101 1011
– Double bit error: Two bits flips
• 0100 1011 -> 1110 1011
• 0100 1011 -> 0100 1000
– Multiple bit error: More bit errors
• 0100 1011 -> 1001 0011
– Burst error: Multiple bits flip or get a new value
• 0100 1011 -> 1111 1011
8. What do?
• Create redundandy!
– Simple: Repeat message twice and check if
content is the same
– Problem: 6 Mbit-DSL will just give 3 Mbit.
– Does duplication really help against systematic
failures?
– i.e. Dual-Channel FlexRay
• Usually, information about validity of
message is enough!
– Add checksum for detection!
9. Checksum vs. CRC
• Checksums are not checksums!
• Typically, „checksums“: are a summation of
all values multiplied with factors depending
on their position:
– Checksum = Sum(Value[n] * Lookup[n%m])
– Not very effective (i.e: TCP)
• CRC:
– Quite funny thing, difficult to explain
– http://en.wikipedia.org/wiki/Computation_of_
CRC
10. Properties of CRC
• Main Properties of a CRC:
– Polynomial, implying the length of CRC
– Seed [Not Seeed (Dickes B)]
– Inverting, +1, etc…
• The calculated CRC will be appended to
message
• CRC increases hamming distance of
messages.
– Corruption can be detected!
11. Choice of Polynomial
• So, let‘s choose a CRC…
• Where to start?
• For example:
– http://www.ece.cmu.edu/~koopman/roses/ds
n04/koopman04_crc_poly_embedded.pdf
– Nice work!
12. Task
• Task:
– Find the probability that a corrupted message
will be assumed as corrupt!
– We will use „Monte Carlo Method“
• http://en.wikipedia.org/wiki/Monte_Carlo_method
• Simple things need complex words!
• Do random guessing and take this as the truth
• Simple, quite effective
13. • Part 1 completed!
• Part 2 will present the application!