

Ask HN: Book recommendations for Linux 2.6 tcp/ip - TallGuyShort

Sorry if "book review" is an annoying theme that often comes up, but I respect the opinions here, and I've found the reviews on Amazon to be a bit confusing.<p>I'm a long-time C programmer that has dabbled in  Linux programming, OS development, and networking. I'm very interested in doing some serious hacking of the TCP/IP (ipv4 and ipv6) stack in Linux 2.6 kernels. So although I'm not new to the whole scene, I need some serious help before I can understand the source code enough to do what I'd like to do. Can anyone here recommend a good book that you think matches these interests and my level?<p>"Linux TCP/IP Networking for Embedded Systems" (http://www.amazon.com/Linux-TCP-Networking-Embedded-Systems/dp/1584504811/ref=sr_1_1?ie=UTF8&#38;s=books&#38;qid=1249270908&#38;sr=1-1) is probably my best lead, so far. It has some poor reviews, but despite the "Embedded Systems" in the title, it looks like a good general primer that's about at my level. Any thoughts, especially from owners of the book?
======
mahmud
Do you know there is "Understanding Linux Network Internals"? It's a fat beast
but covers the subject in great detail. I had to write a device driver and
needed to use a netlink socket for high speed chunked data transfer; for that
particular purpose, I found ULNI to be too verbose and learned everything I
needed from the Rubini book, the Love book, and various Linux Journal and LWN
articles along with the requisite snooping into various sources.

Robert Love's book is a joy to read, very compact and quick, piecemeal
introduction to the higher levels aspects of the kernel. Corbet, Rubini and
Kroah-Hartman is good for some quick hands on. Supplment them with various
other stuff online and linux/Documentation; nothing will force you to learn
FAST like a buggy driver or a piece of unsupported hardware. I find casual
academic hacking boring, and none of what I read makes sense until I am found
by a very interesting problem.

Good luck.

~~~
TallGuyShort
>> Rubini

I dismissed that book just because I thought a book on "Device Drivers"
wouldn't cover the networking modules specifically, and that's really all I'm
interested in at this point. Was I wrong? Do they cover it in detail?

>> Robert Love

Ooh yes - I've looked at that book before and almost bought it. You say it's a
"compact and quick piecemeal introduction to the higher level aspects of the
kernel". Would you say that book is at least detailed enough for me to start
confidently modifying the source code of the networking code once I'm done? It
would be nice to understand the kernel as a whole form a high-level, but what
I really need is a detailed look at the TCP/IP stack.

>> Good luck.

Thanks!

~~~
mahmud
You said you were "new to the whole scene"; you will at least need basic
kernel hacking to work on the networking subsystem; at least enough to be able
to use the appropariate memory allocation strategies; the options to kmalloc
are not optional, you will have to grok what each strategy entails; same for
slab buffers, synchronization primitives, error handling and clean up, etc.

The book you REALLY want is ULNI; the driver model is essential for
understanding the kernel because everything in the kernel is "pluggable", you
almost use the same mechanisms to register a device driver, a file system, a
network protocol, or something as basic as creating a new sysfs entry.

If you're feeling too macho you can probably ignore Rubini and Love and just
get ULNI and ctags ;-)

~~~
TallGuyShort
No I said I WASN'T new to the whole scene. I've written kernel code before,
and I'm very familiar with all those mechanisms. However the networking code
is extremely optimized, and a good walk-through of the code is necessary
before one is able to associate each instruction with a particular action as
it fits into the whole algorithm - and that's the kind of book I'm looking
for. Thanks, though.

------
blacky
The Linux Networking Architecture: Design and Implementation of Network
Protocols in the Linux Kernel by Klaus Wehrle, Frank Pählke, Hartmut Ritter,
Daniel Müller, Marc Bechler.

Here's an excerpt from the preface:

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+01] 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
architecture—for 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>.

~blacky

------
TallGuyShort
Just as an update if anyone cares, I decided to go with "Understanding Linux
Network Internals". It doesn't cover TCP or IPv6, but it looks like the
perfect level of depth that I'm looking for, so hopefully what I learn from
this book will help me figure out the rest of the TCP part by myself.

The Linux Networking Architecture: Design and Implementation of Network
Protocols in the Linux Kernel looked perfect, but it doesn't cover 2.6
kernels, only 2.2-2.4. Although it did cover more network protocols, I'm more
interested in the current kernel than in a wide range of details.

