Ns3 Logging

154 views
Skip to first unread message

Sathyanarayanan Chandrasekharan

unread,
Nov 17, 2014, 12:47:54 AM11/17/14
to ns-3-...@googlegroups.com
Hi Guys,

I am working with the WiFi module of ns3 simulator. However, my question pertains to ns3 simulator as a whole.

Can we enable logging on a per node basis? For example, if I have 100 nodes in the simulation, I could not find a way to enable logging only in node 7.

Also, could we track or enable logging on a per packet basis? For example, in a simulation can I track a specific packet (Packet 100) from a specific node (Node 70)?

Thanks in advance,
Sathya

Tommaso Pecorella

unread,
Nov 17, 2014, 2:52:19 AM11/17/14
to ns-3-...@googlegroups.com
Hi,

nice question. It would be, indeed, a nice feature. Alas, we don't have it. It's an all-or-nothing (on a per-class basis).
You could try something strange with the log prefixes, but I'm not sure if you can selectively remove the log lines you are not interested into.
The best suggestion I can give you is to use NS_LOG_APPEND_NODE_PREFIX (see the manual) and use grep to filter what you are interested into.

As for the packet-selective logging... I fear it's next to impossible, since there's no strict guarantee that a packet is kept as it is during its lifetime. In other words, there's a problem in identifying the packet.

Cheers,

T.

Sathyanarayanan Chandrasekharan

unread,
Nov 17, 2014, 9:32:40 PM11/17/14
to ns-3-...@googlegroups.com
Hi,

Thanks for the prompt reply.

Regarding the first question, it is just that the debugging becomes exponentially complex with large number of nodes as opposed with smaller simulations. But thanks for the suggestion to use grep to filter out.

With the second question, I believe the identification of a packet is a problem due to the way in which it emulates the real-world system. In other words, the packet does not have a unique id by which we could trace it through the simulation as the sequencing is handled by individual layers. Do you think it would be worthwhile to have a unique id for the packet class in general so that atleast in simulations it would be easier to trace and debug?

BR,
Sathya

Tommaso Pecorella

unread,
Nov 18, 2014, 10:08:07 AM11/18/14
to ns-3-...@googlegroups.com
Hi,

the packets already have a unique UID, but it is not guaranteed to be kept through the simulation. The obvious example is when packets are aggregated in a bundle (for example: AMPDU in Wi-Fi, TCP buffers and so on).
As a consequence, no, the feature could be nice only in a very limited number of cases. In any "decent" protocol simulation we can not guarantee to be able to track a packet though its UID.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages