Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 1999 09:56:57 +0900
From:      itojun@iijlab.net
To:        jayanth <jayanth@yahoo-inc.com>
Cc:        Alex Rousskov <rousskov@ircache.net>, freebsd-net@FreeBSD.ORG
Subject:   Re: TCP throughput vs number of aliases 
Message-ID:  <15751.940985817@coconut.itojun.org>
In-Reply-To: jayanth's message of Tue, 26 Oct 1999 17:35:24 MST. <381648CC.B57E06BF@yahoo-inc.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

>The code in ip_input.c seems to step through the list of all
>ip addresses for that interface.  It is probably stepping thro' all the
>alias addresses
>I wonder if that is the problem.

	One possible solution for this is implemented in KAME IPv6 stack,
	for IPv6 only.  We may want to port that part to IPv4 if it is common
	to have more than 500 interface addresses onto a host.
	If you really are interested you can grab the code from www.kame.net,
	or
	http://www2.kame.net/dev/cvsweb.cgi/kame/kame/sys/netinet6/ip6_input.c

	Basically KAME code avoids linear search over list of interface
	addresses, and use routing table lookup to check if the packet
	is destined to ourselves.
	If your host is assigned 203.178.141.194/27, You would have an entry
	like below.  You can perform routing table lookup against ip->ip_dst,
	and see if this is routed to loopback interface to know if the
	packet is toward me.

>203.178.141.192/27 link#1             UC          0        0 
>203.178.141.194    0:80:ad:71:81:fc   UHLW        1  4351966       lo0

	KAME team needed to do this for IPv6 because IPv6 has 128bit address
	and # of comparison instruction would become 4 times more than IPv4
	case.  The change actually needs some more twists, and is obviously
	incompatible with past code.  We may leave the current linear search
	code in the source, and use routing table-based lookup as shortcut,
	like:
	1. lookup routing table, if it looks to be ours, goto ours. (ADDED)
	2. linear search over list of interface addresses, if it looks to be
	   ours, goto ours.
	3. if I'm a router, forward it.
	4. drop it.
	By commenting (1) out, you get 100% backward compatible code/behavior.

itojun


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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