If you've ever wondered how Linux carries out the complicated tasks assigned to it by the IP protocols -- or if you just want to learn about modern networking through real-life examples -- Understanding Linux Network Internals is for you.
Like the popular O'Reilly book, Understanding the Linux Kernel, this book clearly explains the underlying concepts and teaches you how to follow the actual C code that implements it. Although some background in the TCP/IP protocols is helpful, you can learn a great deal from this text about the protocols themselves and their uses. And if you already have a base knowledge of C, you can use the book's code walkthroughs to figure out exactly what this sophisticated part of the Linux kernel is doing.
Part of the difficulty in understanding networks -- and implementing them -- is that the tasks are broken up and performed at many different times by different pieces of code. One of the strengths of this book is to integrate the pieces and reveal the relationships between far-flung functions and data structures. Understanding Linux Network Internals is both a big-picture discussion and a no-nonsense guide to the details of Linux networking. Topics include:
Key problems with networking
Network interface card (NIC) device drivers
System initialization
Layer 2 (link-layer) tasks and implementation
Layer 3 (IPv4) tasks and implementation
Neighbor infrastructure and protocols (ARP)
Bridging
Routing
ICMP
Author Christian Benvenuti, an operating system designer specializing in networking, explains much more than how Linux code works. He shows the purposes of major networking features and the trade-offs involved in choosing one solution over another. A large number of flowcharts and other diagrams enhance the book's understandability.
General Background
Chapter 1 Introduction
Basic Terminology
Common Coding Patterns
User-Space Tools
Browsing the Source Code
When a Feature Is Offered as a Patch
Chapter 2 Critical Data Structures
The Socket Buffer: sk_buff Structure
net_device Structure
Files Mentioned in This Chapter
Chapter 3 User-Space-to-Kernel Interface
Overview
procfs Versus sysctl
ioctl
Netlink
Serializing Configuration Changes
System Initialization
Chapter 4 Notification Chains
Reasons for Notification Chains
Overview
Defining a Chain
Registering with a Chain
Notifying Events on a Chain
Notification Chains for the Networking Subsystems
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Chapter 5 Network Device Initialization
System Initialization Overview
Device Registration and Initialization
Basic Goals of NIC Initialization
Interaction Between Devices and Kernel
Initialization Options
Module Options
Initializing the Device Handling Layer: net_dev_init
User-Space Helpers
Virtual Devices
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Chapter 6 The PCI Layer and Network Interface Cards
Data Structures Featured in This Chapter
Registering a PCI NIC Device Driver
Power Management and Wake-on-LAN
Example of PCI NIC Driver Registration
The Big Picture
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Chapter 7 Kernel Infrastructure for Component Initialization
Boot-Time Kernel Options
Module Initialization Code
Optimized Macro-Based Tagging
Boot-Time Initialization Routines
Memory Optimizations
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Chapter 8 Device Registration and Initialization
When a Device Is Registered
When a Device Is Unregistered
Allocating net_device Structures
Skeleton of NIC Registration and Unregistration
Device Initialization
Organization of net_device Structures
Device State
Registering and Unregistering Devices
Device Registration
Device Unregistration
Enabling and Disabling a Network Device
Updating the Device Queuing Discipline State
Configuring Device-Related Information from User Space
Virtual Devices
Locking
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Transmission and Reception
Chapter 9 Interrupts and Network Drivers
Decisions and Traffic Direction
Notifying Drivers When Frames Are Received
Interrupt Handlers
softnet_data Structure
Chapter 10 Frame Reception
Interactions with Other Features
Enabling and Disabling a Device
Queues
Notifying the Kernel of Frame Reception: NAPI and netif_rx
Old Interface Between Device Drivers and Kernel: First Part of netif_rx
Congestion Management
Processing the NET_RX_SOFTIRQ: net_rx_action
Chapter 11 Frame Transmission
Enabling and Disabling Transmissions
Chapter 12 General and Reference Material About Interrupts
Statistics
Tuning via /proc and sysfs Filesystems
Functions and Variables Featured in This Part of the Book
Files and Directories Featured in This Part of the Book
Chapter 13 Protocol Handlers
Overview of Network Stack
Executing the Right Protocol Handler
Protocol Handler Organization
Protocol Handler Registration
Ethernet Versus IEEE 802.3 Frames
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Bridging
Chapter 14 Bridging: Concepts
Repeaters, Bridges, and Routers
Bridges Versus Switches
Hosts
Merging LANs with Bridges
Bridging Different LAN Technologies
Address Learning
Multiple Bridges
Chapter 15 Bridging: The Spanning Tree Protocol
Basic Terminology
Example of Hierarchical Switched L2 Topology
Basic Elements of the Spanning Tree Protocol
Bridge and Port IDs
Bridge Protocol Data Units (BPDUs)
Defining the Active Topology
Timers
Topology Changes
BPDU Encapsulation
Transmitting Configuration BPDUs
Processing Ingress Frames
Convergence Time
Overview of Newer Spanning Tree Protocols
Chapter 16 Bridging: Linux Implementation
Bridge Device Abstraction
Important Data Structures
Initialization of Bridging Code
Creating Bridge Devices and Bridge Ports
Creating a New Bridge Device
Bridge Device Setup Routine
Deleting a Bridge
Adding Ports to a Bridge
Enabling and Disabling a Bridge Device
Enabling and Disabling a Bridge Port
Changing State on a Bridge Port
The Big Picture
Forwarding Database
Handling Ingress Traffic
Transmitting on a Bridge Device
Spanning Tree Protocol (STP)
netdevice Notification Chain
Chapter 17 Bridging: Miscellaneous Topics
User-Space Configuration Tools
Tuning via /proc Filesystem
Tuning via /sys Filesystem
Statistics
Data Structures Featured in This Part of the Book
Functions and Variables Featured in This Part of the Book
Files and Directories Featured in This Part of the Book
Internet Protocol Version 4 (IPv4)
Chapter 18 Internet Protocol Version 4 (IPv4): Concepts
IP Protocol: The Big Picture
IP Header
IP Options
Packet Fragmentation/Defragmentation
Checksums
Chapter 19 Internet Protocol Version 4 (IPv4): Linux Foundations and Features
Main IPv4 Data Structures
General Packet Handling
IP Options
Chapter 20 Internet Protocol Version 4 (IPv4): Forwarding and Local Delivery
Forwarding
Local Delivery
Chapter 21 Internet Protocol Version 4 (IPv4): Transmission
Key Functions That Perform Transmission
Interface to the Neighboring Subsystem
Chapter 22 Internet Protocol Version 4 (IPv4): Handling Fragmentation
IP Fragmentation
IP Defragmentation
Chapter 23 Internet Protocol Version 4 (IPv4): Miscellaneous Topics
Long-Living IP Peer Information
Selecting the IP Header's ID Field
IP Statistics
IP Configuration
IP-over-IP
IPv4: What's Wrong with It?
Tuning via /proc Filesystem
Data Structures Featured in This Part of the Book
Functions and Variables Featured in This Part of the Book
Files and Directories Featured in This Part of the Book
Chapter 24 Layer Four Protocol and Raw IP Handling
Available L4 Protocols
L4 Protocol Registration
L3 to L4 Delivery: ip_local_deliver_finish
IPv4 Versus IPv6
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Chapter 25 Internet Control Message Protocol (ICMPv4)
ICMP Header
ICMP Payload
ICMP Types
Applications of the ICMP Protocol
The Big Picture
Protocol Initialization
Data Structures Featured in This Chapter
Transmitting ICMP Messages
ICMP Statistics
Passing Error Notifications to the Transport Layer
Tuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Neighboring Subsystem
Chapter 26 Neighboring Subsystem: Concepts
What Is a Neighbor?
Reasons That Neighboring Protocols Are Needed
Linux Implementation
Proxying the Neighboring Protocol
When Solicitation Requests Are Transmitted and Processed
Neighbor States and Network Unreachability Detection (NUD)
Chapter 27 Neighboring Subsystem: Infrastructure
Main Data Structures
Common Interface Between L3 Protocols and Neighboring Protocols
General Tasks of the Neighboring Infrastructure
Reference Counts on neighbour Structures
Creating a neighbour Entry
Neighbor Deletion
Acting As a Proxy
L2 Header Caching
Protocol Initialization and Cleanup
Interaction with Other Subsystems
Interaction Between Neighboring Protocols and L3 Transmission Functions
Christian Benvenuti received his masters degree in Computer Science at the University of Bologna in Italy. He collaborated for a few years with the International Center for Theoretical Physics (ICTP) in Trieste, where he developed ad-hoc software based on the Linux kernel, was a scientific consultant for a project on remote collaboration, and served as an instructor for several training sessions on networking. The trainings, held mainly in Europe, Africa, and South America wereall based on Linux systems and addressed to scientists from developing countries, where the ICTP has been promoting Linux for many years. He occasionally collaborates with a non-profit organization founded by ICTP members, Collaborium.org, to continue promoting Linux on developing countries.
In the past few years he worked as a software engineer for Cisco Systems in the Silicon Valley, where he focused on Layer two switching, high availability, and network security.
Comments about oreilly Understanding Linux Network Internals:
I was looking for information about Traffic Control, and even if the book doesn't cover directly this topic, it has been of great help during my research.
Even so the kernel is constantly moving, almost everything detailed in this book is still true. Christian Benvenuti's explanations of the code are very helpful and not too technical for a non-developpers like me.
The book itself is huge and reading/digesting it completely is a several weeks task.
2/4/2007
(4 of 4 customers found this review helpful)
5.0
a wondering book
By dave young
from Undisclosed
Comments about oreilly Understanding Linux Network Internals:
The best book on core IP networking and its LINUX implementations. I read it from page one to the end and loved it. I really encourage the author to continue on volume 2, covering multicast, IPSEC and TCP/UDP, volume 3 on QOS and other remaining topics. This will be one of the classic set of books on networking just like 'TCP/IP Illustrated'.