Routing¶
Definition of Routing protocol.
This module defines the StaticRouting protocol, which uses a pre-generated static routing table to direct reservation hops. Routing tables may be created manually, or generated and installed automatically by the Topology class. Also included is the message type used by the routing protocol.
- class src.network_management.routing.StaticRoutingMessage(msg_type: Enum, receiver: str, payload: Message)¶
Message used for communications between routing protocol instances.
- msg_type¶
type of message, required by base Message class.
- Type:
Enum
- receiver¶
name of destination protocol instance.
- Type:
str
- class src.network_management.routing.StaticRoutingProtocol(own: Node, name: str, forwarding_table: Dict)¶
Class to route reservation requests.
The StaticRoutingProtocol class uses a static routing table to direct the flow of reservation requests. This is usually defined based on the shortest quantum channel length.
- name¶
label for protocol instance.
- Type:
str
- forwarding_table¶
mapping of destination node names to name of node for next hop.
- Type:
Dict[str, str]
- add_forwarding_rule(dst: str, next_node: str)¶
Adds mapping {dst: next_node} to forwarding table.
- pop(src: str, msg: StaticRoutingMessage)¶
Message to receive reservation messages.
Messages are forwarded to the upper protocol.
- Parameters:
src (str) – node sending the message.
msg (StaticRoutingMessage) – message received.
- Side Effects:
Will call pop method of higher protocol.
- push(dst: str, msg: Message)¶
Method to receive message from upper protocols.
Routing packages the message and forwards it to the next node in the optimal path (determined by the forwarding table).
- Parameters:
dst (str) – name of destination node.
msg (Message) – message to relay.
- Side Effects:
Will invoke push method of lower protocol or network manager.
- received_message(src: str, msg: Message)¶
Method to directly receive messages from node (should not be used).
- update_forwarding_rule(dst: str, next_node: str)¶
updates dst to map to next_node in forwarding table.