Network Manager
Definition of the Network Manager.
This module defines the NetworkManager ABC and the default NetworkManager, DistributedNetworkManager.
- class sequence.network_management.network_manager.DistributedNetworkManager(owner: QuantumRouter, memory_array_name: str, component_templates=None)
The default Network Manager implementation.
- protocol_stack
list of protocols in the network manager stack, ordered from lowest to highest.
- Type:
list[StackProtocol]
- forwarding_table
mapping of destination node to next hop for forwarding.
- Type:
dict[str, str]
- create_stack() list[StackProtocol]
Helper function to stand up the protocols
- Returns:
list of protocol instances in the stack, ordered from lowest to highest.
- Return type:
list[StackProtocol]
- get_forwarding_table() dict[str, str]
Returns the forwarding table.
- Returns:
forwarding table mapping destination node to next hop.
- Return type:
dict[str, str]
- load_stack(stack: list[StackProtocol])
Method to load a defined protocol stack.
- Parameters:
stack (list[StackProtocol]) – New protocol stack.
- pop(msg: RSVPMessage)
Pop a message. This is a message coming from its internal RSVP protocol.
- Parameters:
msg (RSVPMessage) – message received from another node.
- push(dst: str, msg: Message)
Push a message. This is an OUTBOUND message that will be sent to another node.
- Parameters:
dst (str) – destination node of the message.
msg (Message) – message to be sent.
- received_message(src: str, msg: NetworkManagerMessage)
Handle Message received from another node that is directed into the NetworkManager.
- Parameters:
src (str) – name of source node that sent the message.
msg (NetworkManagerMessage) – the message received from the source node.
- request(responder, start_time, end_time, memory_size, target_fidelity, entanglement_number=1, identity=0)
- Handle Requests from the Application by pushing the request into the stack.
The RSVP protocol at the top of the stack will handle it.
- Parameters:
responder (str) – name of node with which entanglement is requested.
start_time (int) – reservation start time in picoseconds.
end_time (int) – reservation end time in picoseconds.
memory_size (int) – number of entangled memories requested (at the initiator and responder).
target_fidelity (float) – desired fidelity of entanglement.
entanglement_number (int) – the number of entanglement pairs the request ask for.
identity (int) – the ID of a request
- set_forwarding_table(forwarding_table: dict)
Set the forwarding table for the network manager.
- Parameters:
forwarding_table (dict) – mapping of destination node to next hop.
- class sequence.network_management.network_manager.NetworkManager(owner: QuantumRouter, memory_array_name: str, **kwargs)
Network Manager Abstraction Has the following responsibilities: Take in a reservation request, complete scheduling in some manner, receive the decided path, and finally inform the ResourceManager to create Rules.
- name
name of the network manager instance.
- Type:
str
- owner
node that network manager is attached to.
- Type:
- memory_array_name
name of the memory array component in the node.
- Type:
str
- memo_arr
reference to the memory array component in the node.
- Type:
- timecards
list of timecards for each memory in the node, each timecard is associated with a memory in the memory array.
- Type:
list[MemoryTimeCard]
- classmethod create(owner, memory_array_name: str, **kwargs: Any) NetworkManager
Factory method to create network manager instance based on global type.
- Parameters:
owner (QuantumRouter) – node that network manager is attached to.
memory_array_name (str) – name of the memory array component in the node.
**kwargs – additional arguments to pass to the network manager constructor.
- Returns:
instance of network manager based on global type.
- Return type:
- generate_rules(reservation: Reservation)
Generate and load rules for a given reservation.
- Parameters:
reservation (Reservation) – reservation for which to generate rules.
- abstractmethod received_message(src: str, msg: NetworkManagerMessage)
Handle Message received into the NetworkManager.
- classmethod register(name, network_manager_cls=None)
Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
- abstractmethod request(responder, start_time, end_time, memory_size, target_fidelity, entanglement_number=1, identity=0)
Handle Requests from the Application.
- class sequence.network_management.network_manager.NetworkManagerMessage(msg_type: Enum, receiver: str, payload)
Message used by the network manager.
- msg_type
message type required by base message type.
- Type:
Enum
- receiver
name of destination protocol instance.
- Type:
str
- class sequence.network_management.network_manager.NetworkManagerMsgType(*values)