Skip to content

Chloe2330/dynamic-routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asynchronous Dynamic Routing Simulations

Uses asyncio to simulate all routers concurrently exchanging messages and executing algorithms in:

  1. Distance Vector Routing: Routers with decentralized information about their neighbors update their vectors using the Bellman-Ford algorithm to find optimal routing paths.
  2. Link State Routing: Routers with a global network view create a shortest path tree using Dijkstra's algorithm to find optimal routing paths.

Dependencies

  • Python 3.x, git
  1. Clone the repository:
git clone https://github.com/Chloe2330/dynamic-routing.git
  1. Set the PYTHONPATH
cd dynamic-routing
export PYTHONPATH="$(pwd):$PYTHONPATH"

Distance-vector routing (Bellman-Ford)

  1. Run DVR Simulation
python -u "distance_vector/dvr.py"

Link-state routing (Dijkstra)

  1. Run LSR Simulation
python -u "link_state/lsr.py"
  • Typically, each router floods the network with advertisements and constructs its own network graph from the received data. For simplicity, I create the graph once for all routers to share.

Notes

  • Scope: Only supports simple, undirected network graph topologies.
  • Live Update:
    • Disable auto-save in VS Code to avoid premature JSON processing
    • Manually save config.json after finalizing changes
  • Restrictions: Invalid or complex graphs (e.g., non-existent nodes, multiple edges between nodes) will cause errors or invalid results

About

Distance-vector and link-state routing simulations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages