40

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?

  • Not sure but definitely an interesting question – Eric F Oct 13 '14 at 14:06
  • Although I’m too lazy to research more, it’s about available non-overlapping channels and radio interference. – Daniel B Oct 13 '14 at 14:31
  • @DanielB I got that far already, but nobody seems to mention any numbers. There's 16 channels available, but not always depending on country, and then again people only recommend you use 3 of them anyway. Given that I find 16 different networks with my WiFi-scan at work, clearly the cap is not 3. I have a feeling it's not at 16 either... but I can't find a spec or something else that clearly states "X is the limit". If there's none, then what would be a reasonable limit? – Pimgd Oct 13 '14 at 14:38
  • A reasonable limit is defined by the number of non-overlapping channels: 3. Above that, performance will drop when all APs are in use. – Daniel B Oct 13 '14 at 14:43
  • 2
    +1 -- this is an interesting question especially for businesses, colleges, etc, where WiFi may be intensively used by hundreds of people in a relatively confined area. One suspects that the limit has been reached in some cases, it's just not documented (possibly because folks just write it off as "flaky WiFi" and don't worry about the cause). – Daniel R Hicks Oct 14 '14 at 0:30
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.

  • 1
    +1 For managing to spot my actual question too: "How many simultaneously active Wi-Fi networks can there be in a single area?" Because that's what you get when scanning. Networks. Not access points. – Pimgd Oct 14 '14 at 7:23
  • Accepted this answer, as 24 hours have passed and I believe this answers my question quite well. As one router can serve multiple SSID's, one could reach a near infinite amount of detected networks. Thus a fixed size buffer won't work. I'll have to use a dynamically allocated buffer. – Pimgd Oct 14 '14 at 13:54
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.

  • How will the interference affect the signal? Will the weaker signal disappear? Or will stronger signals be affected too? – Pimgd Oct 13 '14 at 14:51
  • When you deploy a dense network of access points, it's necessary to reduce the transmit signal power of each of the access points. If you don't reduce the power, the access points generate interference to each other, a phenomenon known as co-channel interference. This means all of the signals will be affected. – Eddyy Oct 13 '14 at 14:53
  • So to have 17 different Wi-Fi access points would cause interference, blocking the weaker signals. Does this mean it's effectively capped at 16, or would 17+ Wi-Fi access points still be reachable, provided the signal from each of them was strong enough? Or would the stronger signals cause stronger interference, disrupting the wifi even more? Basically, can you successfully pick up 17 or more Wi-Fi networks with a Wi-Fi scan? – Pimgd Oct 13 '14 at 15:06
  • 4
    @Pimgd There is still no limit. At my old University, the wi-fi network sometimes dropped packets. From inside the central hub building, I ran a scanner and picked up 87! different 'SSIDs'. I say that in quotes because we had access points that allowed access to multiple (3) networks each. However, even taking that into account, that is a minimum of 29 access points within range. There were actually more, (37) as not all of them were from that system and were only broadcasting for the one network. note: these all fit in the 2.4Ghz band. – Baldrickk Oct 13 '14 at 15:53
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).

  • Nice answer, but I don't have control over the actual scan itself. I have to store the results of a scan by some other device. It'd have been a great answer if I was building my own Wi-Fi scanner though. Still, I appreciate the theory behind your answer (you get +1 for that), as it explains and confirms some things about Wi-Fi that I found. – Pimgd Oct 14 '14 at 9:37
  • There are many, many, many more channels than just 13: en.wikipedia.org/wiki/List_of_WLAN_channels And this list will only grow over time. – Adam Davis Oct 15 '14 at 2:17
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!]

  • I think this fails after the 6th access point or so. – Pimgd Oct 15 '14 at 7:32
  • @Pimgd that's what I thought initially, too, but if you reexamine it closely, you'll find it doesn't. For the argument to work, any access point must be unable to see at least one other access point. I've updated my answer with some prettier pictures :D – imallett Oct 15 '14 at 8:23
  • 2
    Ooooh pretty graphics (+1). I see that they wouldn't know that there's a problem now. – Pimgd Oct 15 '14 at 8:27
  • Hence my comment on the original question. +1 for your images :) – hagubear Oct 15 '14 at 11:44
  • Interesting and related - this is why having too many APs broadcasting on the same channel causes issues. That red zone in the center? Yeah, that's where the network has the highest congestion. That's a bad thing – Wayne Werner Oct 17 '14 at 19:35
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.

  • I have noticed that my Apple TV gets laggy using airplay when microwave oven is on. – Matthew Lock Oct 14 '14 at 1:36
  • 1
    ... aren't there 16 channels in total? Why do you say 11? – Pimgd Oct 14 '14 at 7:36
  • While this is interesting from the networking quality and QOS viewpoint, this doesn't actually answer the question :( – Vogel612 Oct 14 '14 at 7:40
  • Looking at the answer in more detail, you seem to be talking about the limits on the amount of CLIENTS rather than a limit on the amount of access points/networks. I'm not looking for a limit on clients, in operation or otherwise, I'm looking for a limit on networks/access points that one would pick up in a scan for Wi-Fi networks. – Pimgd Oct 14 '14 at 7:43
  • 1, 6 and 11 are the total number of channels. Barafu is correct as far as I am aware. Channels 1, 6 and 11 don't overlap and are the best channels to use, I have never been advised of using channel 16. As much as I hate to include a link, look at the first image (1.1) en.wikipedia.org/wiki/… – Eddyy Oct 14 '14 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.