DHCP(动态主机配置协议)基本信息
2008-01-05 18:40:09 来源:WEB开发网核心提示:概要动态主机配置协议 (DHCP) 是 RFC 1541(已被 RFC 2131 取代)定义的标准协议,该协议答应服务器向客户端动态分配 ip 地址和配置信息,DHCP(动态主机配置协议)基本信息,通常,DHCP 服务器至少向客户端提供以下基本信息: •
概要
动态主机配置协议 (DHCP) 是 RFC 1541(已被 RFC 2131 取代)定义的标准协议,该协议答应服务器向客户端动态分配 ip 地址和配置信息。通常,DHCP 服务器至少向客户端提供以下基本信息: • IP 地址• 子网掩码
• 默认网关 它还可以提供其他信息,如域名服务 (DNS) 服务器的地址和 Windows Internet 名称服务 (WINS) 服务器的地址。系统治理员配置 DHCP 服务器分配给客户端的选项。 当客户端被配置为接收 DHCP 信息后首次初始化时,它将启动与服务器的对话。
以下是客户端和服务器之间对话的摘要表,最后一列是数据包级的过程说明:
Source Dest Source Dest Packet MAC addr MAC addr IP addr IP addr Description ----------------------------------------------------------------- Client Broadcast 0.0.0.0 255.255.255.255 DHCP Discover DHCPsrvr Broadcast DHCPsrvr 255.255.255.255 DHCP Offer Client Broadcast 0.0.0.0 255.255.255.255 DHCP Request DHCPsrvr Broadcast DHCPsrvr 255.255.255.255 DHCP ACK
DHCP 客户端和 DHCP 服务器之间的具体对话如下:
DHCPDISCOVER
客户端发送 DHCPDISCOVER 数据包。以下内容摘自网络监视器的捕捉信息,显示了 DHCPDISCOVER 数据包中的 IP 和 DHCP 部分。在 IP 部分,可以看到 Destination 地址是 255.255.255.255,而 Source 地址是 0.0.0.0。DHCP 部分将数据包标识为 Discover 数据包,并使用网卡的物理地址在两处标识客户端。注重 CHADDR 字段和 DHCP 中的值:Client Identifier 字段是相同的。
IP:ID = 0x0; PRoto = UDP; Len: 328 IP:Version = 4 (0x4) IP:Header Length = 20 (0x14) IP:Service Type = 0 (0x0) IP:Precedence = Routine IP:...0.... = Normal Delay IP:....0... = Normal Throughput IP:.....0.. = Normal Reliability IP:Total Length = 328 (0x148) IP:Identification = 0 (0x0) IP:Flags Summary = 0 (0x0) IP:.......0 = Last fragment in datagram IP:......0. = May fragment datagram if necessary IP:Fragment Offset = 0 (0x0) bytes IP:Time to Live = 128 (0x80) IP:Protocol = UDP - User Datagram IP:Checksum = 0x39A6 IP:Source Address = 0.0.0.0 IP:Destination Address = 255.255.255.255 IP:Data:Number of data bytes remaining = 308 (0x0134) DHCP:Discover (xid=21274A1D) DHCP:Op Code (op) = 1 (0x1) DHCP:Hardware Type (htype) = 1 (0x1) 10Mb Ethernet DHCP:Hardware Address Length (hlen) = 6 (0x6) DHCP:Hops (hops) = 0 (0x0) DHCP:Transaction ID (xid) = 556223005 (0x21274A1D) DHCP:Seconds (secs) = 0 (0x0) DHCP:Flags (flags) = 0 (0x0) DHCP:0............... = No Broadcast DHCP:Client IP Address (ciaddr) = 0.0.0.0 DHCP:Your IP Address (yiaddr) = 0.0.0.0 DHCP:Server IP Address (siaddr) = 0.0.0.0 DHCP:Relay IP Address (giaddr) = 0.0.0.0 DHCP:Client Ethernet Address (chaddr) = 08002B2ED85E
更多精彩
赞助商链接