Bug 1722

Summary: beacons transmitted concurrently
Product: ns-3 Reporter: Jonathan Ling <jonathan.ling77>
Component: wifiAssignee: Daniel L. <nikkipui>
Severity: normal CC: ns-bugs, ruben, tomh
Priority: P5    
Version: ns-3.17   
Hardware: All   
OS: All   
Attachments: A patch to random the time for the first beacon
patch using attributes

Description Jonathan Ling 2013-06-28 10:32:30 EDT
Currently beacons transmitted by APs are all transmitted concurrently.  This continues as they are repeated according to the beacon interval. 

This behavior is easily confirmed in wireshark, where the trace shows only one beacon other beacons because lie on top of each other.

There are some algorithms which might like to switch APs based on load, etc, and thus the beacons should be visible to all STAs.

Starting beaconing randomly does the trick:

//m_beaconEvent = Simulator::ScheduleNow (&ApWifiMac::SendOneBeacon, this);
UniformVariable z(0,1000);
m_beaconEvent = Simulator::Schedule(MicroSeconds(z.GetValue()),&ApWifiMac::SendOneBeacon, this);
Comment 1 Daniel L. 2013-08-21 21:20:07 EDT
Created attachment 1665 [details]
A patch to random the time for the first beacon

I think the attached patch will fix this issue.

It's not really a bug but something that is normal in the simulation where all APs start up at the same time (t=0) so all beacons will be sent out at the same time (t=0, t=beaconInterval, t=2*beaconInterval, ...).

The attached patch random the time for the first beacon uniformly between 1 and beaconInterval.

(I'm not sure which one is better between [1, beaconInterval] and [0, beaconInterval - 1] since 0 and beaconInterval are the same thing.)
Comment 2 Tom Henderson 2013-09-11 08:40:36 EDT
Created attachment 1668 [details]
patch using attributes

I'd like to instead suggest a variation that allows one to configure the random variable through the attribute system.
Comment 3 Daniel L. 2013-09-13 10:22:04 EDT
I tested Tom's patch with a few APs and everything is working as expected. I think it is ready to go.
Comment 4 Daniel L. 2013-10-04 09:47:58 EDT
changeset:   10206:ecd136bcb899