How to set up beacon data rate

Hello there, this is my first post here.
I am working on a project to benchmark the AP with different beacon data rates. I want to set up the beacon to 802.11b with 1, 2, 5.5, and 11 Mbps and 802.11g with 6, and 12 Mbps. I am using a raspberry pi 3b and tried both ubuntu+hostapd and OpenWrt. However, the beacon is always 802.11b with a 1 Mbps data rate, no matter how I change the hostapd.conf (hostapd) or /etc/config/wireless (openwrt). this is confirmed using Wireshark to monitor the beacon frame in the air.

I tried to add beacon_rate in hostapd.conf but I got
nl80211: Driver does not support setting* Beacon frame rate

with OpenWrt, I tried to disable the legacy rate, and set the basic rate. all the measures don't work.

so what is the right way to set the beacon's data rate? is it the nl80211 driver limitation? or do I need another wifi card?

thank you.

Seems rather clear.

I thought this was what you wanted?

Have you seen the information on basic_rate, legacy_rates and supported_rates parameters here:


It is recommended to use the cell_density option instead.

(BTW I think 802.11b is deprecated - it definitely causes congestion/interference with newer WiFi.)

hi lleachii, thank you for your reply.
what I want is to generate WiFi beacons with various data rates. it doesn't have to be the setup I am using now.
these rate parameters in OpenWrt only have an effect on regular transmissions, not the beacon (maybe I am wrong on this). the beacon is always 802.11b 1 Mbps even though I disabled the legacy rates or set some basic_rate.
with Wireshark, I see many WiFi beacon signal has a data rate of 6 or 11 Mbps, so how can I achieve it?

Hi there,

Something is weird. The beacon rate is 1 Mbit/s only if 802.11b is enabled; otherwise, it's 6 Mbit/s.

In any case, look at /lib/netifd/ You'll see a beacon_rate parameter you can use in your /etc/config/wireless. It's not in the Wiki, and you can configure it the same way you configure cell_density or basic_rates.


Hi amteza
I have unchecked the Allow legacy 802.11b rates in the General Setup of the wireless network. but I still get 802.11b 1 Mbps beacon signals (other signals are 802.11g 6 Mbps)

as per your suggestion, I added one line in /etc/config/wireless in the wifi-device group

option beacon_rate '20'

then I use wifi down and wifi up, the wifi won't start. On the wifi setup page, it is said Wireless is not associated.

with logread, I saw

hostapd: nl80211: Driver does not support setting Beacon frame rate (legacy)

Legacy rates do not disable 802.11b, just its rates, it looks. Can't you disable it altogether? Regarding the driver not supporting the beacon rate, I don't know what else to consider.

so how can I disable the 802.11b completely?

I tried to add option legacy_rates '0'
and also checked the support_rate and basic_rates, they don't have 802.11b rates.

however, still get 1 mbps beacon...
it will be helpful if I can just enable 802.11g 6 Mbps beacon

I guess configuring option hwmode '11a' should do the trick.

from the document, the hwmode is deprecated since 21.02.2 and is replaced with band. and the band supports options like 2g, 5g, 6g.
but my onboard wifi module only supports 802.11 b/g/n, so it is 2g only, no 5g or 11a available.

Funny, as my configuration running master stills work with hwmode, tho'. Okay, looks like on "2g" you are restricted to 1 Mbit/s, I failed to write that 2g (802.11b/g) will support only 1 Mbit/s.

OK, I commented out the band and use hwmode instead. it works too.
"11a" won't bring up the wifi, and "11g" is just the same 1 Mbps beacon.

1 Like

The Pi built in radio has very limited support in open source since it is a Broadcom chip.

That said it is selectable dual band, if you set band 5g and a channel in 5 GHz that is allowed in your country (be sure to also set country) it should work on 5 GHz.

Make sure whatever you are using to monitor reports the actual data rate of a received packet. Most wifi cards do not.

1 Like

thank you for your suggestion.
the wifi radio on pi 3b only supports b/gn at 2.4g, no 5g band is supported.
I monitor the beacon with Wireshark and a rtl8812au wifi card on monitor mode.

Anyway, my question is how to enable various data rates on the wifi beacon signal.
please also let me know if other (small sized) hardware and software combinations can do the work.

First, you could consider not attempting to setup invalid combinations. I thought the other poster was fairly clear too - but your responses seem as if you aren't considering the replies.

  • Can you provide examples of APs/beacons with the setup you're seeking?
  • Benchmark what about the AP, exactly?
  • Are you just seeking to record a beacon frame configured as you desire; or is there some functional purpose to altering the beacons?

I ask because there may be a functional setting for what you desire - instead of simply trying to alter beacon frames.

Forcing an AP to send beacons (and everything else) at high modulation rates is a legitimate network management practice, and the basis of the cell_density setting.

Packets sent at a high modulation rate cannot be decoded at a long distance compared to the same radio system falling back to a low rate. That is actually good since forces clients to be close to the AP where high rates can be sustained in both directions. If a client moves away from the AP they will either roam to another AP, or be dropped.

It's essential to differentiate between these two things:

  1. Beacon rate: the rate at which beacons are sent.
  2. Basic rate: the rate at which management frames to and from the client are sent.

@Riesling is referring to 1, and you are referring to 2 in your comment, @mk24.

1 Like

for your first comment, are you suggesting that I shall not attempt to use nl80211 based method since the driver cannot modify the beacon rates? other than RP 3b, I have RP 4b, ESP32, and a bunch of USB WiFi cards.

I am benchmarking the range performance, as pointed out by mk24.
I have a beacon detector, and I would like to know its detection range for different beacon data rates (with the same TX power).
If it is truly difficult to set, I will settle for 1 Mbps.

same_sending_device + Tx@same_power + same_location + same_physical_conditions == same_Rx_distance

Do you mean testing actual throughput? No, because you mention the beacon many times.

What you're doing and what mk24 pointed out are 2 different things.

If you're actually testing "range performance" - It seems the solution would be to actually move the test client to the desired distances and monitor/record your observations. :wink:

I'm not sure why you believe altering the content of a beacon does this.

  • Have you tried 2g, NOHT, wmm off, legacy_rates '1', etc. (i.e. parameters that actually match the rates you're asking about)?
  • supported_rates??? (I noted this above) :wink:
  • Are these OpenWrt devices?
    • If so, are they: b, g, n, ac or ax devices?

Answer: I'm suggesting that to do what you desire - you set the basic and/or supported rates to proper parameters - see:

:warning: Please see the cautions regarding changing rates in certain combinations and client connectivity - I think this was your issue.

  • Is this the exact combination, or just values in a set of combinations you wish to test?
  • (It would take days for me to test if your combination(s) are valid, I assume you saw all on-air, correct?)
  • :thinking: I'm almost sure some of those combinations reflect the basic rate of different bandwidths (i.e. setting some would be invalid at 20 MHz or 40 MHz - I'd have to find the reference...)
1 Like
  • For 802.11b, the sampling rate (≈ bandwidth?) is constant at 11 MHz. low data rate = high coding rate = robust to attenuation and interference = better range performance. that is why I want to test with a modified beacon data rate. and yes, I will move the test client to a couple of distances to monitor the observations. I am not modifying the beacon content, only the data rate.
  • yes, I have tried the parameters you mentioned, and they don't alter the beacon data rate. basic and supported rates seem only control the non-beacon data frames.
  • Raspberry Pi 3b and ESP 32 are b/g/n devices, and Raspberry Pi 4b are b/g/n/ac devices. For now, I only consider the beacons using b and g
  • these beacon data rates are what I have seen in the air with Wireshark(except the 12 Mbps). all these are supposed to be non-HT, legacy rates (I may be wrong about this). the sampling rate of 802.11b is 11 MHz while the 802.11g is 20 MHz, regardless of the data rates.

I found an old "hospapd.conf" file, where the beacon_rate is a valid parameter. but it doesn't work anymore due to the "nl80211" driver. that is why I feel it may be impossible for me since I am far from being capable patching a Linux driver.