[4514] in linux-net channel archive
Re: IP Alias Limit
daemon@ATHENA.MIT.EDU (Juan Jose Ciarlante)
Mon Sep 23 15:33:36 1996
Date: Mon, 23 Sep 1996 13:21:49 -0300 (GMT-0300)
From: Juan Jose Ciarlante <jjciarla@raiz.uncu.edu.ar>
Reply-To: Juan Jose Ciarlante <jjciarla@raiz.uncu.edu.ar>
To: fishbowl@netcom.com
cc: Kernel Hackers <linux-kernel@vger.rutgers.edu>,
LxNet <linux-net@vger.rutgers.edu>
In-Reply-To: <Pine.LNX.3.95.960920202817.8459A-100000@fotd.netcomi.com>
On Fri, 20 Sep 1996, James L. McGill wrote:
> What is the limit to the number of IPALIASes?
> I need to install 506 IP Addresses on a box and
> make Apache HTTPD answer to them.
net devices aliases are limited to 256.
You can raise it by editing linux/include/net_alias.h:
--- linux/include/linux/net_alias.h Thu Sep 19 21:33:14 1996
+++ linux_alias+/include/linux/net_alias.h Mon Sep 23 11:14:58 1996
@@ -25,7 +25,7 @@
* max. alias slot number allowed
*/
-#define NET_ALIAS_MAX_SLOT 256
+#define NET_ALIAS_MAX_SLOT 1024
struct net_alias;
struct net_alias_info;
There is no "side-effect" in editing this value (maybe 256 was a poor
choice).
Anyway there is 16-entry hash table ( 16*sizeof(void*) ) created for each
aliasED device (struct net_alias_info) . This hash_tab is mainly used for
incoming pkts [ip_input.c:ip_rcv()] lookup to select alias device whose
address is iph->daddr (thus allowing references to alias devices:
firewalling, proxy arp, etc).
We could make this stuff configurable:
- At config-time:
Something like "CONFIG_NET_ALIAS_LOT"
. NET_ALIAS_MAX_SLOT=<really_high>
. NET_ALIAS_HASH_SIZE=256 (256*4=1Kb for each aliasED device)
Making this option "boolean" allows a 'compile-time-selection'
of faster hash function code.
- At runtime:
Via sysctl interface so one can select max_slot (and set proper
hash_size) before creating device aliasing structures. This nicer
approach has one main drawback: hash function will depend on a
*runtime* value stored in net_alias_info structure.
Suggestions?
2
-- Juanjo, J C <jjciarla@raiz.uncu.edu.ar>