本文简单介绍了DHCP协议。
8.1. 简介
动态主机配置协议 (Dynamic Host Configuration Protocol,DHCP) 是一个用于局域网的网络协议,位于OSI模型的应用层,使用UDP协议工作,主要用于自动分配IP地址给用户,方便管理员进行统一管理。
DHCP服务器端使用67/udp,客户端使用68/udp。DHCP运行分为四个基本过程,分别为请求IP租约、提供IP租约、选择IP租约和确认IP租约。客户端在获得了一个IP地址以后,就可以发送一个ARP请求来避免由于DHCP服务器地址池重叠而引发的IP冲突。
8.2. DCHP 报文格式
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| op (1) | htype (1) | hlen (1) | hops (1) |
+---------------+---------------+---------------+---------------+
| xid (4) |
+-------------------------------+-------------------------------+
| secs (2) | flags (2) |
+-------------------------------+-------------------------------+
| ciaddr (4) |
+---------------------------------------------------------------+
| yiaddr (4) |
+---------------------------------------------------------------+
| siaddr (4) |
+---------------------------------------------------------------+
| giaddr (4) |
+---------------------------------------------------------------+
| chaddr (16) |
+---------------------------------------------------------------+
| sname (64) |
+---------------------------------------------------------------+
| file (128) |
+---------------------------------------------------------------+
| options (variable) |
+---------------------------------------------------------------+
8.3. 参考链接
- DHCP Wiki
- RFC 2131 Dynamic Host Configuration Protocol
- RFC 2132 DHCP Options and BOOTP Vendor Extensions
- RFC 3046 DHCP Relay Agent Information Option
- RFC 3397 Dynamic Host Configuration Protocol (DHCP) Domain Search Option
- RFC 3442 Classless Static Route Option for Dynamic Host Configuration Protocol (DHCP) version 4
- RFC 3942 Reclassifying Dynamic Host Configuration Protocol Version Four (DHCPv4) Options
- RFC 4242 Information Refresh Time Option for Dynamic Host Configuration Protocol for IPv6
- RFC 4361 Node-specific Client Identifiers for Dynamic Host Configuration Protocol Version Four (DHCPv4)
- RFC 4436 Detecting Network Attachment in IPv4 (DNAv4)
下一节:路由算法是用于找到一条从源路由器到目的路由器的最佳路径的算法。存在着多种路由算法,每种算法对网络和路由器资源的影响都不同;由于路由算法使用多种度量标准 (metric),所以不同路由算法的最佳路径选择也有所不同。