Skip to main content

What is DHCP protocol?

What is DHCP protocol?


Introduction

DHCP (Dynamic Host Configuration Protocol) is a core infrastructure service on any network that provides IP addressing and DNS server information to PC clients and any other device. DHCP is used so that you do not have to statically assign IP addresses to every device on your network DHCP is being expanded to fit into new network services like the Windows Health Service and Network Access Protection (NAP). However, before you can use it for more advanced services, you need to first install it. Your ISP has a DHCP server. They can assign IPs by modem MAC addresses. When your modem comes online, it communicates to the network indicating it is looking for an IP address. The DHCP server listens to this communication and starts talking to the modem. The modem then transmits its MAC address to the DHCP server. At that point, either an IP has been reserved for the modem or one is assigned at that time. Hence cloning your MAC address to get a new IP from your ISP. Routers and DHCP - Under the General Setup or LAN Setup tab in your router, you'll see a settings option for DHCP. You can control how many IPs are assigned or to enable/disable the DHCP server portion of the router. If you disable it, you'll have to statically assign IPs to each computer, or have a DHCP server or your network. This goes for wired and wireless. Any connection on your network has an IP address.

DHCP Works

A DHCP server is used to issue unique IP addresses and automatically configure other network information.

Once a device is turned on and connected to a network that has a DHCP server, it will send a request to the server, called a DHCPDISCOVER request. After the DISCOVER packet reaches the DHCP server, the server attempts to hold on to an IP address that the device can use, and then offers the client the address with a DHCPOFFER packet. Once the offer has been made for the chosen IP address, the device responds to the DHCP server with a DHCPREQUEST packet to accept it, after which the server sends an ACK that's used to confirm that the device has that specific IP address and to define the amount of time that the device can use the address before getting a new one.

More Information on DHCP

This is another reason DHCP is so useful - because it allows lots of devices to connect to a network over a period of time without needing a massive pool of available addresses. For example, even if only 20 addresses are defined by the DHCP server, 30, 50, or even 200 (or more) devices can connect to the network so long as no more than 20 are using one of the available IP address simultaneously. Because DHCP assigns IP addresses for a specific period of time (a lease period), using commands like ipconfig to find your computer's IP address will yield different results over time. Though DHCP is used to deliver dynamic IP addresses to its clients, it doesn't mean static IP addresses can't also be used at the same time. A mixture of devices that are getting dynamic addresses and devices that have their IP addresses manually assigned to them, can both exist on the same network.

DHCP relaying

Where only one IP subnet is being managed, DHCP clients communicate directly with DHCP servers. However, DHCP servers can also provide IP addresses for multiple subnets. In this case, a DHCP client that has not yet acquired an IP address cannot communicate directly with the DHCP server using IP routing, because it doesn't have a routable IP address, doesn't know the IP address of a router, and doesn't know the IP address of the DHCP server.

DHCP Simplifies Network Administration

Dynamic addressing simplifies network administration because the software keeps track of IP addresses rather than requiring an administrator to manage the task. This means that a new computer can be added to a network without the hassle of manually assigning it a unique IP address. Many ISPs use dynamic IP addressing for Internet subscribers.


How DHCP Works 


A DHCP server is used to issue unique IP addresses and automatically configure other network information. In most homes and small businesses, the router acts as the DHCP server. In large networks, a single computer might act as the DHCP server.
In short, the process goes like this: A device (the client) requests an IP address from a router (the host), after which the host assigns an available IP address to allow the client to communicate on the network. A bit more detail below...
Once a device is turned on and connected to a network that has a DHCP server, it will send a request to the server, called a DHCPDISCOVER request.
After the DISCOVER packet reaches the DHCP server, the server attempts to hold on to an IP address that the device can use, and then offers the client the address with a DHCPOFFER packet.
Once the offer has been made for the chosen IP address, the device responds to the DHCP server with a DHCPREQUEST packet to accept it, after which the server sends an ACK that's used to confirm that the device has that specific IP address and to define the amount of time that the device can use the address before getting a new one.
If the server decides that the device cannot have the IP address, it will send a NACK.
All of this, of course, happens very quickly and you don't need to know any of the technical details you just read in order to get an IP address from a DHCP server.

More Information about DHCP 

A DHCP server defines a scope, or range, of IP addresses that it uses to serve devices with an address. This pool of addresses is the only way a device can obtain a valid network connection.
This is another reason DHCP is so useful - because it allows lots of devices to connect to a network over a period of time without needing a massive pool of available addresses. For example, even if only 20 addresses are defined by the DHCP server, 30, 50, or even 200 (or more) devices can connect to the network so long as no more than 20 are using one of the available IP address simultaneously.
Because DHCP assigns IP addresses for a specific period of time (a lease period), using commands like ipconfig to find your computer's IP address will yield different results over time.
Though DHCP is used to deliver dynamic IP addresses to its clients, it doesn't mean static IP addresses can't also be used at the same time. A mixture of devices that are getting dynamic addresses and devices that have their IP addresses manually assigned to them, can both exist on the same network.
Even an ISP uses DHCP to assign IP addresses. This can be seen when identifying your public IP address. It will likely change over time unless your home network has a static IP address, which is usually only the case for businesses that have publicly accessible web services.
In Windows, APIPA assigns a special temporary IP address when the DHCP server fails to deliver a functional one to a device, and uses this address until it can obtain one that works.

Pros and Cons of Using DHCP 

A computer, or any other device that connects to a network (local or internet), must be properly configured to communicate on that network. Since DHCP allows that configuration to happen automatically, it's used in almost every device that connects to a network including computers, switches, smartphones, gaming consoles, etc.
Because of this dynamic IP address assignment, there's less of a chance that two devices will have the same IP address, which is very easy to run into when using manually-assigned, static IP addresses.
Using DHCP also makes a network much easier to manage. From an administrative point of view, every device on the network can get an IP address with nothing more than their default network settings, which is set up to obtain an address automatically. The only other alternative is to manually assign addresses to each and every device on the network.
Because these devices can get an IP address automatically, they can move freely from one network to another (given that they're all set up with DHCP) and receive an IP address automatically, which is super helpful with mobile devices.
In most cases, when a device has an IP address assigned by a DHCP server, that IP address will change each time the device joins the network. If IP addresses are assigned manually, it means administration must not only give out a specific address to each new client, but existing addresses that are already assigned must be manually unassigned for any other device to use that same address. This is not only time-consuming, but manually configuring each device also increases the chance of running into human-made errors.
Though there are plenty of advantages to using DHCP, there are certainly some disadvantages as well. Dynamic, changing IP addresses should not be used for devices that are stationary and need constant access, like printers and file servers.
Although devices like that exist predominantly in office environments, it's impractical to assign them with an ever-changing IP address. For example, if a network printer has an IP address that will change at some point in the future, then every computer that's connected to that printer will have to regularly update their settings so their computers will understand how to contact the printer.
This type of setup is extremely unnecessary and can be easily avoided by not using DHCP for those types of devices, and instead by assigning a static IP address to them.
The same idea comes into play if you need to have permanent remote access to a computer in your home network. If DHCP is enabled, that computer will get a new IP address at some point, which means the one you've recorded as that computer having, will not be accurate for long. If you're using remote access software that relies on a IP address-based access, you'll need to use a static IP address for that device.

Comments

Popular posts from this blog

Difference between bandwidth and latency

Difference between bandwidth and latency Difference between bandwidth and latency is something that confuses a lot of people, but if you are an IT person it would be useful to know the difference between the two because sooner or later you will face a network problem related to it. Part of the confusion has been created by Internet providers by always recommending increase of bandwidth to Internet speed related problem, but as we will see, an Internet connection speed is not always dictated by bandwidth. This part is very important. What is difference between bandwidth and latency? I will give you an analogy to make it easier to understand it if you are still confused. Imagine a highway with 4 lanes where the speed limit is 70 mph. Now on the Internet, bandwidth is the highway, and latency is the 70 mph speed limit. Now if you want to increase the amount of cars that travels through the highway you can add more lanes, but because the highway has too many curves, and

10 things that android phones can do, apple iPhone can`t do

10 things that android phones can do, apple iPhone can`t do Android and iOS both operating systems offer a lot of features (most of them commonly found in both), there are always a few that are exclusively available on that OS. Here are 10 such features available on Android, but missing from iPhones' operating system. Instant app: test apps before downloading This feature allows users to test the apps before they decide to download. Compatible with all Android devices operating on Jelly Bean or higher, this feature is still missing for iPhones. Set DATA Limit alerts  In the settings option of your Android smartphone, users have the choice to set data limit with a mode called the Data Saving Mode. This allows users to limit the background data consumption in case there is a dearth of available data. And you cannot set limit in iPhone.  Records phone apps  Thanks to the customized UIs of the various Android smartphones, the option to record a call is prese

What is DNS?

What is DNS? The Domain Name System (aka DNS) is used to resolve human-readable hostnames like www.notesshow.blogspot.in into machine-readable IP addresses like 204.13.248.115. DNS also provides other information about domain names, such as mail services. But why is DNS important? How does it work? What else should you know? History of the DNS When the Internet was still in its infancy when you wanted to visit a website you had to know the IP address of that site. That’s because computers are and were only able to communicate using numbers. It’s long, hard to remember, and we (humans, I presume) are not robots. We needed a way to translate computer-readable information into human-readable. And it had to be fast, lightweight. DNS In the early 1980’s, Paul Mockapetris came up with a system that automatically mapped IP addresses to domain names. And the DNS was born. This same system still serves as the backbone of the modern Internet, today. And yet, only a small subs