Routing Packet¶
The Routing Packet object is similar to the Packet object with the difference that it is analogous to a network layer packet from the Internet. The main difference in our implementation is that these packets have a TTL (time to live) property such that they are eliminated from the network after some number of relays or “hops” in the network.
-
class
qunetsim.objects.packets.routing_packet.
RoutingPacket
(sender, receiver, protocol, payload_type, payload, ttl, route)¶ Bases:
object
A network layer packet.
-
decrease_ttl
()¶ Decreases TTL by 1.
-
property
payload
¶ The payload of the packet which is a transport layer packet.
- Returns
The payload of the network packet.
- Return type
payload (Packet)
-
property
payload_type
¶ If the payload is classical of quantum (i.e. a qubit or classical data).
- Returns
The payload type.
- Return type
payload_type (str)
-
property
protocol
¶ The network layer protocol for this packet.
- Returns
The protocol for the packet.
- Return type
protocol (str)
-
property
receiver
¶ The receiver ID of the packet.
- Returns
The receiver ID of the packet.
- Return type
receiver (str)
-
property
route
¶ The route the packet should take.
- Returns
A list of host IDs which the packet will travel.
- Return type
route (list)
-
property
sender
¶ The sender ID of the packet.
- Returns
The sender ID of the packet.
- Return type
sender (str)
-
property
ttl
¶ Time to live (TTL) of the packet. When this goes to 0 the packet is removed from the network.
- Returns
The time to live of the packet.
- Return type
ttl (int)
-