Consider a wireless communications network. The network consists of several sensors and one sink. Each sensor is equipped with a wireless transmitter. The sensors send information to a sink which is equipped with a wireless receiver device.At each sensor the transmitter sends information in form of data packets. Each packet consists of a preamble followed by a packet ID and a data portion. The preamble is a known signal common to all the transmitters and packets. The preamble consists of L bits. Packet ID is a unique packet identifier which consists of I bits. The data portion of a packet consists of N bits. Data portions are all different between transmitters and packets (just like packet IDs). Thus the length of each packet is L + I + N bits.
The packets are transmitted by different transmitters independently of each other. How ever, for simplicity we assume that the time is slotted in bit slots and the packets are transmitted and received in a bit-synchronous fashion.All packets are transmitted over the same wireless media and, therefore, the receiver will see a sum of the transmitted packets with time offsets caused by different transmission times.For simplicity we assume that for any two or more packets, even if they originate at distinct transmitters, the transmission CANNOT start at exactly same time. The transmission starting times differ by at least one bit time slot.
The task of the receiver is to detect presence and starting time of each packet in the received signal, and then decode packetâs ID and data portion. In case many packets are transmitted at close times by different transmitters the packets will interfere. In such cases the receiver faces difficulty in detection and decoding of the packets.As we already mentioned, for the packetâs information to be acquired the packet has to befirst Detected and then Decoded.
The Detector device, which is a part of the receiver, operates by the following rules for successful detection of a preamble:
1. the preamble of the packet of interest should have no time overlaps with other packetâs preambles
2. any bit of the preamble should interfere (overlap in time) with no more than M ? 1 other packetâs ID or data portions.
If the preamble of the packet of interest is successfully detected (packet is detected) the decoding of the packet can be processed by the Decoder (also a part of the receiver), otherwise it is not detected and the receiver is unaware of its presence.The Decoder operates as follows. First it tries to decode the ID portion of a packet. The ID Decoding is successful if ID portion of the packet interferes (time overlaps) with no more than Q?1 other packet preamble, ID, or data portions (even if these packets are not detected).
If packet ID is not decoded successfully the Decoder stops (and moves on to th next packet),otherwise if ID Decoding is successful, the Decoder proceeds with Data Decoding. Data De- coding is successful if Data portion of the packet interferes (time overlaps) with no more than P ? 1 other packet preamble, ID or data portions (even if these packets are not detected).
The input file for simulation contains input parameters such as L, I, N, M, Q, P and the total number of packets n as well as a series of time stamps indicating the starting times of the packets. We assume that the packets are numbered starting from 1 to n in the order of their starting time.The output file contains n lines, one for each packet. If the packet is detected but not ID decoded, the respective line contains D. If the packets is ID decoded but not data decoded it contains I. If the packet is data decoded it contains S. If the packet is not even detected the corresponding line contains F .
Task
Create:
1. C++ code producing output from a given input. (compilable in DevCpp version as in the lab)
2. Report indicating how to run the code and one example.
3. Executable.Pack all in one zip file and submit online via Brigthspace.