List of Figures. List of Tables. Preface. 1. Overview of the Internet Protocols. 1.1 Roadmap. 1.2 Introduction. 1.3 Protocols. 1.3.1 A Note on Programming Languages and Methodologies. 1.4 Protocol Stacks. 1.4.1 The Basics. 1.4.2 IP. 1.4.3 Routes. 1.4.4 TCP. 1.4.5 Packet Exchange Patterns. 1.4.6 Performance Trends. 1.5 Security. 1.6 Performance. 1.6.1 Integrated Services. 1.6.2 Differentiated Services. 1.7 Summary. 2. Introduction to the Linux Operating System. 2.1 Roadmap. 2.2 What Is an Operating System? 2.2.1 MultiUser. 2.2.2 MultiTasking. 2.2.3 MultiDevice. 2.2.4 From Input/Output to Interprocess Communication. 2.2.5 Processor Independence. 2.2.6 Concurrency Control. 2.2.7 Memory Management. 2.3 What More Could You Ask For? 2.3.1 Reliability, Efficiency, Safety, Security. 2.4 The Source Code Organization. 2.5 A Day in the Life of a Process. 2.6 A Day in the Life of a File. 2.7 A Day in the Life of an Operating System. 2.7.1 The Start of Time. 2.7.2 As Time Goes By. 2.7.3 The End of Time. 2.8 A Day in the Life of a Device Driver. 2.9 A Day in the Life of a Kernel Module. 2.10 SMP. 2.10.1 Application Support. 2.11 A Day in the Life of Time. 2.12 Summary. 3. The Brief Life of a Packet. 3.1 Roadmap. 3.1.1 User, Application, and Protocol Viewpoints. 3.1.2 Source Code, Execution, and Wire Viewpoints. 3.1.3 State, Memory, and So On. 3.2 TCP Example. 3.2.1 Socket Level. 3.2.2 TCP Output. 3.2.3 IP Output Work. 3.2.4 Link-Level Output. 3.2.5 Link-Level Input. 3.2.6 IP Input Work. 3.2.7 TCP Input Work. 3.2.8 Socket Input Work. 3.2.9 On the Wire. 3.3 DNS/UDP Example. 3.3.1 UDP Output. 3.3.2 UDP Input. 3.3.3 On the Wire. 3.4 RTP/UDP (Multicast) Example. 3.4.1 On the Wire. 3.4.2 But with a Router in the Path... 3.5 Three Views of the Traces of Ping. 4. Interprocess Communication. 4.1 Roadmap. 4.2 Socket API. 4.3 The Actual Socket API. 4.4 Using the Socket API. 4.4.1 Polling a Socket. 4.4.2 Nonblocking I/O. 4.4.3 Asynchronous I/O. 4.4.4 System Include Files. 4.5 Summary. 5. Protocol Implementation Framework. 5.1 Roadmap. 5.2 A Day in the Life of a Software Interrupt. 5.2.1 Concurrency in the Linux Communications Stack. 5.2.2 Producer/Consumer Chain. 5.2.3 What about Real Multiprocessor Systems? 5.3 Bottom Up: Interrupts, DMA, and So On. 5.4 Device Level, Bottom Up, One Level Up. 5.4.1 Network Device Driver API. 5.4.2 Network Reception. 5.4.3 A Specific Device Driver-3c501. 5.4.4 Link Driver-Level Configuration. 5.5 Top Down: Socket Glue Level. 5.5.1 Virtual File System Socket Instance Functions. 5.6 Sideways: A Day in the Life of a Socket Buffer. 5.6.1 Allocating a Socket Buffer. 5.6.2 Allocating and Freeing a Socket Buffer from the Global Pool. 5.6.3 Manipulating Socket Buffers. 5.7 A Day in the Life of a Protocol Control Block. 5.7.1 Socket and Route-Related Transport State. 5.7.2 Future of the Socket Structure. 5.7.3 Reference Counting. 5.7.4 Sockets and Routes. 5.7.5 Socket Credentials Manager Interface. 5.7.6 A Brief Comparison with BSD Style Stack Infrastructure. 5.8 Summary. 6. Infrastructure Protocols. 6.1 Roadmap. 6.2 IP. 6.2.1 Internet Protocol Output. 6.2.2 Fragmentation. 6.2.3 Internet Protocol Input. 6.2.4 Internet Protocol Forwarding. 6.2.5 Internet Protocol Fragmentation Support Functions. 6.2.6 Internet Protocol Options. 6.2.7 Internet Protocol Socket Glue. 6.3 Addressing. 6.4 Network-Level Debugging-ICMP. 6.5 Group Management-IGMP. 6.5.1 IGMP. 6.5.2 Managing the Group/Interface State. 6.5.3 Multicast Forwarding. 6.5.4 Multicast Transmission. 6.5.5 PIM Specifics. 6.5.6 Starting Multicast. 6.6 NATs, Tunnels, and Other Hacks. 6.7 Network Address Translation. 6.8 Tunnels. 6.8.1 IP in IP Tunnels. 6.8.2 GRE Tunnels. 6.9 IP version. 6.9.1 IPv6 Header Definitions. 6.9.2 IPv6 API. 6.9.3 IPv6 Address (Auto) Configuration. 6.9.4 IPv6 Neighbor Discovery. 6.9.5 IPv6 Input. 6.9.6 IPv6 Output. 6.9.7 IPv6 Forward Function. 6.9.8 IPv6 Socket Glue. 6.9.9 IPv6 Flow Label. 6.9.10 Extension Headers. 6.9.11 Simple Internet Transition. 6.9.12 Effect on Transport of IPv6 of Note. 6.10 Summary. 7. Transport. 7.1 Roadmap. 7.2 Introduction. 7.3 UDP-User Datagram Protocol. 7.3.1 Introduction. 7.3.2 Multiplexing. 7.3.3 UDP Packet Header Anatomy. 7.3.4 Transport Layer Linkage. 7.3.5 The sock Structure. 7.3.6 DNS Lookup. 7.4 TCP-Transmission Control Protocol. 7.4.1 TCP Transport Functionality. 7.4.2 HTTP Request. 7.4.3 TCP Header. 7.4.4 TCP Implementation. 7.4.5 TCP States. 7.4.6 TCP Structures. 7.4.7 TCP Code. 7.4.8 TCP Behavior. 7.5 Management. 7.6 TCP vs. UDP. 7.7 RTP-Real-Time Protocol. 7.8 Writing a New Transport Layer. 7.9 Summary. 8. Routing. 8.1 Roadmap. 8.2 Introduction. 8.3 Forwarding Table Computation. 8.3.1 IP Addressing. 8.3.2 FIB Purpose. 8.3.3 FIB Implementation. 8.3.4 FIB Interface. 8.3.5 FIB Code. 8.4 Multicast. 8.4.1 Dense Mode, Data-Driven Multicast Routing. 8.4.2 Sparse and Single-Source Multicast. 8.5 QoS Routing. 8.6 Routing Table Construction. 8.6.1 GateD. 8.6.2 Route Control and Traffic Control Maintenance. 8.7 Host Routing. 8.8 Managing IP-Level State Information-the IPCommand. 8.9 Summary. 9. Forwarding. 9.1 Roadmap. 9.2 Introduction. 9.2.1 Integrated Services. 9.2.2 Admission Test for Integrated Services Guaranteed Service. 9.2.3 Network Architecture. 9.3 Mixing Traffic onto the Wire. 9.3.1 Performance Parameters. 9.3.2 Probing or Measurement-Based Admission Control? 9.4 Elastic and Inelastic Applications-Tolerance for Variation? 9.4.1 Network Source Behavior Characterization: Leaky and Token Buckets. 9.5 Packet-Forward Scheduling and Queue Management. 9.6 Queuing Disciplines. 9.6.1 Common Scheduling Disciplines. 9.6.2 Class-Based Queuing. 9.7 Queue Management. 9.7.1 Random Early Detection. 9.8 Linux Forwarding Treatment Architecture. 9.8.1 Output Interface. 9.8.2 Queue Discipline. 9.8.3 Class/Type. 9.8.4 Filter, or Classifier. 9.9 The Classifier Code. 9.9.1 Classifiers. 9.10 Queuing Discipline. 9.11 Scheduler Framework. 9.11.1 Scheduling API. 9.11.2 Scheduler Framework. 9.12 Class-Based Queuing. 9.13 Queue Management. 9.13.1 Best-Effort (Also Known as FIFO) Scheduler. 9.13.2 Ingress Queuing. 9.13.3 Differentiated Services Marker. 9.13.4 RED and Friends. 9.13.5 Explicit Congestion Notification. 9.13.6 GRED. 9.13.7 Token Bucket Queue. 9.13.8 Ingress Queuing. 9.13.9 Priority Queuing. 9.13.10 Stochastic Fairness Queuing. 9.13.11 Priority Queuing. 9.13.12 Stochastic Fairness Queuing. 9.13.13 Link Equalization. 9.13.14 Profiling. 9.14 Managing Forwarding Treatment Information-the TC Command. 9.14.1 Traffic Control-Using the Tool. 9.14.2 Traffic Control-How the Tool Is Implemented. 9.14.3 TC Command Usage. 9.15 BSD. 9.16 Summary. 10. Security. 10.1 Roadmap. 10.2 Security Scenarios. 10.2.1 Firewalls. 10.2.2 NAT-Network Address Translation. 10.3 Netfilter. 10.3.1 Introduction. 10.3.2 IP Tables. 10.3.3 Summary. 10.4 IPSec. 10.5 SSL. 10.6 Summary. Afterword. Glossary. Bibliography. Index.