Theory of DHCP:
So, let’s look at some of the theory of DHCP, DHCP uses a client server model
where the DHCP server or router is providing IP addresses to a client such as a PC, IP phone,
iPad or some other kind of user device.
So, the user device such as laptop, will boot-up without an IPv4 address and then will
request an IP address from a DHCP server.
This takes place in both IPv4 and IPv6, but we'll discuss IPv6 in a separate video. this video
concentrates mainly on IPv4, DHCP mechanisms.
So when the PC or laptop or phone boots up and requests an IP address from a DHCP
server. The server will then offer an IP address to the client. so when the PC or laptop, or
phone boots up, it will send out a broadcast trying to discover a DHCP server.
A DHCP server will then offer an IP address to the client, which the client can then request.
We look at the exact process in the moment but essentially the client sends out a broadcast
looking for DHCP servers
one or more DHCP servers will then offer an IP address to the client and the client will then
request an IP address from one of the DHCP server's typically from the server that answered
first.
The DHCP server then send an acknowledgement of that request. So the IP address and
other parameters are allocated to the client typically for a limited period of time
But it’s important to note that they don’t have to be. You could configure a DHCP server to
permanently allocate an IP address to a specific device.
So rather than statically configuring an IP address on a PC
you could configure an IP address in a DHCP server but ensure that the PC always gets the
same IP address via DHCP.
In most implementations in the real world, however, IP addresses are only allocated to
clients for a limited amount of time.
This allows you to re-use IP addresses. So in a subnet, where users are coming and going,
you may have a limited number of addresses in your pool and hence the addresses can be
re-used by users over a period of time.
As an example, In Starbucks, people are coming and going all the time so you may only
have a limited number of addresses that you wanna re-use over and over and over
so you may only allocate an IP address for a shorter amount of time such as an hour and
that means that a user who comes in has their coffee and leaves will not keep that IP
address but it could be re-used by someone else.
A client is the device that is requiring initialization parameters from a DHCP server such as
an IP address, default gateway and DNS server.
In IPv4 a PC or phone cannot communicate with other devices until it has an IP address so
in other words you can't surf the internet or watch a YouTube video until your PC has been
allocated an IP address
So parameters such as your default gateway to get to the internet and DNS server to
resolve name such as youtube.com to an IP address have to be allocated to a client. So your
client well request that information from the DHCP server.
Now there are 3 DHCP mechanisms and this often causes confusion because the names are
counter intuitive.