Applicable VersionsNetSim StandardNetSim Pro


Applicable Releasev13


In NetSim Packet times are logged in each layer of the TCP/IP network stack. Generally, the PHY layer end time can be considered as the time at which a packet reaches the destination. Information can be accessed (i) Post simulation, or (ii) At run time, as explained below. 
 
Post Simulation


 Observe the Packet Trace log file as shown below:


The packet trace option can be enabled prior to running the simulation.
The log file can be accessed post-simulation from the Simulation Results dashboard.


At run time

This information can be accessed in code from the packet structure. The NetSim Packet structure is defined in the Packet.h file which is part of the Source Code Include directory. 

 
This includes the pointers to the data associated with the Application, Transport, Network, Mac, and Phy layers. These structures are also defined in the same file with Arrival time being part of each of them as shown below:

For instance, the Network Layer arrival time is updated in the IP.c file as part of the fn_NetSim_IP_Run() function under the NETWORK_OUT_EVENT case as shown below:


The arrival time at each layer of the stack can also be accessed from the packet similarly.