Except for the initialization and the closure, calls to all functions are through the 
fn_NetSim_<protocol>_Run ( ) function , for example fn_NetSim_TCP_Run ()


Within this you would notice <LAYER>-IN, <LAYER>-OUT and TIMER events. For example in TCP, you would notice


TRANSPORT_IN, TRANSPORT_OUT and TIMER events


The IN is for when a packet enters a device and the OUT is for when a packet leaves a device.


Related articles:

How can I access parameters of a node in NetSim code i.e Velocity, Location, Direction, Energy level, Distance etc?

Explain the working & code for data rate versus MCS in 802.11 in NetSim?

Where can I find source codes related to 802.11 ac MU-MIMO in NetSim?

How do I get started with IoT code and implementation in NetSim?