An IP version four host needs a set of parameters in order to communicate on a network. Here’s some of those parameters.
How we can dynamically assign IPV4 address information
Well first of all, it needs an address. It needs an IP version for address, and that address contains both the network and the host portion of that device’s address on the network.
But we probably want to get off of our local network. That’s what a default network can do for us, that’s the router that knows how to get to the rest of the world. And we want to be able to type in an easy to remember name, like something.com, and have that translated into an IP address. That’s what a DNS server can do for us.
And we could absolutely go in and manually configure all this, but do we really want to do that on dozens, or hundreds, of computers? It doesn’t scale very well, does it? What we could do instead is dynamically assign this information using a protocol called DHCP, the dynamic host configuration protocol.
DHCP – the dynamic host configuration protocol
And a DHCP server can hand out information to a host that’s requesting IP address information, such as the address, and default gateway, and DNS server, and lots of other information could be optionally configured. Here’s the way it works.
There are four message types exchanged between the host and the DHCP server, and it reminds me of a show my daughters used to watch when they were growing up. I think it was a Nickelodeon show. It was called Dora the Explorer. I think of Dora whenever I think of DHCP because DORA, that acronym, we can use that to remember the four messages that are exchanged with DHCP.
Specifically the D in DORA, reminds me of the D in the discover broadcast message that the host sends out saying, “Hey, are there any DHCP servers out there?” Well here, yes, we have a DHCP server, and it’s going to respond with the O in DORA. It’s going to respond with an offer message saying, “Yes, I’m a DHCP server and here’s my IP address if you want to talk with me.” And the host says, “Great.”
And it sends out the R in DORA, the request, saying, “Can you please give me some IP address information?” The server responds with the A in DORA, an acknowledgment, and it’s inside that acknowledgment message where we give the host all that requested information. Here’s your IP address, and Subnet mask, and so on.
There’s not a router sitting between these two devices
Now, this is great if the PC and the server happen to be on the same network segment. In other words, there’s not a router sitting between these two devices. We get a bit of an issue, though, if we have to go through a router to get to this server.
Take a look at PCB, it also wants to get IP address information, but when it sends out its discover broadcast, it gets dropped. The router does not forward broadcasts to other network segments. So, how do we get there?
Well here’s the key, we have to take that router and configure it to something called a DHCP relay agent, that way when PCB sends that discover message, the relay agent can now forward that intelligently to the DHCP server and PCB gets its IP address information as well.
And that’s a look at how we can dynamically assign IPV4 address information.