IP Address
Every device on a network needs a unique address — its IP address. IP addresses are the foundation of all internet communication, allowing data to be routed to the correct destination.
Learning Objectives
- 11.6.2.4 Explain IP addressing
Conceptual Anchor
The Home Address Analogy
Your home has a postal address so mail can reach you. An IP address is the digital equivalent — it tells the network exactly which device should receive the data. Just like postal addresses follow a format (country, city, street, number), IP addresses follow a structured format too.
Rules & Theory
IPv4 vs IPv6
| Feature | IPv4 | IPv6 |
|---|---|---|
| Format | 4 numbers separated by dots | 8 groups of hexadecimal separated by colons |
| Example | 192.168.1.1 | 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
| Bits | 32 bits (4 × 8) | 128 bits (8 × 16) |
| Total addresses | ~4.3 billion | ~340 undecillion (3.4 × 10³⁸) |
| Each number range | 0–255 (8 bits per octet) | 0000–FFFF (16 bits per group) |
| Status | Running out of addresses | Virtually unlimited |
IPv4 Structure
192 . 168 . 1 . 25
─── ─── ─── ───
Octet1 Octet2 Octet3 Octet4
(8 bits each = 32 bits total)
Each octet: 0–255 (binary: 00000000 – 11111111)
Example in binary:
192.168.1.25 = 11000000.10101000.00000001.00011001Public vs Private IP
| Feature | Public IP | Private IP |
|---|---|---|
| Visibility | Visible on the internet | Only visible within local network |
| Assigned by | ISP (Internet Service Provider) | Router (via DHCP) |
| Unique | Globally unique | Unique only within LAN |
| Example | 203.0.113.42 | 192.168.1.5 |
Private IP Ranges (IPv4)
| Class | Range | Usage |
|---|---|---|
| A | 10.0.0.0 – 10.255.255.255 | Large organizations |
| B | 172.16.0.0 – 172.31.255.255 | Medium organizations |
| C | 192.168.0.0 – 192.168.255.255 | Home/small office networks |
Static vs Dynamic IP
| Feature | Static IP | Dynamic IP |
|---|---|---|
| Assignment | Manually configured, never changes | Assigned automatically by DHCP, may change |
| Use case | Servers, printers, routers | Regular devices (laptops, phones) |
| Management | More work to manage | Automatic, no manual setup |
| Cost | More expensive (ISP charges more) | Standard/free |
NAT (Network Address Translation)
Your home router uses NAT to share one public IP address among all your devices. Each device gets a private IP (192.168.x.x), and the router translates between private and public addresses. This is why we haven't completely run out of IPv4 addresses yet.
Worked Examples
1 Is This IP Valid?
| Address | Valid? | Reason |
|---|---|---|
| 192.168.1.1 | ✅ Yes | All octets 0–255 |
| 256.1.1.1 | ❌ No | 256 > 255 (max per octet) |
| 10.0.0.0 | ✅ Yes | Valid private IP (Class A) |
| 192.168.1 | ❌ No | Only 3 octets (need 4) |
| 0.0.0.0 | ✅ Yes | Special address (represents "all interfaces") |
Common Pitfalls
IP Address = MAC Address
IP is a logical address that can change (Layer 3). MAC is a physical hardware address burned into the NIC that never changes (Layer 2). Both are needed for network communication but serve different purposes.
IPv4 Octet Values
Each octet is 8 bits, so the maximum value is 255 (2⁸ - 1), not 256. An address like 300.1.1.1 is invalid.
Tasks
State the difference between IPv4 and IPv6. How many bits does each use?
Explain why IPv6 was created. Why isn't IPv4 sufficient for the future?
Convert the IPv4 address 172.16.0.1 to binary.
Explain how NAT helps conserve IPv4 addresses. Draw a diagram showing a router using NAT with 3 devices.
Self-Check Quiz
Q1: How many bits are in an IPv4 address?
Q2: Is 192.168.1.100 a public or private IP address?
Q3: What protocol automatically assigns IP addresses?