FreeBSD IP Device Driver

Brooks Davis brooks at one-eyed-alien.net
Sat Jan 31 10:06:00 PST 2004


On Fri, Jan 30, 2004 at 11:34:41AM -0600, Erik Hamilton wrote:
> I'm currently working on building a simple token ring networking scheme
> over the parallel port (/dev/ppi0) for a graduate project. The project
> itself is to be used later for educational purposes, illustrating how you
> can build a network from the ground up through hardware developement,
> framing, and layering.  The hardware is done, simple token managment is
> working, and data can be passed around the ring. So basically I have the
> physical and datalink layers mostly done. It's my understanding that if I
> can get my program to speak IP to FreeBSD (through a kernel module or
> something else) I could inherit its TCP/IP stack.
> 
> Ideally I would like to have my simple token ring as another network
> device that could be used just like any other network interface. I've been
> reading through FreeBSD's handbooks and poking through /usr/src/sys/dev/.
> 
> * Developers' Handbook:
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/index.html
> 
> * FreeBSD Architecture Handbook (esp. Section II: Device Drivers):
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/index.html
> 
> Basically I think I'm just looking for some guidance. Am I on the right
> track? or am I confused?  I haven't had the best luck with google, so any
> other reading material would be greatly appreciated.

Those are good places to look.  I'd specifictly recommend looking at the
implementation of the plip driver since that interfaces to the parallel
port.  Depending on how your device works (what the datalink layer looks
like, what your timing requirements are, etc.), you might find it easier
to handle the transmission through a userland program using tap or tun
devices or possiably a combination of netgraph nodes.  Actually, making
a netgraph parallel port device might simplify your life tremendously if
you decide to work in the kernel.

One thing that would help you would be if your datalink layer looks
enough like ethernet that you can use ARP so you don't have to rebuild
the link layer to IP mapping code.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040130/42d23105/attachment-0003.bin


More information about the freebsd-questions mailing list