IP address structure — AQA A-Level Computer Science
An IP address is a unique numerical identifier assigned to a device on a network, split logically into network and host identifiers. AQA A-Level Computer Science requires mastery of both 32-bit IPv4 (dotted decimal) and 128-bit IPv6 (hexadecimal colon notation), alongside subnet masking and CIDR notation.
IP address structure explained
An IPv4 address is a 32-bit number, usually written as four decimal octets separated by full stops, for example 192.168.1.25.
Read the full explanation
Each address is split into two parts: a network part, which identifies the network the device belongs to, and a host part, which identifies an individual device within that network. All devices on the same network share the same network part but have different host parts. The boundary between the two parts is not fixed by the address itself; it is defined by the subnet mask, so the same address can be divided differently in different networks. Routers use the network part to decide where to forward a packet, while the host part is used to deliver it to the correct device on the final network. Understanding this split is the foundation for working with subnets and masks later in the topic.
Your focus
- Know that an IP address is split into a network
Which command word is this?
Set out the mathematical or logical mechanism clearly. For IP addressing, this means describing the bitwise comparison or the relationship between network and host bits, rather than simply stating definitions.
IP address structure exam tips
Topic Overview
IP address structure forms the core of packet switching, network layer routing, and internet architecture within AQA A-Level Computer Science. It explores how devices are uniquely located on local and global networks through logical addressing schemes, establishing the fundamental distinction between physical MAC addresses and routable IP addresses.
Students study the mechanical composition of 32-bit IPv4 addresses, Classless Inter-Domain Routing (CIDR), subnet masking via bitwise logical operations, and the architectural migration to 128-bit IPv6. Understanding these concepts is essential for analyzing network efficiency, subnet allocation, and communication across the TCP/IP stack.
Key Concepts
- →IPv4 Structure: 32 bits arranged into four 8-bit octets separated by dots, expressed in dotted-decimal notation (e.g., 192.168.1.1).
- →Subnet Masking & Bitwise AND: A 32-bit mask of contiguous 1s followed by 0s; performing a logical AND between an IP address and its subnet mask isolates the Network ID from the Host ID.
- →CIDR Notation: Slash notation (e.g., /24) indicating the exact count of leading bits dedicated to the network identifier, replacing rigid historic classful boundaries.
- →IPv6 Structure: 128 bits represented as eight groups of four hexadecimal digits separated by colons, designed to eliminate global address exhaustion and simplify routing tables.
- →Reserved Addresses: The first address in any subnet (all host bits 0) represents the Network ID, and the final address (all host bits 1) is reserved as the Subnet Broadcast Address.
Marking Points
- Identifies that an IP address contains a network part and a host part.
- Explains that the network part identifies the network and is shared by all devices on it.
- Explains that the host part identifies an individual device within the network.
- Recognises that the split point is determined by the subnet mask rather than fixed by the address.
Examiner Tips
- 💡Practise splitting a given address into its two parts using a stated subnet mask rather than memorising a fixed split.
- 💡When asked why routers look at only part of an address, state that they use the network part to choose a route.
- 💡Use the terms network part and host part precisely in answers.
- 💡Show working in binary for subnet calculations: Even if you make an arithmetic error in the final denary conversion, writing out the bitwise AND logic guarantees method marks.
- 💡Use precise technical terms: Say 'Network ID' and 'Host ID' rather than vague descriptions like 'the router part' and 'the computer part'.
Common Mistakes
- Treats the network part and host part as fixed-length in every case, ignoring that the boundary varies with the subnet mask.
- Confuses the network part with the host part, describing the host part as identifying the whole network.
- Assumes that two devices with different network parts can communicate directly without a router.
- Assuming MAC addresses and IP addresses do the same job: MAC addresses are physical, flat 48-bit addresses burned into NICs for local link delivery, whereas IP addresses are logical, hierarchical addresses enabling internetwork routing.
- Forgetting to subtract 2 when calculating usable hosts: Students regularly compute 2^n and forget that all-0s (network) and all-1s (broadcast) cannot be assigned to individual endpoints.
- Believing subnet masks can have arbitrary interleaved bits: Valid subnet masks must consist of contiguous 1s followed by contiguous 0s; a mask cannot contain patterns like 1010.
Revision Plan
- 1Day 1-2: Master binary-to-denary conversion for full 8-bit octets (128, 64, 32, 16, 8, 4, 2, 1) and memorize standard subnet values (128, 192, 224, 240, 248, 252).
- 2Day 3-4: Practice bitwise AND operations between IP addresses and various subnet masks to extract Network IDs and calculate broadcast addresses.
- 3Day 5: Revise CIDR notation conversions (e.g., translating /18 to 255.255.192.0) and solve 2^n - 2 host calculation problems.
- 4Day 6: Study IPv6 notation, zero-compression rules (::), and compare structural differences with IPv4.
- 5Day 7: Complete timed past-paper exam questions covering subnetting and routing decisions under AQA exam conditions.
Exam Question Types
- 📋Binary / Denary Subnet Mask Calculations: Short-answer questions requiring conversion of dotted decimal IPs to binary, applying a mask, and stating the resulting subnet or usable host count.
- 📋Comparative Explain Questions: 2 to 4 mark questions asking for structural distinctions between IPv4 and IPv6, or between public and private IP addressing.
- 📋Routing Logic Scenario Questions: Explaining how a gateway router uses an incoming packet destination IP and its routing table subnet masks to direct traffic.
Command Word Expectations (AQA)
Set out the mathematical or logical mechanism clearly. For IP addressing, this means describing the bitwise comparison or the relationship between network and host bits, rather than simply stating definitions.
Show clear stages of working (including binary conversions if applicable) before arriving at a final numerical value or dotted-decimal address.
Identify specific structural points of difference and similarity (e.g., bit lengths, notations, address space) between two concepts like IPv4 vs IPv6, balancing both sides.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: A host device has the IPv4 address 192.168.10.75 with a subnet mask of 255.255.255.224. Calculate the Network ID, the broadcast address for this subnet, and the maximum number of usable host addresses.
- 1.Step 1: Convert the interesting octet (the 4th octet) of both the IP address and the subnet mask to 8-bit binary. Host octet 75 = 01001011. Mask octet 224 = 11100000.
- 2.Step 2: Perform a bitwise AND operation on the 4th octet: 01001011 AND 11100000 = 01000000 (which is 64 in denary). The Network ID is therefore 192.168.10.64.
- 3.Step 3: Determine host bits and subnet capacity. The subnet mask has 3 network bits in the last octet (24 + 3 = /27 CIDR), leaving 5 host bits (32 - 27 = 5). Total addresses = 2^5 = 32.
- 4.Step 4: Identify the broadcast address and usable host range. The broadcast address sets all 5 host bits to 1: 01000000 + 31 = 01011111 (denary 95), giving 192.168.10.95. Usable hosts = 2^5 - 2 = 30 (range 192.168.10.65 to 192.168.10.94).
Question: Explain how CIDR notation representation /20 partitions an IPv4 address, and calculate how many host addresses can be assigned within this block.
- 1.Step 1: Define CIDR prefix length. A /20 prefix means the first 20 contiguous bits from the left represent the Network ID.
- 2.Step 2: Calculate remaining host bits. An IPv4 address contains 32 bits, so host bits = 32 - 20 = 12 bits.
- 3.Step 3: Calculate assignable host addresses using the formula 2^n - 2, where n is host bits: 2^12 - 2 = 4096 - 2 = 4094 usable host addresses (subtracting the network and broadcast addresses).