Date: Tue, 23 Dec 2003 03:19:03 -0600 (CST) From: Mike Silbersack <silby@silby.com> To: Barney Wolff <barney@databus.com> Cc: net@freebsd.org Subject: Re: Controlling ports used by natd Message-ID: <20031223031435.S2131@odysseus.silby.com> In-Reply-To: <20031223051259.GA36331@pit.databus.com> References: <200312120312.UAA10720@lariat.org> <20031212074519.GA23452@pit.databus.com> <20031212083522.GA24267@pit.databus.com> <20031212181944.GA33245@pit.databus.com> <20031213001913.GA40544@pit.databus.com> <20031222182913.M2799@odysseus.silby.com> <20031223051259.GA36331@pit.databus.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 23 Dec 2003, Barney Wolff wrote: > It is odd that libalias picks a port number, and then, if the "use sockets" > option is set, tries to open a socket on that port. Perhaps if the above > option is set, it should bind port 0 and use the port the kernel assigns. > > If folks think that's a good idea, I could produce a patch to alias_db.c > for evaluation. > > -- > Barney Wolff http://www.databus.com/bwresume.pdf I haven't looked at libalias, but there may be some method to the madness. If you just ask the kernel for a source port, it can only hand out the portrange of ports. However, if you know your source / destination tuple beforehand, you may be able to get around the portrange limitation for your concurrent connection count. Now, whether or not libalias is smart enough and whether or not the kernel is playing along is another question entirely. I looked into ephemeral port allocation a few months ago, and it's an absolute nightmare to determine what combination of socket / bind / connect calls are necessary to get the best possible behavior. Hence why I gave up and enhanced time_wait recycling instead. :) Mike "Silby" Silbersack
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031223031435.S2131>