3

I've seen a lot of circumstances when there are 50-100 users in the net cafes -- under normal gaming and web browsing activities with no heavy downloads -- causes the router to drop packets (leads to in-game lag) and sometimes completely hangs. Their solution is usually replacing the router box with a real x86 PC with a more powerful CPU and a lot of RAM, running pfSense as router.

The router works just fine even when the Internet connection (~200mbps) is maxed out by downloading large files. Why did it crash when there were a lot of users using probably less than 1mbps each? And how a powerful CPU and more RAM help improve the situation?

A little off-topic but related to the original question: Wireless Access Points suffer from the same issue. It works well when there are few users maxing out the throughput, but hang when there are a lot of users connected doing nothing. Why?

4

You are referring to NAT routers. Normal routers (not implementing NAT) require only very little amounts of memory and processing power for routing - they are essentially stateless and pretty much all they require is bandwidth. (Internet routers may require significant amounts of memory and processing capabilities for their routing table, but that's another story.)

NAT routers translate one address scheme to another - usually private to public IP addresses or vice versa. They need to read and update their translation table where each connection is tracked. That table is in memory, memory is limited, so the NAT table's size - the maximum number of connections that can be managed - is generally limited.

If the NAT table get filled up, the router needs to resort to some sort of contingency: unless it drops older connections it cannot accept new ones. If low memory conditions aren't handled well by the router firmware, the device might even crash or hang (sadly quite common for consumer-grade routers).

Simply adding more memory to a small hardware model might backfire when the CPU can't adequately handle the larger NAT table any more - you'd likely want processing being done in finite time. So, more memory also requires either a faster CPU or increased hardware performance when NAT is done in hardware.

NAT routers exist in various sizes. The most reasonable solution would be to get a router that can handle the number of planned connections (number of users * average number of connections per user). A decent, business-grade router (the ones that are on-topic here) is often able to handle a few million connections for NAT quite easily, so 100 or 200 even heavy users wouldn't be a problem.

Using a software router is definitely one solution - there's plenty of memory and processing power in a standard PC/server. But depending on the requirements for physical space, low latency, power consumption and cooling it might not be the best one.

| improve this answer | |
  • In addition to the NAT state table case already discussed, routers need enough RAM to run the routing protocols and handle the route table. This is most notable for a router running BGP with a full route table with hundreds of thousands of route entries. Edge routers with only a default route don’t have this need. – Darrell Root Dec 28 '19 at 14:55
  • @DarrellRoot See the brackets Internet routers may require... I skipped the details because it's not relevant in the OP's case. – Zac67 Dec 28 '19 at 17:56
  • You are right @Zac67 👍 – Darrell Root Dec 28 '19 at 22:25

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.