Network+ Exam Objective: DHCP Basics
Dynamic Host Configuration Protocol
Dynamic Host Configuration Protocol (DHCP for short) is a networking protocol used to automate the assignment of IP addresses and other network information to clients. DHCP offers a convenient way to centrally manage IP addresses, especially in very large networks. This is why DHCP is such a large part of the CompTIA Network+ exam objectives and why you need to make it a part of your study and practice testing before going up for the Network+ exam.
DHCP is a service
While the term DHCP server is commonly used, it is a bit misleading. A DHCP server is not a piece of physical hardware. In Microsoft-based networks, DHCP runs as a service on a Windows Server machine and is called (naturally) the DHCP Server service.
A DHCP server is configured with an IP address scope, a range of IP addresses that can be assigned to clients. When a client boots up, it receives an IP address from the DHCP scope.
In some cases, you want a client to always receive the same IP address every time it joins the network. This can be done by creating a DHCP reservation. A DHCP reservation links an IP address with a machine’s MAC address, and will only assign that IP address to the specified machine. DHCP reservations are most commonly used with servers, print devices, and networking hardware like routers.
EXAM TIP: Remember that the DHCP port numbers are 67 and/or 68. This is a question you may be asked at the exam.
IP addresses assigned by a DHCP server come with a time limit called a lease. A client’s DHCP-assigned IP address is automatically returned to the DHCP pool if its lease expires. The default lease duration is set by configuring the DHCP Server service. Common lease times are between 1-3 days, but shorter or longer leases can be used.
When a DHCP lease duration reaches the halfway point, the client automatically attempts to renew the lease and hang on to its current IP address. If it is unsuccessful (due to a technical issue or some other reason), the client will continue to pester the DHCP server with renewal requests until either the DHCP server approves a request or the lease expires and the client is forced to release its IP address.
Here is a basic description of how DHCP works on a Windows network:
When a network client boots up, it sends out a broadcast called DHCPDISCOVER. This is the client shouting, “I’m looking for a DHCP server that can assign an IP address to me.”
When a DHCP server receives this broadcast, it responds with a DHCPOFFER message. This is the DHCP server saying, “I heard your request, and I can assign an IP address to you.”
The client receives this offer and responds with a DHCPREQUEST message. The client is now saying, “I accept your offer. Send me an IP address.”
The DHCP server seals the deal by sending a DHCPACK response. This response contains the IP address assigned to the client and the length of the lease time.
DHCP can also be configured to send additional network information to clients. The most common information sent through DHCP to clients is:
- The default gateway for the network the client is on.
- The subnet mask is used.
- A list of IP addresses for Domain Name Server (DNS) servers.
EXAM TIP: When a client doesn’t have a default gateway or subnet mask defined in its TCP/IP properties, it’s most likely due to the client being unable to contact a DHCP server. The same thing applies to a client that has no DNS server IP addresses configured. This can indicate an issue with the DHCP service, or a network communication error. This is a popular troubleshooting scenario on both CompTIA and Microsoft exams.
DHCP has a limitation with networks split into one or more subnets. A client request for an IP address is confined to the subnet the client exists on. To get around this limitation, a DHCP relay agent must be configured. A DHCP relay agent is a bit of software that forwards client requests and DHCP server responses across different subnets. This prevents having to have a DHCP server configured on every subnet.
This brings us to a related topic: APIPA or Automatic Private IP Addressing. In Windows networks, if a client is unable to get an IP address from a DHCP server, it automatically assigns itself an IP address of 169.254.x.y and a subnet mask of 255.255.0.0. This fallback action gets the client up and running, but it can only communicate with computers on the same subnet which are also using APIPA.
EXAM TIP: Watch for any exam question where a Windows client has an IP address of 169.254.x.y. This indicates the client is using APIPA because it couldn’t contact a DHCP server.
Finally, you can always reset a client’s DHCP-assigned IP address by rebooting the system. But, there is a faster method. The ipconfig command-line tool can be used to reset a client’s DHCP-assigned IP address without having to reboot the computer. To do this, open a Windows command prompt and:
- Type ipconfig /release and press Enter to clear the client’s current IP address.
- Type ipconfig /renew and press Enter to send a new request to the DHCP server.
You are now well-versed in DHCP essentials. Good luck with your exam!
So where do we find CompTIA objectives covering the above?
For the Network+ N10-006 Exam you will find DHCP addressed in:
Main Domain 1.0 “Networking Concepts”: Sub-objective 1.1 – Explain the purposes and uses of ports and protocols > Protocols and ports > DHCP 67, 68
Sub-objective 1.4 Given a scenario, configure the appropriate IP addressing components >Address assignments >DHCP
Sub-objective 1.8 Explain the functions of network services >DHCP Service > DHCP relay/IP helper
Main Domain 4.0 “Network security”: Sub-objective 4.6 – Explain common mitigation techniques and their purposes > Switch port protection > DHCP snooping
Main Domain 5.0 “Network Troubleshooting and Tools”: Sub-objective 5.5 – Given a scenario, troubleshoot common network service issues > Exhausted DHCP scope
…and you will find ipconfig under:
Main Domain 5.0 “Network Troubleshooting and Tools”: 5.2 Given a scenario, use the appropriate tool > Command line tools > Software tools > ipconfig
…and for the A+ exam…
…there is no DHCP other than at the awareness level i.e. in the list of acronyms. However, the ipconfig command in itself is present under:
CompTIA A+ 220-1002 Main Domain: 1.0 “Operating Systems”: Sub-Objective 1.4 Given a scenario, use appropriate Microsoft command line tools > ipconfig
Aaron Axline is a technology writer and knowledge management specialist based in Edmonton, Canada. His work has appeared in titles from Que Publishing and on popular tech blogs and sites. His professional writing site is AaronAxline.blogspot.ca