Skip to content

Routing Module using Register#326

Open
caitaozhan wants to merge 6 commits intoRnDfrom
routing-module-register
Open

Routing Module using Register#326
caitaozhan wants to merge 6 commits intoRnDfrom
routing-module-register

Conversation

@caitaozhan
Copy link
Contributor

@caitaozhan caitaozhan commented Mar 13, 2026

Added the routing module: a new parent class RoutingProtocol for the subclasses StaticRoutingProtocol and DistributedRoutingProtocol. The register decorator is used to make it easy to plug in new routing protocols in the future.

Issue #325

… StaticRoutingProtocol and DistributedRoutingProtocol. The register decorator is used to make it easy to plug in new routing protocols in the future.
Copilot AI review requested due to automatic review settings March 13, 2026 00:55
@caitaozhan caitaozhan changed the title Routing Module using egister Routing Module using Register Mar 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new sequence.network_management.routing package that unifies routing protocols behind a RoutingProtocol base class + registry, and updates call sites/configs to use the new routing identifiers and forwarding-table update API.

Changes:

  • Added RoutingProtocol (registry + factory) and migrated StaticRoutingProtocol / DistributedRoutingProtocol into sequence/network_management/routing/.
  • Updated NetworkManager/topologies/tests/examples to reference the new routing module and to use update_forwarding_rule.
  • Updated JSON test topologies to use the new routing type strings (routing_static, routing_distributed).

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/topology/test_dqc_node_net_topo.py Adds an import-time test invocation (problematic).
tests/topology/dqc_node_net_topo_simple.json Updates routing type string to routing_static.
tests/network_management/test_routing.py Updates imports and logging module names for distributed routing.
tests/network_management/test_network_manager.py Switches to update_forwarding_rule API.
tests/network_management/ring_topo.json Updates routing type string to routing_distributed.
tests/network_management/line_topo.json Updates routing type string to routing_distributed.
sequence/topology/router_net_topo.py Uses new routing module import + update_forwarding_rule.
sequence/topology/dqc_net_topo.py Uses update_forwarding_rule when generating forwarding tables.
sequence/network_management/routing_static.py Removes old module (migrated into package).
sequence/network_management/routing/routing_static.py New static routing protocol registered via RoutingProtocol.
sequence/network_management/routing/routing_distributed.py Migrates distributed routing protocol + registers it; updates message receiver naming.
sequence/network_management/routing/routing_base.py Adds routing base class/registry + forwarding table helpers.
sequence/network_management/routing/init.py Re-exports routing APIs from the new package.
sequence/network_management/network_manager.py Switches routing protocol creation to registry-based factory.
sequence/network_management/init.py Updates exported submodules list.
sequence/gui/simulator_bindings.py Updates forwarding rule API usage (currently targets wrong object).
example/demo_for_beginners/three_node_eg_ep_es.ipynb Updates example calls to update_forwarding_rule.
CHANGELOG.md Documents the new routing module and adjusts formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@caitaozhan caitaozhan added this to the 1.0 milestone Mar 13, 2026
hayekr
hayekr previously approved these changes Mar 16, 2026
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a global type, or should we allow nodes to have differing routing protocols?

Copy link
Contributor Author

@caitaozhan caitaozhan Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The global_type is removed. I do not want to enforce that all nodes have the same routing protocol. Even though this might be the most common scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants