Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: March 18, 2024
In modern networks, every computer must have a network address to communicate with other connected machines. In such a context, IP versions 4 and 6 are the most relevant protocol to define computers’ network addresses.
We can use Dynamic Host Configuration Protocol (DHCP) to automatically get IP addresses for our computers, usually aiming to make them able to communicate over the Internet. However, the DHCP can fail sometimes, and a computer may not receive a valid IP address.
The Automatic Private IP Address (APIPA) emerges in the previously described scenario to guarantee that a computer (its network interfaces actually) receive an IP address. So, in this paper, we’ll explore how APIPA works in detail.
APIPA is a mechanism natively incorporated in computers running Microsoft Windows. The idea of such a mechanism is to guarantee that computers still receive an IP address in case of unavailability or failure of a DHCP server.
It is relevant to note that many events can make a DHCP server unavailable. These events are from a technical problem in the DHCP server itself to issues on the network (such as an optical fiber rupture), making it impossible for DHCP requests to reach the server.
Actually, APIPA makes the computers self-assigning a specific IP address. The self-assigned address, in turn, does not enable a computer to access the Internet. But, this address enables computers in the same Local Area Network (LAN) to communicate.
Technically, APIPA uses IP addresses ranging from 192.254.0.1 to 192.254.255.254 and the subnet mask of 255.255.0.0.
Thus, computers in the same subnet that self-assigned IP addresses with APIPA can naturally communicate. But, they can not communicate with any other computer in a different subnet (neither with the Internet, consequently). The figure next depicts the described scenario:
Although self-assigning an IP address, all the computers in the same APIPA-based LAN must have a particular and unique IP address. Thus, after selecting an IP address, computers should ask others in the same network if the chosen address is available for use. This process defines the APIPA’s IP address assignment, which considers the following steps:
However, it is important to note that a computer using an APIPA IP address does not give up communicating with the DHCP server. In this case, the computer requests the DHCP server regularly, every three minutes. If the DHCP server responds to the IP request, the received address replaces the APIPA one.
In this tutorial, we studied the Automatic Private IP Address. APIPA is a mechanism to enable local networked communication even without manual configuration of IP addresses and without a DHCP server. We explored the technical characteristics of APIPA and how it executes the process of IP address self-assignment.
We can conclude that APIPA is an efficient mechanism to enable computers to communicate in unexpected networked conditions. In such a way, computers are not kept isolated and can execute particular local tasks.