书籍详情
深入理解LINUX网络内幕(影印版)
作者:(意)本文纳特 著
出版社:东南大学出版社
出版时间:2006-05-01
ISBN:9787564103675
定价:¥98.00
购买这本书可以去
内容简介
Linux如此的流行正是得益于它的特性丰富并有效的网络协议栈。如果你曾经惊叹于Linux能够实现如此复杂的工作,或者你只是想通过现实中的例子学习现代网络,《深入理解Linux网络内幕》将会给你指导。同其他O'Reilly的流行书籍一样,《深入理解Linux网络内幕》清楚地阐述了网络的基本概念,并指导你如何用C语言实现。虽然早先的TCP/IP经验是有用的,但初学者通过本书仍然可以学习到协议本身和大量的应用信息。一旦彻底掌握了这些网络工具,你就可以使用本书所附的代码,准确地指出Linux内核中最重要的部分如何工作。 网络功能的实现或破坏在不同的时候是由不同的代码块完成的,这正是理解网络和实现它的难点中的一部分。本书的成功之一就是描述这些代码块如何集成,以及众多的函数和数据结构之间的关系。《深入理解Linux网络内幕》不仅描述了Linux网络的全貌,而且是理解Linux网络细节的有效指南。 作者Christian Benvenuti是一个专注于操作系统网络的设计者。他在书中不仅解释了Linux代码如何工作,还阐述了主要网络特性的目的以及在不同解决方案间是如何抉择的。书中还包含了大量的流程图和其他图表以帮助读者理解。 书中的主题包含:·网络通信的主要问题·网络接口设备(NIC)驱动·系统初始化·第二层(链路层)的功能和实现·第三层(IPv4)的功能和实现·ARP·桥接·路由·ICMP
作者简介
暂缺《深入理解LINUX网络内幕(影印版)》作者简介
目录
Preface
Patti. GeneraIBackground
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 Structure
net_device Structure
Files Mentioned in This Chapter
3. User-Space-to-Kernel Interface
Overview
procfs Versus sysctl
ioctl
Netlink
Serializing Configuration Changes
Partll. Systemlnitialization
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
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
6. The PCl 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
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
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
Part III. Transmission and Reception
9. Interrupts and Network Drivers
Decisions and Traffic Direction
Notifying Drivers When Frames Are Received
Interrupt Handlers
softnet_data Structure
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
11. Frame Transmission
Enabling and Disabling Transmissions
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
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
Part IV. Bridging
14. Bridging: Concepts
Repeaters, Bridges, and Routers
Bridges Versus Switches
Hosts
Merging LANs with Bridges
Bridging Different LAN Technologies
Address Learning
Multiple Bridges
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
16. Bridging:tinuxlmplementation
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
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
Part V. Internet Protocol Version 4 (IPv4)
18. Internet Protocol Version 4 (IPv4): Concepts
IP Protocol: The Big Picture
IP Header
IP Options
Packet Fragmentation/Defragmentation
Checksums
19. Internet Protocol Version 4 (IPv4): tinux Foundations and Features .
Main IPv4 Data Structures
General Packet Handling
IP Options
20. Internet Protocol Version 4 (IPv4): Forwarding and Local Delivery ..
Forwarding
Local Delivery
21. Internet Protocol Version 4 (IPv4): Transmission
Key Functions That Perform Transmission
Interface to the Neighboring Subsystem
22. Internet Protocol Version 4 (IPv4): Handling Fragmentation
IP Fragmentation
IP Defragmentation
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
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
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
Receiving 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
PartVl. Neighboring Subsystem
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)
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
Queuing
28. Neighboring Subsystem: Address Resolution Protocol (ARP)
ARP Packet Format
Example of an ARP Transaction
Gratuitous ARP
Responding from Multiple Interfaces
Tunable ARP Options
ARP Protocol Initialization
Initialization of a neighbour Structure
Transmitting and Receiving ARP Packets
Processing Ingress ARP Packets
Proxy ARP
Examples
External Events
ARPD
Reverse Address Resolution Protocol (RARP)
Improvements in ND (IPv6) over ARP (IPv4)
29. Neighboring Subsystem: Miscellaneous lopics
System Administration of Neighbors
Tuning via/proc Filesystem
Data Structures Featured in This Part of the Book
Files and Directories Featured in This Part of the Book
Part VII. Routing
30. Routing: Concepts
Routers, Routes, and Routing Tables
Essential Elements of Routing
Routing Table
Lookups
Packet Reception Versus Packet Transmission
31. Routing: Advanced
Concepts Behind Policy Routing
Concepts Behind Multipath Routing
Interactions with Other Kernel Subsystems
Routing Protocol Daemons
Verbose Monitoring
ICMP_REDIRECT Messages
Reverse Path Filtering
32. Routing:tinuxlmplementation
Kernel Options
Main Data Structures
Route and Address Scopes
Primary and Secondary IP Addresses
Generic Helper Routines and Macros
Global Locks
Routing Subsystem Initialization
External Events
Interactions with Other Subsystems
33. Routing: The Routing Cache
Routing Cache Initialization
Hash Table Organization
Major Cache Operations
Multipath Caching
Interface Between the DST and Calling Protocols
Flushing the Routing Cache
Garbage Collection
Egress ICMP REDIRECT Rate Limiting
34. Routing: Routing Tables
Organization of Routing Hash Tables
Routing Table Initialization
Adding and Removing Routes
Policy Routing and Its Effects on Routing Table Definitions
35. Routing: tookups
High-Level View of Lookup Functions
Helper Routines
The Table Lookup: fn hash_lookup
fib_lookup Function
Setting Functions for Reception and Transmission
General Structure of the Input and Output Routing Routines
Input Routing
Output Routing
Effects of Multipath on Next Hop Selection
Policy Routing
Source Routing
Policy Routing and Routing Table Based Classifier
36. Routing: Miscellaneous Topics
User-Space Configuration Tools
Statistics
Tuning via/proc Filesystem
Enabling and Disabling Forwarding
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
Index
Patti. GeneraIBackground
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 Structure
net_device Structure
Files Mentioned in This Chapter
3. User-Space-to-Kernel Interface
Overview
procfs Versus sysctl
ioctl
Netlink
Serializing Configuration Changes
Partll. Systemlnitialization
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
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
6. The PCl 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
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
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
Part III. Transmission and Reception
9. Interrupts and Network Drivers
Decisions and Traffic Direction
Notifying Drivers When Frames Are Received
Interrupt Handlers
softnet_data Structure
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
11. Frame Transmission
Enabling and Disabling Transmissions
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
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
Part IV. Bridging
14. Bridging: Concepts
Repeaters, Bridges, and Routers
Bridges Versus Switches
Hosts
Merging LANs with Bridges
Bridging Different LAN Technologies
Address Learning
Multiple Bridges
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
16. Bridging:tinuxlmplementation
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
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
Part V. Internet Protocol Version 4 (IPv4)
18. Internet Protocol Version 4 (IPv4): Concepts
IP Protocol: The Big Picture
IP Header
IP Options
Packet Fragmentation/Defragmentation
Checksums
19. Internet Protocol Version 4 (IPv4): tinux Foundations and Features .
Main IPv4 Data Structures
General Packet Handling
IP Options
20. Internet Protocol Version 4 (IPv4): Forwarding and Local Delivery ..
Forwarding
Local Delivery
21. Internet Protocol Version 4 (IPv4): Transmission
Key Functions That Perform Transmission
Interface to the Neighboring Subsystem
22. Internet Protocol Version 4 (IPv4): Handling Fragmentation
IP Fragmentation
IP Defragmentation
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
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
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
Receiving 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
PartVl. Neighboring Subsystem
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)
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
Queuing
28. Neighboring Subsystem: Address Resolution Protocol (ARP)
ARP Packet Format
Example of an ARP Transaction
Gratuitous ARP
Responding from Multiple Interfaces
Tunable ARP Options
ARP Protocol Initialization
Initialization of a neighbour Structure
Transmitting and Receiving ARP Packets
Processing Ingress ARP Packets
Proxy ARP
Examples
External Events
ARPD
Reverse Address Resolution Protocol (RARP)
Improvements in ND (IPv6) over ARP (IPv4)
29. Neighboring Subsystem: Miscellaneous lopics
System Administration of Neighbors
Tuning via/proc Filesystem
Data Structures Featured in This Part of the Book
Files and Directories Featured in This Part of the Book
Part VII. Routing
30. Routing: Concepts
Routers, Routes, and Routing Tables
Essential Elements of Routing
Routing Table
Lookups
Packet Reception Versus Packet Transmission
31. Routing: Advanced
Concepts Behind Policy Routing
Concepts Behind Multipath Routing
Interactions with Other Kernel Subsystems
Routing Protocol Daemons
Verbose Monitoring
ICMP_REDIRECT Messages
Reverse Path Filtering
32. Routing:tinuxlmplementation
Kernel Options
Main Data Structures
Route and Address Scopes
Primary and Secondary IP Addresses
Generic Helper Routines and Macros
Global Locks
Routing Subsystem Initialization
External Events
Interactions with Other Subsystems
33. Routing: The Routing Cache
Routing Cache Initialization
Hash Table Organization
Major Cache Operations
Multipath Caching
Interface Between the DST and Calling Protocols
Flushing the Routing Cache
Garbage Collection
Egress ICMP REDIRECT Rate Limiting
34. Routing: Routing Tables
Organization of Routing Hash Tables
Routing Table Initialization
Adding and Removing Routes
Policy Routing and Its Effects on Routing Table Definitions
35. Routing: tookups
High-Level View of Lookup Functions
Helper Routines
The Table Lookup: fn hash_lookup
fib_lookup Function
Setting Functions for Reception and Transmission
General Structure of the Input and Output Routing Routines
Input Routing
Output Routing
Effects of Multipath on Next Hop Selection
Policy Routing
Source Routing
Policy Routing and Routing Table Based Classifier
36. Routing: Miscellaneous Topics
User-Space Configuration Tools
Statistics
Tuning via/proc Filesystem
Enabling and Disabling Forwarding
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
Index
猜您喜欢