Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 2010 17:56:37 -0700
From:      Julian Elischer <julian@elischer.org>
To:        dave@seddon.ca
Cc:        Robert Watson <rwatson@freebsd.org>, Andrew Hannam <andrewh@itsallaboutbiz.com>, FreeBSD Net <net@freebsd.org>
Subject:   Re: FreeBSD route tables limited 16?
Message-ID:  <4C8EC845.2060306@elischer.org>
In-Reply-To: <1284423495.5238.99.camel@das8530.vic.bigpond.net.au>
References:  <1284107762.5923.306.camel@das8530.vic.bigpond.net.au>	 <532349FC-9269-4674-872F-FA84292E264C@mimectl>	 <1284130306.6282.6.camel@das8440.seddon.ca>	 <009101cb5308$514066d0$f3c13470$@com> <1284423495.5238.99.camel@das8530.vic.bigpond.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/13/10 5:18 PM, Dave Seddon wrote:
> Greetings Julian,
>
> I've been wondering if it's possible to increase the number of FreeBSD
> route tables to a larger number.  It seems this is currently 4 bits,
> however I was wondering about perhaps 16 bits?


Yes the code is designed to handle many more and if you do
create more then everything SHOULD handle it.
The bottleneck is that we need to store an associated fib with
each outgoing (or for that matter incoming) packet, bit we do not at
this time want to dedicate a whole word in the mbuf to the task.
My "hack" for 8.x (before it was done) was to hide the information
in the flags word of the mbuf.
I only took 4 bits to make sure I didn't trample on other
people's use of bits there. The plan is/was to make a separate
entry in the mbuf some time after 7.x branched (say, "now" for
example :-)  )
you could just steal more bits for now, but if you take 8 bits
there will only be one spare.

(see /sys/sys/mbuf.h)

It may just be time to bite the bullet and steal the entry.

Out of curiosity, why do you need > 16 fibs?

have you considered using vnet jails a well?



>
> /* MRT compile-time constants */
> #ifdef _KERNEL
>   #ifndef ROUTETABLES
>    #define RT_NUMFIBS 1
>    #define RT_MAXFIBS 1
>   #else
>    /* while we use 4 bits in the mbuf flags, we are limited to 16 */
>    #define RT_MAXFIBS 16
>    #if ROUTETABLES>  RT_MAXFIBS
>     #define RT_NUMFIBS RT_MAXFIBS
>     #error "ROUTETABLES defined too big"
>    #else
>     #if ROUTETABLES == 0
>      #define RT_NUMFIBS 1
>     #else
>      #define RT_NUMFIBS ROUTETABLES
>     #endif
>    #endif
>   #endif
> #endif
>
> Really liked your announcement years ago:
> http://lists.freebsd.org/pipermail/freebsd-arch/2007-December/007331.html
>
> Kind regards,
> Dave Seddon
> +61 447 SEDDON
> dave@seddon.ca
>
> -----Original Message-----
> From: Andrew Hannam<andrewh@itsallaboutbiz.com>
> To: dave@seddon.ca
> Subject: RE: FreeBSD route tables - limited to 16 :(
> Date: Mon, 13 Sep 2010 15:55:47 +1000
> Mailer: Microsoft Office Outlook 12.0
>
> I think the gentleman is confusing route-tables with routes.
> 150K routes is easily possible but it is obvious there is currently only support for up to 16 route tables.
>
> I think that you are right and the number of bits will need to be updated.
>
> I don't know the answer to the 'route leaking' question and it has been a long time since I looked at this code.
>
> You really need to speaking the specialist responsible for the multiple route table code. This person should be clearly marked in the code headers.
>
> I'm guessing that no-one has thought about using it the way you are planning to use it.
>
> If I get some time I will have a look - but don't hold your breath.
>
> Regards,
> Andrew.
>
> -----Original Message-----
> From: Dave Seddon [mailto:dave@seddon.ca]
> Sent: Saturday, 11 September 2010 12:52 AM
> To: Aldous, Matthew D
> Cc: dave@seddon.ca; Andrew Hannam; Truman Boyes
> Subject: RE: FreeBSD route tables - limited to 16 :(
>
> Greetings,
>
> I'm guessing we need to adjust the number of bits defined for the route
> table in the mbufs structure definition (where ever that is), then we
> can update the route.h to match.
>
> I guess really we should make the mbufs codes _and_ route.h code pickup
> the KERNCONF definition of the variable ROUTETABLES.
>
> Andrew - thoughts on this?
>
> I'm not sure if the firewall rules allow you to update the route table
> variable in the mbuf, but if it doesn't we should allow this.  This
> would be equivelant to what they call 'route leaking' in MPLS speak,
> when you can pop traffic from one VPN to another (very nasty, but
> sometimes handy).

yes ipfw does allow you to do this but it needs some more work..
It only really works as the naive user may expect on incoming packets.

>
> Regards,
> Dave
>
> On Fri, 2010-09-10 at 19:05 +1000, Aldous, Matthew D wrote:

>> ________________________________
>> From: Dave Seddon [dave@seddon.ca]
>> Sent: Friday, 10 September 2010 6:36 PM
>> To: Andrew Hannam
>> Cc: dave@seddon.ca; Aldous, Matthew D; Truman Boyes
>> Subject: FreeBSD route tables - limited to 16 :(
>>
>> I just tried compiling up FreeBSD 8.1 with 1024 route tables.  It's
>> throwing an error, which is tracked down to the
>> vi /usr/src/sys/net/route.h (line 99ish).  The limit is 16, because as
>> the comments say this is 4 bits.  Need to look into increasing this to
>> say 16 bits :).  Given each mbuf will have this, it could cause a
>> significant increase in memory usage for a system with a large number of
>> packets (although who cares, ram is cheap).
>>
>>
>> /* MRT compile-time constants */
>> #ifdef _KERNEL
>>   #ifndef ROUTETABLES
>>    #define RT_NUMFIBS 1
>>    #define RT_MAXFIBS 1
>>   #else
>>    /* while we use 4 bits in the mbuf flags, we are limited to 16 */
>>    #define RT_MAXFIBS 16
>>    #if ROUTETABLES>  RT_MAXFIBS
>>     #define RT_NUMFIBS RT_MAXFIBS
>>     #error "ROUTETABLES defined too big"
>>    #else
>>     #if ROUTETABLES == 0
>>      #define RT_NUMFIBS 1
>>     #else
>>      #define RT_NUMFIBS ROUTETABLES
>>     #endif
>>    #endif
>>   #endif
>> #endif
>>
>>
>
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C8EC845.2060306>