AlternateBitProtocolSimulator

ABP (Alternating Bit Protocol) is a communication protocol to ensure reliable transmission through unreliable network.

View on GitHub

Alternate Bit Protocol Simulator


Organization: Carleton University


Authors:

Originally Developed By: Dr. Cristina Ruiz Martin

Modified By: Saad Hasan and Hamza Sadruddin


Introduction


Alternate Bit Protocol (ABP) simulator is a communication protocol to ensure reliable transmission through an unreliable network. It consists of three components: sender, network (decomposed further into two subnets) and receiver. The sender sends a packet and waits for an acknowledgement. If the acknowledgement doesn’t arrive within a predefined time, the sender re-sends this packet until it receives an expected acknowledgement and then sends the next packet. In order to distinguish two consecutive packets, the sender adds an additional bit on each packet (called alternating bit because the sender uses 0 and 1 alternatively). The behavior of receiver is to receive the data and send back an acknowledgement extracted from the received data after a time period. The subnets just pass the packets after a time delay. However, in order to simulate the unreliability of the network, only 95% of the packets will be passed in each of the subnet, i.e. 5% of the data will be lost through the subnet. There is a good documentation for the installation installation of cadmium installation on different platforms like windows and Linux and about Alternate Bit Protocol Simulator. Following the link for more guide.Installation Guide and Documentation. We are focuing on the on the proper documentation. reviewing the code, following software documentation and conventions, code standards along with the optimization of the new feature to imporve the simulator. The new feature which implemented by generating the output files in Comma separated values format which is the most widely used fromat in the field of Data Science and analytics and also human readible format. The enhancement also include the time delay statistics between sender and receiver correspondance along with the maximum, minimum and average delay by following the proper comments and coding conventions and standards.


Files Organization

bin [This folder has files for executables genrated after running the Simulator]

build [This Folder has all object generated after after runnung the simulator]

data [Data files for testing and some simulator outputs]

doc [This folder contains documents related to ABP and Cadmium including installation guide in winddows and Linux]

include [This folder contains the header files and data structures used in the project]

  1. data_structures [This folder has message.hpp file]
    • message.hpp - receiver_cadmium.hpp - sender_cadmium.hpp - subnet_cadmium.hpp - simulator_renaissance.hpp

lib [This folder contains 3rd party header files needed in the project]

  1. cadmium [This folder contains cadmium functionalities]
  2. DESTimes [This folder contains DESTimes functionalities]
  3. Vendor [Other third-party resources]
    • iestream.hpp

src [This folder contains source code for the Alternate Bit Protocol simulator]

test [This folder the unit test for the different include files]

  1. data [Data files used by receiver, sender and subnet]
    • receiver_input_test.txt
    • receiver_mod_output.csv
    • receiver_test_output.txt
    • sender_input_test_ack_In.txt
    • sender_input_test_control_In.txt
    • sender_mod_output.csv
    • sender_test_output.txt
    • send_time_stats_output.csv
    • subnet_input_test.txt
    • subnet_mod_output.csv
    • subnet_test_output.txt
  2. src [Contains the source code]

    i. receiver [This folder contains the unit test of the receiver]

    • receiver.cpp

    ii. sender [This folder contains the unit test of the sender]

    • sender.cpp
iii. subnet [This folder contains the unit test of the subnet] - subnet.cpp

Installation Guide

Below are the instructions to install dependencies on Windows operating system and tLnux is available in the section Installation Guide and Documentation.

apt-cyg installations: Open Cygwin in administrator mode and type the below commands,

wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg/bin
apt-cyg install git

Please use these commands if you don’t have git pre-installed in your system. ** Cadmium dependencies installations. **

1. Initialize the git-submodules In the main project directory.

2. Run the unit tests The same steps should be followed for receiver and subnet tests as we are showing the steps for the sender.

3. - Run the simulator