Linux IPv6 router table size.

Ted Mittelstaedt tedm at ipinc.net
Sat Jan 15 22:23:28 CET 2011


Jan,

   Keep in mind that in both Linux and FreeBSD (FreeBSD having the same
problem) that the formula that calculates the max route size isn't
assuming the system is going to be used as a BGP router.

   In other words, a purpose-built FreeBSD or Linux system intended as
a BGP router should basically have most of it's free ram in use for
the route table.

   Thus the correct approach to this problem is, in my view, for
Quagga to purposfully expand the sysctl when it is run along with
a log entry rather than complain about the operating system not 
accepting routes anymore.

   With FreeBSD not only the route size but NMBCLUSTERS has to
be increased, along with some other parameters (I have buried in
my notes somewhere, it's been a while since I've run a PC based
BGP router)

   Even if the Linux kernel maintainers modify the assignment
then you still have the problem that the route size is tied
to a percentage of free ram.  Why for example is it necessary
to buy 4GB of ram for a router just to get a 500MB max route
size for IPv4 or IPv6 in a PC router?

   It's much better for the application program to make
these modifications in the kernel.  That is why these kernel
variables are bought out into a sysctl in the first place.

   You need to be filing this as a bug with quagga developers.

Ted


On 1/15/2011 12:45 PM, Jan Hugo Prins wrote:
> Hi everyone,
>
> This might be something that some people here are interested in to hear.
>
> In the beginning of December the number of IPv6 routes in the BPG router
> tables got somewhere close to 4096 and this number is somewhat magical
> in Linux. Why is it magical? Well, the default setting for
> net.ipv6.route.max_size is hardcoded in the linux kernel to be exactly
> this number, this in contradiction with the IPv4 net.ipv4.route.max_size
> which is set based upon the size of your memory. Actually, in the IPv4
> part of the kernel sources their is a route.c with a nice formula
> telling the kernel how big this number should be. For IPv6 their is also
> a route.c with some nice formula in it, the formula says exactly the
> following:
> net->ipv6.sysctl.ip6_rt_max_size = 4096;
>
> The result of all this magic was that when the BGP RIB in my quagga
> routers went over the 4096 routes, quagga started complaining that it
> couldn't put the routes in the kernel FIB anymore and this went all into
> syslog.
>
> It took some digging to find the reason for these error messages, but
> after changing this sysctl to something more useful, everything was fine
> again.
>
> Greetings,
> Jan Hugo Prins
>



More information about the ipv6-ops mailing list