Skip to main content

How Reserving a Pavilion Explains DHCP

It’s party time! You decide to throw a party at a park with a bunch of pavilions. But you can’t just walk up and claim a pavilion. Instead, you have to go through the park’s reservation service. You tell them the date and time of your event, and they check their list to see what’s available. Great news! A pavilion is open, and they assign it to you for a set time. The day arrives, and as planned, you host your party until it’s time to leave. What a great gathering!

This is a lot like how DHCP works in a network. When a device — like your phone or laptop — joins a network, it can’t just start communicating. It needs an IP address first, just like you needed a reserved pavilion. Then, what is the "reservation" process of getting an IP address? Let's take a dive into the automated world of DHCP.

What is DHCP?

The Dynamic Host Configuration Protocol simplifies network provisioning by automatically assigning important network parameters. These include:
  • IP addresses: Just as you may get Pavilion 1 for your party, your device gains an IP address used to communicate amongst other devices. 
  • Subnet mask: Just as you want enough space for your guests and not disturb other parkgoers, the subnet mask serves as the boundary of a network - the range of IP addresses that identifies a device on a specified network
  • Default gateway: The guests enter the park first before reaching the pavilion, and when it is time to leave, they go through the park exit. The default gateway, or the router, has an IP address that allows devices on your local network to reach the Internet or another network. 
  • DNS server: It also helps to know how to get to the pavilion by using signs or putting clear directions on your invitation. Without it, your guests would be lost. The DNS server translates human-readable websites or domain names into machine-readable 32-bit IP addresses. 
It is hard to manage networks without it. DHCP debuted in 1993, but its earlier siblings provided its framework for automatic network connections. Before DHCP, protocols such as Reverse Address Resolution Protocol (RARP) or the Bootstrap Protocol (BOOTP), were used to assign IP addresses to devices. DHCP, however, is more efficient and flexible. Manual configurations are still handled today but preferably among smaller networks or networks that do not change frequently. DHCP handles the brunt of IP decision-making, but how does it work?

DORA the (IP) Explorer

Just like you have to go through a series of steps to book the pavilion, DHCP has a four-step process to provide these network parameters, known as DORA: Discover, Offer, Request, Acknowledge. 

Discover: When you walk into the office, you tell the manager that you want a pavilion. This will prompt the manager to look at the schedule and see what is available. Similarly, when your device connects to a network, it does not have the necessary network settings to communicate; it needs to reach a DHCP server to get the required network parameters. The device sends a broadcast message to the entire network, essentially announcing "Is there a DHCP server I can access?"

Offer: After looking at what is available, the manager provides you what pavilions are available for your needs. Similarly, the DHCP servers on a network will respond to the device's Discover message, saying "I am available", and provides those necessary parameters.

Request: Once the manager provides you with what is available, you may choose from those options. Similarly, the device receives an offer (or offers) from one or multiple DHCP servers on a network. If it receives multiple offers, the device may choose the first one that comes in or based on optimal performance factors. The device sends a DHCP Request message to the chosen server, saying "I'll take this one".

Acknowledge: The manager takes your selection and confirms the booking by providing you a receipt or letter of acknowledgement of your reservation. Similarly, the chosen DHCP server sends a DHCP ACK message, confirming and providing all the network parameters to your device. Now you can party - or access the network, in this case. 

DHCP Lease

Now let's party; but keep one thing in mind - do not overextend your stay. Why is that? The park may close at a certain time, park rangers need to clean the area, and other people want to use it.

Similarly, DHCP has a mechanism where you do not hold on to your IP address forever. A DHCP lease is a specified amount of time your device can hold onto an IP address. Just like you may book the pavilion for a few hours or until park closing, you can configure this setting on a DHCP server to the time you want, such as 24 hours, 7 days, 30 days, or even a few hours. 

Frequent lease changes can disrupt connections. If you realize your party is going past your booked time, you may choose to extend your reservation. Similarly, your device can renew its lease automatically as it nears its end, allowing you to keep your IP address or get a new one.

For a lengthy event, you may choose to book the entire day. DHCP has something for that - DHCP reservation. A DHCP reservation allows a device to keep its IP address whenever it is connected to the network based on its MAC address. This is an example of a static or manual DHCP configuration. 


What's Next?

Did you and your guests enjoy the party? They may not know it, but you did all that work to have an enjoyable occasion. When it comes to your devices, we are very happy when we are able to do research, watch videos, and have seamless data transfers. There is a lot that goes behind the scenes, but it would not be possible if you were not given your "pavilion", or IP address. DHCP is an important protocol that allows us to connect with other devices seamlessly without us having to tirelessly search for our ticket to connection.

In a future post, let's see how to configure a DHCP server in a virtual lab environment. We will also cover some DHCP issues and troubleshooting techniques. Have you configured a DHCP server in a live environment? What challenges have you faced when setting one up? Feel free to share your insights! 



Comments

Popular posts from this blog

IP in Practice: The Need for IPv6

 It is time for IPv6. Not just for our network infrastructure, but for this series. The IPv4 section has come to an end, and now it is time for a deep dive into IPv6. More than ever, it is time to consider systems that can handle heavier workloads, more devices, and fewer address limitations - AI agents, IoT devices, edge computing. This post will examine why we need IPv6 and why it is an important network solution.   Why do we need IPv6? We need more space. IPv6 literally increases the address space exponentially. The IPv6 address space is 2 128 total addresses, 3.4 followed by 38 zeroes. Technology is no longer limited to servers, office computers, and mobile devices. Today's systems integrate AI infrastructure, edge computing, IoT devices, cloud networking, virtual machines, and more. Simply, more devices mean more space.  We need more scalability. As more devices connect to systems, administrators need to consider not only the number but the distribution. System...

IP in Practice: IPv4 Workarounds

IPv4 has been dealing with burnout since 2011. Yet we work it to the ground by finding workarounds. Why? The Internet as we know it still runs on it. IPv6 is not as pervasive or widely accepted as IPv4 and often requires adding new infrastructure or reworking what is already in place. So far, the alternatives have extended the use of IPv4 beyond its intended design.  How have we continued to stretch IPv4? If you are studying networking, building a home lab, or managing large-scale networks, these techniques should ring a bell. This post will revisit four current IPv4 workarounds.  Workaround #1 - Private IP Addresses Instead of every server, device, and client getting their own public IP address and taking up space, private IP addresses provide reusable address spaces for local networks. These addresses are not directly accessible via the Internet. Routers will drop external traffic trying to directly access them.  To the outside world, only public IP addresses are...

Subnets: Key to Network Organization

Whether it is a to-do list or a big project, organization is key. We have busy lives. The task in itself can have several parts or may require some sort of collaboration with a partner or a team. A project may call to meet deadlines, which means keeping up with those crucial dates and having a system of order. Similarly, our networks are busy, transferring a great deal of data across links and nodes. The amount of traffic generated can lead to bottlenecks, packet loss, and delays. A network’s design can vary in complexity, depending on the environment or needs of a customer. Just as we find a manageable way to handle heavy workloads, our networks have a way of efficiently handling network traffic by creating "mini-networks" within our network. This process is called subnetting.   Why We Subnet To reduce congestion. Just as traffic in cities cause slowdowns and delays, too much traffic can lead to bottlenecks, packet loss, and delays. Subnetting breaks the netwo...