Question
You are to write two C/C++ programs: (1) a synchronous transmitter, and (2) a synchronous receiver. Both programs will assume the use of ASCII codes
You are to write two C/C++ programs: (1) a synchronous transmitter, and (2) a synchronous receiver. Both programs will assume the use of ASCII codes with odd bit parity. The transmitter and receiver communication to be implemented makes use of a set of files. Details regarding such files are provided by the table below.
File Characteristics | |||
Naming | Contents | Created by | Accessed by |
filename.inpf | any ASCII character | user | transmitter |
filename.binf | (0 and 1) ASCII characters | transmitter | receiver |
filename.outf | any ASCII character | receiver | user |
1. The Synchronous Transmitter
Creates files of bits (0 and 1 characters) from the input files. All valid input files contain data made up of ASCII characters and have the .inpd file extension. The data to be transmitted must be structured as a set of blocks. Each block will consist of 2 SYN characters, ASCII 22, one control character to indicate the length of data block followed by a maximum of 64 data characters. Assume that there are no trailing control characters. Every block transmitted must contain 64 data characters except possibly the case where the remainder of the file cannot fill the buffer. Each character will consist of 7 information bits and a parity bit. These bits will be transmitted from the least significant bit (LSB) to the most significant bit (MSB). The table below illustrates the structure of a block created to transmit the Hello! character string. The actual contents of this block has to be encoded with characters 0 and 1 to simulate the binary representation of the characters used.
2222 | 6 | Hello! |
2. The Synchronous Receiver
This program reads the files created by the Transmitter (.binf) as input, checks for transmission errors, decodes stream of bits, and stores the resulting information on a file (.outf).
Both programs should have three distinct layers: physical, data link and application. The physical layer should contain routines to handle jobs such as converting a character into a binary bit pattern, calculating, and including a parity bit, executing the cyclic redundancy check and writing bits into an output file (i.e., transmission of bits). It should also include routines for reading bits from a file (i.e., reception of bits) and converting bits into characters. The data link layer should contain routines for framing (putting two SYN characters, a LENGTH character, and data into a frame) and deframing (separating those control characters from data characters). The application layer should contain routines to handle tasks such as reading data to be transmitted from input data file in the Transmitter and writing received data into display (or output data file) in the Receiver, as well as any other routines that you feel necessary. Your solution must also include a module to simulate transmission errors.
3. Details
The following are the tasks to be done for this project:
- Create a simple client/server (transmitter/receiver; consumer/producer) application as discussed in this document that uses a simple odd parity bit and a file for "data transmission".
- Design and implement the Error Creation module. This component must, in a random way, change a single bit as well as more than one bit in the message. Your function must have the number of bits that are to be modified as an input parameter. It must also inform the user the frame, byte and bit locations of the errors introduced. The receiver must be able to report the location of errors introduced during transmission.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started