https://github.com/vdesmond/arq-protocols
Implementation of Automatic Repeat reQuest (ARQ) protocols in python
https://github.com/vdesmond/arq-protocols
arq arq-protocols simulation
Last synced: 5 months ago
JSON representation
Implementation of Automatic Repeat reQuest (ARQ) protocols in python
- Host: GitHub
- URL: https://github.com/vdesmond/arq-protocols
- Owner: vdesmond
- License: mit
- Created: 2021-03-26T18:25:52.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-12T18:07:19.000Z (about 5 years ago)
- Last Synced: 2024-01-29T20:25:44.968Z (over 2 years ago)
- Topics: arq, arq-protocols, simulation
- Language: Python
- Homepage:
- Size: 2.07 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# arq-protocols (and other stuff)
This repository contains implementation of 3 protocols:
- Stop and Wait ARQ
- Go Back N ARQ
- Selective Repeat ARQ
And also some bonus stuff including:
- CSMA/CA Simulation
### How to run
1. Clone this repository
2. *(optional)* Create a virtual environment before running.
1. Install some additional python packages: ```pip install coloredlogs verboselogs```
2. If you want to use the logging module only, you can modify the code under ```# Configure Logging``` for every file.
3. Run sender and receiver in seperate tabs/windows.
4. The command line arguments are as follows:
1. **Stop and Wait ARQ**
Sender: ```python sw_sender.py ```Receiver: ```python sw_receiver.py ```
2. **Go Back N ARQ**
Sender: ```python gbn_sender.py ```Receiver: ```python gbn_receiver.py ```
3. **Selective Repeat ARQ**
Sender: ```python sr_sender.py ```Receiver: ```python sr_receiver.py ```
4. **CSMA/CA Simulation**
CSMA/CA has been implemented on top of Stop and Wait ARQ
Sender station: ```python sender_station.py ```Base Station: ```python base_station.py ```
### Additional Notes
- Make sure ```PORT``` and ```SEQ_NO_BIT_WIDTH``` is same for both sender and receiver
- ```ACK_TIMEOUT``` is in milliseconds.
- The window length for Go Back N and Selective Repeat ARQ is calculated as ```(2 ** SEQ_NO_BIT_WIDTH) - 1``` and ```2 ** (SEQ_NO_BIT_WIDTH - 1)``` respectively
- For CSMA/CA, ```IFS``` is in milliseconds.
### Additional Notes (Ubuntu)
- Added single script to run all files. Use ```./arq.sh -h``` for help.
- If you use zsh, change ```-- bash``` to ```-- zsh``` in lines 71, 74, 77. If you use any other terminal, make appropriate changes
### Examples
Stop and Wait ARQ

Go Back N ARQ

Selective Repeat ARQ

CSMA/CA Simulation

*UEC1604 - Communication Networks, SSN College of Engineering*