[1232] in linux-net channel archive
Re: ip aliasing support ...
daemon@ATHENA.MIT.EDU (Stephen R. van den Berg)
Mon Oct 23 17:04:30 1995
From: srb@cuci.nl (Stephen R. van den Berg)
Date: Mon, 23 Oct 1995 13:55:46 +0100
In-Reply-To: Alan Cox's message as of 1995 Oct 23 Mon 10:39.
<199510230939.KAA09808@snowcrash.cymru.net>
To: Alan Cox <alan@cymru.net>
Cc: linux-net@vger.rutgers.edu
Alan Cox <alan@cymru.net> wrote:
>> being done for *every* packet that goes through the machine. If the table
>> starts approaching sizes like 7MB, then it had better be an array so that
>> binary searches are swift and painless (and so that it doesn't occupy more
>> memory due to pointers and such, which would likely increase the table
>> size by a significant amount).
>if its gets that big its a problem. I was going to linear search it on the
>grounds its normally 16 items or less.
Well, it isn't if you're running it as a router or terminal server (one entry
per statically allocated IP no. per line), or a multihomed host.
I'm not saying that I'm using 7MB or bigger routing tables (someone tried
it with a Linux box, sheer suicide with linear searches, of course) yet.
But the current routing table I'm using already has 17 entries (and that
does not include individual IPno's for dial up lines and virtual IP
addresses for a multihomed host).
I'd strongly suggest something like a binary search be adopted (or
at least optional), otherwise Linux will not be suitable for any heavy
network routing operation.
I've already given it some thought, seems that one would need a separate
binary search array for every different netmask.
Then the binary search will have to start in the most specific table.
Switching to the next more specific table upon every total miss, of course.
--
Sincerely, srb@cuci.nl
Stephen R. van den Berg (AKA BuGless).
E Pluribus Unix.