Skip to the content.

IPv6 GlobalRouting

Student: Shashwat Patni

Mentors: Tommaso Pecorella, Manoj Kumar Rana

Organisation: ns-3 Network Simulator

Repository: Repository


📖 Project Overview

The goal of this project was to extend ns-3’s native GlobalRouting protocol to support IPv6 while minimizing code duplication from the existing IPv4 implementation. Global Routing is based on the quagga implementation of the OSPF Routing Protocol (RFC 2328) and uses the Djikstra Shortest path algorithm to compute paths for a single area network configuration. The problem is that GlobalRouting doesn’t work for IPv6, and that’s a huge limitation. The goal of the project was to fix that limitation . Over the summer , we extended and refactored the code , to make globalRouting Also Work for IPv6 , using the same fundamental Algorithm, and tweaks to handle IPv6 vs IPv4 Differences.

Along the way we faced some obstacles:

One of the main goals was to come up with a way to minimize code duplication. During the Project we Explored different programing alternatives to the problem, namely static polymorphism vs dynamic vs a hybrid approach. Each Design came with its own Pros and Cons . We felt that Template Meta-Programming offerred the best alternative. The tradeoff between dynamic and Static Polymorphism was runtime Performance vs Compile time Checks and complexity with the code base . We finally decided to go with the Static Route due to its various advantages. We actually developed both versions halfway , to better understand each in GlobalRoutings Context. This way we could understand that using Runtime Checks was not good enough for our use case.

After discussing with Mentors it was decided to use the Static Polymorphism approach to Generalize IPv4GlobalRouting to the generic GlobalRouting using template Meta-Programming. Using Compile Time Checks , we instantiated Two versions of the template , one for each of the address class.

Along the way I found and fixed some CRITICAL bugs lurking in the protocol and also added a few performance improvements.


Merge Requests and Commits Summary

No. Name Status Commit
[1] internet: test: Add Tests for GlobalRouting Merged [1] [2]
[2] internet: (fixes #1243) GlobalRouting: Change NextHopCalculation from Network to Attached Router Merged [1] [2]
[3] internet: Add Ptr member to SPFVertex to Improve Performance Merged [1]
[4] internet: (fixes #1242) Remove Identical Route entries and document known limitations for GlobalRouting Merged [1] [2]
[5] internet: Add PrintRoute function For Global Routing In Review [1]
[6] internet: Generalize Ipv4GlobalRouting to Generic Global Routing Classes using Templates In Review -
[7] internet: Add Ipv6 Support to Global Routing In Review -

Features Implemented


Milestones

The Project was divided into three Phases and two Milestones:

Phase 1:

Phase 2:

Phase 3:

— Deliverables —
Milestone 1 Generalize Ipv4GlobalRouting to Generic Global Routing Classes using Templates Source Code
Milestone 2 Add Ipv6 Support to Global Routing Source Code

My Experience

Acknowledgements

I would like to thank all my mentors and the ns-3 developers for providing guidance and advice throughout the project, and for the opportunity to contribute to ns-3 through GSoC ‘25. GSoC taught me alot. I went from being clueless about open source , to my very first commit , to actually contributing in a meaningful way. Thank you to everyone from the community as well as from Google Summer of Code. A very special thanks to Tommaso for the constant support and encouragement. The weekly meetings were as fun as they were a learning experience. Discussing bugs and Design choices with the seasoned Pros of ns-3 was a surreal and amazing learning experience.

Challenges Faced

There were definitely times of doubt. When i felt like this bug will not go away, or there is something wrong with my design. For example: when i found the first few bugs in the implementation or when i was looking into the dynamic Polymorphic approach. Discussing with mentors and ns-3 devs helped a lot. These challenges helped me learn, as well. For starters, the Bitter/sweet Truth about programming in general. There are no dead ends, there are always alternatives leading to similar answers. Do NOT be Afraid to ask for help .

Suggestions for Future Contributors