From owner-freebsd-net Tue Oct 26 17:57:10 1999 Delivered-To: freebsd-net@freebsd.org Received: from coconut.itojun.org (coconut.itojun.org [210.160.95.97]) by hub.freebsd.org (Postfix) with ESMTP id F052714FE2 for ; Tue, 26 Oct 1999 17:57:06 -0700 (PDT) (envelope-from itojun@itojun.org) Received: from kiwi.itojun.org (localhost.itojun.org [127.0.0.1]) by coconut.itojun.org (8.9.3+3.2W/3.7W) with ESMTP id JAA15753; Wed, 27 Oct 1999 09:56:57 +0900 (JST) To: jayanth Cc: Alex Rousskov , freebsd-net@FreeBSD.ORG In-reply-to: jayanth's message of Tue, 26 Oct 1999 17:35:24 MST. <381648CC.B57E06BF@yahoo-inc.com> X-Template-Reply-To: itojun@itojun.org X-Template-Return-Receipt-To: itojun@itojun.org X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 Subject: Re: TCP throughput vs number of aliases From: itojun@iijlab.net Date: Wed, 27 Oct 1999 09:56:57 +0900 Message-ID: <15751.940985817@coconut.itojun.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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