From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20090415160640.GR4823@masters6.cs.jhu.edu> References: <20090415160640.GR4823@masters6.cs.jhu.edu> Date: Wed, 15 Apr 2009 12:31:10 -0400 Message-ID: <9ab217670904150931k2949ced0qb4420dd6115d79c0@mail.gmail.com> From: "Devon H. O'Dell" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] NAT implementation Topicbox-Message-UUID: dc29700c-ead4-11e9-9d60-3106f5b1d025 2009/4/15 Nathaniel W Filardo : > On Wed, Apr 15, 2009 at 02:03:35PM +0200, Patrick Kristiansen wrote: >> I'm thinking of writing a NAT implementation for plan 9. > > I would suggest instead that it might be easier to write an adaptor progr= am > for non-Plan 9 hosts which made their network stacks talk to a /net. =A0T= hat > is, you'd want a program which spoke TAP/TUN out one end to the host kern= el > and out the other dialed and imported /net from the Plan 9 gateway. =A0AF= AIK > TAP/TUN-like things exist on most OSes, and there's good example code in > OpenVPN (for example). It's not simpler, requiring N implementations for heterogeneity, where N is the number of non-Plan 9 hosts you support. Certainly Windows, Linux, OS X, and FreeBSD would all need separate implementations. OS X doesn't have a tap(4) device per default, and Windows needs a driver as well. Of course some code can be shared, but I believe this will simply lead to bloat. If we want Plan 9 to work with other operating systems, let's make it work with other operating systems... I don't think forcing everyone else to conform to us is the right answer, in this case. NAT is well-defined, well-understood, and honestly not that difficult to implement. > The program would have to know enough about the on-the-wire representatio= n > of TCP/IP and UDP/IP to do connection tracking etc. (much like NAT, I > suppose) but the advantage is that it wouldn't impact the Plan 9 kernel. NAT can be implemented in userland in Plan 9 as is. > --nwf; > > P.S. This idea shamelessly stolen from vsrinivas, but he's mailing-list s= hy. Not trying to come off as catty, I just don't think this is a practical idea. Might be a fun project, nonetheless. --dho