7

I've recently been examining the performance statistics of my linux-based router, and have been surprised by what I'm seeing. I expected the routing workload to be much more taxing to RAM and CPU than it is. Can you help me understand why this is the case?

EEAA
  • 108,414
  • 18
  • 172
  • 242
Carbon
  • 103
  • 8
  • 5
    Probably because **your router** is not required to actually **do** all that much... A couple of Mbit/s is nothing compared to a [*"serious"* router](https://ams-ix.net/technical/statistics) ... – HBruijn Sep 06 '15 at 18:48

1 Answers1

14

What part of a router's job takes up RAM? Precious little. Packets in, packets out. The network stacks of modern operating systems are very well-tuned, and all packet inspection and routing happen directly in the kernel, so no ancillary user-land code is necessary.

If your router is also performing NAT, then the state table would consume some memory, but even a modest 2GB system is able to store hundreds of thousands of NAT state table entries without blinking an eye.

Additionally, if your router is performing dynamic routing duties (VRRP, BGP, etc.) those will consume memory.

To conclude, though, most firewall and routing tasks are very easy on system resources.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • 2
    And if you were to add lots of memory to be used for queuing packets for transmission, you would likely find that beyond a few KB per interface you'd likely see adding more memory causing worse performance rather than improving it. – kasperd Sep 07 '15 at 19:05