Loading content...
Consider the scale of addressing on today's Internet: billions of devices, each requiring a unique identifier, spread across every continent, connected by networks owned by thousands of different organizations, using dozens of different physical transmission technologies.
How do you create an addressing scheme that:
The answer is logical addressing—a software-defined addressing scheme that operates independently of physical network hardware. Where MAC addresses are burned into network interface cards and identify the hardware, IP addresses are assigned by software and identify a device's location in the network topology.
This distinction—hardware-independent, topology-aware addressing—is what makes the global Internet possible.
By the end of this page, you will understand why logical addressing is essential for internetworking, the key properties of IP addresses (hierarchy, uniqueness, assignability), how logical addresses contrast with physical addresses, and the foundational concepts that prepare you for deep dives into IPv4 and IPv6 addressing in subsequent chapters.
To appreciate logical addressing, we must first understand what it replaces and why physical addressing alone is insufficient for global networking.
Physical Addresses (MAC Addresses):
The Data Link Layer uses Media Access Control (MAC) addresses to identify devices. These addresses have specific characteristics:
00:1A:2B:3C:4D:5E)Why MAC Addresses Fail for Global Routing:
Imagine trying to build a global postal system where every address is a random 48-bit number with no relationship to geographic location. To deliver mail, every post office would need a list of every address in the world and which direction to send it. This is clearly unworkable.
MAC addresses have the same problem:
No Location Information: MAC 00:1A:2B:3C:4D:5E tells you nothing about where that device is. It could be in Tokyo, Texas, or the International Space Station.
No Aggregation: You cannot summarize MAC addresses. A router cannot say "all addresses starting with 00:1A go left" because devices with similar MAC prefixes are scattered globally.
Flat Routing Tables: Without aggregation, routing tables would need an entry for every device on the Internet—billions of entries, updated in real-time. This is computationally impossible.
Hardware Dependence: If you replace your network interface card, your identifier changes. Persistent system identification becomes impossible.
If the Internet used MAC addresses for routing, the global routing table would need ~50 billion entries (one per device). At roughly 100 bytes per entry, that's 5 terabytes just for the routing table—updated continuously. Modern routers cannot handle this; they work with ~900,000 prefixes (IP aggregations), not billions of individual addresses.
Logical addresses (IP addresses) solve the problems of physical addressing through several key properties:
1. Hierarchical Structure
IP addresses embed location information through a hierarchical structure:
An IP address consists of two conceptual parts:
The division point is defined by a subnet mask (or prefix length). This hierarchy enables:
2. Software Assignability
Unlike MAC addresses, IP addresses are assigned by software and can change:
This flexibility enables:
3. Global Uniqueness (for public addresses)
Public IP addresses are globally unique—no two devices on the public Internet have the same address (at the same time). This is enforced through a hierarchical allocation system managed by IANA and Regional Internet Registries (RIRs).
4. Scope Awareness
IP addresses have defined scopes:
IP addresses work like telephone numbers: the country code identifies the nation, the area code identifies the region, the exchange identifies the local hub, and the subscriber number identifies the individual line. Just as you can route a call through increasingly local switches using these hierarchical prefixes, routers can forward packets using increasingly specific IP prefixes.
IPv4, the fourth version of the Internet Protocol, has been the dominant network layer protocol since the 1980s. Its addressing scheme, while showing its age, illustrates the core concepts of logical addressing.
IPv4 Address Structure:
| Property | Value | Details |
|---|---|---|
| Length | 32 bits (4 bytes) | Provides ~4.3 billion unique addresses |
| Notation | Dotted decimal | Four decimal numbers 0-255 separated by dots: 192.168.1.100 |
| Binary | 32 binary digits | 11000000.10101000.00000001.01100100 |
| Hexadecimal | 8 hex digits (uncommon) | C0.A8.01.64 |
| Address Space | 0.0.0.0 - 255.255.255.255 | Total 2^32 = 4,294,967,296 addresses |
Network and Host Division:
Every IPv4 address is conceptually divided into a network portion and a host portion. The subnet mask defines where this division occurs:
IP Address: 192.168.1.100 = 11000000.10101000.00000001.01100100
Subnet Mask: 255.255.255.0 = 11111111.11111111.11111111.00000000
|------- Network -------| |--Host--|
Network ID: 192.168.1.0 (IP AND Mask)
Broadcast: 192.168.1.255 (IP OR NOT Mask)
Host Range: 192.168.1.1 - 192.168.1.254
CIDR Notation:
Modern notation uses CIDR (Classless Inter-Domain Routing) prefix notation:
192.168.1.0/24 means the first 24 bits are the network portion/24 is called the "prefix length"IPv4 Address Types:
With only 4.3 billion addresses and billions more devices, IPv4 addresses have been exhausted. IANA allocated its last blocks in 2011, and most RIRs have run out. Techniques like NAT (Network Address Translation) and eventually IPv6 migration address this crisis.
IPv6 was designed to solve IPv4's address exhaustion with a massively larger address space, while incorporating lessons learned from decades of IPv4 operation.
IPv6 Address Structure:
| Property | Value | Details |
|---|---|---|
| Length | 128 bits (16 bytes) | Provides ~340 undecillion addresses |
| Notation | Colon hexadecimal | Eight groups of 4 hex digits: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
| Abbreviated | Zero suppression | 2001:db8:85a3::8a2e:370:7334 |
| Address Space | Enormous | 2^128 ≈ 3.4 × 10^38 addresses |
| Prefix Length | /64 typical for LANs | Network prefix commonly 48-64 bits |
Scale of IPv6 Address Space:
To appreciate how large 2^128 is:
IPv6 Address Abbreviation Rules:
2001:0db8 → 2001:db8::: 2001:db8:0:0:0:0:0:1 → 2001:db8::1:: can only appear once (to avoid ambiguity)IPv6 Address Types:
IPv6 eliminates broadcast addresses entirely! Instead, multicast replaces broadcast functionality. For example, the IPv6 equivalent of "all hosts on this subnet" is the ff02::1 multicast address. This reduces unnecessary traffic and improves efficiency.
A fundamental advantage of logical addressing is that addresses can be assigned dynamically by software. This section explores the mechanisms that assign IP addresses to hosts.
Static Assignment:
The simplest method—an administrator manually configures each device:
# Linux example
ip addr add 192.168.1.100/24 dev eth0
ip route add default via 192.168.1.1
# Windows example (in Network Adapter Settings)
IP Address: 192.168.1.100
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
DNS Server: 8.8.8.8
When to use static assignment:
Dynamic Host Configuration Protocol (DHCP):
DHCP automates address assignment through a four-step process:
DHCP Provides:
IPv6 Address Configuration:
IPv6 offers additional configuration methods:
SLAAC (Stateless Address Autoconfiguration): Hosts generate their own addresses using:
DHCPv6 (Stateful): Similar to DHCPv4, server assigns complete addresses
DHCPv6 (Stateless): SLAAC for address, DHCPv6 only for additional info (DNS servers, etc.)
Link-Local Addressing:
When no configuration is available:
These allow local communication even without infrastructure.
Global IP address assignment follows a strict hierarchy: IANA → Regional Internet Registries (ARIN, RIPE, APNIC, LACNIC, AFRINIC) → Local Internet Registries / ISPs → End users. This ensures global uniqueness and enables route aggregation. You can't just pick a public IP—it must be allocated through this system.
Logical addresses enable global routing, but actual data transmission occurs over physical links using physical addresses. The network layer must translate between these two addressing schemes—a process called address resolution.
The Resolution Challenge:
When Host A (192.168.1.10) wants to send a packet to Host B (192.168.1.20):
Address Resolution Protocol (ARP) for IPv4:
ARP uses a simple request/reply mechanism:
ARP Cache:
Resolving addresses for every packet would be prohibitively slow. Hosts maintain an ARP cache (or ARP table) that stores recent mappings:
$ arp -a
? (192.168.1.1) at d4:e2:5a:1f:3c:88 [ether] on eth0
? (192.168.1.20) at bb:bb:bb:bb:bb:bb [ether] on eth0
Cached entries have a timeout (typically 20 minutes to 4 hours) and are refreshed when needed.
Neighbor Discovery Protocol (NDP) for IPv6:
IPv6 replaces ARP with ICMPv6 Neighbor Discovery:
NDP advantages over ARP:
ARP has no authentication—any device can claim any IP-to-MAC mapping. ARP spoofing/poisoning attacks exploit this to intercept traffic (man-in-the-middle) or cause denial of service. Mitigations include Dynamic ARP Inspection (DAI) on switches, static ARP entries for critical systems, and monitoring tools.
The true power of logical addressing becomes apparent when we examine how it enables efficient routing. The hierarchical structure of IP addresses is specifically designed to support scalable routing across the global Internet.
Prefix-Based Routing:
Routers don't store entries for every individual host—they match destination addresses against network prefixes:
Routing Table Entry:
Destination: 192.168.1.0/24
Next Hop: 10.0.0.2
Interface: eth1
Meaning: "Any address matching 192.168.1.x should be sent to 10.0.0.2 via eth1"
This single entry covers 254 possible hosts. A /16 prefix covers 65,534 hosts. Aggregation continues upward:
Route Aggregation Example:
| Level | Prefix | Coverage | Example Router |
|---|---|---|---|
| Host | 192.168.1.100/32 | 1 host | Host's own routing to self |
| Subnet | 192.168.1.0/24 | 254 hosts | LAN router |
| Organization | 192.168.0.0/16 | 65,534 hosts | Campus router |
| ISP Customer | 192.160.0.0/12 | ~1 million hosts | Regional ISP |
| RIR Allocation | 192.0.0.0/8 | ~16.7 million hosts | Backbone router |
Longest Prefix Matching:
When a packet arrives, the router may have multiple matching routes. It selects the most specific match (longest prefix):
Routing Table:
10.0.0.0/8 → Next hop A (matches 16.7M addresses)
10.45.0.0/16 → Next hop B (matches 65K addresses)
10.45.99.0/24 → Next hop C (matches 254 addresses)
0.0.0.0/0 → Default gateway (matches everything)
Destination: 10.45.99.50
Matches 10.0.0.0/8 (/8 prefix)
Matches 10.45.0.0/16 (/16 prefix)
Matches 10.45.99.0/24 (/24 prefix) ← SELECTED (longest match)
Matches 0.0.0.0/0 (/0 prefix)
Packet forwarded to Next hop C
Why Hierarchy Matters:
Scalability: The global Internet routing table has ~900,000 prefixes, not ~50 billion hosts. This is only possible because addresses aggregate hierarchically.
Stability: Changes in individual host addresses don't require global routing updates. Only prefix-level changes propagate.
Locality: Traffic destined for the same organization follows the same path until it reaches that organization's network.
Policy Enforcement: Network policies can be applied at prefix boundaries (entire organizations, regions, countries).
Before CIDR (1993), routing was based on Class A/B/C address classes, wasting enormous address space and preventing flexible aggregation. CIDR introduced variable-length subnet masks, enabling arbitrary prefix lengths and the aggregation that saved both IPv4 address space and routing table sizes from explosion.
Logical addressing is the foundation upon which all network layer functions are built. Without hierarchical, assignable, location-aware addresses, global routing would be impossible. Let's consolidate the key insights:
What's Next:
Logical addressing tells us where packets should go; routing tells us how to get them there. The next page explores routing—the mechanisms and algorithms that routers use to discover paths through the network and build the forwarding tables that direct packets hop-by-hop toward their destinations.
You now understand logical addressing—the cornerstone of network layer operation. IP addresses provide the hierarchical, topology-aware identifiers that enable routing decisions. IPv4's 32-bit addresses are exhausted; IPv6's 128-bit addresses provide effectively unlimited space. Address resolution protocols bridge logical and physical addressing. With this foundation, you're ready to explore how routing uses these addresses to determine paths through the network.