Bug 1910 - Tx trace is fired at wrong time and is not recorded in ascii trace
Tx trace is fired at wrong time and is not recorded in ascii trace
Product: ns-3
Classification: Unclassified
Component: csma
All All
: P5 normal
Assigned To: ns-bugs
Depends on:
  Show dependency treegraph
Reported: 2014-05-02 07:05 EDT by Tommaso Pecorella
Modified: 2014-05-02 13:37 EDT (History)
1 user (show)

See Also:

patch (8.68 KB, application/octet-stream)
2014-05-02 07:05 EDT, Tommaso Pecorella

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2014-05-02 07:05:50 EDT
Created attachment 1833 [details]

The CsmaNetDevice does not record the "t" event in the ASCII trace.

Moreover (and perhaps more important), the MacTx trace is called as soon as a packet reaches the NetDevice for transmission, regardless if it is dropped. The packet itself may be further delayed by channel activity, making it hard to track when the packet was effectively transmitted.

As a matter of fact, the MacTx trace is a duplicate of the Enqueue trace, differing only because the latetr could not be fired if the packet is dropped by the queue.

The proposed patch fixes this by:
1) firing MacTx only when the packet is actually transmitted, and
2) providing default hooks for Tx events
Comment 1 Tom Henderson 2014-05-02 11:45:24 EDT
I'm skeptical of this patch.  In 2009 timeframe, Craig Dowell and Mathieu Lacage worked on aligning trace source semantics across the devices we had at the time.  Some discussion of this is in bug 443, some can be found on ns-developers mailing list around that time.

There are two aspects to your proposed patch:

1) enabling MacTx by the CsmaHelper for ascii tracing.

If you read the comments in the code, Craig suggested that the 't' event should instead be provided by the queue, since the semantics of MacTx across multiple devices are that this

The goal of the ascii trace helper is not to enable all possible traces but instead to provide an 'ns-2-like' trace file.

2) changing the semantics of MacTx firing in the model code

Again, this patch would change the intended behavior of this trace (csma-net-device.cc:91).

So if this bug is driven by a user complaining that the traces do not show an expected t event, let's look at what 't' should correspond to and see if it can be enabled.  But I'm not inclined to make the changes proposed by the patch.
Comment 2 Tommaso Pecorella 2014-05-02 13:37:21 EDT
To be honest I'm (partially) skeptic about it too. That's why I didn't push it :)

Only partially, tho.

I'll move the discussion to ns-dev, to have a larger audience.