IPv4 and IPv6 Addressing
Chapter 7 — IPv4 and IPv6 Addressing
IP addressing gives every network interface a logical Layer 3 identity and provides the hierarchy routers use to deliver packets between networks. This chapter develops that foundation through IPv4 structure and subnet boundaries, special-purpose ranges, IPv6 notation and scopes, automatic address assignment, migration technologies, and practical troubleshooting.
IPv4 Foundations
An IP address is a logical Layer 3 identifier used by routers to deliver packets between networks. IPv4 uses 32 bits written as four decimal octets; a prefix marks the network bits and the remaining bits identify interfaces within that subnet.
How IPv4 provides logical addressing
IPv4 uses a 32-bit address written in dotted-decimal notation as four 8-bit octets, for example 192.168.10.25. Each octet can represent 0 through 255. A subnet mask or CIDR prefix divides the address into:
- Network portion: identifies the subnet and is shared by interfaces in that subnet.
- Host portion: identifies an interface within the subnet.
An address belongs to an interface, not permanently to an entire device. A multihomed router or server therefore has multiple IP addresses.
Bit
A bit is 0 or 1. Eight bits form one octet with a decimal range of 0 through 255.
Network address
Identifies the subnet for routing and is not assigned to an ordinary host.
Broadcast address
Reaches every IPv4 host in the subnet. Assignable host addresses fall between network and broadcast.
Prefix length
Written /n; defines the boundary between network bits and host bits.
Binary Octet Converter
Enter a decimal octet from 0 to 255 to see its eight binary place values.
Historical Address Classes
Early IPv4 networks used classful addressing. The first bits—and therefore the first-octet range—implied a fixed network size. This wasted addresses because organizations often received blocks much larger than required.
| Class | First octet | Default prefix | Use |
|---|---|---|---|
| A | 1–126 | /8 | Very large host networks |
| B | 128–191 | /16 | Medium networks |
| C | 192–223 | /24 | Smaller networks |
| D | 224–239 | None | Multicast |
| E | 240–255 | None | Experimental / reserved |
Network, Host & Broadcast
The prefix determines which bits describe the network. In a conventional IPv4 subnet, the first address identifies the network, the last is the directed broadcast, and addresses between them are normally assignable.
Worked example: 192.168.10.77/26
A /26 mask is 255.255.255.192. The block size is 256 − 192 = 64, giving ranges 0–63, 64–127, 128–191, and 192–255. Since 77 falls in 64–127:
- Network: 192.168.10.64
- Usable hosts: 192.168.10.65–192.168.10.126
- Broadcast: 192.168.10.127
| Example network | First usable | Last usable | Broadcast |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.1 | 10.255.255.254 | 10.255.255.255 |
| 172.16.0.0/16 | 172.16.0.1 | 172.16.255.254 | 172.16.255.255 |
| 192.168.100.0/24 | 192.168.100.1 | 192.168.100.254 | 192.168.100.255 |
IPv4 Address Classifier
Select an address to reveal its range and practical meaning.
Public, Private & APIPA
Public addresses must be globally unique and may be routed across the Internet. RFC 1918 private addresses are reusable inside organizations and are not forwarded across the public Internet.
Private addressing, NAT, and APIPA
NAT translates private addressing for Internet access. PAT lets many hosts share one public address by tracking transport ports. If DHCP fails, a Windows client may self-assign an APIPA address from 169.254.0.0/16. APIPA supports same-link communication but normally provides no default gateway. Check the DHCP server, relay, VLAN, switch port, and physical or wireless link.
10.0.0.0/8
Private range 10.0.0.0 through 10.255.255.255.
172.16.0.0/12
Private only from 172.16.0.0 through 172.31.255.255—not every 172 address.
192.168.0.0/16
Private range 192.168.0.0 through 192.168.255.255.
169.254.0.0/16
APIPA provides local-link communication but no usable default gateway automatically.
CIDR, VLSM & Delivery
CIDR expresses the number of leading network bits as /n. A longer prefix creates a smaller subnet; a shorter prefix covers more addresses. VLSM applies different prefix lengths so each subnet matches its host requirement.
/24
255.255.255.0; 256 total and normally 254 usable addresses.
/27
255.255.255.224; 32 total and normally 30 usable addresses.
/30
255.255.255.252; four total and traditionally two usable addresses.
| Delivery | Pattern | Key behavior |
|---|---|---|
| Unicast | One to one | Packet targets one interface |
| Broadcast | One to all | All hosts in the IPv4 broadcast domain |
| Multicast | One to subscribed group | Uses 224.0.0.0/4 |
IPv6 Foundations & Notation
IPv6 uses 128 bits written as eight 16-bit hexadecimal hextets. It greatly expands address capacity and makes autoconfiguration, multicast, anycast, and Neighbor Discovery central features.
Reading an IPv6 address
A full address has eight 16-bit hexadecimal groups called hextets, separated by colons. Each hexadecimal digit represents four bits. A typical LAN uses a /64: the leading 64 bits identify the prefix and the remaining 64 bits form the interface ID.
IPv6 does not use ARP. Neighbor Discovery Protocol (NDP), carried by ICMPv6, supports router discovery, neighbor resolution, reachability detection, and Duplicate Address Detection. IPv6 has no broadcast; multicast handles discovery and group delivery.
Global unicast
2000::/3 is globally routable IPv6 space.
Link-local
FE80::/10 supports neighbour discovery and is never routed beyond the link.
Unique local
FC00::/7 is routable inside an organization but not on the public Internet.
Multicast
FF00::/8 replaces many functions that used IPv4 broadcast.
IPv6 Compression Explorer
Remove leading zeros in each block, then replace one contiguous run of zero blocks with ::. The double colon may appear only once.
IPv6 Address-Type Explorer
SLAAC Sequence Builder
Stateless Address Autoconfiguration (SLAAC) lets a host construct an IPv6 address from information advertised by a router, without a server assigning and tracking an address lease.
Router discovery and validation
- The interface creates a link-local address and checks it using Duplicate Address Detection (DAD).
- The host may send an ICMPv6 Router Solicitation (RS).
- A router returns a Router Advertisement (RA) containing prefix, default-router, lifetime, and configuration information.
- The host combines the prefix with an interface ID and performs DAD again.
The RA M flag points to stateful DHCPv6 address assignment; the O flag points to other DHCPv6 information such as DNS settings.
Modified EUI-64
Modified EUI-64 is a historical method for deriving a 64-bit IPv6 interface identifier from a 48-bit MAC address. Modern systems commonly prefer privacy or stable-random identifiers, but the calculation remains important exam knowledge.
Worked example: 00:1A:2B:3C:4D:5E
Split the MAC, insert FF:FE, and invert the universal/local bit in the first octet. Here 00 changes to 02.
SLAAC, DHCPv6 & Transition
Address configuration and migration solve different problems. SLAAC and DHCPv6 provide addressing information; dual stack, tunneling, and translation enable coexistence.
| Mode | Address source | Other options | State |
|---|---|---|---|
| SLAAC | RA prefix + local interface ID | RA/RDNSS where supported | No lease |
| Stateless DHCPv6 | SLAAC | DHCPv6 options such as DNS | No address lease |
| Stateful DHCPv6 | DHCPv6 server | DHCPv6 server | Tracked lease |
SLAAC
Host builds its address from a router-advertised prefix; no lease database is required.
Stateless DHCPv6
SLAAC builds the address while DHCPv6 supplies options such as DNS.
Stateful DHCPv6
A server assigns and tracks the IPv6 address and supplies options.
Dual stack
Runs IPv4 and IPv6 simultaneously; flexible but both must be operated and secured.
Tunneling
Encapsulates IPv6 across an IPv4-only section, adding overhead and possible NAT complications.
NAT64
Translates between IPv6-only clients and IPv4-only services, often with DNS64.
IP Addressing Command-Line Practice
Use command-line evidence to determine whether an interface has a valid address, prefix, default route, neighbor entry, and working name resolution.
Troubleshooting order
- Inspect the address, prefix, gateway, and DNS configuration.
- Test loopback, the local address, then the default gateway.
- Test a remote IP to separate routing from DNS.
- Resolve an A or AAAA record and test by name.
APIPA suggests DHCP failure. A valid address without a default route limits communication to directly connected networks. Working IP connectivity with failed hostname connectivity suggests DNS.
Get-NetIPAddressAddresses, prefixes, families, originsGet-NetIPAddress -AddressFamily IPv4IPv4 onlyGet-NetIPAddress -AddressFamily IPv6IPv6 onlyGet-NetRoute -AddressFamily IPv4IPv4 routes and default routeGet-NetNeighborARP and IPv6 neighboursTest-NetConnection 127.0.0.1IPv4 loopbackTest-NetConnection ::1IPv6 loopbackResolve-DnsName example.com -Type AAAAIPv6 DNS recordExam Check
Fifteen review questions drawn directly from the Chapter 7 manual.