A simple program to test how various CRC error detection capabilities depending on how much error is introduced. The program will create an n-number of messages and its respective error message with n number of bit errors. Afterward, compute the CRC for both the untouched message and the error message and check if they are not equal. Because if equal, it means a collision has occurred, which would mean that the software using the CRC think it is a valid message.
First clone the project followed by updating the git submodules used in this project, which are required in order to compile the program.
git clone <this repo url>
cd <git workspace>
git submodule update --init --recursive
Afterward, it is as simple as follow the following commands.
mkdir build && cd build
cmake ..
make
The executable can be located in the bin directory as CRCAnalysis.
CRCAnalysis --samples=100000000 --message-data-size=256 -b 1 --crc=xor8
CRCAnalysis --samples=100000000 --message-data-size=256 --tasks=10000 -b 2 --crc=xor8
The support command line options can be view with the following command.
CRCAnalysis --help
An example output can be the following.
Naive CRC Analysis
A simple program for checking error detection
Usage:
CRCAnalysis [OPTION...]
-v, --version Version information
-h, --help helper information.
-c, --crc arg CRC Algorithm (default: crc8)
-p, --message-data-size arg Size of each messages in bytes. (default: 5)
-e, --error-correction Perform Error Correction.
-s, --samples arg Samples (default: 1000000)
-t, --tasks arg Task (default: 2000)
-b, --nr-of-error-bits arg Number of bits error added to each message.
(default: 1)
-f, --forever Run it forever.
-l, --show-crc-list List of support CRC and Checksum Alg
-P, --error-probability arg Probability of adding error in data package.
(default: 1)