Understanding Linux Network Internals 第八章 翻译稿:设备注册和初始化

【翻译】设备注册和初始化

 

5章和第6章中,我们了解了内核是如何识别网卡以及内核执行初始化过程以使网卡能够和驱动程序通讯。本章中,我们讨论初始化的其它阶段:

l         网络设备什么时候,如何注册到内核

l         网络设备如何注册到网络设备数据库并分配一个net_device结构实例

l         net_device结构是如何被组织到哈希表和队列中以支持各种不同的查找

l         net_device结构实例是如何初始化的。部分由内核核心函数,部分由它们的设备驱动程序

l         虚拟设备和实际设备的注册过程有何不同

 

本章不是力图指导你如何编写网卡驱动程序,我有时会深入到网卡驱动程序代码细节,但我并不会讲到整个的网卡驱动程序的设计。我们仅对注册以及设备驱动程序,诸如连接状态改变侦测、电源管理等特性之间的接口感兴趣,可以参考Linux Device Drivers (O'Reilly)了解设备驱动程序细节问题。

在网卡能够被使用前,与之相关联net_device数据结构必须被初始化,并被加到网络设备数据库中配置和激活。很重要的一点就是大家不要混淆了注册/注销与激活/禁止,它们是两个不同的概念:

l         如果我们抛开加载设备驱动程序的动作,注册/注销是用户独立的,由内核驱动它们。仅被注册的设备还不能工作。我们将会在“设备什么时候注册”和“设备什么时候注销”两小节中看到设备什么时候被注册与注销。

l         激活/禁止设备需要用户的干涉。一旦内核注册了设备,用户能够通过用户命令看到它,并能够配置、激活它。可以参考后续小节“激活和禁止网络设备”。

 

我们来看看什么事件触发网络设备的注册与注销。

8.1、设备什么时候注册

注册网络设备发生在下列情形:

l         加载网卡驱动程序

       网卡驱动程序如果被编译进内核,则它在启动时被初始化,在运行时被作为模块加载。无论初始化是否发生,所以由驱动程序控制的网卡都被注册。

l         插入可热拔插网络设备

       当用户插入一块热拔插网卡,内核通知其对应的驱动程序以注册设备。(为了简单化,我们假定设备驱动程序已经被加载)

 

第一种情形下应用的注册模式在后面的“网卡注册和注销框架”一节描述,它适用所有的总线类型,不管注册函数是被总线体系结构还是被模块初始化代码调用结束都是一样的。例如:我们在第六章看到PCI设备驱动程序如何加载以致pci_driver->probe函数执行,通常命名有几分象xxx_probe,它由驱动程序提供并兼顾设备注册。本章中,我们看看这些probe函数如何实现。

       用于其它总线类型(USB, PCMCIA等等)的设备驱动程序的注册共用同样的框架。就像第六章我们看到的PCI一样,我们不会考虑这些总线体系结构如何结束调用它们的probe类函数。老的总线可能不能够自动侦测设备的存在,可能需要设备驱动程序自己用缺省参数或用户提供的启动时参数主动搜索特殊的内存地址. [*]我们不会考虑这其中的任何一种情况。

       例如:看看drivers/net/Space.c中的net_olddevs_init。这个函数由第七章中介绍的device_initcall宏标记,它在启动时执行。它还兼顾了环回设备的注册。

 

8.2、设备什么时候注销

两个主要的情形会导致设备注销

 

l         卸载网卡驱动程序

       这只适用与驱动程序作为模块被加载的情形,当然不适于编译进内核的情况。当管理员卸载网卡设备驱动程序时,所有相关网卡的驱动程序都被注销(译者注:比如虚拟网卡是依附在实际网卡上的,一旦实际网卡被卸载,则相关虚拟网卡的设备驱动都将被注销)

l         移除热拔插网络设备

       当用户从正在运行且内核支持热拔插功能的系统中移除热拔插网卡时,网络设备被注销。

 

8.3、分配net_device结构空间

 

网络设备由net_device结构定义。由于在内核代码中它们通常命名为dev,所有我在本章中会频繁的使用这个名字来标识net_device。这些数据结构由net/core/dev.c中定义的alloc_netdev函数分配空间,它需要三个入参:

 

l         私有数据结构大小

       我们将在“net_device结构组织”小节中看到:net_device结构由设备驱动程序用私有数据块扩展以存储驱动程序参数,这个参数指定了数据块的大小。

l         设备名

       这是一个局部名称,内核通过某些策略确保设备名唯一。

l         配置函数:

       这个函数用于初始化net_device结构的部分域,详细信息参考“设备初始化”一节和“设备类型初始化:xxx_setup函数”小节。

 

返回值是alloc_netdev函数分配的net_device的结构指针,如果出错就返回NULL

 

每个设备都根据设备类型分配一个唯一名字,当同样类型的设备注册是,这个名字包含按序递增的数字。例如,以太网设备分配eth0eth1等等。单个的设备由于注册设备的顺序不同也会被分配不同的名字。例如,如果你有两块网卡由不同的模块处理,设备名字则依赖两个模块加载的顺序;而热拔插设备明显地会导致自己的名字变化不可预知。

 

因为用户空间配置工具引用了内核分配的设备名称,所以设备注册顺序相当重要。由于这是用户空间细节,除非谈到net-tools工具包中的诸如nameif(这个工具允许将确定的名字分配给基于MAC地址的网络接口)等工具,我们后面不必关心它。

当设备名以name%d(:eth%d)的形式传递给alloc_netdev,内核用dev_alloc_name函数分配完整的名字,后者根据设备类型将%d改为第一个未分配的数字。

内核也提供了一些封装alloc_netdev功能的函数,表8-1列出了几个用于普通设备类型并能传适当参数给alloc_netdev函数的包裹函数[*]。例如:alloc_etherdev函数用于以太网设备,所以它创建以字符串eth后跟唯一数字形式的设备名;第二点,它指派ether_setup作为配置函数,对于所有以太网卡来说,配置函数均把net_device结构的部分域初始化为公用值。

 

[*]也有例外,就是类似包裹函数并不遵循alloc_xxxdev命名规则。此外,有些设备直接调用alloc_netdev函数注册到内核而不采用包裹函数。

 

8-1 alloc_netdev包裹函数

网络设备类型

封装函数名

说明

以太网

alloc_etherdev

return alloc_netdev(sizeof_priv,"eth%d",ether_setup);

光纤分布式数据接口

alloc_fddidev

return alloc_netdev(sizeof_priv,"fddi%d",fddi_setup);

高性能并行接口

alloc_hippi_dev

return alloc_netdev(sizeof_priv,"hip%d",hippi_setup);

令牌网

alloc_trdev

return alloc_netdev(sizeof_priv,"tr%d",tr_setup);

光纤通道

alloc_fcdev

return alloc_netdev(sizeof_priv,"fc%d",fc_setup);

红外数据联盟

alloc_irdadev

return alloc_netdev(sizeof_priv,"irda%d",irda_device_setup);

 

8.4、网卡注册和注销框架

8-1(a)表明了网络代码中网卡驱动程序注册的通用方式,图8-1(b)表明了注销时发生的调用动作。尽管例子展示的是PCI以太网网卡,但对每种设备类型都是一样的;只是函数名称或函数被调用的方式根据总线代码如何实现而变化。

 

 

8-1(a)  设备注册方式                                                    8-1(b) 设备注销模式

 

 

函数由alloc_etherdev分配net_device结构开始,alloc_etherdev函数也初始化所有以太网设备通用的参数。然后驱动程序初始化net_device结构其它部分,并调用register_netdev函数以结束设备的注册过程。

 

注意:

l         驱动程序调用合适的alloc_netdev包裹函数(如例子中的alloc_etherdev),并提供唯一的私有数据块大小。表8-1列出了几个包裹函数

l         包裹函数用驱动程序提供的参数调用alloc_netdev,并且加上另外两个参数(设备名和初始化配置函数)

l         alloc_netdev分配的内存块包括net_device结构、驱动程序私有数据块、以及强制对齐的填充数据。参考后面章节的图8-2

l         有些驱动程序调用netdev_boot_setup_check函数以检查用户在加载内核时是否提供了启动时参数。参考第七章“用启动选项配置网络设备”小节

l         新的net_device实例由register_netdevice插入设备数据库,(参考后面的小节“设备注册)。顺便提一下,我在这里用了术语数据库,在本书的其它地方,提及的许多数据结构可以在内核需要时通过数据库方便的获取相关信息。

   

8-1(b)展示了设备注销的简单形式,它总是包含unregister_netdevice free_netdev函数,free_net有时明确的调用,有时由dev->destructor函数[*]间接调用,这可以在后面的图8-4中看到。设备驱动程序也必须释放设备使用的所有资源(IRQ、内存映象等等),但是本章对此不作描述。

[*]仅有些虚拟设备的驱动程序采用这种方式(例子参考net/8021q/vlan.c),图8-4的两个调用是互斥的

 

8.5、设备初始化

 

在“设备什么时候注册”一节,我们看到什么需要内核初始化以和网卡通讯,在接下来的章节里,我们看看高级初始化任务。

net_device结构相当大,它的域由不同的函数块初始化。特别的,每个域都负责不同的域子集[*] .

[*]一个值得关注的例外是环回设备,它的初始化是没有限制的,在drivers/net/loopback.c中定义的loopback_dev函数里面

l       设备驱动程序

       诸如IRQI/O内存、I/O端口等参数的值依赖硬件配置,由设备驱动程序提供。参考第五章

l       设备类型

       某个设备类型家族的所有设备都公用一些结构字段,这些字段的初始化由xxx_setup函数实现,例如:以太网设备采用ether_setup函数,参考“设备类型初始化:xxx_setup函数”小节。

l       特性

       有些必需的和可选的属性也需要初始化,例如:网络接口排队算法(也就是QoSqdisc(queuing discipline))register_netdevice函数初始化,这在“register_netdevice函数”小节中描述其它特征在关联模块被通知有新设备注册时初始化(参考“设备注册状态通知”小节)

       设备类型初始化是设备驱动程序初始化的一部分(也就是说,xxx_setupxxx_probe调用),以使驱动程序有机会覆盖设备类型设定的初始值。可以参考“可选的初始化和特殊情况”小节的例子。

       8-2展示了由xxx_setup函数初始化的函数指针及留给设备驱动程序[*](xxx_probe)初始化的函数指针:什么是设备类型特性、什么是设备模型特性。注意,并不是所有的设备驱动程序都遵循表8-2所示的差别,例如:有些xxx_setup函数并不初始化任何函数指针(例如:net/irda/irda_device.c中的irda_device_setup),但另一些会初始化所有的函数指针(如:drivers/net/wireless/airo.c中的wifi_setup)

       [*] 第二章包含了net_device结构的所有参数的细节

 

8-2 xxx_setupxxx_probe初始化的net_device 函数指针

 

初始化函数

函数指针名

xxx_setup

change_mtu

set_mac_address

rebuild_header

hard_header

hard_header_cache

header_cache_update

hard_header_parse

设备驱动程序探测函数

open

stop

hard_start_xmit

tx_timeout

watchdog_timeo

get_stats

get_wireless_stats

set_multicast_list

do_ioctl

init

uninit

poll

ethtool_ops (this is actually an array of routines)

 

8-3和表8-2似,但是它列出的不是函数指针,而是net_device结构的其它一些字段。

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
深入理解Linux网络内幕(英文) 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 -- is that 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. Topics include: Key problems with networking Network interface card (NIe device drivers System initialization Layer 2 (link-layer) tasks and implementation Layer 3 (IPv4) tasks and implementation Neighbor infrastructure and protocols (ARP) Bridging Routing ICMP Author Christian Benvenuti, an operating system designer specializing in networking, explains much more than how Linux code works. He shows the purposes of major networking features and the trade-offs involved inchoosing one solution over another. A large number of flowcharts and other diagrams enhance the book's understandability. Part I: General Background 背景知识 Chapter 1. Introduction 简介 Section 1.1. Basic Terminology 基础技术 Section 1.2. Common Coding Patterns 通用程序模式 Section 1.3. User-Space Tools 用户空间的工具 Section 1.4. Browsing the Source Code 浏览代码 Section 1.5. When a Feature Is Offered as a Patch 一些特性什么时候以补丁的形式提供 Chapter 2. Critical Data Structures 重要数据结构 Section 2.1. The Socket Buffer: sk_buff Structure 套接字缓存:sk_buff结构 Section 2.2. net_device Structure net_device结构 Section 2.3. Files Mentioned in This Chapter 本章所涉及的到的(代码)文件 Chapter 3. User-Space-to-Kernel Interface 从用户空间到内核态的接口 Section 3.1. Overview 简介 Section 3.2. procfs Versus sysctl Section 3.3. ioctl Section 3.4. Netlink 网络链接 Section 3.5. Serializing Configuration Changes 不断的配置变化 Part II: System Initialization 系统初始化 Chapter 4. Notification Chains (消息)通知链 Section 4.1. Reasons for Notification Chains 通知链的原因 Section 4.2. Overview 简介 Section 4.3. Defining a Chain 定义一个链 Section 4.4. Registering with a Chain 注册链 Section 4.5. Notifying Events on a Chain 在链上标记事件 Section 4.6. Notification Chains for the Networking Subsystems 网络子层的标记链 Section 4.7. Tuning via /proc Filesystem Section 4.8. Functions and Variables Featured in This Chapter 本章所涉及的到的函数与变量 Section 4.9. Files and Directories Featured in This Chapter 本章所涉及的到的(代码)文件 Chapter 5. Network Device Initialization 网络设备的组织 Section 5.1. System Initialization Overview 简介 Section 5.2. Device Registration and Initialization 设备注册初始化 Section 5.3. Basic Goals of NIC Initialization NIC初始化的基本目标 Section 5.4. Interaction Between Devices and Kernel 设备与内核的交互 Section 5.5. Initialization Options 初始化选项 Section 5.6. Module Options 模块选项 Section 5.7. Initializing the Device Handling Layer: net_dev_init 设备处理层的初始化 Section 5.8. User-Space Helpers 用户空间的帮助 Section 5.9. Virtual Devices 虚拟设备 Section 5.10. Tuning via /proc Filesystem Section 5.11. Functions and Variables Featured in This Chapter Section 5.12. Files and Directories Featured in This Chapter Chapter 6. The PCI Layer and Network Interface Cards PCI层的网卡 Section 6.1. Data Structures Featured in This Chapter 本章的数据结构 Section 6.2. Registering a PCI NIC Device Driver PIC NIC设备驱动的注册 Section 6.3. Power Management and Wake-on-LAN 电源管理以及LAN唤醒 Section 6.4. Example of PCI NIC Driver Registration 示例 Section 6.5. The Big Picture 框架图 Section 6.6. Tuning via /proc Filesystem Section 6.7. Functions and Variables Featured in This Chapter Section 6.8. Files and Directories Featured in This Chapter Chapter 7. Kernel Infrastructure for Component Initialization 组件初始化的底层内核(实现) Section 7.1. Boot-Time Kernel Options 内核启动选项 Section 7.2. Module Initialization Code 模块初始化 Section 7.3. Optimized Macro-Based Tagging 基于标记的模块优化 Section 7.4. Boot-Time Initialization Routines 启动时的初始化例程 Section 7.5. Memory Optimizations 内存优化 Section 7.6. Tuning via /proc Filesystem Section 7.7. Functions and Variables Featured in This Chapter Section 7.8. Files and Directories Featured in This Chapter Chapter 8. Device Registration and Initialization 设备注册初始化 Section 8.1. When a Device Is Registered 什么时候注册一个设备 Section 8.2. When a Device Is Unregistered Section 8.3. Allocating net_device Structures 给XX结构分配内存 Section 8.4. Skeleton of NIC Registration and Unregistration NIC注册与反注册的框架 Section 8.5. Device Initialization 设备初始化 Section 8.6. Organization of net_device Structures XX结构的组织 Section 8.7. Device State 设备状态 Section 8.8. Registering and Unregistering Devices Section 8.9. Device Registration Section 8.10. Device Unregistration Section 8.11. Enabling and Disabling a Network Device 网络设备的使能与去使能 Section 8.12. Updating the Device Queuing Discipline State 更新设备的?? Section 8.13. Configuring Device-Related Information from User Space 从用户空间配置与设备相关的信息 Section 8.14. Virtual Devices Section 8.15. Locking 查找 Section 8.16. Tuning via /proc Filesystem Section 8.17. Functions and Variables Featured in This Chapter Section 8.18. Files and Directories Featured in This Chapter Part III: Transmission and Reception 传输与接收 Chapter 9. Interrupts and Network Drivers 网络设备的中断 Section 9.1. Decisions and Traffic Direction 数据流的方向与决策 Section 9.2. Notifying Drivers When Frames Are Received 在数据帧接收到时通知驱动 Section 9.3. Interrupt Handlers 中断处理 Section 9.4. softnet_data Structure XX数据结构 Chapter 10. Frame Reception 帧接收 Section 10.1. Interactions with Other Features 与其它特性交互 Section 10.2. Enabling and Disabling a Device 设备的使能与去使能 Section 10.3. Queues 队列 Section 10.4. Notifying the Kernel of Frame Reception: NAPI and netif_rx 帧接收时通知内核 Section 10.5. Old Interface Between Device Drivers and Kernel: First Part of netif_rx 内核到设备驱动之间的老的接口 Section 10.6. Congestion Management 阻塞管理 Section 10.7. Processing the NET_RX_SOFTIRQ: net_rx_action Chapter 11. Frame Transmission 帧传输 Section 11.1. Enabling and Disabling Transmissions Chapter 12. General and Reference Material About Interrupts 中断的常识和和参考 Section 12.1. Statistics 统计 Section 12.2. Tuning via /proc and sysfs Filesystems Section 12.3. Functions and Variables Featured in This Part of the Book Section 12.4. Files and Directories Featured in This Part of the Book Chapter 13. Protocol Handlers 协议处理 Section 13.1. Overview of Network Stack Section 13.2. Executing the Right Protocol Handler Section 13.3. Protocol Handler Organization Section 13.4. Protocol Handler Registration Section 13.5. Ethernet Versus IEEE 802.3 Frames Section 13.6. Tuning via /proc Filesystem Section 13.7. Functions and Variables Featured in This Chapter Section 13.8. Files and Directories Featured in This Chapter Part IV: Bridging 网桥 Chapter 14. Bridging: Concepts Section 14.1. Repeaters, Bridges, and Routers 中继器,网桥和路由器 Section 14.2. Bridges Versus Switches 网桥与交换机 Section 14.3. Hosts 服务器 Section 14.4. Merging LANs with Bridges 聚合LAN和网桥 Section 14.5. Bridging Different LAN Technologies Section 14.6. Address Learning 寻址 Section 14.7. Multiple Bridges 多网桥 Chapter 15. Bridging: The Spanning Tree Protocol 网桥,生成树协议 Section 15.1. Basic Terminology 基础技术 Section 15.2. Example of Hierarchical Switched L2 Topology 分级交换机的二层拓扑示例 Section 15.3. Basic Elements of the Spanning Tree Protocol 生成树协议的基本元素 Section 15.4. Bridge and Port IDs 网桥和端口ID Section 15.5. Bridge Protocol Data Units (BPDUs) 交换机协议数据单元 Section 15.6. Defining the Active Topology Section 15.7. Timers 计时器 Section 15.8. Topology Changes Section 15.9. BPDU Encapsulation Section 15.10. Transmitting Configuration BPDUs Section 15.11. Processing Ingress Frames Section 15.12. Convergence Time 时间收敛 Section 15.13. Overview of Newer Spanning Tree Protocols Chapter 16. Bridging: Linux Implementation 桥接:Linux的实现 Section 16.1. Bridge Device Abstraction Section 16.2. Important Data Structures Section 16.3. Initialization of Bridging Code Section 16.4. Creating Bridge Devices and Bridge Ports Section 16.5. Creating a New Bridge Device Section 16.6. Bridge Device Setup Routine Section 16.7. Deleting a Bridge Section 16.8. Adding Ports to a Bridge Section 16.9. Enabling and Disabling a Bridge Device Section 16.10. Enabling and Disabling a Bridge Port Section 16.11. Changing State on a Bridge Port Section 16.12. The Big Picture Section 16.13. Forwarding Database Section 16.14. Handling Ingress Traffic Section 16.15. Transmitting on a Bridge Device Section 16.16. Spanning Tree Protocol (STP) Section 16.17. netdevice Notification Chain Chapter 17. Bridging: Miscellaneous Topics 桥接:其它的主题 Section 17.1. User-Space Configuration Tools Section 17.2. Tuning via /proc Filesystem Section 17.3. Tuning via /sys Filesystem Section 17.4. Statistics Section 17.5. Data Structures Featured in This Part of the Book Section 17.6. Functions and Variables Featured in This Part of the Book Section 17.7. Files and Directories Featured in This Part of the Book Part V: Internet Protocol Version 4 (IPv4) IP协议(V4) Chapter 18. Internet Protocol Version 4 (IPv4): Concepts Section 18.1. IP Protocol: The Big Picture Section 18.2. IP Header Section 18.3. IP Options Section 18.4. Packet Fragmentation/Defragmentation Section 18.5. Checksums Chapter 19. Internet Protocol Version 4 (IPv4): Linux Foundations and Features Section 19.1. Main IPv4 Data Structures Section 19.2. General Packet Handling Section 19.3. IP Options Chapter 20. Internet Protocol Version 4 (IPv4): Forwarding and Local Delivery Section 20.1. Forwarding Section 20.2. Local Delivery Chapter 21. Internet Protocol Version 4 (IPv4): Transmission Section 21.1. Key Functions That Perform Transmission Section 21.2. Interface to the Neighboring Subsystem Chapter 22. Internet Protocol Version 4 (IPv4): Handling Fragmentation Section 22.1. IP Fragmentation Section 22.2. IP Defragmentation Chapter 23. Internet Protocol Version 4 (IPv4): Miscellaneous Topics Section 23.1. Long-Living IP Peer Information Section 23.2. Selecting the IP Header's ID Field Section 23.3. IP Statistics Section 23.4. IP Configuration Section 23.5. IP-over-IP Section 23.6. IPv4: What's Wrong with It? Section 23.7. Tuning via /proc Filesystem Section 23.8. Data Structures Featured in This Part of the Book Section 23.9. Functions and Variables Featured in This Part of the Book Section 23.10. Files and Directories Featured in This Part of the Book Chapter 24. Layer Four Protocol and Raw IP Handling Section 24.1. Available L4 Protocols Section 24.2. L4 Protocol Registration Section 24.3. L3 to L4 Delivery: ip_local_deliver_finish Section 24.4. IPv4 Versus IPv6 Section 24.5. Tuning via /proc Filesystem Section 24.6. Functions and Variables Featured in This Chapter Section 24.7. Files and Directories Featured in This Chapter Chapter 25. Internet Control Message Protocol (ICMPv4) Section 25.1. ICMP Header Section 25.2. ICMP Payload Section 25.3. ICMP Types Section 25.4. Applications of the ICMP Protocol Section 25.5. The Big Picture Section 25.6. Protocol Initialization Section 25.7. Data Structures Featured in This Chapter Section 25.8. Transmitting ICMP Messages Section 25.9. ICMP Statistics Section 25.10. Passing Error Notifications to the Transport Layer Section 25.11. Tuning via /proc Filesystem Section 25.12. Functions and Variables Featured in This Chapter Section 25.13. Files and Directories Featured in This Chapter Part VI: Neighboring Subsystem Chapter 26. Neighboring Subsystem: Concepts Section 26.1. What Is a Neighbor? Section 26.2. Reasons That Neighboring Protocols Are Needed Section 26.3. Linux Implementation Section 26.4. Proxying the Neighboring Protocol Section 26.5. When Solicitation Requests Are Transmitted and Processed Section 26.6. Neighbor States and Network Unreachability Detection (NUD) Chapter 27. Neighboring Subsystem: Infrastructure Section 27.1. Main Data Structures Section 27.2. Common Interface Between L3 Protocols and Neighboring Protocols Section 27.3. General Tasks of the Neighboring Infrastructure Section 27.4. Reference Counts on neighbour Structures Section 27.5. Creating a neighbour Entry Section 27.6. Neighbor Deletion Section 27.7. Acting As a Proxy Section 27.8. L2 Header Caching Section 27.9. Protocol Initialization and Cleanup Section 27.10. Interaction with Other Subsystems Section 27.11. Interaction Between Neighboring Protocols and L3 Transmission Functions Section 27.12. Queuing Chapter 28. Neighboring Subsystem: Address Resolution Protocol (ARP) Section 28.1. ARP Packet Format Section 28.2. Example of an ARP Transaction Section 28.3. Gratuitous ARP Section 28.4. Responding from Multiple Interfaces Section 28.5. Tunable ARP Options Section 28.6. ARP Protocol Initialization Section 28.7. Initialization of a neighbour Structure Section 28.8. Transmitting and Receiving ARP Packets Section 28.9. Processing Ingress ARP Packets Section 28.10. Proxy ARP Section 28.11. Examples Section 28.12. External Events Section 28.13. ARPD Section 28.14. Reverse Address Resolution Protocol (RARP) Section 28.15. Improvements in ND (IPv6) over ARP (IPv4) Chapter 29. Neighboring Subsystem: Miscellaneous Topics Section 29.1. System Administration of Neighbors Section 29.2. Tuning via /proc Filesystem Section 29.3. Data Structures Featured in This Part of the Book Section 29.4. Files and Directories Featured in This Part of the Book Part VII: Routing Chapter 30. Routing: Concepts Section 30.1. Routers, Routes, and Routing Tables Section 30.2. Essential Elements of Routing Section 30.3. Routing Table Section 30.4. Lookups Section 30.5. Packet Reception Versus Packet Transmission Chapter 31. Routing: Advanced Section 31.1. Concepts Behind Policy Routing Section 31.2. Concepts Behind Multipath Routing Section 31.3. Interactions with Other Kernel Subsystems Section 31.4. Routing Protocol Daemons Section 31.5. Verbose Monitoring Section 31.6. ICMP_REDIRECT Messages Section 31.7. Reverse Path Filtering Chapter 32. Routing: Li nux Implementation Section 32.1. Kernel Options Section 32.2. Main Data Structures Section 32.3. Route and Address Scopes Section 32.4. Primary and Secondary IP Addresses Section 32.5. Generic Helper Routines and Macros Section 32.6. Global Locks Section 32.7. Routing Subsystem Initialization Section 32.8. External Events Section 32.9. Interactions with Other Subsystems Chapter 33. Routing: The Routing Cache Section 33.1. Routing Cache Initialization Section 33.2. Hash Table Organization Section 33.3. Major Cache Operations Section 33.4. Multipath Caching Section 33.5. Interface Between the DST and Calling Protocols Section 33.6. Flushing the Routing Cache Section 33.7. Garbage Collection Section 33.8. Egress ICMP REDIRECT Rate Limiting Chapter 34. Routing: Routing Tables Section 34.1. Organization of Routing Hash Tables Section 34.2. Routing Table Initialization Section 34.3. Adding and Removing Routes Section 34.4. Policy Routing and Its Effects on Routing Table Definitions Chapter 35. Routing: Lookups Section 35.1. High-Level View of Lookup Functions Section 35.2. Helper Routines Section 35.3. The Table Lookup: fn_hash_lookup Section 35.4. fib_lookup Function Section 35.5. Setting Functions for Reception and Transmission Section 35.6. General Structure of the Input and Output Routing Routines Section 35.7. Input Routing Section 35.8. Output Routing Section 35.9. Effects of Multipath on Next Hop Selection Section 35.10. Policy Routing Section 35.11. Source Routing Section 35.12. Policy Routing and Routing Table Based Classifier Chapter 36. Routing: Miscellaneous Topics Section 36.1. User-Space Configuration Tools Section 36.2. Statistics Section 36.3. Tuning via /proc Filesystem Section 36.4. Enabling and Disabling Forwarding Section 36.5. Data Structures Featured in This Part of the Book Section 36.6. Functions and Variables Featured in This Part of the Book Section 36.7. Files and Directories Featured in This Part of the Book About the Authors Colophon Index

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值