Bug 1722 - beacons transmitted concurrently
beacons transmitted concurrently
Product: ns-3
Classification: Unclassified
Component: wifi
All All
: P5 normal
Assigned To: Daniel L.
Depends on:
  Show dependency treegraph
Reported: 2013-06-28 10:32 EDT by Jonathan Ling
Modified: 2013-10-04 09:47 EDT (History)
3 users (show)

See Also:

A patch to random the time for the first beacon (1.16 KB, patch)
2013-08-21 21:20 EDT, Daniel L.
Details | Diff
patch using attributes (5.19 KB, patch)
2013-09-11 08:40 EDT, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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