Skip to content

eomielan/routing-protocols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Routing Protocols

Overview

This project is a Python implementation of the link state and distance vector routing protocols. There are two separate programs: one that implements the link state protocol, and one that implements the distance vector protocol. Both programs read and use the same file format for the network’s topology as well as the same format for messages to send.

Instructions

  1. Run chmod +x dvr.sh lsr.sh to make the scripts executable.

  2. Run python3 -m venv myenv and then source myenv/bin/activate to start a virtual environment.

  3. Run pip install -r requirements.txt in the virtual environment to install dependencies.

  4. To start a simulation, run one of the following commands:

    Distance Vector Routing Protocol

    ./dvr.sh <topologyFile> <messageFile> <changesFile> [outputFile]
    

    Example:

    ./dvr.sh topology.txt message.txt changes.txt
    

    Link State Routing Protocol:

    ./lsr.sh <topologyFile> <messageFile> <changesFile> [outputFile]
    

    Example:

    ./lsr.sh topology.txt message.txt changes.txt
    
  5. Run pytest to run the tests.

    NOTE: The tests require dos2unix to run on Linux. If you do not already have this package installed please run:

    sudo apt-get update
    sudo apt-get install dos2unix
  6. Run deactivate to stop the virtual environment.

Testing

We used Pytest, a Python testing framework, to test our code. These test files can be found in the test directory.

To run the test suite:

  1. Complete the first three steps in the instructions to ensure Pytest is installed.
  2. In the command line, run pytest to start the test suite.

Note that you can run the test suite from the root or test directory.

About

Link state and distance vector routing protocols

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published