4.2 IPv4, IPv6, Subnetting, APIPA, and DHCP Configuration
Key Takeaways
- IPv4 addresses are 32-bit values divided into four 8-bit octets in dotted-decimal format, logically split into a Network ID and Host ID by a subnet mask.
- RFC 1918 reserves three private address spaces: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16; Network Address Translation (NAT) maps internal private addresses to public routable IP addresses to conserve address space.
- APIPA assigns addresses in the 169.254.0.0/16 range when a DHCP client cannot contact a DHCP server; clients with APIPA addresses can communicate only with peers on the local broadcast segment and cannot reach default gateways or the Internet.
- DHCP automates client network configuration via the four-step DORA process (Discover, Offer, Request, Acknowledge); DHCP reservations bind physical MAC addresses to specific IP addresses, and scopes distribute critical options including default gateways and DNS servers.
- IPv6 uses 128-bit hexadecimal addresses to eliminate NAT; every IPv6-enabled interface requires an auto-configured fe80::/10 link-local address, and clients can configure addresses via SLAAC or DHCPv6.
4.2 IPv4, IPv6, Subnetting, APIPA, and DHCP Configuration
Quick Summary: Network layer addressing allows computers to locate and exchange data across interconnected networks. Support technicians must master IPv4 dotted-decimal formatting, distinguish private RFC 1918 addresses from public addresses, recognize APIPA configuration failures, understand subnet mask boundary logic, and trace the DHCP DORA process to maintain client network connectivity.
IPv4 Addressing Architecture and Default Classes
An Internet Protocol version 4 (IPv4) address is a 32-bit binary number uniquely assigned to an individual network interface. For human readability, the 32 bits are separated into four 8-bit groupings called octets, converted into base-10 numbers, and presented in dotted-decimal notation (e.g., 192.168.1.100).
Each octet represents values ranging from 00000000 (decimal 0) to 11111111 (decimal 255). Therefore, the theoretical IPv4 address space spans from 0.0.0.0 to 255.255.255.255, yielding approximately $2^{32}$ (4.29 billion) unique addresses.
Network ID vs. Host ID
Every IP address is divided into two distinct components:
- Network ID (Network Prefix): Identifies the specific physical or logical network segment to which the host belongs. All devices on the same local subnet share the identical Network ID.
- Host ID: Uniquely identifies the individual device interface (workstation, server, network printer) residing on that specific network.
Historical Classful Addressing
Before modern Classless Inter-Domain Routing (CIDR), the IPv4 address space was divided into standardized classes defined by the value of the first octet:
| Address Class | First Octet Range | Default Subnet Mask | CIDR Prefix | Network / Host Split | Max Networks | Max Hosts per Network |
|---|---|---|---|---|---|---|
| Class A | 1 – 126 | 255.0.0.0 | /8 | Network.Host.Host.Host | 126 | 16,777,214 |
| Class B | 128 – 191 | 255.255.0.0 | /16 | Network.Network.Host.Host | 16,384 | 65,534 |
| Class C | 192 – 223 | 255.255.255.0 | /24 | Network.Network.Network.Host | 2,097,152 | 254 |
| Class D | 224 – 239 | N/A | N/A | Multicast Groups (One-to-Many) | N/A | N/A |
| Class E | 240 – 255 | N/A | N/A | Experimental / Research (DoD) | N/A | N/A |
Notice: The number 127 is omitted from Class A because the entire
127.0.0.0/8block is reserved for internal loopback diagnostics.
Private IP Addresses (RFC 1918) & NAT
Because the global IPv4 address pool was rapidly depleted, the Internet Engineering Task Force (IETF) published RFC 1918, establishing three blocks of private IPv4 addresses reserved exclusively for internal corporate, academic, and home networks. Public Internet backbone routers are programmed to drop any packet bearing an RFC 1918 destination address.
The Three RFC 1918 Private Address Ranges
+-------------------------------------------------------------------------------+
| RFC 1918 PRIVATE ADDRESS SPACES |
+-------------------------------------------------------------------------------+
| Class A Block: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8) - 16.7M IPs |
| Class B Block: 172.16.0.0 to 172.31.255.255 (172.16.0.0/12) - 1.05M IPs |
| Class C Block: 192.168.0.0 to 192.168.255.255 (192.168.0.0/16) - 65.5K IPs |
+-------------------------------------------------------------------------------+
- 10.0.0.0/8 (10.0.0.0 – 10.255.255.255): Provides a single Class A network holding over 16.7 million usable host addresses. Widely deployed in large global enterprise networks and cloud datacenters.
- 172.16.0.0/12 (172.16.0.0 – 172.31.255.255): Provides 16 contiguous Class B network blocks (from 172.16.0.0 up through 172.31.0.0). Ideal for mid-sized corporate campus environments.
- 192.168.0.0/16 (192.168.0.0 – 192.168.255.255): Provides 256 contiguous Class C network blocks (from 192.168.0.0 through 192.168.255.0). The universal standard for small offices, retail branches, and home Wi-Fi routers.
Network Address Translation (NAT) / PAT
Because private addresses cannot route across the public Internet, organizations deploy Network Address Translation (NAT) at the boundary router or firewall.
- How it works: When internal client
192.168.1.45requests a website from93.184.216.34, the router intercepts the outbound packet, replaces the client's private source IP with the router's single public routable IP, and records the session in an internal state table. - Port Address Translation (PAT / NAT Overload): Assigns a unique high-numbered source Layer 4 port to each internal host connection. When the return packet arrives from the Internet, the router references the port mapping to forward the response back to the correct internal client. NAT conserves IPv4 space and conceals internal network topology from external attackers.
Special Purpose IPv4 Addresses
- Loopback Address (
127.0.0.1to127.255.255.254): The standard loopback address is127.0.0.1(in IPv6,::1). When a host pings127.0.0.1, packets never reach physical network media. The operating system routes them directly back into its own TCP/IP network software stack. Pinging the loopback confirms that the local TCP/IP protocol driver, network stack, and OS socket layer are operational. - Limited Broadcast Address (
255.255.255.255): Sends a packet to every active host on the local physical network segment. Routers do not forward limited broadcast packets beyond the local subnet. - Subnet-Directed Broadcast: The highest numerical address within a given subnet (e.g.,
192.168.1.255on a255.255.255.0network). Directs traffic to all hosts residing on that specific network segment. - Network Identifier: The lowest numerical address within a given subnet (e.g.,
192.168.1.0on a/24network). Represents the subnet itself and cannot be assigned to an individual host interface.
APIPA (Automatic Private IP Addressing)
Automatic Private IP Addressing (APIPA), formally defined as IPv4 Link-Local, is an operating system feature built into Windows, macOS, and Linux.
- The APIPA Address Range:
169.254.0.0/16(169.254.0.1through169.254.255.254) with a fixed subnet mask of255.255.0.0. - How APIPA Triggers: When a client is configured to "Obtain an IP address automatically" via DHCP, it broadcasts a series of DHCPDISCOVER messages at boot. If no DHCP server responds within a timeout window (typically 30 to 60 seconds), the client halts discovery and assigns itself a pseudo-random address in the
169.254.x.xrange using gratuitous ARP to prevent address collisions. - Functional Limitations: APIPA clients can communicate only with other hosts on the exact same physical broadcast segment that also have
169.254.x.xaddresses. APIPA does NOT configure a default gateway or DNS server. Consequently, an APIPA host cannot reach the Internet, cloud services, or internal servers on other subnets. - Technician Troubleshooting Directives: Discovering a
169.254.x.xaddress during anipconfigcheck is an immediate diagnostic indicator that:- The local DHCP server is down or unreachable.
- The DHCP scope is completely exhausted (out of available leasable IP addresses).
- The switch port is assigned to the wrong VLAN or disabled by port security.
- The network patch cable or wall jack has a Layer 1 break.
Subnet Masks & The Default Gateway
Computers use a subnet mask to determine whether a destination IP address resides on the local network or on a remote network.
How Subnet Masking Works
A subnet mask is a 32-bit sequence of contiguous binary 1s followed by contiguous binary 0s:
IP Address: 192.168. 1. 50 --> 11000000.10101000.00000001.00110010
Subnet Mask: 255.255. 255. 0 --> 11111111.11111111.11111111.00000000
Network ID: 192.168. 1. 0 --> 11000000.10101000.00000001.00000000
- The binary 1s define the Network ID.
- The binary 0s define the Host ID.
- In CIDR (Classless Inter-Domain Routing) shorthand, the mask is written as a forward slash followed by the count of 1-bits:
/24equals255.255.255.0,/16equals255.255.0.0, and/8equals255.0.0.0.
The Local vs. Remote Routing Decision
When an application initiates a connection to a destination IP:
- The host performs a bitwise logical AND operation between the destination IP and its own configured subnet mask.
- Destination is Local: If the calculated destination network matches the host's own local network, the host sends an ARP request to locate the target's MAC address and delivers the Layer 2 Ethernet frame directly across the local switch.
- Destination is Remote: If the calculated network differs, the host knows the packet must leave the local subnet. It encapsulates the packet inside a Layer 2 frame addressed to the hardware MAC address of its Default Gateway.
The Role of the Default Gateway
The Default Gateway is the local router interface connected to the client's subnet. It serves as the primary exit doorway to reach the rest of the enterprise and the Internet. If a client has an incorrect or missing default gateway IP, it can communicate seamlessly with neighboring computers and local printers on its own subnet, but cannot reach any external resource.
Dynamic Host Configuration Protocol (DHCP)
Dynamic Host Configuration Protocol (DHCP) automates the assignment of IP addresses, subnet masks, gateways, and DNS settings. DHCP operates over UDP, using Server Port 67 and Client Port 68.
The Four-Step DORA Exchange
When a network client connects, it negotiates an IP configuration via four sequential messages:
Client (Port 68) DHCP Server (Port 67)
│ │
├─────── [ 1. DHCPDISCOVER (Broadcast) ]──────────────>│
│ │
│<────── [ 2. DHCPOFFER (Unicast / Broadcast) ]─────┤
│ │
├─────── [ 3. DHCPREQUEST (Broadcast) ]──────────────>│
│ │
│<────── [ 4. DHCPACK (Unicast / Broadcast) ]─────┤
│ │
- D - Discover (DHCPDISCOVER): The client has no IP address, so it transmits a broadcast packet (Source:
0.0.0.0, Destination:255.255.255.255) across the local subnet searching for active DHCP servers. - O - Offer (DHCPOFFER): A listening DHCP server reserves an available IP address from its pool and responds with an offer containing proposed IP, subnet mask, lease duration, and server identifier.
- R - Request (DHCPREQUEST): The client broadcasts its acceptance of the offered parameters. Broadcasting ensures that if multiple DHCP servers made offers, the other servers know their offers were declined and can return those IPs to their available pools.
- A - Acknowledge (DHCPACK): The selected DHCP server commits the lease to its database and sends a final acknowledgment packet containing full configuration parameters (Option 3 Gateway, Option 6 DNS, etc.).
DHCP Management Concepts
- DHCP Scope: The defined pool of contiguous valid IP addresses (e.g.,
192.168.10.50through192.168.10.200) that the server is authorized to lease to clients on a given subnet. - Exclusion Range: Specific IP addresses within the scope that the server is forbidden from leasing (e.g., reserving
192.168.10.1to192.168.10.20for routers, managed switches, and physical servers). - DHCP Reservation (Static Binding): Configures the DHCP server to permanently bind a specific IP address to a client's 48-bit MAC address. Whenever that specific network interface boots, it dynamically requests an IP via DORA and always receives the identical reserved IP. Essential for network multifunction printers and conference room AV controllers.
- Lease Duration: The length of time a client is legally entitled to use the assigned IP address. Standard enterprise lease times range from 8 hours (for mobile devices) to 8 days. At 50% of the lease duration (the T1 timer), the client attempts to renew the lease directly with the original DHCP server via a unicast DHCPREQUEST.
- Core DHCP Options:
- Option 3: Default Gateway (Router IP)
- Option 6: Domain Name Servers (DNS)
- Option 15: Domain Name Suffix (e.g.,
corp.local) - Option 66 / 67: Boot Server Host Name and Bootfile Name (used for PXE network operating system deployment)
IPv6 Addressing Fundamentals
To permanently solve IPv4 exhaustion, IPv6 expands the address space to 128 bits, providing approximately $3.4 \times 10^{38}$ unique addresses (enough to assign billions of IPs to every grain of sand on Earth). IPv6 eliminates the architectural necessity for private address translation (NAT).
IPv6 Structure and Notation
IPv6 addresses are written as 8 groups of 4 hexadecimal digits (called hextets or quartets) separated by colons:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Address Compression Rules
- Omit Leading Zeros: Leading zeros within any 4-digit hextet may be dropped:
:0000:becomes:0:and:0db8:becomes:db8:. - Double Colon Compression (
::): Any single contiguous string of one or more all-zero hextets can be replaced with a single double colon (::). Rule: The double colon can be used only once per address to prevent mathematical ambiguity.- Uncompressed:
fe80:0000:0000:0000:020c:29ff:fe4b:8a12 - Compressed:
fe80::20c:29ff:fe4b:8a12
- Uncompressed:
Key IPv6 Address Types
- Global Unicast Address (GUA -
2000::/3): Publicly routable IPv6 addresses across the global Internet (equivalent to public IPv4 addresses). - Link-Local Address (
fe80::/10): Automatically generated on every IPv6-enabled interface. Ranges fromfe80::tofebf::. Used strictly for communication between hosts on the local physical link. Link-local packets are never forwarded by routers. Required for neighbor discovery and router solicitation. - Loopback Address (
::1): Equivalent to IPv4127.0.0.1. - Unspecified Address (
::): Equivalent to IPv40.0.0.0.
IPv6 Autoconfiguration: SLAAC vs. DHCPv6
- SLAAC (Stateless Address Autoconfiguration): The client needs no DHCP server. Upon boot, the client sends an ICMPv6 Router Solicitation (RS) message. The local router responds with an ICMPv6 Router Advertisement (RA) containing the 64-bit network prefix. The client then generates its own 64-bit interface ID (using EUI-64 derived from its MAC address, or a randomized privacy address) and performs Duplicate Address Detection (DAD).
- DHCPv6 (Stateful): Operates similarly to IPv4 DHCP, where a dedicated DHCPv6 server leases IPv6 addresses and tracks client state.
Help Desk Scenario: The Executive Floor APIPA Outage
At 9:00 AM on Monday, twelve executives in the corporate boardroom report that they cannot access corporate cloud applications or internal email.
- Diagnostic Check: The technician runs
ipconfigon an executive laptop and observes:IPv4 Address. . . . . . . . . . . : 169.254.88.19 Subnet Mask . . . . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . . . . : - Analysis: The
169.254.x.xaddress confirms that the client failed to reach a DHCP server and defaulted to APIPA. - Root Cause Isolation: The technician logs into the core DHCP server and checks the scope for the executive VLAN (
10.20.5.0/24). The scope shows 100% utilization (0 free addresses) because visiting vendors during a weekend conference consumed all available leases. - Resolution: The technician reduces the scope lease time from 8 days to 8 hours and clears inactive leases. The executive devices are renewed using
ipconfig /renew, instantly receiving valid10.20.5.xaddresses, corporate gateway settings, and restoring network connectivity.
A desktop computer configured to obtain network settings dynamically suddenly loses access to all corporate servers and the Internet. Running ipconfig reveals an IPv4 address of 169.254.112.45 with a subnet mask of 255.255.0.0 and no default gateway listed. What does this condition indicate, and what is the client's current communication capability?
Which of the following IPv4 addresses belongs to the private address ranges defined in RFC 1918 and can be used on internal corporate local area networks without public internet registration?
A network administrator needs to guarantee that a shared departmental network multifunction printer always receives the exact same IPv4 address, default gateway, and DNS configuration whenever it powers on, while still managing network settings centrally from the DHCP console. Which DHCP feature should the administrator configure?