41

I'm writing an API for controlling an external device. Part of this API is having the device scan for Wi-Fi access points. The API will be implemented across many types of devices, with varying memory capacity. I want to know whether I can just allocate a buffer for found access points once and then forget about it, or whether I need to handle this via dynamic memory allocation.

To make that decision, I need to know how many different Wi-Fi networks/access points can be available in a given area.

At work, when I do a Wi-Fi scan, I pick up 16 different Wi-Fi networks. Even if most of these Wi-Fi networks are poorly reachable, I still wish to pick them up with my Wi-Fi scan.

Is there a cap on simultaneously active Wi-Fi Access points in a single area? More specifically, is there a cap on simultaneously active Wi-Fi networks in a single area? If so, what happens if you go over it?


What I tried (Research)
I tried googling, but the only thing that seems to come up is a limit on the amount of devices per access point. Various searches ("access point limit", "wifi max access point") didn't give me the result I was looking for.

I then tried with different search terms, trying to find out how Wi-Fi scans work. I found out that they work via sending a packet that basically says hello, and then listening for how many hellos they get back.
This seems to indicate to me that there is no cap; I could, in theory, buy many power strips, plug a lot of Wi-Fi access points in (perhaps all connected to one big router so they're connected to the internet, perhaps not), do a Wi-Fi scan and find many access points, provided they have different SSID's. (I don't plan on doing this; even if I did, there'd be no way to know if I'm being limited by the protocol or by the scanner.)
Is this correct? Is there no cap on Wi-Fi access points? Would said theoretical scenario even work in practice?

Pimgd
  • 611
  • 5
  • 16

5 Answers5

23

The wifi standard 802.11 (and its variants) do not provide a technical limitation to the number of active SSIDs in any given area. In fact, many newer routers and APs can, and do, broadcast multiple SSIDs and manage multiple virtual networks. Thus you can have dozens, even hundreds, of SSIDs operating and "visible" in a given area. Further, as newer technologies and bands become available, the bandwidth is better utilized, thus allowing the spectrum in a given area to be more crowded without significant interference.

If you really must be able to hold information about all of them, rather than the X best signals available, then you will need to use dynamic allocation.

Adam Davis
  • 4,405
10

There is no cap on active Wi-Fi devices. However, too many Wi-Fi Access Points (WAPs) might result in some not being shown on your device due to a device limitation. If two WAPs use the same channel there will be interference, resulting in drop outs of signal.

The actual Wi-Fi access points will work, and if there is no limitation on the device then you could scan and get back as many WAPs as there are available.

Pimgd
  • 611
  • 5
  • 16
Eddyy
  • 128
  • 7
6

Background

Channels

In the Netherlands, as in most countries, channels 1 to 13 are available for Wifi use in the "standard" 2,4 GHz band, as used in Wifi B, G & N standards. This seems to be the CCITT standard. Countries in the Americas (North, Central, South) all seem to use only channels from 1 to 11, which seems to be the FCC standard. I believe that channel 14 is also available in Japan, but only for B & G, not for N. Wifi A used the 5 MHz band, as does Wifi "N dual-band" (in parallel with the 2,4 GHz band). Wifi A is pretty much obsolete - it offered 54Mb compared to only 11Mb for B but has low power, short range, and was never "popular" - then it obsoleted by G which offered 54Mb in the 2,4 GHz band and so too was easily shared/compatible with B.

SSID's

Beware, the same SSID may be re-used by many Wifi Access Points, typically in the same general area, in such a way that several/many can be seen simultaneously. This is not a mistake, this is done on purpose. Such multiple WAP's with the same SSID could potentially cause major nightmares if they all had different password/encryption - but they will not, quite the opposite: large organisations place multiple WAP all around their office space with the same SSID and identical password/encryption so that mobile devices can swap from one WAP to another according to signal strength. This will occur automatically when moving around causes an existing connection to drop-out. Then the device will try to reconnect, usually to the same SSID, and so pick up on the strongest available WAP with the same old SSID - it will not even notice that its not the same one (typically the BSSID of the WAP, which will be it's hardware or MAC address, is never specified). However, since the availability of WPA2 (security protocol) in 2004 it is possible for a device to sign-on to a "new" WAP whilst still connected to an "old" WAP, then it can cut over to using the "new", sign-off the "old", and again start looking for the "next new" WAP. Thus mobile devices can swap to best available WAP, always with the same SSID, without interrupting on-going communications. This is important for mobile devices because, even with high bandwidth, the sign-on procedure is still relatively slow or perhaps fail for whatever reason (bad setup?). Hence the idea to "pre-identify". Presumably the device, given a choice, will (first) select the WAP with the strongest signal as being "best", but could also prefer an isolated WAP (i.e. not sharing its channel with other WAP signals), or whatever, and then try other WAP's if/when it fails to sign-on to the first one(s).

Overlap and collision

If 2 or more WAP's use the same channel then for use you could say that there is signal overlap. However, as the "air" is filled with radio signals only on an as-need basis, with fairly low incompressible overhead (sign-on, keep-alive hand-shake, occasional broadcasts & their replies), then actual signal collision may be a problem only sometimes. Persistent heavy traffic (even on a single WAP) will definitely cause collisions, and so lost packets or "drop out", when on the same channel as 1 or more other WAP, especially if they have similar or higher signal strengths. To be fair though, "drop out" is already a risk with an isolated WAP if traffic is too high, as there is already competition between multiple client devices. In theory, even an isolated WAP with a single client device could suffer collision and loss! So that's all a probability thing, with random and widely varying outcomes, mostly at risk of "drop out" in case of heavy traffic. Adjacent channel also interfere with each other since the actual spectral distribution "occupied" by a single channel or "centre frequency" overlaps to less and less degrees with neighbouring channels on each side out to the about the 4th removed (interference dropping to only moderate at +/- 3, and then weak at +/- 4, given similar signal strengths). Risk of actual collision and "drop out" loss is a question of statistics, with interference from neighbouring channels being less and less likely compared to same channel interference.

Bottom line

You will never find any standard or specification as to how many WAP can be present in the same visible area, on the same channel, advertising the same SSID and/or any combination of such. Don't look, you will only waste your time. In practice, if ever there is so much traffic/interference that Wifi usable becomes unreliable, only then people will look a (curative) solution. Typically by adding even more WAP (with the same SSID)! And so too will interference increase. Except where the client device is smart enough to always connect to strongest available WAP for it's target SSID - then you can laugh all the way to the bank as traffic will be effectively shared around and interference will not cause actual "drop out" as long as the "good" signal is significantly stronger than "all the others". Logic dictates that nearest neighbouring WAP should be given widely different channels, although the same channel can still be used again for the neighbour's neighbour (think of multi-coloured patch-work but made up of similar-sized hexagonal "cell" patches, never the same colour/channel side-by-side - that's where the "cell" in "cell phone" comes from!)

Practical answer?

I would say, just out of the blue that you should only bother with the say the 10 strongest signals on the same Wifi channel. That makes a maximum useful panel of 130 list-able Access Points. When scanning you should keep a list of WAP seen for each channel, including some signal-strength information and of course the BSSID, so that you keep just the top-10 signals (and not make duplicates with the same BSSID). Of course you may think 10 is too many on the same channel, perhaps 3 or 5 is enough, or whatever (it's your call). Alternately, if you already have a target SSID (perhaps you're already connected) then you might want to list some small number of WAP for that same SSID on any channel where found, regardless of how bad the signal strength is, but still the best available signal out of those WAP with that same SSID (i.e. for each channel, keep a half-list of top strength WAP's with any SSID, plus another half-list of best strength WAP having the same target SSID). Then you can an informed choice of the best available WAP for you same target SSID, knowing if there are other WAP on the same/adjacent channel, and there relative strength. You will probably need to set some absolute strength threshold as being "minimum for a reasonable chance of success", and then look for some compromise between best-isolated and strongest-signal WAP. And you'll be a happy camper (also at work).

5

This is a bit long for a comment, and less technical than the rest. But, here's a mathy way to think about the problem.

Suppose only one access point is allowed in a given area. One easy way to get a device to see two is to put two access points far apart and the device in the middle. The device is in range of both, but the access points aren't in range of each other, so they can't know there's a problem: 2 access points

This generalizes easily.

If there are only n access points allowed in an area, then you can put n+1 access points in a circle such that antipodal access points are mutually out of range. Then, no access point sees more than n-1 other access points, but a device in the middle sees all n+1. Here's a progression from three up through eleven access points. Notice that, as long as none of the access points are in the very darkest area, none of them know there's a problem!

3 access points 4 access points 5 access points 6 access points 7 access points 8 access points 9 access points 10 access points 11 access points

These images came from a quick program I just wrote.

[EDIT: updated with some better pictures!]

1

Theory
The 2.4G Wi-Fi has 11 channels. 13 in some countries. However, channels are not separate, they interfere with one-another, so there are only 3-5 separate channels. Access points on the same channel can coexist, however, if one of them is sending lots of data, this leads to severe loss of speed, more than just sharing a bandwidth. The actual loss depends on quality of devices and their configurations. They do agree on common timeslot schedule, but, in practice, have trouble following it, especially clients. When 2 devices emit a package on the intersecting channels at the same time, both packages are lost and devices need to wait for their queue to resend them. The presence of old WiFi client on the channel is a grand showstopper, because they have and use different timetables.
Note that Wi-Fi devices are not the only users of these 3 channels. Wireless devices, DECT phones, microwave ovens, car protection remotes all use the same 3 channels and are even worse an interference. I actually know a case, when the speed of Wi-Fi in an openspace office went up nearly 2X after one wireless mouse was found and shut down. It was a very badly designed mouse. When one device provide several SSIDs, or a group of relays work together on the same SSID, they do not create much of interference for themselves, because they agree on common schedule. They should, at least.
Answer
So, if there are two access points on the same channel, they have to share the 15%-75% of bandswidth of one. The overhead depends on numerous values, quality of both access points and their clients too. I'd not expect even 3 high-load networks to work fine. There is no set limit on the amount of non-loaded networks in the same space, but you should not expect more than 10 different devices coexist peacefully.