مشخصات کتاب
-
christian benvenuti
-
2006
-
انگلیسی
-
2027
-
396
-
0
Understanding Linux Network Internals
Part I. General Background
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Basic Terminology 3
Common Coding Patterns 4
User-Space Tools 18
Browsing the Source Code 19
When a Feature Is Offered as a Patch 20
2. Critical Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
The Socket Buffer: sk_buff Structure 22
net_device Structure 43
Files Mentioned in This Chapter 57
3. User-Space-to-Kernel Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Overview 58
procfs Versus sysctl 60
ioctl 67
Netlink 70
Serializing Configuration Changes 71
Part II. System Initialization
4. Notification Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Reasons for Notification Chains 75
Overview 77
Defining a Chain 78
Registering with a Chain 78
Notifying Events on a Chain 79
Notification Chains for the Networking Subsystems 81
Tuning via /proc Filesystem 82
Functions and Variables Featured in This Chapter 83
Files and Directories Featured in This Chapter 83
5. Network Device Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
System Initialization Overview 84
Device Registration and Initialization 86
Basic Goals of NIC Initialization 86
Interaction Between Devices and Kernel 87
Initialization Options 93
Module Options 93
Initializing the Device Handling Layer: net_dev_init 94
User-Space Helpers 96
Virtual Devices 100
Tuning via /proc Filesystem 103
Functions and Variables Featured in This Chapter 104
Files and Directories Featured in This Chapter 105
6. The PCI Layer and Network Interface Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Data Structures Featured in This Chapter 106
Registering a PCI NIC Device Driver 108
Power Management and Wake-on-LAN 109
Example of PCI NIC Driver Registration 110
The Big Picture 112
Tuning via /proc Filesystem 114
Functions and Variables Featured in This Chapter 114
Files and Directories Featured in This Chapter 115
7. Kernel Infrastructure for Component Initialization . . . . . . . . . . . . . . . . . . . . 116
Boot-Time Kernel Options 116
Module Initialization Code 122
Optimized Macro-Based Tagging 125
Boot-Time Initialization Routines 128
Memory Optimizations 130
Tuning via /proc Filesystem 134
Functions and Variables Featured in This Chapter 134
Files and Directories Featured in This Chapter 135
8. Device Registration and Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
When a Device Is Registered 137
When a Device Is Unregistered 138
Allocating net_device Structures 138
Skeleton of NIC Registration and Unregistration 140
Device Initialization 141
Organization of net_device Structures 145
Device State 147
Registering and Unregistering Devices 149
Device Registration 154
Device Unregistration 156
Enabling and Disabling a Network Device 159
Updating the Device Queuing Discipline State 161
Configuring Device-Related Information from User Space 166
Virtual Devices 169
Locking 171
Tuning via /proc Filesystem 171
Functions and Variables Featured in This Chapter 172
Files and Directories Featured in This Chapter 173
Part III. Transmission and Reception
9. Interrupts and Network Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Decisions and Traffic Direction 178
Notifying Drivers When Frames Are Received 178
Interrupt Handlers 183
softnet_data Structure 206