Dynamic Host Configuration Protocol
What is DHCP why do we need it what does it do do we have to have it on our network all good questions let's answer those real quick real simple DHCP is something that's taken credit every single day especially modern day with modern day networks you see without DHCP networking would be a tedious primitive difficult and extraneously boring and impossible task DHCP is an acronym meaning dynamic host configuration protocol its primary and biggest really function is to assign IP addresses to each host on a network this is much like a teacher assigning names to students in a class or numbers to students in a class so each host can have an IP address or a name on the network and it can communicate with other hosts on that network if it has that IP address assigned to it now DHCP also assigns other things to hosts such as the subnet mask the default gateway that host will actually use and the DNS address DHCP can be a server and/or a client.
Fig 1: Dynamic Host Configuration Protocol |
So let's get right to it using this simple network as our example let suppose we have two hosts here are two pcs in this case a switch and a router along with those two pcs in order for these two computers to connect and to work on the network they will each need a unique IP address unique not just to each other but unique on the entire network or the local area network segment that they are connected on here if each host or component on the network does not have a unique IP address incorrect devices will be receiving and/or sending information and you really don't have a network now if you just have two hosts as in our example here or even 10 to 15 hosts on a small network you can easily statically assign IP addresses to each host and be done with it but imagine the complexity when you have fifty to a hundred hosts or components on a network or 200 300 or I've ever spoken to wants to manually statically assign all those IP addresses what if you inadvertently use an IP address you previously used on their host how do you keep track this is where DHCP comes into play in the biggest way possible if you have a DHCP server set up on your local area network segment and you've assigned a scope of IP addresses to it to actually use and they call it a scope that's the range of IP addresses that that DHCP server is allowed to hand out and each host is running an operating system that typically contains a DHCP client then the DHCP client on each host can ask for an IP address as soon as it connects to the network powers on and boots up for the DHCP server to work it will need to be somewhere on this same network segment to receive the request for an IP address from the DHCP client that's on each of those hosts it will then choose an IP address out of its aloud scope of IP addresses and respond to that host with the IP address the subnet mask the default gateway and the DNS information now you can run a DHCP server on a server or you can oftentimes run it on a router or a layer 3 switch with the capability on your home system you'll likely find it on your home router on an enterprise level network.
However it's more than likely running on a server so when you power on a PC a laptop or any device connected to a network it sends out a DHCP request asking for an IP address that's not yet being used on the network it says hey I need an IP address this request is what's known as a broadcast it's a broadcast that's sent out because it essentially is shouting to the entire network hey I need an IP address I need a DHCP server to respond back with one please now devices that are not a DHCP server will look at that broadcast message and simply drop it this first step is known as DHCP discover for the DHCP offer that's actually step two in the process when the DHCP server gets that message it responds with I get it I understand here's an IP address you can use that's not being used by anyone else any other host on this network segment then we move on a step three which is the DHCP request and that's where the host says I'll take that IP address and it sends that request to the DHCP server then you have the fourth step the dhcp process overall which is the DHCP ACK or DHCP acknowledgement now this is where the DHCP server sins that IP address to the host that requested an IP address along with the subnet mask the default gateway that the host needs to use and the DNS and the DHCP server says you can have it or use it but I want it back at some point it expires if there's certain period of time and I'll then hand it out to some other host if you don't confirm you still need it or are no longer using it so there you have it that's pretty much the basics of DHCP why you need it what it's used for.
0 Comments