Problem in offsetting start times of server in BulkSendApplication - A possible bug?

37 views
Skip to first unread message

Varun Reddy

unread,
Jun 4, 2017, 11:47:45 AM6/4/17
to ns-3-users
There are 5 Wifi stations sending 1000 bytes to a single AP. I want to offset their application start times by using the following snippet:

  double t = 0;
  double SimulationStartTime = 2;
 
for (unsigned int i = 0; i < staNodes.GetN(); i++)
 
{
    t
=SimulationStartTime+(double)(i)/100;
    server
.SetAttribute ("StartTime", TimeValue (Seconds (t)));
    serverApp
.Add(server.Install (staNodes.Get (i)));
    std
::cout<<"Station "<<i+1<<" starting at "<<t<<"s\n";
 
}

The start times can be verified by looking at output.txt (attached). The problem that occurs is that data is sent twice by all the 5 stations to the AP. This doesn't happen when I just set the same starting time for all stations:

serverApp.Start (Seconds (2.0));

What's wrong about my implementation? Or could this be a bug?

Thanks,
Varun
wifi-tcp.cc
output.txt

Rediet

unread,
Jun 6, 2017, 2:45:23 AM6/6/17
to ns-3-users
Hello Varun,

In your script, just above the lines provided in the post, you have forgotten to comment the default installation:
 server.SetAttribute ("MaxBytes", UintegerValue (payloadSize));
 
ApplicationContainer serverApp = server.Install (staWifiNode);

 
/* Start Applications */

Cheers,

Rediet

Varun Reddy

unread,
Jun 6, 2017, 6:35:59 PM6/6/17
to ns-3-users
Thank you so much Rediet. Can't believe I missed that line of code.

Varun
Reply all
Reply to author
Forward
0 new messages