GithubHelp home page GithubHelp logo

vdesmond / arq-protocols Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.12 MB

Implementation of Automatic Repeat reQuest (ARQ) protocols in python

License: MIT License

Python 89.00% Shell 11.00%
arq arq-protocols simulation

arq-protocols's Introduction

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 <PORT> <LOSS_PROB> <ACK_TIMEOUT> <MESSAGE>
      Receiver: python sw_receiver.py <PORT> <LOSS_PROB>

    2. Go Back N ARQ
      Sender: python gbn_sender.py <PORT> <SEQ_NO_BIT_WIDTH> <LOSS_PROB> <ACK_TIMEOUT> <MESSAGE>
      Receiver: python gbn_receiver.py <PORT> <SEQ_NO_BIT_WIDTH> <LOSS_PROB>

    3. Selective Repeat ARQ
      Sender: python sr_sender.py <PORT> <SEQ_NO_BIT_WIDTH> <LOSS_PROB> <ACK_TIMEOUT> <MESSAGE>
      Receiver: python sr_receiver.py <PORT> <SEQ_NO_BIT_WIDTH> <LOSS_PROB>

    4. CSMA/CA Simulation
      CSMA/CA has been implemented on top of Stop and Wait ARQ
      Sender station: python sender_station.py <PORT> <LOSS_PROB> <ACK_TIMEOUT> <CHANNEL_BUSY_PROB> <IFS> <MAX_K> <MESSAGE>
      Base Station: python base_station.py <PORT> <LOSS_PROB>

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 Stop and Wait ARQ

Go Back N ARQ Go Back N ARQ

Selective Repeat ARQ Selective Repeat ARQ

CSMA/CA Simulation CSMA/CA Simulation

UEC1604 - Communication Networks, SSN College of Engineering

arq-protocols's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.