When a client device tries to join a new
network for the very first time, it must have a valid IP address to
communicate. It first transmits a DHCPDISCOVER
message on its local subnet. Because the client has no way of knowing the subnet to which it belongs, the DHCPDISCOVER
is an all-subnets broadcast (destination IP address of 255.255.255.255, a layer
3 broadcast address) and a destination MAC address of FF-FF-FF-FF-FF-FF (a layer 2
broadcast address). The client does not have a configured IP address, so the source IP address of 0.0.0.0
is used. The purpose of DHCPDISCOVER
message is to try to find out a DHCP Server.
After receiving the discover message, the
DHCP Server dynamically picks up an unassigned IP
address from its IP pool and broadcasts a DHCPOFFER message to the client device. DHCPOFFER message could contain other information such as subnet mask, default gateway, IP address lease time, and domain name server (DNS). In fact, the DHCPOFFER is a layer 3 broadcast message (the IP destination is 255.255.255.255) but a layer 2 unicast message (the MAC destination is the MAC of the DHCP Client).
address from its IP pool and broadcasts a DHCPOFFER message to the client device. DHCPOFFER message could contain other information such as subnet mask, default gateway, IP address lease time, and domain name server (DNS). In fact, the DHCPOFFER is a layer 3 broadcast message (the IP destination is 255.255.255.255) but a layer 2 unicast message (the MAC destination is the MAC of the DHCP Client).
If the client accepts the offer, it then
broadcasts a DHCPREQUEST message saying it will take this IP address. It is called request message because the client might deny the
offer by requesting another IP address. The DHCPREQUEST message is still a broadcast message because the
DHCP client has still not received an acknowledged IP. Also a DHCP Client can receive
DHCPOFFER messages from other DHCP Servers so sending broadcast DHCPREQUEST message is also a way to
inform other offers have been rejected.
When the DHCP Server receives the
DHCPREQUEST message from the client, the DHCP Server
accepts the request by sending the client a unicast DHCPACKNOWLEDGEMENT message (DHCPACK).
accepts the request by sending the client a unicast DHCPACKNOWLEDGEMENT message (DHCPACK).
After
receiving DHCPACKNOWLEDGEMENT, the IP address is leased to the DHCP Client. A
client will usually keep the same address by periodically contacting the DHCP server to
renew the lease before the lease expires.
The process can be summarized as DORA(Discover,Offer,Request and Acknowledgement);
Comments
Post a Comment