4

Say we have hundreds of WiFi clients that pretend to connect to a single router. The firmware on the clients is modifiable.

I'm aware the routers can handle only few dozen of clients at time. Because I need to minimize the period of each client can successfully connect I'm looking for a way to minimize retries.

One thought is:

  1. on power up each client tries to connect (and then only few actually can)
  2. after exchange data they say "goodbye" to the server but before disconnect it sends the next connection slot in seconds (i.e. try again after 150 seconds)

Problems:

  • to send a reliable interval, the server should be aware of how many clients are active now, and it cannot know this (the machines are powered on/off as required by users)
  • to overcome this we can assume that all devices are active, but of course is not optimized at all!
  • in any case, I estimate: 4-5 seconds for connection (best scenario) + 1 second for exchange data + 1 second for disconnection. So if each device keeps busy a slot for, say, 7 seconds and the router can handle 50 clients, in the best scenario 200 clients can be cycled in about 30 seconds... a bit too high for the ideal requirements.
0

1 Answer 1

1

Do not forget the DHCP lease durations. A typical router may only have 100, and probably less than 254, available IP addresses, depending on how the DHCP server is configured. When a new client (WiFi or wired) connects, an IP address is leased to the MAC address of the device. That lease is reserved for the DHCP lease time.

You will need to set the DHCP lease time to be shorter than the default (often between 15 minutes and one week). The best duration may be at least twice the expected duration of the longest connection. The DHCP protocol requires that the client begin to renew the lease when it has one half of the duration remaining.

If you find that the shortest lease time is long enough that you must have a unique IP address for every device that connects, be sure that you open a large enough address range, and that your router (which typically includes the DHCP server) can handle that number of simultaneous assignments.

So summarize, there are limits everywhere. Your question focuses on the number of simultaneous WiFi links an AP (access point) will support. You should also check on the number of DHCP assignments your DHCP server (often part of the router) can service.

I separate the functions of AP and Router/DHCP server based on my experience with my home WiFi network and collection of IOT devices. I have 5 "routers". Fourare used only as access points. One has the DHCP server enabled but has WiFi disabled. By having a single DHCP server, my IOT devices keep the same IP assignments as the devices move through the house, or access conditions change.

For distributing the load amount the clients, you could use, as you propose, a smart protocol where the reconnection time is given with each connection. You could also use a scheme where the reconnection cycle was fixed, and the phase in the cycle was determined by a hash on the MAC address. That way, each device knows what to do, the load is spread moderately evenly, and no central control algorithm or change in protocols is needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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