Before the explosion of routing tables and of forwarded traffic, the classic routing paradigm constituted routing table lookups in increasingly complex routing tables. These tables were populated by more or less scalable and fast-converging dynamic routing protocols together with connected routes and static routes.
This paradigm has changed rapidly with the innovations in switching technology (for example, Cisco Express Forwarding, or CEF, an example of fast switching). This new paradigm tries to switch traffic by tagging it or by facilitating other measures to avoid costly Layer 3 routing table lookups. "Costly" refers to keeping the CPU busy and clogging the bus instead of intra-ASIC or intra-linecard switching/forwarding. As discussed later, the signaling and forwarding is done differently within UNIX IP stacks. Signaling refers to exchanging protocol and reachability information, whereas forwarding actually moves packets, frames, or datagrams between gateway interfaces.
The Evolution of AT&T System V (SVR4) UNIX and 4.4-Lite BSD Derivatives
UNIX was born in the early 1960s at AT&T Research as a robust timesharing operating system to overcome some of the restrictions of Multics (Multiplexed Information and Computing System). Over time, myriad flavors and derivatives have emerged and evolved, while the original MILNET/ARPANET evolved into NFSNET and later into the Internet as we know it today.
With the advent of GNU/Linux, UNIX started to attract unprecedented public attention and widespread acceptance. This also led to more popularity of Berkeley Software Distribution (BSD)-like Unices and finally to Apple Inc.'s decision to shift the Macintosh OS toward an operating system based on FreeBSD. In addition, UNIX started to expand its undisputed reign in the server arena into workstations, notebooks, and even PDAs and cell phones. A new momentum was added to the mix with the introduction of distributions as a container for operating systems such as Gentoo, Debian, or RedHat/Fedora in the Linux arena.
I do not have a preference when it comes to UNIX flavors. This book is bias-free and stays away from the religious wars a lot of UNIX aficionados and evangelists engage in nowadays. Open-source as well as commercial and proprietary approaches all have their merits. I see the world as a blend of the AT&T System V (SVR4) UNIX and 4.4-lite BSD derivatives. In a world of POSIX standards, the difference is not such a big deal anymore. Most UNIX or UNIX-like systems offer the same look and feel and directory layout. The differences among these systems are most prevalent when dealing with disk organization and file systems.
Throughout this book, I stick to the three open-source operating systems—OpenBSD, FreeBSD, and Linux—for the discussion of the IP stack and user-space architectures. However, most of the conclusions and concepts are valid on other platforms as well, such as SUN Solaris, Mac OS X/Darwin, and NetBSD.
NOTE
The brand UNIX is, after a long and glorious journey, now a registered trademark of the Open Group (http://www.opengroup.org). Hence, several open-source projects call their architectures UNIX-like to avoid copyright issues. I do not make this differentiation throughout this book
Operating Systems Design Considerations
In the UNIX world, discussions are always going on about the pros and cons of microkernel architectures, modular kernels, embedded systems, real-time operating systems, and monolithic kernel designs. For details, look at the GNU Hurd/Mach web page and the design documents available from the Linux kernel designers. The URL is http://www.gnu.org/software/hurd/hurd.html.
Unfortunately, no single authoritative repository exists for Linux information. However, you can start by reading the classic books from Avi Silberschatz (Applied Operating System Concepts, Fifth Edition; Wiley Text Books, 1999) and Andrew S. Tanenbaum (Modern Operating Systems, Second Edition; Prentice Hall, 2001) about operating systems design to grasp the concepts and design rationale as well as the Minix foundation of Linux. Knowing the information from these sources will help you go through this book because several examples either facilitate kernel routines or dynamic loadable modules; it will also help you in your career because an understanding of operating concepts will always be an advantage when making difficult choices with regard to future platforms.
Kernel-Space Modules Versus User-Space Applications
Some features such as network drivers, IP Security (IPSec), and IPv6 support are implemented in kernel space, meaning they are an integral part of the kernel sources or are available as dynamically loadable kernel modules. Other features such as httpd or vrrpd are implemented as user-space applications (processes or daemons) and run under special system accounts or (un)privileged users. Because applications can be more easily ported than kernel routines and a lot of stuff such as packet filtering that heavily interacts with the kernel needs to be placed in the kernel, knowing what is implemented in which space will help you as you go through this book.