Why Do Devices Need Addresses?
Think about the postal system. Every house has a unique address so that letters and parcels can be delivered to the correct location. Without addresses, the postal service would have no way of knowing where to send your mail. Computer networks face exactly the same problem — when one device wants to send data to another, it needs a way to identify the destination. This is where IP addresses and MAC addresses come in.
Every device connected to a network — your phone, laptop, smart TV, games console, even your smart fridge — needs at least one unique identifier so that data can be routed to it correctly. In fact, most devices have two types of address: an IP address for communication across networks (like the internet), and a MAC address for communication within a local network.
In this topic you will learn:
- What an IP address is and why it is needed
- The difference between IPv4 and IPv6
- Static vs dynamic IP addresses and when each is used
- Public vs private IP addresses and how NAT connects them
- What a MAC address is and how it differs from an IP address
- How IP and MAC addresses work together to deliver data
IPv4 — Internet Protocol Version 4
The most widely used version of IP addresses is IPv4 (Internet Protocol version 4). IPv4 has been the backbone of internet addressing since the 1980s, and the vast majority of internet traffic still uses it today.
How IPv4 Addresses Work
An IPv4 address is a 32-bit number. This means it is made up of 32 binary digits (ones and zeros). However, writing out 32 bits every time would be impractical for humans, so IPv4 addresses are displayed in a more readable format called dotted decimal notation.
In dotted decimal notation, the 32 bits are divided into four groups of 8 bits. Each group of 8 bits is called an octet. Each octet is converted from binary to a decimal number between 0 and 255, and the four octets are separated by dots (full stops).
Binary: 11000000 . 10101000 . 00000001 . 00000001
Decimal: 192 . 168 . 1 . 1
Format: [octet1] . [octet2] . [octet3] . [octet4]
Range: 0-255 . 0-255 . 0-255 . 0-255
Examples: 192.168.1.1 (common home router address)
10.0.0.5 (private network address)
8.8.8.8 (Google's public DNS server)
172.16.0.1 (private network address)
The IPv4 Exhaustion Problem
Because IPv4 uses 32 bits, the total number of possible unique addresses is 232 = approximately 4.3 billion addresses. When IPv4 was designed in the early 1980s, 4.3 billion seemed more than enough — the internet was a small research network with only a few hundred computers. Nobody imagined that billions of smartphones, tablets, laptops, servers, smart devices, and IoT sensors would all need unique addresses.
Today, with over 15 billion internet-connected devices worldwide, we have essentially run out of IPv4 addresses. The last blocks of IPv4 addresses were allocated in 2011. This shortage is known as IPv4 address exhaustion, and it is the primary reason IPv6 was developed.
IPv6 — Internet Protocol Version 6
IPv6 was created specifically to solve the IPv4 address exhaustion problem. It uses a vastly larger address space that can accommodate the growth of the internet for the foreseeable future.
How IPv6 Addresses Work
An IPv6 address is a 128-bit number — four times the length of an IPv4 address. It is written as eight groups of four hexadecimal digits, separated by colons.
Format: [group1]:[group2]:[group3]:[group4]:[group5]:[group6]:[group7]:[group8]
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Each group: 4 hexadecimal digits (0000 to ffff)
Total: 8 groups x 4 hex digits = 32 hex digits = 128 bits
Simplified: 2001:db8:85a3::8a2e:370:7334
(Leading zeros in each group can be omitted.
Consecutive groups of all zeros can be replaced with ::)
The Scale of IPv6
With 128 bits, IPv6 provides 2128 possible addresses. That is approximately 340 undecillion (340,282,366,920,938,463,463,374,607,431,768,211,456) unique addresses. To put this in perspective, there are enough IPv6 addresses to assign billions of addresses to every grain of sand on Earth. For all practical purposes, IPv6 provides an effectively unlimited supply of addresses.
Why Is IPv6 Adoption Slow?
Despite its advantages, IPv6 adoption has been gradual. Many existing systems and devices only support IPv4, and transitioning an entire network to IPv6 requires significant investment. Technologies like NAT (Network Address Translation) have helped extend the life of IPv4 by allowing many devices to share a single public IPv4 address. However, IPv6 adoption continues to grow steadily, and major companies like Google, Facebook, and Amazon fully support it.
IPv4 vs IPv6 Comparison
This table summarises the key differences between IPv4 and IPv6. You should be able to describe these differences clearly in the exam.
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Format | 4 octets in dotted decimal (e.g., 192.168.1.1) | 8 groups of 4 hex digits separated by colons (e.g., 2001:0db8:85a3::8a2e:0370:7334) |
| Address space | ~4.3 billion (232) addresses | ~340 undecillion (2128) addresses |
| Status | Addresses exhausted; still widely used | Adoption growing; effectively unlimited supply |
| Example | 192.168.1.1 | 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
| Notation | Decimal numbers separated by dots | Hexadecimal numbers separated by colons |
| NAT required? | Often needed to conserve addresses | Not needed — enough addresses for every device |
Static vs Dynamic IP Addresses
IP addresses can be assigned to devices in two different ways: statically (permanently) or dynamically (temporarily). The method used depends on the purpose of the device and the needs of the network.
Static IP Addresses
A static IP address is one that is permanently assigned to a device. It never changes, regardless of how many times the device connects or disconnects from the network. Static IPs are manually configured by a network administrator.
Devices that typically use static IP addresses:
- Web servers: A website needs a consistent address so that users (and DNS servers) can always find it
- Email servers: Must be reachable at the same address for reliable mail delivery
- Network printers: So that all computers on the network can always locate the printer
- Routers and gateways: Need a fixed address as the “default gateway” for all devices on the network
Dynamic IP Addresses
A dynamic IP address is one that is automatically assigned to a device each time it connects to the network. The address may change each time the device reconnects. Dynamic IPs are assigned by a DHCP server (Dynamic Host Configuration Protocol).
How DHCP works: When a device connects to a network, it sends a request to the DHCP server. The DHCP server selects an available IP address from its pool of addresses and “leases” it to the device for a set period of time. When the lease expires (or the device disconnects), the address is returned to the pool and can be assigned to a different device.
Devices that typically use dynamic IP addresses:
- Smartphones and tablets: Connect and disconnect frequently from different networks
- Laptops: Move between home, school, and public Wi-Fi networks
- Desktop computers: In most home networks, desktops receive dynamic addresses
- IoT devices: Smart home devices on a home network
Advantages and Disadvantages
| Type | Advantages | Disadvantages |
|---|---|---|
| Static IP |
|
|
| Dynamic IP |
|
|
Public vs Private IP Addresses
Not all IP addresses are the same. There is an important distinction between public and private IP addresses, and understanding this difference is essential for GCSE Computer Science.
Public IP Addresses
A public IP address is an address that is unique across the entire internet. It is assigned to your network by your ISP (Internet Service Provider) and is used to identify your network on the global internet. No two devices on the internet can have the same public IP address at the same time.
When you visit a website, the web server sees your public IP address as the “return address” for sending the web page data back to you. Your home router typically has one public IP address that represents your entire household on the internet.
Private IP Addresses
A private IP address is an address used within a local area network (LAN) only. Private addresses are not routable on the internet — they cannot be used to communicate directly with devices outside the local network. Multiple different local networks around the world can use the same private address ranges without conflict, because these addresses are never exposed to the public internet.
The following address ranges are reserved for private use:
| Range | From | To | Common Use |
|---|---|---|---|
| 10.x.x.x | 10.0.0.0 | 10.255.255.255 | Large organisations and corporate networks |
| 172.16.x.x – 172.31.x.x | 172.16.0.0 | 172.31.255.255 | Medium-sized networks |
| 192.168.x.x | 192.168.0.0 | 192.168.255.255 | Home and small office networks |
NAT — Network Address Translation
If private IP addresses cannot be used on the internet, how do devices on a home network access websites and online services? The answer is NAT (Network Address Translation).
NAT is performed by the router. When a device on the local network (e.g., 192.168.1.5) sends data to the internet, the router replaces the private source IP address with its own public IP address before forwarding the data. When the response comes back, the router translates the public address back to the correct private address and delivers the data to the right device. This allows many devices to share a single public IP address.
Your Phone (192.168.1.5) ---+
|
Your Laptop (192.168.1.10) --+---> Router ---> Internet ---> Web Server
| (NAT) (203.0.113.50)
Smart TV (192.168.1.15) ---+ Public IP:
86.42.7.201
Outgoing: Router replaces 192.168.1.5 with 86.42.7.201
Incoming: Router replaces 86.42.7.201 with 192.168.1.5
The web server only sees 86.42.7.201 -- it never sees the
private addresses. All three devices share one public IP.
MAC Addresses
While IP addresses identify devices at the network layer (for routing across networks), MAC addresses identify devices at the data link layer (also called the Network Access layer in the TCP/IP model). A MAC address is used to deliver data to the correct device within a local network.
What Is a MAC Address?
A MAC address (Media Access Control address) is a 48-bit unique identifier that is permanently burned into the hardware of a device’s NIC (Network Interface Card) by the manufacturer during production. Every NIC in the world — whether it is a Wi-Fi adapter, an Ethernet port, or a Bluetooth chip — has a unique MAC address assigned at the factory.
MAC Address Format
A MAC address is written as six pairs of hexadecimal digits, separated by colons (or sometimes hyphens). Each pair represents one byte (8 bits), giving a total of 48 bits.
Format: XX:XX:XX:YY:YY:YY
| | | |
+---+---+ +---+---+
| |
OUI Device
(manufacturer) (serial)
Example: A1:B2:C3:D4:E5:F6
First 3 pairs (A1:B2:C3) = OUI (Organisationally Unique Identifier)
- Identifies the MANUFACTURER (e.g., Apple, Intel, Samsung)
- Assigned by the IEEE (Institute of Electrical and Electronics Engineers)
Last 3 pairs (D4:E5:F6) = Device Identifier
- A unique serial number for that specific device
- Assigned by the manufacturer
Total combinations: 2^48 = 281,474,976,710,656 (over 281 trillion)
Key Properties of MAC Addresses
- Permanent: Burned into the hardware at manufacture — cannot normally be changed (though some advanced software can “spoof” a MAC address temporarily)
- Globally unique: No two NICs in the world should have the same MAC address
- Local scope: Used only within the local network (LAN) — MAC addresses are not used for routing across the internet
- Hardware-level: Operates at the Data Link / Network Access layer of the TCP/IP model
- Device-specific: A laptop with both Wi-Fi and Ethernet has two different MAC addresses (one per NIC)
How MAC Addresses Are Used
When data arrives at a local network, it needs to be delivered to the correct device on that network. The router knows the destination IP address, but to physically deliver the data to the right NIC on the local network, it needs the MAC address. The ARP (Address Resolution Protocol) is used to map IP addresses to MAC addresses within a LAN. The router broadcasts an ARP request asking “Who has IP address 192.168.1.5?” and the device with that IP responds with its MAC address.
IP Address vs MAC Address Comparison
Understanding the differences between IP and MAC addresses is a frequently tested topic. This table provides a clear comparison.
| Feature | IP Address | MAC Address |
|---|---|---|
| OSI / TCP/IP layer | Network layer (Layer 3) / Internet layer | Data Link layer (Layer 2) / Network Access layer |
| Scope | Global — used to route data across networks and the internet | Local — used to deliver data within a single LAN |
| Format | IPv4: 4 octets in decimal (e.g., 192.168.1.1) IPv6: 8 groups of 4 hex digits (e.g., 2001:0db8::1) |
6 pairs of hex digits (e.g., A1:B2:C3:D4:E5:F6) |
| Length | 32 bits (IPv4) or 128 bits (IPv6) | 48 bits |
| Assignment | Assigned by software — configured manually (static) or by DHCP (dynamic) | Assigned by hardware — burned into the NIC at manufacture |
| Changeable? | Yes — can change when connecting to different networks or by reconfiguration | No — permanently set in hardware (though can be temporarily spoofed) |
| Used by | Routers (to forward packets across networks) | Switches (to forward frames within a local network) |
| Analogy | A postal address (where you live, can change if you move) | A person’s name (permanently identifies you) |
Test Your Knowledge
Try these interactive exercises to check your understanding of IP and MAC addresses. Read each question carefully and think about your answer before clicking.
Exercise 1: IP or MAC? Address Identifier
Look at the address shown below and identify whether it is an IPv4, IPv6, or MAC address.
Exercise 2: IP Address Concepts Quiz
Test your knowledge of IP addressing concepts including static/dynamic, public/private, IPv4/IPv6, and MAC addresses.
Exercise 3: True or False
Read each statement about IP and MAC addresses and decide whether it is True or False.
Practice Questions
Click on each question to reveal the answer. Try to answer in your head or on paper first before checking!
Answer: An IP address (Internet Protocol address) is a unique numerical identifier assigned to every device connected to a network. Its purpose is to identify the device on the network so that data can be routed to the correct destination. It functions like a postal address for computers — just as a letter needs a delivery address and a return address, every data packet needs a source IP and destination IP address so that routers know where to forward it and the recipient knows where to send a reply. IP addresses work at the Network layer (Internet layer in the TCP/IP model).
Answer: Difference 1 — Address length: IPv4 addresses are 32 bits long, providing approximately 4.3 billion unique addresses. IPv6 addresses are 128 bits long, providing approximately 340 undecillion unique addresses (effectively unlimited). Difference 2 — Format: IPv4 addresses are written as four decimal numbers (octets) separated by dots, e.g., 192.168.1.1. IPv6 addresses are written as eight groups of four hexadecimal digits separated by colons, e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334. IPv6 was developed because IPv4’s address space has been exhausted.
Answer: A static IP address is permanently assigned to a device and never changes. It is configured manually by a network administrator. Example: a web server needs a static IP so that it can always be found at the same address. A dynamic IP address is automatically assigned by a DHCP server each time a device connects to the network. The address may change between connections. Example: a smartphone connecting to Wi-Fi receives a dynamic IP because it does not need to be at a fixed address. Dynamic addressing is more efficient because addresses from the pool are only used while a device is connected.
Answer: A public IP address is globally unique and is used to identify a device (or network) on the internet. It is assigned by the ISP. A private IP address is used within a local area network (LAN) only and is not routable on the internet. Multiple networks around the world can reuse the same private address ranges without conflict. One reserved private range is 192.168.0.0 to 192.168.255.255 (commonly written as 192.168.x.x). Other ranges include 10.x.x.x and 172.16.x.x to 172.31.x.x. NAT (Network Address Translation) is used by the router to translate between private and public addresses.
Answer: A MAC address (Media Access Control address) is a 48-bit unique identifier that is permanently burned into the hardware of a device’s Network Interface Card (NIC) by the manufacturer. It is written as six pairs of hexadecimal digits separated by colons (e.g., A1:B2:C3:D4:E5:F6). The first three pairs identify the manufacturer (OUI) and the last three are a unique device serial. It differs from an IP address in several ways: (1) a MAC address is permanent (set in hardware) while an IP address can change; (2) a MAC address operates at the Data Link layer for local delivery, while an IP address operates at the Network layer for routing across networks; (3) MAC addresses are used within a LAN, while IP addresses are used across the internet.
Answer: NAT (Network Address Translation) is a technique performed by a router that translates between private IP addresses (used within a LAN) and the public IP address (used on the internet). When a device on a local network (e.g., 192.168.1.5) sends data to the internet, the router replaces the private source IP with its own public IP address. When the response returns, the router translates the public address back to the correct private address. NAT is needed because: (1) private IP addresses are not routable on the internet, so they must be translated to a public address; (2) it allows many devices to share a single public IP address, which helps conserve the limited supply of IPv4 addresses; (3) it provides a degree of security by hiding internal network addresses from the internet.
Answer: The 3 servers should use static IP addresses because they need to be reliably reachable at the same address at all times. Other devices and users on the network need to know the server’s address to connect to shared files, printers, databases, or web services. If a server’s IP changed, clients would lose their connection. The 50 desktop computers should use dynamic IP addresses assigned by a DHCP server because: (1) it would be impractical and time-consuming to manually configure 50 static addresses; (2) dynamic addressing is more efficient — if some desktops are not in use, their addresses can be reassigned; (3) DHCP makes it easy to add new computers or change network settings centrally without touching each machine individually.
Answer: The OUI is the first three pairs: 3C:22:FB. OUI stands for Organisationally Unique Identifier and it identifies the manufacturer of the network interface card. It is assigned by the IEEE (Institute of Electrical and Electronics Engineers). The remaining three pairs (91:A0:77) are a unique serial number assigned by that manufacturer to this specific device. One key property of MAC addresses is that they are permanent — the address is burned into the NIC hardware during manufacture and does not change when the device connects to different networks. Unlike IP addresses, which can be reassigned, a MAC address stays the same throughout the device’s lifetime.
Key Vocabulary
This table summarises the essential terms for this topic. Use it for revision and to check your understanding.
| Term | Definition |
|---|---|
| IP address | A unique numerical identifier assigned to a device on a network, used to route data to the correct destination across networks and the internet |
| IPv4 | Internet Protocol version 4 — uses 32-bit addresses written as four decimal octets separated by dots (e.g., 192.168.1.1), providing approximately 4.3 billion addresses |
| IPv6 | Internet Protocol version 6 — uses 128-bit addresses written as eight groups of four hex digits separated by colons, providing an effectively unlimited address space |
| Octet | A group of 8 bits. In IPv4, the 32-bit address is divided into four octets, each representing a decimal value from 0 to 255 |
| Static IP address | An IP address that is permanently and manually assigned to a device; it does not change between connections |
| Dynamic IP address | An IP address that is automatically assigned by a DHCP server each time a device connects; it may change between connections |
| DHCP | Dynamic Host Configuration Protocol — a protocol that automatically assigns IP addresses to devices from a pool of available addresses |
| Public IP address | A globally unique IP address assigned by an ISP, used to identify a device or network on the internet |
| Private IP address | An IP address used within a LAN only, not routable on the internet (ranges: 10.x.x.x, 172.16-31.x.x, 192.168.x.x) |
| NAT | Network Address Translation — a technique used by routers to translate between private IP addresses on a LAN and the public IP used on the internet |
| MAC address | Media Access Control address — a 48-bit hardware identifier burned into a device’s NIC by the manufacturer, written as six pairs of hex digits (e.g., A1:B2:C3:D4:E5:F6) |
| NIC | Network Interface Card — the hardware component in a device that enables it to connect to a network (e.g., Wi-Fi adapter, Ethernet port) |
| OUI | Organisationally Unique Identifier — the first three pairs of a MAC address, identifying the manufacturer of the NIC |
| ARP | Address Resolution Protocol — used to map IP addresses to MAC addresses within a local network so data can be delivered to the correct device |
| ISP | Internet Service Provider — a company that provides internet access and assigns public IP addresses to customers |
| IPv4 exhaustion | The depletion of available IPv4 addresses, caused by the massive growth of internet-connected devices beyond the 4.3 billion address limit |
How to Succeed in the Exam
Past Paper Questions
Try these exam-style questions, then click to reveal the mark scheme answer.
Explain the difference between an IP address and a MAC address. [4] marks
Mark scheme:
- IP address is a logical address assigned by the network (1)
- IP address can change when connecting to different networks (1)
- MAC address is a physical address permanently assigned to the network interface card (NIC) by the manufacturer (1)
- MAC address cannot be changed (1)
Explain one difference between IPv4 and IPv6 addressing. [2] marks
Mark scheme:
- IPv4 uses 32 bits / provides approximately 4.3 billion addresses (1)
- IPv6 uses 128 bits / provides a vastly larger number of addresses to accommodate the growing number of internet-connected devices (1)
IP and MAC Addresses in Your Daily Life
Now that you understand IP and MAC addresses, you can appreciate the invisible system of identification that makes every online activity possible. Consider these everyday scenarios:
- Connecting to Wi-Fi: When you connect your phone to the school’s Wi-Fi, a DHCP server assigns your phone a dynamic private IP address (like 192.168.10.45). Your phone’s MAC address (permanently set in its Wi-Fi chip) is used by the switch to deliver data to your specific device on the local network. If you go home and connect to your home Wi-Fi, you get a different IP address, but your MAC address stays the same.
- Browsing the web: When you visit a website, your request travels from your device (private IP), through your router (which uses NAT to swap in its public IP), across the internet (routed using IP addresses), and arrives at the web server (which has a static public IP). The response takes the reverse journey. At each local network hop, MAC addresses ensure the data reaches the right physical device.
- Gaming online: Game servers have static public IP addresses so millions of players can connect to them reliably. Your console or PC uses a dynamic private IP at home. NAT on your router handles the translation, which is why you sometimes need to configure “port forwarding” for certain games — this tells NAT which private device should receive incoming game traffic.
- The future with IPv6: As more devices come online — smart watches, smart speakers, connected cars, industrial sensors — IPv6 will become increasingly essential. With IPv6, every device could have its own globally unique address, potentially eliminating the need for NAT entirely. You are living through this transition right now.
Challenge yourself: On your home computer, try opening the command prompt (Windows) or terminal (Mac/Linux) and typing ipconfig (Windows) or ifconfig (Mac/Linux). Can you find your device’s private IP address and MAC address? Can you identify which private address range your home network uses? Try visiting a website like “whatismyipaddress.com” to see your public IP — notice how it is different from your private IP. This is NAT in action!