Linux PPPoE

A large number of DSL service providers are actively using the PPPoE protocol for providing residential broadband Internet services. In this short write-up, we’ll acquaint you with the basics of PPPoE protocol and tell you about its implementation strategy under Linux environment.

Majority of Internet service providers don’t offer support for Linux environments and supply the PPPoE clients only for Mac OS X and Windows operating systems.

There are several different possibilities when it comes to implementation of a PPPoE client under the Linux environment. Following are three reasonable strategies which you can put to use:
1. Implement both the session and PPPoE discovery phases in a single user space program.
2. Implement the PPPoE session in kernel and PPPoE discovery phase inside a user space program.
3. Implement both the session and the PPPoE discovery phases inside the kernel.

It would be wise to drop the third strategy straight away. The PPPoE discovery isn’t very speed critical and comprises of a code that is rarely used. It wouldn’t make any sense to bloat up the kernel with the discovery code.

Hence, we’d need to go with the remaining choices, which is implementing the PPPoE session code inside the kernel environment or inside a user space program. The choice is pretty clear in this scenario too. Ideally, it should be the kernel handling the PPPoE session. Execution of every PPPoE frame’s user code is a pretty inefficient way of going about it.

At the time of writing this piece, the PPPoE support existed in the 2.3 kernels (in experimental stages) and was expected to be incorporated in the 2.4 kernels. Furthermore, there were kernel patches available for adding the PPPoE support to the 2.0 and 2.2 kernels.

Despite the kernel being quite clearly in the desired place for the PPPoE session support, you can implement PPPoE inside a user space program. Although this could be repugnant to the kernel hackers, following are some advantages of implementing it in a user space program:
- Writing and debugging a user space program is not very difficult.
- User space programs are comparatively more portable. In fact the rp-pppoe has already been ported to the NetBSD.
- Since a large majority of Linux users are novices, they can’t easily apply and configure the existing kernel patches. Furthermore, when it comes to the new Linux users, they find a simple DEB or RPM package with helpful configuration shell script much more workable.
- A large number of Linux users try to avoid making any modifications to the kernels. If ever they feel the need of upgrading the kernels for security reasons, they try not to remember to compile in support for PPPoE.
- A good number of residential DSL connections have pretty slow speed (less than or equal to 2.2 M bps). Even user space clients can keep up with such speeds on all hardware but the oldest ones.

Hence, the user space client is viewed as a convenient but temporary means until the more stable kernels include support for PPPoE. Even if the standard kernel provides PPPoE support, majority of user space code is about the discovery phase, and hence can be re-employed in the newer kernels. Furthermore, since the session code is pretty simple, there is no harm in getting rid of it.