Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jul 1996 12:46:13 -0700 (PDT)
From:      "JULIAN Elischer" <julian@ref.tfs.com>
To:        gram@oms.co.za (Gram)
Cc:        jgreco@brasil.moneng.mei.com, hackers@freebsd.org, gram@gram.oms.co.za
Subject:   Re: BPF and point-to-point links
Message-ID:  <199607081946.MAA04870@ref.tfs.com>
In-Reply-To: <199607081519.RAA00702@gram.oms.co.za> from "Gram" at Jul 8, 96 05:19:21 pm

next in thread | previous in thread | raw e-mail | index | archive | help
 Hi.
we have set up an infrastructure for arbitrary user-level agents
to 'meddle' with packets..
it is based on the packet filtering code..
you can arbitrarily divert certain packets to a user level agent, which
can examine/modify them and re-inject them to the system.
> 

it sounds like you might be able to use thos for what you want
to do better than bpf etc.

We (whistle.com) want to commit the additions to the system 
but haven't got a 2nd "sponsor" yet..

these are relative to-current and allow us to impliment
arbitrary network address translation  and packet encryption and
encapsulation among other things.

> 
> Hi Joe
> 
> > > I am trying to use BPF to write packets directly out to a network 
> > > interface. I hacked the kernel to allow me to do this with PPP (both
> > > user and kernel PPP). 
> > 
> > As a quick clarification, is there some reason that you cannot use the tun
> > device to set up a separate interface for your program?  In other words, I
> > do not understand why you are trying to do this in what appears to be a more
> > "difficult" manner, when the system provides facilities for this sort of
> > stuff...
> 
> Well, I am writing an application level gateway using the BPF devices.
> The idea is that you run something like:
> 
>    gateway ed1 ed2
> 
> and the gateway program then gateways packets between the interfaces.
> I use ipfw to prevent the kernel from doing anything with the packets.
> The main purpose of the application is to perform address hiding for the
> internal network, and restrict traffic to outgoing TCP connections. Thus
> I am patching the IP addresses and IP and TCP checksums in the packets
> between reading and writing them.
as I said.. we should talk..

> 
> While our client is using a router for their Internet connection,
> we have a dialup PPP connection to an ISP ourselves.  I've been
> running the program at our site during development and testing.
> I want to be able to do:
> 
>     gateway ed1 tun0
> 
> to have the same effect for PPP. Because the PPP part is just for our own
> use and is not critical, and furthermore is mostly intended for testing
> the code which *must* run Ethernet-to-Ethernet, I don't want to make lots of
> special provisions for the PPP case. At the same time, I would like to
> retain the demand-dial capabilities of user PPP.
> 
our scheme is independent of the inteface used..

> I hope this answers your question. Or am I missing the point somewhere?
> 
> HOWEVER, I must say that my original description was not entirely
> correct. I am also experiencing some delays when browsing the WWW.
> On the other hand, when making telnet connections to a couple of sites,
> on which I have accounts, everything hums (I'm just doing a ls -lR /
> and the output cruises by nicely).
> 
> Some further details about what I've done may help:
> 
> * when I write a packet out on the BPF device, I am putting prepending
>    a data link header if the bound interface is Ethernet. If it is SLIP or PPP,
>    I just write out the IP packet with no DLL header. From looking at 
>    the kernel code, this seemed to be the right thing to do.
> * I hacked the BPF kernel code so that I only tap incoming packets, and not 
>    outgoing, to prevent the gateway from getting copies of the packets that
>    it writes out.
we've taken that into account
> * the mods I made to bpf.c to allow me to write out packets 
>    to /dev/ppp or /dev/tun0 were in the routine bpf_movein:
> 
>     ....
>     ....
> 

In addition we can divert some packets while not divert others, allowing
a mixture  of high-speed and low-speed routing at the same time..

> 
> 
[stuff deleted]

+----------------------------------+       ______ _  __
|   __--_|\  Julian Elischer       |       \     U \/ / On assignment
|  /       \ julian@whistle.com    +------>x   USA    \ in a very strange
| (   OZ    ) 110 Marsh road, Foster City. \___   ___ | country !
+- X_.---._/  USA+(510) 645-3137(wk)           \_/   \\          ><DARWIN>
          v                                                        LL  LL





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607081946.MAA04870>