Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jun 2002 09:05:10 +0530
From:      "Gautham Ganapathy" <gauthamg123list@myrealbox.com>
To:        "Terry Lambert" <tlambert2@mindspring.com>
Cc:        "FreeBSD.org - Hackers" <freebsd-hackers@freebsd.org>, "FreeBSD. org - Net" <net@freebsd.org>
Subject:   RE: Inserting a kernel module b/w IP and ethernet (Moving to net-)
Message-ID:  <NGBBJAAOCMHHCAAOGNFMIEIMCDAA.gauthamg123list@myrealbox.com>
In-Reply-To: <3D0DF45F.C616C7CA@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, June 17, 2002 8:08 PM, Terry Lambert wrote:
>
> Gautham Ganapathy wrote:
> > How can I add an extra layer of processing b/w the IP and
> ethernet layers
> > using a kernel module ? If I load a module, I should be able to
> access the
> > functions exported by IP and ethernet. Also, I think the
> ethernet layer can
> > be configured to use my module as the protocol by patching
> ifconfig. Am I
> > right so far ? So, how do I get IP to use my module as it's
> link layer ? If
> > I am wrong, what's the proper way ? Or is there any other
> simpler way ? My
> > requirement is to add a compression layer (RFC 2507)
>
> Questions like this should probably be sent to -net, rather than
> -hackers.  You will probably find a better answer than mine, just
> by searching the -net list archives at www.freebsd.org.
>

ok. will do

> The RFC specifically references a NetBSD implementation for PPP; is
> this for PPP?  If it's for PPP, then mpd may have already implemented
> what you need as a netgraph node.  One thing you aren't going to be
> able to do is BPF on input after netgraph catches the data.
>

it is not for ppp. this will currently be used on a LAN. it is used for
reducing header bandwidth on wireless transmission systems. the ip packets
generated after compression are not compatible with standard ipv4 packets
and probably cannot be used on the same network. as in tcp/ip, there is no
dependency on an underlying protocol. i'll check if the netbsd ppp will be
of use.

> Don't bother with a protocol family, unless you want to have to
> implement everything; TCP in tcp_output() calls ip_output()
> directly, so you will not be able to wedge it in there (TCP and IP
> are not implemented as stackable protocol layers seperate and
> distinct from each other).  I can point you at code that does
> this, but it requires changing your application in order to
> make it open sockets with the new family instead of AF_INET; if
> you ar adamant, the code is at Rice University, as part of the
> Scala Server Project.

i won't need to embed it between tcp and ip. it would have to be between ip
and ethernet.

> My particular choice for an example would be /sys/netgraph/ng_pppoe.c
> but others might point you to something else.  Julian or Archie are
> always the best people to ask (obviously).
>
> You could also create an interface (see /sys/netgraph/ng_iface.c)
> that pretended to be a plain old interface, and did the
> encapsulation/deincapsulation, and sent to the regular interface.
>

this sounds good, but i think i have a lot of code to go through since i
have just started studying the kernel.

> The basics are going to be that you replace the mbuf with your
> modified mbuf, rather than eating it outright, if you want the
> input/output processing to proceed normally on the (de)compressed
> packet.
>
> I don't know if there is a ng_null that anyone has written; it
> would *really* be the best starting point.
>

thanx a lot


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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