一、客户端向服务器请求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
2DHCP server10.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)

此时客户端ip0.0.0.0,服务器预提供的ip10.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) request2次)

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地址时服务器offerack包是广播地址,服务器把客户端信息记录下来,当客户端再次接入网络获取地址时,服务器对该客户端发送单播包。