Bug 490 - OnOffApplication: m_lastStartTime not set correctly
OnOffApplication: m_lastStartTime not set correctly
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
ns-3-dev
All All
: P1 normal
Assigned To: Rajib Bhattacharjea
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-05 12:28 EST by Tom Henderson
Modified: 2009-03-12 16:19 EDT (History)
2 users (show)

See Also:


Attachments
suggested patch (2.02 KB, patch)
2009-02-05 12:29 EST, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2009-02-05 12:28:56 EST
m_lastStartTime needs to be set both when a packet is sent and when the application starts sending.  Otherwise, it is possible for an application to start and stop without a packet being sent, and the computation for m_residualBits becomes incorrect.  An artifact of the current bug is that csma-multicast.cc script doesn't send any packets.

Also, the behavior of OnOffApplication needs to be better documented because it wasn't intuitive to me that state is saved across stop/start event sequences.
Comment 1 Tom Henderson 2009-02-05 12:29:34 EST
Created attachment 373 [details]
suggested patch
Comment 2 Rajib Bhattacharjea 2009-02-25 15:46:07 EST
Makes perfect sense; if its tested, please commit.
Comment 3 Rajib Bhattacharjea 2009-03-02 15:13:37 EST
The patch breaks the regression in two tests:
FAIL: 2 of 22 tests have failed (test-csma-multicast, test-csma-raw-ip-socket)

Tom, can you comment on whether or not you'd expect the regression traces to change in these two cases?  It seems that most of our tests use the OnOff application, but only two of them change their output.
Comment 4 Rajib Bhattacharjea 2009-03-02 15:16:48 EST
Whoops, didn't mean to close the bug.
Comment 5 Craig Dowell 2009-03-02 15:37:48 EST
Somewhere along the line the csma-multicast regression test was actually disabled because an app change caused it to cease emitting packets.  Tom and I had a laugh when he disabled multicast in his ipv4 rework and the multicast tests continued to pass.

All of the traces for csma-raw-ip-socket are also empty now as well, probably due to the same thing.

If your change causes these tests to begin emitting packets, that is "A Good Thing" (TM).
Comment 6 Tom Henderson 2009-03-03 03:57:54 EST

(In reply to comment #3)
> The patch breaks the regression in two tests:
> FAIL: 2 of 22 tests have failed (test-csma-multicast, test-csma-raw-ip-socket)
> 
> Tom, can you comment on whether or not you'd expect the regression traces to
> change in these two cases?  It seems that most of our tests use the OnOff
> application, but only two of them change their output.
> 

Yes, my initial comment said that csma-multicast was broken by this bug.  test-csma-raw-ip-socket also has no packets because of this bug.  It seemed to me that this patch causes packets to flow correctly in those cases.

Can you please commit it?  
Comment 7 Rajib Bhattacharjea 2009-03-12 16:19:15 EDT
4262:170eff4aba90 in ns-3-dev

72:b58c70b348d4 is ns-3-dev-ref-traces