Rsvp
- class sequence.network_management.rsvp.QCap(node: str)
Quantum Capacity. Class to collect local information for the reservation protocol
- node
name of the current node.
- Type:
str
- class sequence.network_management.rsvp.RSVPMessage(msg_type, receiver: str, reservation: Reservation, **kwargs)
Message used by resource reservation protocol.
This message contains all information passed between reservation protocol instances. Messages of different types contain different information.
- msg_type
defines the message type.
- Type:
- receiver
name of destination protocol instance.
- Type:
str
- reservation
reservation object relayed between nodes.
- Type:
- qcaps
cumulative quantum capacity object list (if msg_type == REQUEST)
- Type:
list[QCaps]
- path
cumulative node list for an entanglement path (if msg_type == APPROVE or msg_type == REJECT)
- Type:
list[str]
- class sequence.network_management.rsvp.RSVPMsgType(*values)
Defines possible message types for the reservation protocol.
- class sequence.network_management.rsvp.RSVPProtocol(owner: QuantumRouter, name: str, memory_array_name: str)
ReservationProtocol for node resources.
The reservation protocol receives network entanglement requests and attempts to reserve local resources. If successful, it will forward the request to another node in the entanglement path and create local rules. These rules are passed to the node’s resource manager. If unsuccessful, the protocol will notify the network manager of failure.
- owner
node that protocol instance is attached to.
- Type:
- name
label for protocol instance.
- Type:
str
- memo_arr
memory array to track.
- Type:
- timecards
list of reservation cards for all memories on node.
- Type:
list[MemoryTimeCard]
- es_succ_prob
sets success_probability of EntanglementSwappingA protocols created by rules.
- Type:
float
- es_degradation
sets degradation of EntanglementSwappingA protocols created by rules.
- Type:
float
- accepted_reservations
list of all approved reservation requests.
- Type:
list[Reservation]
- next_hop_when_tracing_back(path: list[str]) str
the next hop when going back from the responder to the initiator
- Parameters:
path (list[str]) – a list of router names that goes from initiator to responder
- Returns:
the name of the next hop
- Return type:
str
- pop(src: str, msg: RSVPMessage)
Method to receive messages from lower protocols. Messages may be of 3 types, causing different network manager behavior:
- REQUEST: requests are evaluated and forwarded along the path if accepted.
Otherwise, a REJECT message is sent back.
REJECT: any reserved resources are released and the message forwarded back towards the initializer.
- APPROVE: rules are created to achieve the approved request.
The message is forwarded back towards the initializer.
- Parameters:
src (str) – source node of the message.
msg (RSVPMessage) – message received.
- Side Effects:
May push/pop to lower/upper attached protocols (or network manager).
- Assumption:
the path initiator -> responder is the same as the reverse path
- push(responder: str, start_time: int, end_time: int, memory_size: int, target_fidelity: float, entanglement_number: int = 1, identity: int = 0)
Method to receive reservation requests from higher level protocol.
Will evaluate the request and determine if the node can meet it. If it can, it will push the request down to a lower protocol. Otherwise, it will pop the request back up.
- Parameters:
responder (str) – node that entanglement is requested with.
start_time (int) – simulation time at which entanglement should start.
end_time (int) – simulation time at which entanglement should cease.
memory_size (int) – number of memories to be entangled.
target_fidelity (float) – desired fidelity of entanglement.
entanglement_number (int) – the amount of entanglement the request asked for.
identity (int) – the ID of the request.
- Side Effects:
May push/pop to lower/upper attached protocols (or network manager).
- received_message(src, msg)
Method to receive messages directly (should not be used; receive through network manager).
- schedule(reservation: Reservation) bool
Method to attempt a reservation request. If an attempt succeeded, return True; otherwise, return False.
- Parameters:
reservation (Reservation) – reservation to approve or reject.
- Returns:
if reservation can be met or not.
- Return type:
bool