Skip to content

Add a TCP trace helper

Tracing TCP flows is challenging because the socket objects are created at runtime, while trace connection is typically done at configuration time, when the sockets do not yet exist.

This issue describes more about the issue: https://www.nsnam.org/bugzilla/show_bug.cgi?id=2336

The general idea of a solution would be to allow users to specify a TcpTraceHelper such as:

TcpTraceHelper tcpTraceHelper;
tcpTraceHelper.Trace (/* some possibly wildcarded 5-tuple flow specifier */);

and have this trace helper register with the nodes to wait for callbacks of new connection instantiation, and to hook a trace when the pattern matches.

Some issues to consider include:

  • whether to directly specify nodes involved, or let the helper figure them out
  • format for trace file output
  • format for trace file names
  • which trace sources to provide support for (if not all of them)