22 min read Network Addressing Lesson 3 (of 13)
Part 1 — Physical & Logical Network Foundations

Lesson 03 — How Computers Identify Each Other: MAC, IP & DHCP

Unambiguous Identity & Routing Across Billions of Global Endpoints

What We Will Master in This Lesson

By the end of this lesson, you will completely demystify network addressing and identity:

  • Why distinct network addressing layers are strictly required
  • What a MAC address is and where it is physically burned
  • What an IP address is and how logical routing functions
  • The fundamental engineering distinctions between MAC and IP
  • Why both IPv4 and IPv6 exist in the modern Internet
  • Private IP vs Public IP architectures and how NAT preserves address space
  • How DHCP automatically leases network configurations via DORA
  • The vital roles of Subnet Masks and Default Gateways
  • How an encapsulated data packet carries both local and global identities end-to-end

1 Starting With a Very Simple Question

Imagine you have four devices active in your home:

💻 Laptop
📱 Smartphone
📺 Smart TV
🖨️ Printer

All four connect wirelessly to the same Wi-Fi router. When you click "Print" on your laptop, radio signals fill the entire room.

"How does the laptop ensure that the print payload reaches only the printer, and not your Smart TV?"

Now scale this problem to a planetary level: Your laptop is in Dhaka; a YouTube streaming server is in Virginia. Out of 50 billion connected machines on Earth, how do packets find their exact destination?

The solution is Addressing. Just as human residences possess physical street addresses, postal codes, and passport identities, networking systems require unambiguous addressing. In computer networking, two fundamental address types work together:

1. MAC Address (Physical Hardware Identity) 2. IP Address (Logical Network Coordinate)

2 What is a MAC Address?

MAC stands for:

Media Access Control (MAC)

A globally unique 48-bit (6-byte) physical hardware identifier permanently burned into the read-only memory (ROM) of a Network Interface Card (NIC)—such as a Wi-Fi chip or Ethernet port—during factory manufacturing.

A MAC address is represented as six pairs of hexadecimal digits separated by colons or hyphens:

3C:52:82:7A:19:F1

The first 3 bytes (3C:52:82) constitute the **OUI** (Organizationally Unique Identifier) assigned by IEEE to the manufacturer (e.g., Apple, Intel), while the remaining 3 bytes (7A:19:F1) form the unique serial number of that specific silicon chip.

3 How Should You Conceptualize a MAC Address?

Consider this definitive analogy:

National ID / Fingerprint Analogy: Your national identity number or biometric fingerprint is tied to your physical body permanently. Whether you travel to Tokyo or relocate to London, your fingerprint never changes. Similarly, your laptop's Wi-Fi hardware MAC address remains constant wherever you take it.

Within your local home Wi-Fi network:

  • Laptop → MAC A (3C:52:82:7A:19:F1)
  • Smartphone → MAC B (A4:83:E7:2B:9C:04)
  • Printer → MAC C (00:1B:44:11:3A:B7)
  • Smart TV → MAC D (F0:18:98:C3:54:12)

Local switches use these MAC addresses to forward Layer-2 frames directly to the intended port.

4 Is the MAC Address the Internet Address?

No! This is the most crucial boundary in computer networking:

A MAC address never travels beyond the local network link onto the global Internet.

Why? Because MAC addresses possess zero hierarchical structure. They are distributed randomly across manufacturers worldwide. If global Internet routers attempted to forward packets using MAC addresses, every core router on Earth would need a routing table containing all 50 billion MAC addresses in memory—an engineering impossibility.

To traverse inter-network boundaries, we need a hierarchical, location-based logical address: the IP Address.

5 What is an IP Address?

IP stands for Internet Protocol.

An IP address is a logical network address indicating where a device is currently attached within the global network hierarchy:

IPv4 Address (32-bit): 192.168.1.20 (or Google Public DNS: 8.8.8.8)
IPv6 Address (128-bit): 2001:0db8:85a3:0000:0000:8a2e:0370:7334

When you pack your laptop and move from your home Wi-Fi to a coffee shop, your laptop's MAC address remains completely identical, but your IP address changes immediately to match the coffee shop's local network prefix!

6 The Fundamental Differences Between MAC and IP

MAC Address (Physical Identity)
  • • Permanently etched into hardware ROM
  • • Essential for Layer-2 local switches and Wi-Fi frames
  • • Static and non-routable across external networks
  • • 48-bit hexadecimal format
IP Address (Logical Location)
  • • Dynamically assigned upon network association
  • • Essential for Layer-3 routers forwarding across networks
  • • Dynamic and changes whenever you switch networks
  • • 32-bit (IPv4) or 128-bit (IPv6) format
"MAC tells the local network which physical interface is which.
IP helps identify where traffic should go across global networks."

7 Observing Your Home Network

Your home Wi-Fi router instantiates a private local subnet. Typically, the router assigns itself the first address:

192.168.1.1

It then distributes sequential addresses to internal endpoints:

Laptop: 192.168.1.20
Phone: 192.168.1.21
Smart TV: 192.168.1.22
Printer: 192.168.1.23

These are designated as Private IP Addresses.

8 What is a Private IP?

Under RFC 1918 standards, the Internet Assigned Numbers Authority (IANA) reserved three specific IPv4 blocks exclusively for private, internal networks:

Class A Private Block: 10.0.0.0 — 10.255.255.255 (/8)
Class B Private Block: 172.16.0.0 — 172.31.255.255 (/12)
Class C Private Block: 192.168.0.0 — 192.168.255.255 (/16)

These addresses are strictly non-routable on the public Internet. If your laptop's IP is 192.168.1.20, millions of households across the globe use that exact same address simultaneously without conflict, because each home is an isolated network boundary.

9 What is a Public IP?

When your router connects to your ISP's uplink, the ISP assigns it a globally unique coordinate on the public Internet called a Public IP Address:

203.0.113.25

Across the planetary Internet, this address identifies exclusively your router's WAN port. Remote servers (like Google or Netflix) never see your private 192.168.1.20 address; they only know and reply to your public IP.

10 Why Do We Need Both? The Power of NAT

IPv4 supports a maximum of 4.3 billion ($2^{32}$) addresses. With billions of mobile phones and IoT appliances active today, IPv4 would have completely collapsed in the late 1990s without an architectural savior:

NAT = Network Address Translation

Your home router acts as a translator. As packets leave your home, NAT replaces private internal IPs (192.168.1.x) with its single public IP, tracking connections using source port numbers. Thus, an entire household shares one single public IPv4 address!

11 What is DHCP?

Imagine if every time a friend entered your home, you had to open an administrative console and manually type subnet masks, gateways, and static IPs into their phone!

DHCP = Dynamic Host Configuration Protocol

The network management protocol that automatically provisions an entering client with an IP address, Subnet Mask, Default Gateway, and DNS server within milliseconds of Wi-Fi association.

12 How DHCP Works: The 4-Step DORA Sequence

The automatic negotiation occurs in four distinct protocol steps known as DORA:

1. Discover The new device broadcasts to the entire LAN (0.0.0.0 → 255.255.255.255): "Is there an active DHCP server? I need an IP lease!"
2. Offer The router replies unicast: "I have an available address: 192.168.1.20 with a 24-hour lease."
3. Request The client broadcasts formally: "I officially accept and request to bind to 192.168.1.20."
4. Acknowledge (ACK) The router registers the binding in its lease table: "Lease confirmed! You are now online."

13 What is a Default Gateway?

Your laptop has IP 192.168.1.20. You attempt to ping Google DNS at 8.8.8.8. The laptop verifies that 8.8.8.8 does not belong to your local subnet.

It automatically hands the packet to its configured Default Gateway:

Laptop (192.168.1.20) → Default Gateway (192.168.1.1) → Upstream ISP

In a home network, the Default Gateway is simply the internal IP of your home router.

14 Why is a Subnet Mask Necessary?

How does your operating system mathematically discern whether a target IP is on the same local switch or requires the gateway?

Subnet Mask Logic

A mask like 255.255.255.0 (or /24) splits an IP into two components: the Network ID (the neighborhood prefix) and the Host ID (the specific house number).

Laptop IP:  192.168.1.20
Printer IP: 192.168.1.23 → Network IDs match! (Local LAN Delivery)
Google IP:  8.8.8.8 → Network IDs differ! (Forward to Gateway)

15 Real-World Example: Local Printing vs Internet Browsing

1. Printing to Local Printer (192.168.1.23)
The laptop performs bitwise comparison and finds the printer in the same subnet. Using the ARP protocol, it resolves the printer's MAC address and transmits an Ethernet frame directly over Wi-Fi without involving the router's WAN uplink.
2. Requesting a Web Page (142.250.190.46)
The target is external. The laptop constructs an IP packet with Destination IP = 142.250.190.46, but encapsulates it in an Ethernet frame with Destination MAC = the Router's MAC address! The router un-encapsulates the frame, applies NAT, and forwards the packet onto the optical WAN link.

16 Peering Inside a Packet: Multi-Layer Encapsulation

The genius of network engineering lies in Layered Encapsulation:

+------------------------- Layer 2: Ethernet Frame -------------------------+
| Dest MAC: Router_MAC  |  Src MAC: Laptop_MAC                              |
|   +--------------------- Layer 3: IP Packet ----------------------+       |
|   | Dest IP: 142.250.190.46 (YouTube)  |  Src IP: 192.168.1.20   |       |
|   |   +----------------- Layer 4: TCP / Data -----------------+   |       |
|   |   | Port: 443 (HTTPS) | Payload Data: "GET /watch?v=..."  |   |       |
|   |   +-------------------------------------------------------+   |       |
|   +---------------------------------------------------------------+       |
+---------------------------------------------------------------------------+
Crucial Rule: As data traverses intermediate routers across continents, the MAC addresses change at every single hop (reflecting the local link), while the Source and Destination IP addresses remain constant end-to-end!

17 Why Two Types: IPv4 vs IPv6

IPv4 (Established 1981)
32-bit | ~4.29 Billion Addresses Global address pools are exhausted. IPv4 remains operational through aggressive Carrier-Grade NAT (CGNAT).
IPv6 (Standardized 1998)
128-bit | $3.4 \times 10^{38}$ Addresses Provides enough unique public IP addresses to assign trillions of addresses to every grain of sand on Earth.

18 The Relationship With DNS

Humans cannot memorize numeric IP coordinates like 142.250.190.46. We think in names: youtube.com.

Human Domain Name (youtube.com) → [ DNS Lookup ] → Machine IP Coordinate (142.250.190.46)

Domain names exist for human usability; IP addresses drive underlying routing engines.

19 Complete Home Network Topology

                          [ PUBLIC INTERNET ]
                                  │
                          Public IP: 203.0.113.25
                                  ▼
                        [ Home Wi-Fi Router ]
                       Gateway IP: 192.168.1.1
                       DHCP Server Enabled
                                  │
        ┌─────────────────────────┼─────────────────────────┐
        │                         │                         │
  [ Laptop ]                  [ Phone ]                 [ Smart TV ]
IP: 192.168.1.20          IP: 192.168.1.21          IP: 192.168.1.22
MAC: 3C:52:82:7A:19:F1    MAC: A4:83:E7:2B:9C:04    MAC: F0:18:98:C3:54:12

20 Key Conceptual Takeaways

MAC Address Permanent hardware identity of a network interface used on local links.
IP Address Hierarchical, dynamic logical coordinate used for routing packets across networks.
Private IP RFC 1918 reserved address space used exclusively inside private local networks.
Public IP Globally unique address routable on the public Internet backbone.
DHCP Dynamic Host Configuration Protocol; automatically leases IP configurations via DORA.
Subnet Mask Bitmask determining whether destination is local LAN or requires gateway routing.

21 What's Coming Next? Packets & Routing

We now understand who is who and where every device resides. But an essential mechanical mystery remains:

"How does a 1GB video actually travel through the wire? Does it move as a giant unbroken block, or is it sliced into millions of tiny packets?"

In Lesson 8.4, we will track a live data packet on its journey:

Your Laptop → Packet Slicing → Router Hops → BGP Routing → Reassembly
Hands-On Simulation Laboratory

Addressing, Subnet & DHCP Laboratory

Select a target destination to observe how your device determines local delivery vs gateway forwarding:

Client IP: 192.168.1.20
Subnet Mask: 255.255.255.0 (/24)
Default Gateway: 192.168.1.1
Bitwise Evaluation Result: Local LAN Delivery (Same Subnet)

Bitwise AND logic confirms 192.168.1.23 shares the exact network prefix (192.168.1.0/24). The frame is addressed to the printer's MAC address directly over local Wi-Fi. The router's external uplink is untouched.

Knowledge Check

Lesson 03 Quiz — Test Your Addressing Knowledge

1. What is the fundamental functional distinction between a MAC Address and an IP Address?

2. How does a computer determine whether an outbound packet should be delivered directly on the local LAN or forwarded to the Default Gateway?

3. What is the correct chronological sequence of the 4-step DHCP address leasing handshake?