IP Addresses
The unique address of every device on the Internet
What Is an IP Address?
Every device connected to the Internet has an address.
This address is called an IP Address.
Why Do We Need IP Addresses?
Just like homes need postal addresses, devices need network addresses.
Without addresses: data would not know where to go.
Example
Home Address
- House 10
- Kathmandu
- Nepal
Internet Address
192.168.1.1- or
103.45.22.7
Purpose
IP addresses help:
- • Identify devices
- • Deliver data
- • Route Internet traffic
Interactive Diagram
Launch the interactive diagram to explore how IP addresses work.
Open Interactive DiagramStep-by-Step Walkthrough
google.com.142.250.193.14.Introduction: Why Every Device Needs a Unique Address
In the previous chapter, we learned that data is broken into packets. But how does each packet know exactly where to go? The answer lies in the IP address — a unique numeric label assigned to every device connected to the Internet.
Without IP addresses, packets would wander aimlessly like letters with no address on the envelope. IP addresses make it possible for routers to forward data across the globe with pinpoint accuracy.
In this chapter, we will explore what IP addresses look like, the difference between IPv4 and IPv6, how devices get their addresses, and why the world is gradually transitioning to IPv6.
How It Works
Deeper Dive
Imagine your house has a street address so the mail carrier knows where to deliver letters. That address is unique — no other house in the world has the exact same address.
Now imagine your tablet, phone, laptop, and game console each need their own mailbox. On the Internet, every device gets its own special number called an IP address.
When you ask for a website, your device puts its IP address on the request packet — like writing a return address on an envelope. The website sends the response back to that address. And that is how your screen fills with the right content, not someone else's!
IP Addresses for Intermediate Learners
An IP address is a unique identifier that allows devices to find and communicate with each other on a network. There are two main versions in use today:
IPv4 (Version 4)
Uses 32-bit addresses written as four numbers separated by dots: 192.168.1.1. Each number ranges from 0 to 255. Provides about 4.3 billion unique addresses.
IPv6 (Version 6)
Uses 128-bit addresses written in hexadecimal: 2001:db8::ff00:42:8329. Provides 340 undecillion addresses — enough for every device on Earth many times over.
Devices get IP addresses in two ways:
- Static: Manually assigned and never changes (used for servers).
- Dynamic (DHCP): Automatically assigned by a router when you connect. Your phone gets a new "lease" each time it joins a Wi-Fi network.
Most home networks use a router that performs NAT (Network Address Translation), allowing many devices to share one public IP address.
IP Addressing: A Technical Deep Dive
An IP address operates at Layer 3 (Network Layer) of the OSI model. It serves two primary functions: network interface identification and location addressing.
IPv4 Structure: 32-bit number, typically written in dotted decimal notation (e.g., 203.0.113.42). Each octet represents 8 bits. The address is divided into a network portion and a host portion, determined by the subnet mask.
Subnetting: A subnet mask (e.g., 255.255.255.0 or /24) separates the network ID from the host ID. This allows networks to be divided into smaller subnetworks for efficient routing and management.
IPv6 Structure: 128-bit number written as eight groups of four hexadecimal digits (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Leading zeros can be omitted, and consecutive zero groups can be replaced with :: (once). IPv6 eliminates the need for NAT and provides built-in IPSec support.
Special Addresses:
127.0.0.1— Localhost (loopback), points back to your own device.10.0.0.0/8,172.16.0.0/12,192.168.0.0/16— Private (RFC 1918) addresses, not routable on the public Internet.169.254.0.0/16— APIPA (Automatic Private IP Addressing), used when DHCP fails.0.0.0.0— Default route, represents "all networks."
Advanced
At a deeper level, ip addresses involves rules and patterns that engineers use worldwide. IP Address follows standards so different brands and devices can still work together. That is why your phone, school laptop, and game console can all connect to the same network or use the same apps.
IPv4 does not happen in a straight line. Systems often use backup paths, error checking, and retries so information arrives correctly. When something fails, smart IPv6 design helps the system recover instead of shutting down completely.
Scientists and engineers keep improving these systems every year — making them faster, safer, and more energy-efficient. The ideas you learn in this chapter are the same building blocks used in real data centers, robots, apps, and websites around the world.
Vocabulary Table
| Term | Definition |
|---|---|
| IP Address | A unique numeric identifier assigned to each device on a network. |
| IPv4 | Internet Protocol version 4, using 32-bit addresses. |
| IPv6 | Internet Protocol version 6, using 128-bit addresses to replace IPv4. |
| Subnet Mask | A number that separates the network and host portions of an IP address. |
| DHCP | Dynamic Host Configuration Protocol — automatically assigns IP addresses to devices. |
| NAT | Network Address Translation — maps private IPs to a public IP for Internet access. |
| Loopback | Address 127.0.0.1 used to test network software locally. |
| Default Gateway | The router that connects a local network to the Internet. |
| DNS | Domain Name System — translates domain names into IP addresses. |
| Public IP | An IP address that is globally routable on the Internet. |
Fun Facts About IP Addresses
4.3 billion
That is how many IPv4 addresses exist. We ran out in 2011. That is why IPv6 was created.
340 undecillion
IPv6 can provide 340,282,366,920,938,463,463,374,607,431,768,211,456 addresses. That is enough for every grain of sand on Earth.
Your IP changes
Most home users get a dynamic public IP from their ISP. It can change every time the router restarts.
You can find yours
Visit whatismyip.com or ask a search engine "what is my IP" to see your public IP address right now.
Common Misconceptions
An IP address never changes
Most home IPs are dynamic and change periodically. Only static IPs (usually for servers) are permanent.
My IP address reveals my exact location
A public IP can usually identify your city or region, but not your exact street address or home. Geolocation databases are approximate.
IPv4 and IPv6 are compatible
They are not directly compatible. IPv6-only devices cannot reach IPv4-only websites without translation gateways (like NAT64).
Every device needs a unique public IP
With NAT, multiple devices on a home network share a single public IP. Private IPs (like 192.168.x.x) are used internally.
Knowledge Check
Test your understanding of IP addresses.
1. What does IP stand for?
Show answer
Internet Protocol.
2. How many bits are in an IPv4 address?
Show answer
32 bits.
3. Which protocol automatically assigns IP addresses to devices on a network?
Show answer
DHCP (Dynamic Host Configuration Protocol).
4. True or False: IPv6 was created because we ran out of IPv4 addresses.
Show answer
True. The IPv4 address pool was exhausted in 2011.
5. True or False: The IP address 127.0.0.1 refers to your own computer.
Show answer
True. 127.0.0.1 is the loopback address (localhost).
6. Matching: Connect each term to its description.
7. Fill in the blank: A __________ mask separates the network and host parts of an IP address.
Show answer
Subnet.
8. Fill in the blank: __________ translates domain names like google.com into IP addresses.
Show answer
DNS (Domain Name System).
Critical Thinking Questions
1. The Address Shortage
We have run out of IPv4 addresses. What technologies (NAT, IPv6, carrier-grade NAT) help solve this problem? What are the trade-offs of each approach, especially for peer-to-peer applications like gaming or video calls?
2. Privacy and Tracking
Your IP address can reveal your approximate location and Internet service provider. How does this affect your privacy online? What tools (VPNs, proxies, Tor) can hide your IP, and how do they work?
3. The Future of IPv6
Many Internet services still use IPv4. Why is the transition to IPv6 so slow? What would happen if the world suddenly switched off IPv4 tomorrow? Research what "dual stack" means and why it is the current common approach.
Mini Projects
Activity 1: Find Your IP Addresses
Open a terminal and run ipconfig (Windows) or ifconfig (macOS/Linux). Find your private IP address, subnet mask, and default gateway. Then visit a website to find your public IP. Compare the two. Why are they different?
Activity 2: Subnet Calculator
Using an online subnet calculator, experiment with different subnet masks. Start with 192.168.1.0/24 — how many usable host addresses does it provide? Try /16 and /28. Write down the network address, broadcast address, and usable range for each.
Teacher Notes
Learning Objectives
- Define an IP address and explain its role in network communication.
- Distinguish between IPv4 and IPv6 formats and address spaces.
- Explain how DHCP assigns IP addresses dynamically.
- Describe NAT and its role in conserving IPv4 addresses.
- Understand subnet masks and how they divide networks.
Preparation
- Ensure the interactive diagram at
diagrams/diagram-06-ip-address/is deployed and tested. - Verify
ipconfig/ifconfigis available on classroom computers. - Prepare a subnet calculator link or worksheet for the mini project.
- Check that whatismyip.com or similar is accessible from the classroom network.
Discussion Prompts
- Why does the Internet need both names (domains) and numbers (IPs)?
- What would happen if your phone kept the same IP address everywhere you went?
- How does a VPN change your apparent IP address?
- Why might an ISP assign dynamic IPs instead of static ones?
