11

It seems that different sources claim very different RAM consumption for having whole BGP routing table information in RAM and having the router to correctly route the traffic.

According to Calculating Cisco router memory requirements for full BGP feeds ballpark figure seems to be between 150 MB and 500 MB for 500k routes. On the other hand, Cisco documentation tells that a router requires 8 GB to support 1 million routes: https://www.cisco.com/c/en/us/products/collateral/routers/asr-1000-series-aggregation-services-routers/data_sheet_c78-441072.html

How much RAM does one route actually need on average? The Cisco numbers suggest that one route would need approximately 8 KB (including OS overhead) which doesn't seem sensible number to me. You can store the information about one route much more compact than that!

Are the hard memory requirements actually caused by the algorithm used to hold the whole table in the RAM where you can have lots of memory overhead for different indexes and other auxillary data designed to speed up the realtime processing?

I'm specifically interested in IPv4 implementations but additional info about IPv6 would be interesting, too.

2
  • You shouldn't mistake overall system memory with free memory required for that routing table.
    – Zac67
    Commented Oct 5, 2021 at 10:42
  • 1
    Yes, that's why I write "including OS overhead". However, when a single route actually requires maybe 64 bytes of RAM, the Cisco implementation needing 8 KB on average means that the router OS overhead is pretty high. The total overhead for Cisco implementation is over 100x the actual data needed for the routing! Commented Oct 5, 2021 at 11:10

1 Answer 1

8

Here is the info given but a production router that does IPv4 BGP only, as of 2021 October 5:

1547576 RIB nodes, using 142 MiB of memory
1687609 BGP routes, using 103 MiB of memory
8 Static routes, using 384 bytes of memory
1687601 Adj-In entries, using 52 MiB of memory
14 Adj-Out entries, using 560 bytes of memory
280025 BGP attributes, using 15 MiB of memory
40216 BGP extra attributes, using 3456 KiB of memory
393 unknown attributes
225597 BGP AS-PATH entries, using 5287 KiB of memory
225879 BGP AS-PATH segments, using 5294 KiB of memory
1127 BGP community entries, using 35 KiB of memory
13 BGP community entries, using 416 bytes of memory
3 peers, using 13 KiB of memory
31 hash tables, using 1240 bytes of memory
507176 hash buckets, using 12 MiB of memory

This specific router has 2 BGP neighbors (yes it states 3 peers but has actually really 2 neighbors) and receive the full (IPv4) Internet table from each.

The BGP Deamon use 706Mib on this system ( which otherwise has 4GB of RAM and use less than 2GB)

3
  • So the memory requirements are for specific router implementation not the actual data size, right? Commented Oct 5, 2021 at 11:05
  • The line 1687609 BGP routes, using 103 MiB of memory sounds more sensible for the actual data alone. That would require about 64 bytes per route. Commented Oct 5, 2021 at 11:06
  • 6
    Yes, it is heavily implementation dependent. Also don't forget that the router routing table (the FIB) is built by picking the best routes from all tables received from all protocols, stored in different RIB. You can have the routes duplicated or a simple pointer to the existing route.
    – JFL
    Commented Oct 5, 2021 at 11:13

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.