
1
Chapter 1
Introduction
This book deals with the implementation of the Linux Kernel Networking stack and the theory behind it. You will find
in the following pages an in-depth and detailed analysis of the networking subsystem and its architecture. I will not
burden you with topics not directly related to networking, which you may encounter while reading kernel networking
code (for example, locking and synchronization, SMP, atomic operations, and so on). There are plenty of resources
about such topics. On the other hand, there are very few up-to-date resources that focus on kernel networking proper.
By this I mean primarily describing the traversal of the packet in the Linux Kernel Networking stack and its interaction
with various networking layers and subsystems—and how various networking protocols are implemented.
This book is also not a cumbersome, line-by-line code walkthrough. I focus on the essence of the implementation
of each network layer and the theory guidelines and principles that led to this implementation. The Linux operating
system has proved itself in recent years as a successful, reliable, stable, and popular operating system. And it seems
that its popularity is growing steadily, in a wide variety of flavors, from mainframes, data centers, core routers, and
web servers to embedded devices like wireless routers, set-top boxes, medical instruments, navigation equipment
(like GPS devices), and consumer electronics devices. Many semiconductor vendors use Linux as the basis for their
Board Support Packages (BSPs). The Linux operating system, which started as a project of a Finnish student named
Linus Torvalds back in 1991, based on the UNIX operating system, proved to be a serious and reliable operating
system and a rival for veteran proprietary operating systems.
Linux began as an Intel x86-based operating system but has been ported to a very wide range of processors,
including ARM, PowerPC, MIPS, SPARC, and more. The Android operating system, based upon the Linux kernel, is
common today in tablets and smartphones, and seems likely to gain popularity in the future in smart TVs. Apart from
Android, Google has also contributed some kernel networking features that were merged into the mainline kernel.
Linux is an open source project, and as such it has an advantage over other proprietary operating systems: its
source code is freely available under the General Public License (GPL). Other open source operating systems, like the
different types of BSD, have much less popularity. I should also mention in this context the OpenSolaris project, based
on the Common Development and Distribution License (CDDL). This project, started by Sun Microsystems, has not
achieved the popularity that Linux has. Among the large community of active Linux developers, some contribute
code on behalf of the companies they work for, and some contribute code voluntarily. All of the kernel development
process is accessible via the kernel mailing lists. There is one central mailing list, the Linux Kernel Mailing List
(LKML), and many subsystems have their own mailing lists. Contributing code is done via sending patches to the
appropriate kernel mailing lists and to the maintainers, and these patches are discussed over the mailing lists.
The Linux Kernel Networking stack is a very important subsystem of the Linux kernel. It is quite difficult to find
a Linux-based system, whether it is a desktop, a server, a mobile device or any other embedded device, that does not
use any kind of networking. Even in the rare case when a machine doesn't have any hardware network devices, you
will still be using networking (maybe unconsciously) when you use X-Windows, as X-Windows itself is based upon
client-server networking. A wide range of projects are related to the Linux Networking stack, from core routers to small
embedded devices. Some of these projects deal with adding vendor-specific features. For example, some hardware
vendors implement Generic Segmentation Offload (GSO) in some network devices. GSO is a networking feature of the
kernel network stack that divides a large packet into smaller ones in the Tx path. Many hardware vendors implement
checksumming in hardware in their network devices. Checksum is a mechanism to verify that a packet was not
WOW! eBook
www.wowebook.org
评论0