9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Patrick Kristiansen <patrick.kasserer@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] NAT implementation
Date: Wed, 15 Apr 2009 15:44:14 +0200	[thread overview]
Message-ID: <bfdb2cad0904150644m1d0c48d9xa97c053f64c8e47b@mail.gmail.com> (raw)
In-Reply-To: <9ab217670904150532l6e9805dcvc339b03c7892aba9@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]

2009/4/15 Devon H. O'Dell <devon.odell@gmail.com>

>
>
> I think #2 would be an easily testable and maybe more `correct' way to
> do this in Plan 9. I think doing an implementation directly in the IP
> path is easier, overall, but that's where my experience lies anyway.
>
Thanks, I'll try that.

>
>
> > Do you have any advices on how to capture packets and how to send them
> out
> > again after replacing src/dst addr and port?
>
> It's not quite that simple. At the simplest, when the packet goes out,
> you have to keep a tab of the destination host / port and source host
> / port. When a packet comes in, you look up the source host / port in
> the hash table (hashed by dest host / port). You rewrite the packet.
> You have to regenerate the packet checksum after rewriting it. You
> send it back out.


I know it's not that simple. But for the rewriting and keeping state stuff,
I can look at the existing implementations of nat, i.e. natd for freebsd.
The thing I need now is the stuff for capturing and sending packets using
pkt interfaces.

>
> > Are there any ways of testing NAT in a virtual machine? Right now I'm
> using
> > vmware and it would be nice to be able to test it without setting up a
> real
> > machine with two Ethernet interfaces.
>
> Sure, configure a couple VMs with hostonly networking and set up their
> IP addresses accordingly.
>
Nice, thanks.

>
> > -Patrick Kristiansen
>
> --dho
>
>

[-- Attachment #2: Type: text/html, Size: 2275 bytes --]

  reply	other threads:[~2009-04-15 13:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 12:03 Patrick Kristiansen
2009-04-15 12:32 ` Devon H. O'Dell
2009-04-15 13:44   ` Patrick Kristiansen [this message]
2009-04-15 12:46 ` erik quanstrom
2009-04-15 16:06 ` Nathaniel W Filardo
2009-04-15 16:29   ` Anthony Sorace
2009-04-15 16:41     ` Devon H. O'Dell
2009-04-15 16:31   ` Devon H. O'Dell
2009-04-15 16:44     ` Anthony Sorace
2009-04-15 17:32       ` blstuart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfdb2cad0904150644m1d0c48d9xa97c053f64c8e47b@mail.gmail.com \
    --to=patrick.kasserer@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).