A Discrete-Event Network Simulator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Internet Stack Model
+ Collaboration diagram for Internet Stack Model:

Tracing in the Internet Stack

The internet stack provides a number of trace sources in its various protocol implementations. These trace sources can be hooked using your own custom trace code, or you can use our helper functions in some cases to arrange for tracing to be enabled.

Tracing in ARP

ARP provides two trace hooks, one in the cache, and one in the layer three protocol. The trace accessor in the cache is given the name "Drop." When a packet is transmitted over an interface that requires ARP, it is first queued for transmission in the ARP cache until the required MAC address is resolved. There are a number of retries that may be done trying to get the address, and if the maximum retry count is exceeded the packet in question is dropped by ARP. The single trace hook in the ARP cache is called,

A second trace hook lives in the ARP L3 protocol (also named "Drop") and may be called for a number of reasons.

Tracing in IPv4

The IPv4 layer three protocol provides three trace hooks. These are the "Tx" (ns3::Ipv4L3Protocol::m_txTrace), "Rx" (ns3::Ipv4L3Protocol::m_rxTrace) and "Drop" (ns3::Ipv4L3Protocol::m_dropTrace) trace sources.

The "Tx" trace is fired in a number of situations, all of which indicate that a given packet is about to be sent down to a given ns3::Ipv4Interface.

The "Rx" trace is fired when a packet is passed from the device up to the ns3::Ipv4L3Protocol::Receive function.

The "Drop" trace is fired in any case where the packet is dropped (in both the transmit and receive paths).

Tracing in ns-3 TCP

There is currently one trace source in the ns-3 TCP implementation named "CongestionWindow" (see ns3::TcpSocketImpl::m_cWnd). This is set in a number of places (see file tcp-socket-impl.cc) whenever the value of the congestion window is changed.

Tracing in NSC TCP

There is currently one trace source in the Network Simulation Cradle TCP implementation named "CongestionWindow" (see ns3::NscTcpSocketImpl::m_cWnd). This is set in a number of places (see file nsc-tcp-socket-impl.cc) when the value of the cogestion window is initially set. Note that this is not instrumented from the underlying TCP implementaion.

Tracing in ns-3 UDP

There is currently one trace source in the ns-3 UDP implementation named "Drop" (see ns3::UdpSocketImpl::m_dropTrace). This is set when a packet is received in ns3::UdpSocketImpl::ForwardUp and the receive buffer cannot accomodate the encapsulated data.