#

Saturday, February 3, 2018

Deep into DHCP Protocol

Let's analyze DHCP packets using Wireshark and see what's really going inside the wire..





You can see the DORA (Discover, Offer, Request, Acknowledgement) packets going through.

Discover

This packet is sent by the client as a broadcast with a source IP address of 0.0.0.0 and a destination IP address of 255.255.255.255
Source MAC address is the client's MAC address and the destination MAC address is FF:FF:FF:FF:FF:FF
Source Port is udp 68 (bootpc) & destination port is udp 67 (bootps)

Offer

This packet is sent by the server as a unicast with a source IP address of the DHCP server and the destination IP address of the client which the server is going to offer in the future.
Source MAC address is the DHCP server's MAC address and the destination MAC address is the client's MAC address
Source Port is udp 67 (bootps) & destination port is udp 68 (bootpc)

If you analyze further in Bootstrap information, it shows the IP address to be given which is equal to the destination IP address of the packet.

























Request

This packet's source & destination IPs, MACs & port numbers are same as the Discover packet. But in the Bootstrap information it shows the requested IP. In this case it is same as the offered IP.



























Acknowledgement

This packet's source & destination IPs, MACs & port numbers are same as the Offer packet which confirms the lease.

Note:- 

When the client is down and come up again within the lease time, the client sends only the Request and the DHCP server sends only the Ack.

No comments:

Post a Comment