Info¶
-
class
NetworkSim.simulation.tools.info.
Info
(simulator)[source]¶ Information class to generate basic information of modules involved in the simulation.
-
ram_info
(device_id)[source]¶ Obtain information on generated data packets in transmitter RAM.
- Parameters
device_id (int) – The ID of the RAM.
- Returns
generated_packets – A DataFrame with the generated data packets that have been stored in transmitter RAM, containing the columns:
- Timestampfloat
The timestamp when the packet is generated using the method chosen.
- Interarrival to Nextfloat
The interarrival time from this packet to the next one.
- Raw Packetstr or list
The raw data packet generated, in string format if simulation is not abstract, and in list format if simulation is abstract.
- Destination IDint
The destination node ID to which the data packet is supposed to be sent.
- Return type
pandas DataFrame
-
receiver_info
(device_id, info_type)[source]¶ Obtain information on received control or data packets in receiver.
- Parameters
device_id (int) – The ID of the receiver.
info_type (str) – The type of information requested, chosen from the following:
- control
Received control packets.
- data
Received data packets.
- queue
RAM queue of control packets.
- Returns
packet_information – A DataFrame with the receiver=d control or data packets.
If control ring is selected, the output contains the columns:
- Reception Timestampfloat
The timestamp when the control packet is received from the control ring.
- Raw Packetstr or list
The received raw control packet, in the format of a list if abstract simulation is used or string if the simulation is not abstract.
- Source IDint
The source node ID from which the control packet is received.
If data ring is selected, the output contains the columns:
- Reception Timestampfloat
The timestamp when the data packet is received from the data rings.
- Raw Packetstr or list
The received raw data packet, in the format of a list if abstract simulation is used or string if the simulation is not abstract.
- Source IDint
The source node ID from which the data packet is received.
If internal RAM queue is selected, the output contains the columns:
- Operation Timestampfloat
The timestamp when the operation is carried out.
- Raw Packetstr
The raw control packet.
- Source IDint
Source ID of the control packet.
- Operationstr
Operation carried out on the packet in the queue.
- Return type
pandas DataFrame
-
ring_info
(ring_id, info_type)[source]¶ Obtain packet transmission information on the control or data ring.
- Returns
packet_record – A DataFrame containing the information on all packet transmission on the ring, including the columns:
- Generation Timestampfloat
The timestamp when the packet is generated and stored in the RAM.
- Transmission Timestampfloat
The timestamp when the packet is added onto the ring by the transmitter.
- Reception Timestampfloat
The timestamp when the packet is received by the receiver.
- Raw Packetstr
The raw packet content.
- Source Nodeint
The ID of the source node.
- Destination Nodeint
The ID of the destination node.
- Statusstr
The status of the packet, can be
added
orremoved
.
- Total Packet Countint
The total number of packets on the ring at the time of the operation.
- Return type
pandas DataFrame
-
transmitter_info
(device_id, info_type)[source]¶ Obtain information on transmitted control or data packets in transmitter.
- Parameters
device_id (int) – The ID of the transmitter.
info_type (str) – The type of ring on which the transmitter transmits the packets.
- Returns
transmitted_packets – A DataFrame with the transmitted control or data packets.
If control ring is selected, the output contains the columns:
- Transmission Timestampfloat
The timestamp when the control packet is transmitted onto the control ring.
- Raw Packetstr or list
The transmitted raw control packet, in the format of a list if abstract simulation is used or string if the simulation is not abstract.
- Destination IDint
The destination node ID to which the control packet is transmitted.
If data ring is selected, the output contains the columns:
- Transmission Timestampfloat
The timestamp when the data packet is transmitted onto the data rings.
- Raw Packetstr or list
The transmitted raw data packet, in the format of a list if abstract simulation is used or string if the simulation is not abstract.
- Destination IDint
The destination node ID to which the data packet is transmitted.
- Return type
pandas DataFrame
-