From owner-freebsd-net@FreeBSD.ORG Fri Jan 30 10:14:04 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C295E16A4CE; Fri, 30 Jan 2004 10:14:04 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA8C043D3F; Fri, 30 Jan 2004 10:13:25 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.3) with ESMTP id i0UIDD2h013344; Fri, 30 Jan 2004 10:13:13 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i0UIDDLq013341; Fri, 30 Jan 2004 10:13:13 -0800 Date: Fri, 30 Jan 2004 10:13:12 -0800 From: Brooks Davis To: Erik Hamilton Message-ID: <20040130181312.GC1914@Odin.AC.HMC.Edu> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6sX45UoQRIJXqkqR" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: freebsd-net@freebsd.org cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD IP Device Driver X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 18:14:04 -0000 --6sX45UoQRIJXqkqR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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/. >=20 > * Developers' Handbook: > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/inde= x.html >=20 > * FreeBSD Architecture Handbook (esp. Section II: Device Drivers): > http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/index.html >=20 > 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 --=20 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 --6sX45UoQRIJXqkqR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAGp62XY6L6fI4GtQRAi5IAKCxW9UVt7KyqEmvLQ26Ecq4TMTz4QCeNjwd aGVwDLdWfoy9F9MhvSwcBQU= =Vrkh -----END PGP SIGNATURE----- --6sX45UoQRIJXqkqR--