From owner-freebsd-net Thu Apr 6 14:57: 9 2000 Delivered-To: freebsd-net@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id D3CC137B515 for ; Thu, 6 Apr 2000 14:57:03 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.2) id OAA76934; Thu, 6 Apr 2000 14:56:26 -0700 (PDT) From: Archie Cobbs Message-Id: <200004062156.OAA76934@bubba.whistle.com> Subject: Re: kernel vs user level implementation of NAT In-Reply-To: <006401bf9d35$37bddb00$0e05a8c0@intranet.syncrontech.com> from Ari Suutari at "Apr 3, 2000 09:24:02 am" To: ari@suutari.iki.fi (Ari Suutari) Date: Thu, 6 Apr 2000 14:56:26 -0700 (PDT) Cc: adsharma@sharmas.dhs.org (Arun Sharma), freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Ari Suutari writes: > > Can someone point me to some discussion or literature on why *BSDs chose > > to implement natd as a daemon as opposed to a kernel service ? I'm > > particularly interested in the performance (latency) aspects of the issue. > > > > The history goes something like this: > > Some years ago I had a cable modem connection at home. I had > internal network with some hosts and a FreeBSD server machine > (running 2.x if I remember correctly). I was looking for solutions how > to get my internal machines to access internet with similar > manner as ip masquerading in Linux (Couldn't use Linux, I'v > always been fond of *BSD). > > Well, I found that Darren Reed's ipfilter didn't work with 2.x so > that was out. Porting of it looked like too much effort at that time. > > Then I found out from somewhere that user mode ppp had > nat features and took a look at it. Surprisingly all the functions > necessary to do it were packaged to a few source files > which I took into natd. These sources were written by Charles > Mott and eventually ended into libalias library. > > There was also another similar program in the beginning, > Brian Somer's masqd. I don't remeber any more why I decided > to go along with natd - maybe both were at very early stage of > development > and I just had more time to play with natd. Anyway, Brian also > contributed to natd. > > What I found good about doing this in user process was the > ease of debugging and testing of new versions. Some even earlier history.. Whistle started working on NAT way back in 1995 for the InterJet. We needed an easy way to develop the code, so we invented divert(4) sockets, which make it easy to do NAT in userland. Our product was I/O limited rather than CPU limited so performance was not an issue. We wrote our own proprietary NAT daemon but 'natd' appeared shortly after divert sockets were added anyway (as we figured it would). -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message