深入理解LINUX网络内幕(影印版)
深入理解LINUX网络内幕(影印版)
Christian Benvenuti
出版时间:2006年06月
页数:1035
Linux如此流行正是得益于它的特性丰富并且有效的网络协议栈。如果你曾经惊叹于Linux能够实现如此复杂的工作,或是你只是想通过现实中的例子学习现代网络,《深入理解Linux网络内幕》将会给你指导。
同其他O'Reilly的畅销书籍一样,《深入理解Linux网络内幕》清楚地阐述了网络的基本概念,并指导你如何用C语言实现。虽然早先的TCP/IP经验是有用的,初学者通过本书仍然可以学习到协议本身和大量的应用信息。一旦彻底掌握了这些网络工具,你就可以使用本书所附的代码,准确地指出Linux内核中最重要的部分如何工作。
网络功能的实现或破坏在不同的时候是由不同的代码块完成的,这正是理解网络和实现它的难点中的一部分。本书的成功之一就是描述这些代码块如何集成,以及众多的函数和数据结构之间的关系。《深入理解Linux网络内幕》不仅描述了Linux网络的全貌,而且是理解Linux网络细节的有效指南。
作者Christian Benvenuti是一个专注于操作系统网络的设计者。他在书中不仅解释了Linux 代码如何工作,还阐述了主要网络特性的目的,以及在不同解决方案间是如何抉择的。书中还包含了大量的流程图和其他图表以帮助读者理解。
书中的主题包含:
·网络通信的主要问题
·网络接口设备(NIC)驱动
·系统初始化
·第二层(链路层)的功能和实现
·第三层(IPv4)的功能和实现
·ARP
·桥接
·路由
·ICMP
  1. Preface
  2. Part I. General Background
  3. 1. Introduction
  4. Basic Terminology
  5. Common Coding Patterns
  6. User-Space Tools
  7. Browsing the Source Code
  8. When a Feature Is Offered as a Patch
  9. 2. Critical Data Structures
  10. The Socket Buffer:sk_buff Structure
  11. net_device Structure
  12. Files Mentioned in This Chapter
  13. 3. User-Space-to-Kernel Interface
  14. Overview
  15. procfs Versus sysctl
  16. ioctl
  17. Netlink
  18. Serializing Configuration Changes
  19. Part II. System Initialization
  20. 4. Notification Chains
  21. Reasons for Notification Chains
  22. Overview
  23. Defining a Chain
  24. Registering with a Chain
  25. Notifying Events on a Chain
  26. Notification Chains for the Networking Subsystems
  27. Tuning via /proc Filesystem
  28. Functions and Variables Featured in This Chapter
  29. Files and Directories Featured in This Chapter
  30. 5. Network Device Initialization
  31. System Initialization Overview
  32. Device Registration and Initialization
  33. Basic Goals of NIC Initialization
  34. Interaction Between Devices and Kernel
  35. Initialization Options
  36. Module Options
  37. Initializing the Device Handling Layer:net_dev_init
  38. User-Space Helpers
  39. Virtual Devices
  40. Tuning via /proc Filesystem
  41. Functions and Variables Featured in This Chapter
  42. Files and Directories Featured in This Chapter
  43. 6. The PCI Layer and Network Interface Cards
  44. Data Structures Featured in This Chapter
  45. Registering a PCI NIC Device Driver
  46. Power Management and Wake-on-LAN
  47. Example of PCI NIC Driver Registration
  48. The Big Picture
  49. Tuning via /proc Filesystem
  50. Functions and Variables Featured in This Chapter
  51. Files and Directories Featured in This Chapter
  52. 7. Kernel Infrastructure for Component Initialization
  53. Boot-Time Kernel Options
  54. Module Initialization Code
  55. Optimized Macro-Based Tagging
  56. Boot-Time Initialization Routines
  57. Memory Optimizations
  58. Tuning via /proc Filesystem
  59. Functions and Variables Featured in This Chapter
  60. Files and Directories Featured in This Chapter
  61. 8. Device Registration and Initialization
  62. When a Device Is Registered
  63. When a Device Is Unregistered
  64. Allocating net_device Structures
  65. Skeleton of NIC Registration and Unregistration
  66. Device Initialization
  67. Organization of net_device Structures
  68. Device State
  69. Registering and Unregistering Devices
  70. Device Registration
  71. Device Unregistration
  72. Enabling and Disabling a Network Device
  73. Updating the Device Queuing Discipline State
  74. Configuring Device-Related Information from User Space
  75. Virtual Devices
  76. Locking
  77. Tuning via /proc Filesystem
  78. Functions and Variables Featured in This Chapter
  79. Files and Directories Featured in This Chapter
  80. Part III. Transmission and Reception
  81. 9. Interrupts and Network Drivers
  82. Decisions and Traffic Direction
  83. Notifying Drivers When Frames Are Received
  84. Interrupt Handlers
  85. softnet_data Structure
  86. 10. Frame Reception
  87. Interactions with Other Features
  88. Enabling and Disabling a Device
  89. Queues
  90. Notifying the Kernel of Frame Reception:NAPI and netif_rx
  91. Old Interface Between Device Drivers and Kernel:First Part of netif_rx
  92. Congestion Management
  93. Processing the NET_RX_SOFTIRQ:net_rx_action
  94. 11. Frame Transmission
  95. Enabling and Disabling Transmissions
  96. 12. General and Reference Material About Interrupts
  97. Statistics
  98. Tuning via /proc and sysfs Filesystems
  99. Functions and Variables Featured in This Part of the Book
  100. Files and Directories Featured in This Part of the Book
  101. 13. Protocol Handlers
  102. Overview of Network Stack
  103. Executing the Right Protocol Handler
  104. Protocol Handler Organization
  105. Protocol Handler Registration
  106. Ethernet Versus IEEE 802.3 Frames
  107. Tuning via /proc Filesystem
  108. Functions and Variables Featured in This Chapter
  109. Files and Directories Featured in This Chapter
  110. Part IV. Bridging
  111. 14. Bridging: Concepts
  112. Repeaters,Bridges,and Routers
  113. Bridges Versus Switches
  114. Hosts
  115. Merging LANs with Bridges
  116. Bridging Different LAN Technologies
  117. Address Learning
  118. Multiple Bridges
  119. 15. Bridging: The Spanning Tree Protocol
  120. Basic Terminology
  121. Example of Hierarchical Switched L2 Topology
  122. Basic Elements of the Spanning Tree Protocol
  123. Bridge and Port IDs
  124. Bridge Protocol Data Units (BPDUs)
  125. Defining the Active Topology
  126. Timers
  127. Topology Changes
  128. BPDU Encapsulation
  129. Transmitting Configuration BPDUs
  130. Processing Ingress Frames
  131. Convergence Time
  132. Overview of Newer Spanning Tree Protocols
  133. 16. Bridging: Linux Implementation
  134. Bridge Device Abstraction
  135. Important Data Structures
  136. Initialization of Bridging Code
  137. Creating Bridge Devices and Bridge Ports
  138. Creating a New Bridge Device
  139. Bridge Device Setup Routine
  140. Deleting a Bridge
  141. Adding Ports to a Bridge
  142. Enabling and Disabling a Bridge Device
  143. Enabling and Disabling a Bridge Port
  144. Changing State on a Bridge Port
  145. The Big Picture
  146. Forwarding Database
  147. Handling Ingress Traffic
  148. Transmitting on a Bridge Device
  149. Spanning Tree Protocol (STP)
  150. netdevice Notification Chain
  151. 17. Bridging: Miscellaneous Topics
  152. User-Space Configuration Tools
  153. Tuning via /proc Filesystem
  154. Tuning via /sys Filesystem
  155. Statistics
  156. Data Structures Featured in This Part of the Book
  157. Functions and Variables Featured in This Part of the Book
  158. Files and Directories Featured in This Part of the Book
  159. Part V. Internet Protocol Version 4 (IPv4)
  160. 18. Internet Protocol Version 4 (IPv4): Concepts
  161. IP Protocol:The Big Picture
  162. IP Header
  163. IP Options
  164. Packet Fragmentation/Defragmentation
  165. Checksums
  166. 19. Internet Protocol Version 4 (IPv4): Linux Foundations and Features
  167. Main IPv4 Data Structures
  168. General Packet Handling
  169. IP Options
  170. 20. Internet Protocol Version 4 (IPv4): Forwarding and Local Delivery
  171. Forwarding
  172. Local Delivery
  173. 21. Internet Protocol Version 4 (IPv4): Transmission
  174. Key Functions That Perform Transmission
  175. Interface to the Neighboring Subsystem
  176. 22. Internet Protocol Version 4 (IPv4): Handling Fragmentation
  177. IP Fragmentation
  178. IP Defragmentation
  179. 23. Internet Protocol Version 4 (IPv4): Miscellaneous Topics
  180. Long-Living IP Peer Information
  181. Selecting the IP Header ’s ID Field
  182. IP Statistics
  183. IP Configuration
  184. IP-over-IP
  185. IPv4:What ’s Wrong with It?
  186. Tuning via /proc Filesystem
  187. Data Structures Featured in This Part of the Book
  188. Functions and Variables Featured in This Part of the Book
  189. Files and Directories Featured in This Part of the Book
  190. 24. Layer Four Protocol and Raw IP Handling
  191. Available L4 Protocols
  192. L4 Protocol Registration
  193. L3 to L4 Delivery:ip_local_deliver_finish
  194. IPv4 Versus IPv6
  195. Tuning via /proc Filesystem
  196. Functions and Variables Featured in This Chapter
  197. Files and Directories Featured in This Chapter
  198. 25. Internet Control Message Protocol (ICMPv4)
  199. ICMP Header
  200. ICMP Payload
  201. ICMP Types
  202. Applications of the ICMP Protocol
  203. The Big Picture
  204. Protocol Initialization
  205. Data Structures Featured in This Chapter
  206. Transmitting ICMP Messages
  207. Receiving ICMP Messages
  208. ICMP Statistics
  209. Passing Error Notifications to the Transport Layer
  210. Tuning via /proc Filesystem
  211. Functions and Variables Featured in This Chapter
  212. Files and Directories Featured in This Chapter
  213. Part VI. Neighboring Subsystem
  214. 26. Neighboring Subsystem: Concepts
  215. What Is a Neighbor?
  216. Reasons That Neighboring Protocols Are Needed
  217. Linux Implementation
  218. Proxying the Neighboring Protocol
  219. When Solicitation Requests Are Transmitted and Processed
  220. Neighbor States and Network Unreachability Detection (NUD)
  221. 27. Neighboring Subsystem: Infrastructure
  222. Main Data Structures
  223. Common Interface Between L3 Protocols and Neighboring Protocols
  224. General Tasks of the Neighboring Infrastructure
  225. Reference Counts on neighbour Structures
  226. Creating a neighbour Entry
  227. Neighbor Deletion
  228. Acting As a Proxy
  229. L2 Header Caching
  230. Protocol Initialization and Cleanup
  231. Interaction with Other Subsystems
  232. Interaction Between Neighboring Protocols and L3 Transmission Functions
  233. Queuing
  234. 28. Neighboring Subsystem: Address Resolution Protocol (ARP)
  235. ARP Packet Format
  236. Example of an ARP Transaction
  237. Gratuitous ARP
  238. Responding from Multiple Interfaces
  239. Tunable ARP Options
  240. ARP Protocol Initialization
  241. Initialization of a neighbour Structure
  242. Transmitting and Receiving ARP Packets
  243. Processing Ingress ARP Packets
  244. Proxy ARP
  245. Examples
  246. External Events
  247. ARPD
  248. Reverse Address Resolution Protocol (RARP)
  249. Improvements in ND (IPv6)over ARP (IPv4)
  250. 29. Neighboring Subsystem: Miscellaneous Topics
  251. System Administration of Neighbors
  252. Tuning via /proc Filesystem
  253. Data Structures Featured in This Part of the Book
  254. Files and Directories Featured in This Part of the Book
  255. Part VII. Routing
  256. 30. Routing: Concepts
  257. Routers,Routes,and Routing Tables
  258. Essential Elements of Routing
  259. Routing Table
  260. Lookups
  261. Packet Reception Versus Packet Transmission
  262. 31. Routing: Advanced
  263. Concepts Behind Policy Routing
  264. Concepts Behind Multipath Routing
  265. Interactions with Other Kernel Subsystems
  266. Routing Protocol Daemons
  267. Verbose Monitoring
  268. ICMP_REDIRECT Messages
  269. Reverse Path Filtering
  270. 32. Routing: Linux Implementation
  271. Kernel Options
  272. Main Data Structures
  273. Route and Address Scopes
  274. Primary and Secondary IP Addresses
  275. Generic Helper Routines and Macros
  276. Global Locks
  277. Routing Subsystem Initialization
  278. External Events
  279. Interactions with Other Subsystems
  280. 33. Routing: The Routing Cache
  281. Routing Cache Initialization
  282. Hash Table Organization
  283. Major Cache Operations
  284. Multipath Caching
  285. Interface Between the DST and Calling Protocols
  286. Flushing the Routing Cache
  287. Garbage Collection
  288. Egress ICMP REDIRECT Rate Limiting
  289. 34. Routing: Routing Tables
  290. Organization of Routing Hash Tables
  291. Routing Table Initialization
  292. Adding and Removing Routes
  293. Policy Routing and Its Effects on Routing Table Definitions
  294. 35. Routing: Lookups
  295. High-Level View of Lookup Functions
  296. Helper Routines
  297. The Table Lookup:fn_hash_lookup
  298. fib_lookup Function
  299. Setting Functions for Reception and Transmission
  300. General Structure of the Input and Output Routing Routines
  301. Input Routing
  302. Output Routing
  303. Effects of Multipath on Next Hop Selection
  304. Policy Routing
  305. Source Routing
  306. Policy Routing and Routing Table Based Classifier
  307. 36. Routing: Miscellaneous Topics
  308. User-Space Configuration Tools
  309. Statistics
  310. Tuning via /proc Filesystem
  311. Enabling and Disabling Forwarding
  312. Data Structures Featured in This Part of the Book
  313. Functions and Variables Featured in This Part of the Book
  314. Files and Directories Featured in This Part of the Book
  315. Index
书名:深入理解LINUX网络内幕(影印版)
作者:Christian Benvenuti
国内出版社:东南大学出版社
出版时间:2006年06月
页数:1035
书号:7-5641-0367-1
原版书出版商:O'Reilly Media
Christian Benvenuti
 
Christian Benvenuti在意大利的Bologna大学取得了他的计算机科学硕士学位。他与位于Trieste的国际理论物理中心(International Center for Theoretical Physics,ICTP)合作多年,开发了基于Linux内核的特定软件,他是一个远程协作项目的科学顾问,并且是多个网络培训课程的讲师。这些培训主要在欧洲、非洲与南美洲举行,均是基于Linux系统,面向发展中国家的科学家,在这些国家,ICTP已经推广Linux多年。他有时也与由ICTP成员建立的一个非营利组织(Collaborium.org)合作,继续在发展中国家推广Linux。
在过去的几年里,他作为软件工程师为硅谷的Cisco Systems工作,致力于第二层交换、高可用性和网络安全。
Christian Benvenuti received his masters degree in computer science at the Univer-
sity 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 collabora-
tion,and served as an instructor for several training sessions on networking.The
trainings,held mainly in Europe,Africa,and South America were all 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 nonprofit
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 2 switching,high availability,and network
security.