Written to give students and professionals the basics required to implement network functionality in the Linux kernel, this book also addresses everyone who wants to deepen their understanding of network specific processes in an operating system. This book introduces the key components and mechanisms of the Linux kernel and the designs of communication systems.
The Linux Networking Architecture is a detailed description of the network subsystem in the newer versions of the Linux kernel. It explains how protocols work and establishes important concepts of the Linux network architecture from device drivers to application interfaces. In addition to central issues such as PPP, IP, firewalls, routing, TCP, NAT, UDP, and sockets, the book discusses more recent protocols and extensions such as PPPoE used in DSL access technologies, the Bluetooth® driver, and quality-of-service support. Features
All core protocols of the TCP/IP protocol family are covered, with additional treatment of supplementary protocols such as RSVP, Mobile IP and IP Security.
Each chapter contains:
- A conceptual introduction to the corresponding protocol
- Discussion of how the protocol's functionality is configured and administered
- Explanation of data structures, algorithms, and programming interfaces
Interface design is explained with a view to which design principles to use when protocols should be implemented.
The informational appendix further facilitates working with Linux, for instance, debugging in the Linux kernel.
This book deals with the architecture of the network subsystem in the Linux kernel. The idea for this book was born at the Institute of Telematics at the University of Karlsruhe, Germany, where the Linux~kernel has been used in many research projects and its network functionality is modified or enhanced, respectively, in a targeted way. For instance, new services and protocols were developed for the next-generation Internet, and their behavior was studied. In addition, existing protocols, such as the TCP transport protocol, were modified to improve their behavior and adapt them to the new situation in the Internet.
In the course of these research projects, it has been found that the Linux kernel is very suitable for studying new network functionalities, because it features a stable and extensive implementation of the TCP/IP protocol family. The freely available source code allows us to modify and enhance the functionality of protocol instances easily. In addition, the enhancement of the kernel functionality is very elegantly supported by the principle of the kernel modules. However, many studies and theses in this field showed that familiarization with the Linux network architecture, which is required before you can modify the behavior of a protocol instance, demands considerable work and time. Unfortunately, this is mainly due to the facts that the network subsystem of the Linux kernel is poorly documented and that there is no material that would explain and summarize the basic concepts.
Although there are a few books that deal with the Linux kernel architecture and introduce its basic concepts, none of these books includes a full discussion of the network implementation. This situation may be due to the following two reasons:
- The network subsystem in the Linux kernel is very complex. As mentioned above, it implements a large number of protocols, which is probably one good reason for the enormous success of Linux. Both BoCe00 and BBDK+Ol mention that the description of all these protocols and their concepts would actually fill an entire book. Well, you are reading such a book now, and, as you can see, it has eventually turned out to be quite a large volume, although it describes only part of the network functionality, in addition to the basic concepts of the Linux network architecture.
- Operating-system developers normally deal with the classical topics of system architecturefor example, the management of memories, processes, and devices, or the synchronization of parallel activities in a system-rather than with the handling of network packets. As you go along in this book, you will surely notice that it has been written not by system developers, but by computer-science specialists and communication engineers.
While considering the facts that there was little documentation covering the Linux network architecture and that students had to familiarize themselves with it over and over again, we had the idea of creating a simple documentation of the Linux network architecture ourselves. Another wish that eventually led to the more extensive concept of this book was a stronger discussion of important communication issues: design and implementation of network protocols in real-world systems. Networking courses teach students the most important concepts and standards in the field of telecommunication, but the design and implementation of network functionality (mainly of network protocols) by use of computer-science concepts has enjoyed little attention in teaching efforts, despite the fact that this knowledge could have been used often within the scope of studies and theses. The authors consider the description of the implementation of the Linux network architecture and its structure, interfaces, and applied concepts a step towards strengthening the informatics component in networking classes.
The authors hope that this book will help to make the processes and structures of the Linux network architecture easier to understand, and, above all, that our readers will have fun dealing with it and perhaps learn a few things about the networking concept and its practical implementation.
The content of this book corresponds to our knowledge of the Linux network architecture. This knowledge is neither comprehensive nor exhaustive. Nevertheless, we have tried to represent the processes and structures of the Linux network architecture in a fashion as easily understandable and detailed as possible. We are thankful for all hints, suggestions for improvement, ideas, and comments, and we will try to consider them in later editions. Updated information about the Linux network architecture and this book is available online at http://www.Linux-netzwerkarchitektur.de.
ORGANIZATION OF THIS BOOK
Chapter 1 will deal intensively with the motivation behind Linux in general and the Linux network architecture in particular; Chapter 2 is an introduction into the basic mechanisms and components of the Linux kernel. To keep the volume of this book manageable, we will discuss only those components that are important for understanding the Linux network architecture. With regard to the other components of the Linux kernel, we refer our readers to other books (e.g., BBDK+01).
Chapter 3 is an introduction to the general architecture of communication systems and the functionality of protocols and protocol instances. It includes an introduction to the popular TCP/IP and ISO/OSI layering models.
Chapters 4 and 5 discuss fundamental concepts of the Linux network architecture, including the representation and management of network packets in the Linux kernel, (see Socket Buffers-Chapter 4) and the concept of network devices (Chapter 5). "Network devices form the links between the protocol instances on the higher layers and hide the particularities of the respective network adapters behind a uniform interface.
Chapter 6 gives an overview of the activity forms in the Linux network architecture and the flow of transmit and receive processes. In addition, this chapter introduces the interface to the higher-layer protocol instances.
Chapters 7 through 12 discuss protocols and mechanisms of the data link layer. More specifically, it describes the SLIP, PPP, and PPP-over-Ethernet protocols and how the ATM and Bluetooth network technologies are supported in Linux. Finally, we will describe how a Linux computer can be used as a transparent bridge.
Our discussion of the TCP/IP protocols starts with an overview of the TCP/IP protocol family in Chapter 13. We will begin with a brief history of the Internet, then give an overview of the different protocols within the TCP/IP protocol family. Chapter 14 will deal with the Internet Protocol and its mechanisms in detail. In addition, it introduces the IP options and the ICMP protocol. Chapters 15 through 23 discuss the following protocols and mechanisms on the network layer: ARP, routing, multicasting, traffic control, firewalls, connection tracking, NAT, KIDS, and IPv6.
Chapters 24 and 25 describe the TCP and UDP transport protocols, respectively. We will close our discussion of the kernel with an explanation of the socket interface, in Chapter 26, then end with a short overview of the programming of network functionality on the application level.
The appendix includes additional information and introduces tools facilitating your work with the Linux network architecture. The issues dealt with include the LXR source code browser, debugging work in the Linux kernel, and tools you can use to manage and monitor the Linux network architecture.
ADDITIONAL SOURCES OF INFORMATION
This section lists a few useful sources of information where you can find additional information about the Linux network architecture.
- The Linux Magazine (http://www.Linux-mag.com) is probably the best-known Linux magazine. It features articles about all issues that are of interest when you deal with Linux. Of special interest is the Kernel Corner column, which regularly publishes articles about the architecture and implementation of components of the Linux kernel-most of them by developers themselves.
- Linux Focus (http://www.linuxfocus.org) is an online magazine publishing articles in many different languages. It also includes a Kernel Corner.
- The Linux Gazette (http://www.linuxgazette.com) is another online magazine dedicated to Linux.
Useful Links in the World Wide Web
- Linux Headquarters: http://www.linuxhq.com
- Linux Documentation Project: http://www.linuxdoc.org
- Linux Weekly News: http://www.lwn.net
- Howtos include a lot of information about different Linux issues. Most deal with the configuration and installation of various Linux functionalities. Especially for the Linux kernel, there are also a few howto documentsfor example, how to use locks in the kernel RUSSOOb, and general information on hacking in the Linux kernel RUSSOOC. Of course, we should not forget to mention the networking howto, which includes a wealth of tips and information about configuring the network functionality in Linux Drak00.
- The source code of the current kernels is found at ftp. kernel .org. There are also mirrors of this FTP server, a list of which can be found at http://www.kernel.org/mirrors/.
- Information about components and drivers of the Linux kernel are also included directly in the source code of a kernel version, in the Documentation subdirectory. In addition, the file Documentation/kernel-docs.txt includes a list of current information about the Linux kernelfor example, documentation, links, and books. (It's worth taking a look at this file!)
CONVENTIONS USED IN THIS BOOK
This book uses the following typographical conventions to emphasize various elements of the Linux kernel, source texts, and other things.
A gray bar denotes important functions. A bar describes the function name on the left and the file name (within the kernel's sourcecode tree) on the right.
When giving a function name in such a place and throughout the body of this book, we normally leave out the parameters, because they would take up much space and impair the readability and text flow.
In general, when introducing a function, we describe the entire parameter set and give a brief description. The variable type is normally left out.
Variables, Function Names, Source Text Excerpts, and so on
A sans-serif font is used for excerpts from the source code, variable and function names, and other keywords referred to in the text.
Commands, Program Names, and so on
A sans-serf f font is used for the names of programs and command-line tools. Parameters that should be passed unchanged are also printed in sans serif; those parameters that have to be replaced by values are printed in sans-serif italic.
Direct input in the command line is often denoted by a leading shell promptfor example,
Files, Directories, Web Links, and so on
A sans-Seri f font is used for files and directories. We generally give the relative path in the kernel source code for files of the Linux kernel (e.g., net/ivp4/ip_input.c). Web links are also printed in sans-serf f font (e.g., http://www.Linux-netzwerkarchitektur.de).
Italic text denotes emphasis, or an introduction to a key term or concept.