Project #1 – CRC Experiments Solution

$35.00 $29.00

Project 1: Write a program (in C++) for a sender that takes a bit stream and computes several experiments to do with CRCs. Whichever language you choose to use, you should provide a Make le consistent with the project submission guidelines below. The input to the program should be a string (which you read from…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

Project 1: Write a program (in C++) for a sender that takes a bit stream and computes several experiments to do with CRCs. Whichever language you choose to use, you should provide a Make le consistent with the project submission guidelines below. The input to the program should be a string (which you read from the command line) containing ASCII 0’s and 1’s that represents the message to be check summed. Your output should be a 16-bit CRC for the CRC-16 polynomial x16 + x12 + x7 + x5 + 1. Please read the hints also on the class web page.

This project will be due on Sunday November 7th, at 11:55 PM PST.

  1. Programming Environment

You should test and develop your code on the SEASnet system, as your submission will be compiled and graded on this environment.

On SEASnet, you can use Vim, Emacs, or Nano to edit your source code and any compiler you’d like to build it. However, you must submit a Make le that can be used to compile your code into an executable named \crcExperiments”.

      1. Instructions

  1. If you haven’t already done so, familiarize yourself with the basics of CRCs. An overview can be seen in the lecture materials or in the textbooks.

  1. Create a program that named crcExperiments that accepts an arbitrary bitstring (for-matted like the following without surrounding quotes: \101010101010000011111100000001″) as an argument, and, given the correct command line arguments does one of the following: computes the CRC, checks if the CRC is correct, computes and outputs all undetected 4-bit errors, and computes and outputs the fraction of undetected 2 bit errors

Requirements:

The program must accept a string as argument provided in the format -c [string representing bits, e.g. 01010101]. It must then output the correct bitstring WITH the attached CRC to stdout, using the generator x16 + x12 + x7 + x5 + 1.

The program must accept a string (that contains a CRC) as argument provided in the format -v [string representing bits, e.g. 01010101[…]1]. It must then validate whether or not the string is consistent with the attached CRC, using the generator x16 + x12 + x7 + x5 + 1.

The program must accept a string as argument provided in the format -f [string representing bits, e.g. 01010101]. It must then output all undetected 4 bit errors to stdout, with newline characters between each error. Errors should take the form of the initial string of bits WITH the error added in.

The program must accept a string as argument provided in the format -t [string representing bits, e.g. 01010101]. It must then output the fraction of un-detected two bit errors to stdout.

If no argument is speci ed, your program must exit with return code 2 and print nothing to stdout.

We strongly recommend you use getopt() to parse command line options.

  1. Grading Criteria

This is an individual project, meaning that no collaboration is allowed. You are allowed to use online resources to understand how to use CRCs; however, you must not copy code from the Internet and must credit any resources used in comments contained in your source code.

Your code will be graded based upon the following criteria:

Whether your Make le compiles your code properly on the SEASnet systems.

Whether you included a le named \README” that contains your name on the rst line and your UID on the second line.

Whether your program runs on SEASnet without any errors or segfaults.

Whether your program is able to nd the value for the CRC of an arbitrary frame, and be able to check an arbitrary frame, given the appropriate command line input.

Whether or not the program is able to nd all possible 4 bit random errors that can occur in the frame. It should send this to stdout in a string of 0’s and 1’s (e.g. ’101010101’). The string printed should be the modi ed version of the bit string provided (e.g. the string with the error added in).

Whether your program can output the fraction of undetected 2 bit errors in the above case.

  1. Project Submission

Put all your les into a directory and compress the contents of this directory into a le named \UID.tar.gz” (replacing UID with your UCLA ID). You MUST put all your les directly at the root of this archive (and not inside a directory) to ensure your code is graded properly.

Please submit your project via CCLE { submissions via any other method will not be accepted.

Your submission should include the following:

Your source code.

A Make le that builds your code. This should create an executable named crcExperiments in the same directory when when one types \make”.

A le named \README” containing your name on the rst line and your UID on the second line.

Acknowledgements

This project was adapted and modi ed from an earlier instance from George Varghese.

Project #1 - CRC Experiments Solution
$35.00 $29.00