一、客户端向服务器请求
ip
地址
1.
客户端
ip
地址是
0.0.0.0
,广播
DHCP discover
"299","295.584998","0.0.0.0","255.255.255.255","DHCP","DHCP
Discover -
Transaction ID 0x29572ad"
DHCP server
检测给客户端提供的
ip
地址是否有客户端已占用
300 295.630175 ca:00:16:00:00:00 Broadcast ARP Who has 10.10.0.4? Tell 10.10.0.1
2
.
DHCP server
(
10.10.0.1
)发送广播提供
DHCP offer
302 297.588139 10.10.0.1 255.255.255.255 DHCP DHCP
Offer
- Transaction ID 0x29572ad
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 10.10.0.4 (10.10.0.4)
此时客户端
ip
是
0.0.0.0
,服务器预提供的
ip
是
10.10.0.4
3.
客户端发送广播请求地址
10.10.0.4
303 297.628176 0.0.0.0 255.255.255.255 DHCP DHCP
Request
- Transaction ID 0x29572ad
Option: (t=50,l=4) Requested IP Address = 10.10.0.4
4.
服务器广播
ACK
给该客户端,此时客户端扔无
ip
地址
304 297.677889 10.10.0.1 255.255.255.255 DHCP DHCP
ACK
- Transaction ID 0x29572ad
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 10.10.0.4 (10.10.0.4)
客户端检查分配给自己的
ip
地址是否和其他客户端冲突
Vmware_c0:00:03 Broadcast ARP Gratuitous ARP for 10.10.0.4 (Request)
(连续
3
次)
客户端获取
DHCP
服务器
MAC
地址,因为下面要进行单播通信
Vmware_c0:00:03 Broadcast ARP Who has 10.10.0.1? Tell 10.10.0.4
ca:00:0f:2c:00:00 Vmware_c0:00:03 ARP 10.10.0.1 is at ca:00:0f:2c:00:00
5.
客户端向
DHCP
服务器发送正式的请求
130 67.478249 10.10.0.4 10.10.0.1 DHCP DHCP
Request
- Transaction ID 0xeb9392dc
Client IP address: 10.10.0.4 (10.10.0.4)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
6.
DHCP
服务器发送
ACK
给客户端
131 67.550820 10.10.0.1 10.10.0.3 DHCP DHCP ACK - Transaction ID 0xeb9392dc
Client IP address: 10.10.0.4 (
10.10.0.4)
Your (client) IP address: 10.10.0.4 (
10.10.0.4
)
二、客户端释放
ip
地址
21 26.987415 10.10.0.4 10.10.0.1 DHCP DHCP Release - Transaction ID 0xc89dd936
三、客户端第二次向服务器请求
ip
地址
1.
客户端地址
0.0.0.0
发送广播
112 200.816873 0.0.0.0 255.255.255.255 DHCP DHCP Discover - Transaction ID 0x9227fa07
服务器检测是否该地址被占用
113 200.852968 10.10.0.1 10.10.0.4ICMP Echo (ping) request
(
2
次)
2.
服务器向
10.10.0.4
发送单播
Ethernet II, Src: ca:00:0f:2c:00:00 (ca:00:0f:2c:00:00), Dst: Vmware_c0:00:03 (00:50:56:c0:00:03)
116 202.832590 10.10.0.1 10.10.0.4 DHCP DHCP Offer - Transaction ID 0x9227fa07
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 10.10.0.4 (10.10.0.4)
3.
客户端发送广播请求地址
10.10.0.4
117 202.832831 0.0.0.0 255.255.255.255 DHCP DHCP Request - Transaction ID 0x9227fa07
4.
服务器广播
ACK
给该客户端,此时客户端仍无
ip
地址
304 297.677889 10.10.0.1 10.10.0.4 DHCP DHCP
ACK
- Transaction ID 0x29572ad
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 10.10.0.4 (10.10.0.4)
客户端检查分配给自己的
ip
地址是否和其他客户端冲突
Vmware_c0:00:03 Broadcast ARP Gratuitous ARP for 10.10.0.4 (Request)
(连续
4
次)
客户端获取
DHCP
服务器
MAC
地址,因为下面要进行单播通信
Vmware_c0:00:03 Broadcast ARP Who has 10.10.0.1? Tell 10.10.0.4
ca:00:0f:2c:00:00 Vmware_c0:00:03 ARP 10.10.0.1 is at ca:00:0f:2c:00:00
7.
客户端向
DHCP
服务器发送正式的请求
130 67.478249 10.10.0.4 10.10.0.1 DHCP DHCP
Request
- Transaction ID 0xeb9392dc
Client IP address: 10.10.0.4 (10.10.0.4)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
8.
DHCP
服务器发送
ACK
给客户端
131 67.550820 10.10.0.1 10.10.0.3 DHCP DHCP ACK - Transaction ID 0xeb9392dc
Client IP address: 10.10.0.4 (
10.10.0.4
)
Your (client) IP address: 10.10.0.4 (
10.10.0.4
)
客户端向服务器请求
ip
地址的不同在于首次请求
ip
地址时服务器
offer
和
ack
包是广播地址,服务器把客户端信息记录下来,当客户端再次接入网络获取地址时,服务器对该客户端发送单播包。
本文出自 “沉” 博客,谢绝转载!