US Region

Grandmetric LLC
Brookfield Place Office
200 Vesey Street
New York, NY 10281
EIN: 98-1615498
Phone: +1 302 691 94 10

EMEA Region

ul. Metalowa 5, 60-118 Poznań, Poland
NIP 7792433527
+48 61 271 04 43

What is DHCP protocol and how does it work?

What is DHCP protocol and how does it work?



DHCP protocol (Dynamic Host Configuration Protocol) is commonly used in networks for dynamic IP addressing configuration. Every user’s device needs at least IP address to join the network and connect to services. When computer first connects to local network with cable or WiFi SSID, first thing is to look for IP address, netmask, default gateway and DNS servers.

How does DHCP protocol work?

  1. Host connecting to network (cable or wireless) sends DHCP discover message to all hosts in Layer 2 segment (destination address is FF:FF:FF:FF:FF:FF). Frame with this DISCOVER message hits the DHCP Server.

DHCP Discover packet

2. After the DHCP Server receives discover message it suggests the IP addressing offering to the client host by unicast. This OFFER message contains:

  • proposed IP address for client (here
  • subnet mask to identify the subnet space (here
  • IP of default gateway for subnet (here
  • IP of DNS server for name translations (here
  • Options (read full article)

DHCP Offer packet

3. Now after the client receives the offer it requests the information officially sending REQUEST message to server this time by unicast.

DHCP Request packet

4. Server sends ACKNOWLEDGE message confirming the DHCP lease to client. Now client is allowed to use new IP settings.

DHCP Acknowledge packet

What information getting from DHCP protocol are necessary and which are optional?

In theory, only IP address and mask is needed for device to work. This is true in scenario that device is within the same subnet with other devices and communicates with others knowing their IP addresses. In such way there is no need for going beyond own subnet and that’s why gateway is not needed. Using only IP addresses for communication also eliminates the need of name translations so DNS is still optional. However, in real world scenarios most of communication goes beyond the subnet and relays on Fully Qualified Domain Names (FQDN).

In addition to necessary DHCP parameters there are DHCP options like popular Option 150 used in IP Telephony to inform IP Phones about the IP address of IP PBX for proper phone registration – for example Cisco Call Manager or Asterisk PBX. Almost all DHCP server vendors are able to pass DHCP options.

What if DHCP server is not in the same subnet ?

You can ask yourself if there is a need for having DHCP server in the same L2 segment (VLAN), because DHCP OFFER message relays on broadcast destination address which is good for the same subnet only. Right trace! But for the sake of DHCP scalability there is option to have DHCP server outside the subnet. In such solution DHCP discover packets typically getting to default gateway interface are transformed into unicast packets (DHCP discover embedded message) with giaddr field that tells server about logical attachment identification. Packet is sent directly to IP of server located somewhere in routable IP cloud. Giaddr helps the DHCP server to find the correct address pool for granting the address.

DHCP relay

Check how to configure DHCP server on network device.


Marcin Bialy

Marcin Biały is Network and Security Architect with over 14 years of experience, with Service Provider and Enterprise networking background. He used to work for large service providers, global vendors and integration services companies as Network Architect, Leading Architect and Techincal Solution Manager positions. He designed, implemented and supported dozens large scale projects and infrastructure migrations, solved hundreds of tickets and spent hours with CLI and GUI of many flavors. Marcin is also holding industry recognizable certificates such as CCNP, CCNA, CCSI #35269, FCNSP #7207, FCNSA and more.

Alok Rawat
22 April 2019 at 13:44

Thanks a lot brother !! live long

15 September 2019 at 15:44

Really good article. Especially, the point you have mentioned about Giaddr.

Ross Flaherty
15 November 2021 at 12:05

Awesome blog! Is your theme custom made or did you download it
from somewhere? A dewsign like yours with a few simple
tweks would really make my blog stand out. Please let me know where you got your design. Cheers

Joanna Sajkowska
22 November 2021 at 10:00

Thanks, Ross. Our design’s custom made.


Leave a Reply

Your email address will not be published. Required fields are marked *

Sign up to our newsletter!