🔒
Pro Content
Subscribe to access all 69 OCR H446 A Level lessons.
£7.99/month
or £59/year
Subscribe now →
🔒 Pro · Component 1 · 1.3.4 The Internet
1.3.4b IP Addressing: IPv4 and IPv6
OCR H446 · A Level Computer Science · ~14 min read
Notes
Video
Slides
Worksheet
Quiz

What is an IP Address?

An IP address (Internet Protocol address) is a unique numerical label assigned to every device connected to a network that uses the Internet Protocol. It serves two purposes: identification (which device is it?) and location addressing (where is it so packets can be routed there?).

Every device communicating over the internet must have an IP address. Routers use IP addresses to forward packets to the correct destination across the global network of networks.

IPv4 — Internet Protocol Version 4

IPv4 is the original and still dominant internet addressing system. An IPv4 address is 32 bits long, written as four octets (8-bit groups) in dotted decimal notation, separated by dots.

192.168.1.1 = 11000000.10101000.00000001.00000001

Each octet ranges from 0 to 255 (8 bits = 2⁸ = 256 values). Total IPv4 address space: 2³² = ~4.3 billion addresses.

IPv4 Address Classes (Historical)

ClassFirst Octet RangeDefault SubnetUse
A1 – 126255.0.0.0 (/8)Large organisations
B128 – 191255.255.0.0 (/16)Medium networks
C192 – 223255.255.255.0 (/24)Small networks
D224 – 239N/AMulticast
E240 – 255N/AReserved/experimental

Private (Non-Routable) IPv4 Address Ranges

These ranges are reserved for use within private networks (LANs) and are NOT routed over the public internet:

RangeSubnetAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

Private addresses allow many devices in a LAN to share a single public IP via NAT (Network Address Translation).

IPv4 Exhaustion and NAT

With only ~4.3 billion addresses and billions of internet-connected devices, IPv4 addresses were exhausted. IANA (Internet Assigned Numbers Authority) allocated the last IPv4 blocks to regional registries in 2011.

NAT (Network Address Translation) was introduced as a workaround: a router holds one public IP address but translates internal private addresses for outgoing traffic, allowing many devices to share a single public IP.

However, NAT is a workaround, not a long-term solution — it breaks end-to-end connectivity and complicates peer-to-peer communication. The real solution is IPv6.

IPv6 — Internet Protocol Version 6

IPv6 is the successor to IPv4, designed to solve address exhaustion. An IPv6 address is 128 bits long, written as eight groups of four hexadecimal digits, separated by colons:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Total IPv6 address space: 2¹²⁸ = ~340 undecillion addresses (~3.4 × 10³⁸) — enough to assign billions of addresses to every person on Earth.

IPv6 Abbreviation Rules

  • Leading zeros in a group can be omitted: 0db8db8
  • One consecutive group of all-zero groups can be replaced with ::: 2001:db8:0:0:0:0:0:12001:db8::1
  • :: can only appear once in an address to avoid ambiguity

IPv4 vs IPv6 Comparison

FeatureIPv4IPv6
Address length32 bits128 bits
Address space~4.3 billion~340 undecillion
NotationDotted decimal (192.168.1.1)Hexadecimal with colons
Header size20–60 bytes (variable)40 bytes (fixed)
NAT requiredYes (due to shortage)No (abundant space)
SecurityOptional (IPSec)Built-in (IPSec mandatory)
ConfigurationOften manual / DHCPAuto-configuration (SLAAC)
BroadcastYesNo (uses multicast/anycast)
FragmentationRouters and hostsHosts only

Subnetting and CIDR

A subnet mask divides an IP address into two parts: the network portion (which network the device is on) and the host portion (which device within that network).

Example: 192.168.1.0 with subnet mask 255.255.255.0 (or /24 in CIDR notation) means the first 24 bits are the network; the last 8 bits identify hosts. This gives 2⁸ - 2 = 254 usable hosts (subtract 2 for network address and broadcast address).

CIDR (Classless Inter-Domain Routing) replaces the old classful system — a /n suffix indicates how many bits are in the network portion. More flexible and efficient allocation of address blocks.

DHCP — Dynamic Host Configuration Protocol

DHCP automatically assigns IP addresses to devices on a network. When a device connects, it broadcasts a DHCP Discover message; the DHCP server offers an available IP address, which the device accepts. This removes the need to manually configure IP addresses on every device.

DHCP assigns addresses from a pool and leases them for a defined period — when the lease expires, the address may be reassigned.

Exam tip: Know the bit lengths — IPv4 = 32 bits, IPv6 = 128 bits. Know the total address spaces — 2³² ≈ 4.3 billion for IPv4; 2¹²⁸ ≈ 340 undecillion for IPv6. Know why IPv6 was introduced (IPv4 exhaustion) and its advantages over IPv4.
Exam tip: Private IPv4 ranges (10.x.x.x, 172.16–31.x.x, 192.168.x.x) are not routed on the public internet — NAT translates them. Loopback address = 127.0.0.1 (device pointing at itself). These appear in exam questions.
⚠ Common Mistakes
  • Saying IPv6 uses "dotted decimal" — IPv6 uses hexadecimal with colons, not dots.
  • Confusing subnet mask with IP address — the subnet mask (e.g. 255.255.255.0) is separate from the IP address; it defines which part is network vs host.
  • Forgetting that 127.0.0.1 is the loopback address — used to refer to the local device itself, not a real network host.
  • Saying IPv4 has 2³² = "4 billion exactly" — more precisely ~4.294 billion; in exams, "approximately 4.3 billion" is fine.
✓ Notes completed!
Video coming soon
Click to advance · Arrow keys also work
Click slide or press arrow keys to navigate

Worksheet — 1.3.4b IP Addressing

8 questions · 20 marks · instantly marked

Q1How many bits are in an IPv4 address and how many unique addresses does this allow? Show your working.[3 marks]
✓ Mark scheme
IPv4 addresses are 32 bits long [1]. Number of unique addresses = 2³² [1] = 4,294,967,296 ≈ 4.3 billion [1].
Q2Explain two differences between IPv4 and IPv6.[4 marks]
✓ Mark scheme
Any two from (1 mark per difference + 1 mark for elaboration): IPv4 = 32 bits / IPv6 = 128 bits — IPv6 can support vastly more addresses (~340 undecillion vs ~4.3 billion) [2]; IPv4 uses dotted decimal notation / IPv6 uses hexadecimal groups separated by colons [2]; IPv4 requires NAT because of address shortage / IPv6 does not require NAT as there are enough unique addresses for every device [2]; IPv4 has a variable-length header / IPv6 has a fixed 40-byte header which speeds up processing [2]; IPv4 allows fragmentation by routers / IPv6 only allows fragmentation by the host [2]; IPv6 has built-in IPSec (security) / IPv4 has optional IPSec [2].
Q3Why were private IPv4 address ranges (e.g. 192.168.x.x) introduced? What technology allows devices using private addresses to communicate with the public internet?[3 marks]
✓ Mark scheme
Private address ranges were introduced because of IPv4 exhaustion — there are not enough public IPv4 addresses for every device on every network [1]. Private addresses can be reused across different private networks (they are not globally unique / not routed on the public internet) [1]. NAT (Network Address Translation) allows a router with a single public IP to translate private addresses for outgoing traffic — many devices on a LAN can share one public IP address [1].
Q4Convert the following IPv6 address to its abbreviated form: 2001:0db8:0000:0000:0000:0000:0000:0001[2 marks]
✓ Mark scheme
Remove leading zeros in each group: 2001:db8:0:0:0:0:0:1 [1]. Replace the consecutive groups of zeros with :: (only once): 2001:db8::1 [1].
Q5A network uses the address 192.168.10.0 with a /24 subnet mask. State the subnet mask in dotted decimal notation, explain what it means, and calculate the number of usable host addresses.[4 marks]
✓ Mark scheme
Subnet mask in dotted decimal: 255.255.255.0 [1]. /24 means the first 24 bits are the network portion; the remaining 8 bits identify hosts on that network [1]. Total addresses = 2⁸ = 256 [1]. Usable host addresses = 256 - 2 = 254 (the network address 192.168.10.0 and broadcast address 192.168.10.255 cannot be assigned to hosts) [1].
Q6Explain the role of DHCP in a network. What would happen if DHCP were not available?[3 marks]
✓ Mark scheme
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses and network configuration (subnet mask, default gateway, DNS server) to devices when they connect to a network [1]; it manages a pool of IP addresses and leases them for a defined period, recycling addresses when devices disconnect [1]. Without DHCP, every IP address would need to be manually configured on each device — time consuming, error-prone, and likely to cause IP address conflicts if duplicate addresses are assigned [1].
Q7A router has public IP 81.147.23.200. Behind it are 50 devices using 192.168.1.x addresses. Explain how these 50 devices can all communicate with the internet simultaneously despite having private IP addresses.[3 marks]
✓ Mark scheme
NAT (Network Address Translation) is used [1]. When a device sends a packet, the router replaces the private source IP (e.g. 192.168.1.5) with the public IP (81.147.23.200) and records the mapping (private IP + port → public IP + port) in a translation table [1]. When the reply arrives, the router uses the table to translate the destination back to the correct private IP and forwards the packet to the right device [1].
Q8State one advantage and one disadvantage of NAT as a solution to IPv4 address exhaustion compared to transitioning fully to IPv6.[2 marks]
✓ Mark scheme
Advantage: NAT is a short-term workaround that works with existing IPv4 infrastructure — no need to replace hardware or software to support IPv6 [1]. Disadvantage: NAT breaks end-to-end connectivity (devices behind NAT cannot be directly addressed from the internet); complicates peer-to-peer communication and hosting servers; adds overhead at the router; is a workaround rather than a true solution [1].
Topic Quiz
1 of 15
You scored
out of 15
🎯

Mini Test — 1.3.4b IP Addressing

  • 10 questions · 10 marks · 10 minutes
  • 5 MCQ + 5 short answer
Card 1 of 15
Click to reveal
🎉
Complete!
TermDefinition
← 1.3.4a The Internet & DNS 1.3.4 The Internet Next: 1.3.4c Routing →