Subject: Re: Userland PPP
To: Yoav Cohen-Sivan <yoavcs@inter.net.il>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 02/18/1999 08:10:23
On Thu, 18 Feb 1999 08:40:10 -0000 
 Yoav Cohen-Sivan <yoavcs@inter.net.il> wrote:

 > Are there any technical, moral or philosophical reasons why we haven't =
 > ported the userlevel PPP program available in Free and OpenBSD? It works =
 > through the tun driver. If there aren't any objections I'd like to try =
 > porting it to NetBSD (I haven't even checked, maybe it'll compile out of =
 > the box ;-) ).
 > 
 > Reasons? It just seems a cleaner solution than pppd, to my untrained =
 > eyes. Why have ppp code in the kernel when it can be userland, right?

Wrong.  ppp in usrland + tun leans every packet is copied at least twice
(serial -> ppp -> tun) over the kernel/user barrier.

In NetBSD, the PPP connection setup protocol _IS_ handled in userland
by pppd, but data packets (i.e. ones that don't have the control bit
set in PPP's "ethertype" equivalent) are packaged into mbufs and handed
directly to the appropriate next layer.

NetBSD's method is MUCH more efficient, which will be important as we
implement PPP over faster media, such as Ethernet (yes, really; there
is an internet draft for this) and ATM.

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>