Most of our IP address configurations occur automatically. In this video, you’ll learn about the Dynamic Host Configuration Protocol (DHCP), assigning static IP addresses, creating DHCP reservations, Automatic Private IP Addressing (APIPA), and IPv6 link-local addresses.
<< Previous Video: An Overview of IPv4 and IPv6 Next: Using IP Addresses >>
In the early days of IP, you had to manually configure everything. You would at an IP address, a subnet mask, a gateway address, the DNS servers, NTP servers, and anything else that needed configuring for your TCP/IP to work properly. All of this changed in October of 1993, and the bootstrap protocol was introduced.
We often refer to this as BOOTP. But BOOTP didn’t work for everything that we needed to have configured automatically. For example, when we added voice over IP phones to our network, there was no way for BOOTP to add voice over IP gateway information.
BOOTP also had no way to know when an IP address was suddenly available again. So we updated BOOTP into a new protocol called dynamic host configuration protocol, or DHCP. And if we are getting automatic IP addresses on our devices these days, then you’re probably using DHCP to accomplish that.
Let’s step through the process that DHCP uses to obtain an IP address. I have a simple IP subnet listed, and on this IP subnet is a switch. And on this switch, we’ve connected a client workstation, a DHCP server, and a router.
The DHCP process works on a local subnet. But on our network, we have a DHCP server on our local subnet and a DHCP server that is not on our local subnet. To be able to use this DHCP server that’s on a different IP subnet than ours, we need to configure our local router to have a DHCP relay address configured.
Sometimes, you’ll hear this referred to as an IP helper-address. This tells this router that if it ever sees any requests for DHCP, to also send them to this DHCP server that’s outside of our local subnet. This means we’re now ready for any problems that might occur. If our local DHCP server has a power supply that goes bad and is suddenly unavailable, we can still use this DHCP server that’s located elsewhere, because we’ve configured a DHCP relay.
When we first turn on our client workstation, it does not have an IP address, so it’s going to send a broadcast out to UDP port 67 over the network. This broadcast will make its way to every device on our local subnet, and it will eventually end up at the DHCP servers that have been configured on our network. Those DHCP servers will examine the request. And if they have an IP address that’s available, they will make an offer to this client workstation using a broadcast to UDP ports 68. Those broadcasts from both DHCP servers will be seen by the original client workstation.
When multiple offers are made to a device, the device usually chooses the first offer that was received. Now that it knows that an IP address is available, our client workstation can send a broadcast over UDP port 67 to request that IP address. Once the DHCP server receives the address, it can send a formal acknowledgment to that address to the client workstation over UDP port 68. And at this point, the client workstation can configure itself with that IP address.
On each of those DHCP servers, there was a pool of addresses configured. So any time a request was made for an IP address, any random set of IP addresses that was available could be sent down to that client. This means that your IP address could occasionally change. The IP address you have this week might be different than the IP address you have next week.
However system administrator may prefer that a device always has the same IP address. For example, they may want a server or a printer to always have the same IP address every day. One way to accomplish this would be to disable DHCP completely on that device. This means you have to manually configure all of the IP address settings. So you as the administrator would have to manually type in the IP address, subnet mask default gateway, DNS settings, and anything else relating to IP.
If any of these values need to be changed later you would have to revisit this device and manually reconfigure all of those settings. A much more flexible way to accomplish this will be to create an IP reservation on the DHCP server where you can associate the MAC address of this device to a specific IP address. That way if you need to make changes, you can go to your DHCP server, and those changes will be propagated to all of these devices.
If you turn on your computer, and you don’t receive a response from a DHCP server, you might still be able to communicate with other devices on your network. You’re able to do this thanks to automatic private IP addressing, or APIPA. This is what we call a link local address. It’s an automatic address that’s assigned to your workstation that allows you to communicate on your own IP subnet, but you’re not able to communicate outside of your local subnet.
There are a range of IPv4 addresses assigned just for APIPA. This ranges 169. 254.0.1 through 169.254.255.254. The first and last 256 addresses are reserved, which means if you look at the available IP addresses for workstation, they’ll fall in the range from 169.254.1.0 through 169.254.254.255. This means if you turn on a device, and you find you’re not able to communicate to the internet, and when you look at the IP addresses, they fall in this particular range, you know you’ve been assigned an APIPA address.
This process of assigning an APIPA address is done automatically by the operating system. And before it puts that address onto your workstation, it sends an Address Resolution Protocol, or ARP frame out to the network to make sure that nobody else is using the IP address that it wants to assign to your workstation. Here’s an example of the IP config information in Windows for a device that has been assigned an automatic IP address. You can even see that it says autoconfiguration IPv4 for address, and this address is 169.254.228.109, which certainly fits into that range of APIPA addresses.
This idea of having a link-local address is also available in IP version 6. And in IP version 6, it’s a functionality that’s automatically assigned to every IPv6-enabled interface. So you may find that your local IPv6 address not only has a link-local address, but it also has an IPv6 address that allows it to communicate outside of your local subnet.
The range for these link-local addresses in IPv6 begins with fe80 and then all zeros, with only one subnet allocated. Which means effectively, this is an IP address that is fe80 with the rest zeros in the first 64 bits, and then the last 64 bits are assigned as the node address. These last 64 bits that are assigned to the device are not always a random value. Often, they are converted from the MAC address of the device so that there is some uniqueness to the link-local address in IP version 6.
Category: CompTIA A+ 220-1001