Read more
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 -- isthat 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.
List of contents
Preface
Part I. General Background
1. Introduction
Basic Terminology
Common Coding Patterns
User-Space Tools
Browsing the Source Code
When a Feature Is Offered as a Patch
2. Critical Data Structures
The Socket Buffer: sk_buff Structurenet_device Structure
Files Mentioned in This Chapter
3. User-Space-to-Kernel Interface
II. System Initialization 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 SubsystemsTuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
5. Network Device Initialization
System Initialization Overview
Device Registration and Initialization
Basic Goals of NIC Initialization
Interaction Between Devices and KernelInitialization Options
Module Options
Initializing the Device Handling Layer: net_dev_init
User-Space Helpers
Virtual DevicesTuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This 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 PictureTuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
7. Kernel Infrastructure for Component Initialization
Boot-Time Kernel Options
Module Initialization Code
Optimized Macro-Based Tagging
Boot-Time Initialization RoutinesMemory OptimizationsTuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This 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 InitializationOrganization 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
LockingTuning via /proc Filesystem
Functions and Variables Featured in This Chapter
Files and Directories Featured in This Chapter
Part III. Transmission and Reception
9. Interrupts and Network Drivers
Decisions and Traffic Direction
Notifying Drivers When Frames Are Received
About the author
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.
Summary
A no-nonsense guide to Linux networking, which offers a clear view of the underlying concepts and teaches you to follow the C code that implements it. The topics include: system initialization, network interface card (NIC) device drivers, bridging, routing, ICMP, and more.