A routing simulation combining shortest paths with longest-prefix IP lookup.
Python · Tries · Dijkstra · NetworkX · Graphviz
Overview · Getting started · Repository guide · Reproducibility
Original five-router topology saved in Project.ipynb.
| Detail | Project information |
|---|---|
| Focus | IP routing with graph algorithms and prefix data structures |
| Start here | Project.ipynb |
| Run mode | Local Jupyter notebook; Graphviz executable for trie diagrams |
| Explore | Routing tables, packet-forwarding paths, and topology/trie images |
A notebook implementation of a small IP routing simulation. Dijkstra's algorithm computes routes through a weighted router graph, while binary prefix tries choose next hops by longest-prefix match during packet forwarding.
- Router and network abstractions with a predefined five-router topology.
- Heap-based Dijkstra shortest-path calculation.
- IPv4 prefix insertion and longest-prefix lookup using binary tries.
- Routing-table output, topology/trie visualizations, and forwarding with loop detection.
Explanatory diagram. Detailed implementation and availability notes follow below.
Install Python, Jupyter, and the visualization packages:
python -m pip install jupyter networkx matplotlib graphvizTrie-image rendering also needs the Graphviz system executable dot on PATH; the Python graphviz package alone does not provide it.
Open Project.ipynb and run its code cell. The notebook defines the topology, computes tables, renders diagrams, and forwards a sample packet.
The topology is defined in code and needs no external dataset. The sample 192.168.5.10 address belongs to RouterD's /24 network; an adjacent comment incorrectly labels it as RouterE. The implementation does not record a /0 default route as an initial match, so treat it as a limited demonstration rather than a complete router.
| File | Purpose |
|---|---|
| Project.ipynb | Complete routing simulation and saved topology output. |
| A8(final).pdf | Project documentation. |
| Digital_DSA.pdf | Supporting write-up. |
| chdsa.docx | Additional written material. |
The topology preview above is an original saved notebook output. The simulation illustrates data structures and routing decisions; it is not a measured throughput or real-network deployment benchmark. Running the notebook also generates per-router trie PNGs.
- Correct the sample-destination comment and cover default-route behavior.
- Add focused algorithm checks for overlapping prefixes, disconnected routers, and forwarding loops.
Run documentation checks and maintain visuals
Local documentation links and image headers are checked on pull requests and relevant pushes by the documentation workflow. Run the same check locally:
python tools/check_docs.pySee the reproducibility guide for evidence, missing artifacts, and visual-source notes. The check validates documentation files; it does not train models or certify application behavior.
