TR¶
-
class
NetworkSim.simulation.process.receiver.
TR
(env, until, receiver_id, simulator, model=None)[source]¶ Tunable receiver simulator.
- Parameters
env (simpy Environment) – The simulation environment.
receiver_id (int) – The receiver ID.
model (Model, optional) – The network model used for the simulation. Default is
Model()
.
- Variables
received_data_packet_df (pandas DataFrame) –
A DataFrame keeping the information of the received data packets, containing the columns:
Timestamp
Raw Packet
Source ID
received_control_packet_df (pandas DataFrame) –
A DataFrame keeping the information of the received control packets, containing the columns:
Timestamp
Raw Packet
Source ID
-
receive_on_control_ring
()[source]¶ Receiver process to remove a new control packet from the ring.
This process operates at the control clock frequency, and the control packet would only be removed from the ring if the destination ID of the packet corresponds to the receiver ID. The receiver would also check if the data packets reception precess is ready before receiving control packets.
In this process:
The receiver starts detecting for incoming control packets;
The receiver checks the destination ID of the control packet received;
When the IDs match, the receiver removes the control packet from the ring, keeps a record of the transmission. and informs the data reception subsystem.
Depends on the control_code, the packet will be added to a queue or remove a packet from the queue;
-
receive_on_data_ring
()[source]¶ Receiver process to remove a new data packet from the ring.
This process operates at the unit clock frequency, and the data packet would only be from the ring once its corresponding control packet has been received.
In this process:
The receiver takes
'tuning_time'
to tune to the data ring;The receiver waits and receives the data packet, removes it from the ring and keeps a record of the transmission.
The latency of the transmission is recorded.