- Home
- Courses
- Edexcel International A-Level Computer Science
- Network Foundations
- IPv4, IPv6 and MAC Addresses
IPv4, IPv6 and MAC Addresses
Attach an address to its role and scope. Counting possible bit patterns is useful, but it is not proof that every pattern is a globally assignable host address.
Before you start
- Expand hexadecimal groups into a stated bit width.
- Distinguish a network prefix, remaining address bits and permitted host assignments.
Watch, pause, try
Video by Craig'n'Dave. Use the shared AQA explanations for IP structure, TCP/IP and local MAC delivery. Pearson’s comparison also needs IPv6’s 128-bit width. Address-pattern counts and a conventional IPv4 subnet exclusion rule are stated explicitly; neither an address nor a MAC value is an immutable proof of a person’s identity.
Viewing focus: Compare IPv4, IPv6 and common MAC representations
After watching, attempt these questions before opening the answers. You can also use the written lesson below.
After watching 1: An IPv4 /27 block has five unconstrained bits. Count raw addresses and, for an exercise explicitly excluding two addresses, assignable hosts. Why can the same subtraction not automatically be applied to a /31 point-to-point link or to an IPv6 prefix?
Show answer and reasoning
Five bits supply 2^5=32 addresses; the stipulated two exclusions leave 30 hosts. That exclusion rule belongs to this conventional exercise. A suitable IPv4 /31 point-to-point link can use both addresses, and IPv6 has its own assignment rules. Establish the address family, prefix and applicable exclusions instead of treating 2^h−2 as a universal identity.
After watching 2: Expand 2001:db8::42 into eight four-digit hexadecimal groups and state its width. Compare the width and local-delivery role of 02:00:00:00:00:42. If the same private IPv4 address occurs in two separate LANs, does that prove the same device or person is present?
Show answer and reasoning
The IPv6 expansion is 2001:0db8:0000:0000:0000:0000:0000:0042; eight 16-bit groups, or 128 bits. The common Ethernet MAC display has six octets, or 48 bits, and serves link-level addressing under its network’s rules. Separate private LANs can reuse an IPv4 address; address reuse or a changeable MAC is not a trustworthy identity conclusion.
What you'll be able to do
- Compare IPv4, IPv6 and common MAC representations
- Distinguish network-layer addressing from link addressing
- Calculate address counts with explicit prefix assumptions
Read the address representation
IPv4 addresses contain 32 bits, commonly written as four decimal octets, each from 0 to 255. The teaching address 192.0.2.10 lies in an IPv4 documentation block; it is used here as an example rather than a live service target. IPv6 uses 128 bits, commonly displayed in hexadecimal groups with valid abbreviation rules.
A full IPv6 hexadecimal display can contain eight groups of sixteen bits, or thirty-two hexadecimal digits excluding separators. Hexadecimal is a written representation, not encryption or a different physical bit count. The raw number of 128-bit patterns is 2¹²⁸, compared with 2³² for IPv4, a ratio of 2⁹⁶. This is a mathematical comparison rather than a current count of Internet-connected devices.
Distinguish routed addresses from local delivery
IP addresses support network-layer addressing and routing in their relevant address domains. An interface may have several addresses, and private addresses can be reused in separate private networks. Routing and mechanisms such as NAT affect what addresses appear at different points. Do not claim that every displayed IP address uniquely identifies one person or one permanent physical device worldwide.
A common Ethernet MAC address has 48 bits, displayed as six hexadecimal octets. Link delivery uses relevant local addresses, while routers make network-layer forwarding decisions. A MAC address may be locally administered or randomised in a deployment; it should not be described as an immutable authentication credential. The address 02:00:00:00:00:01 can serve as a constructed locally administered teaching example.
Count patterns without overclaiming availability
A field with h unconstrained bits has 2ʰ possible patterns. For an IPv4 /24 prefix, eight remaining bits give 256 addresses in that block. A common conventional subnet exercise excludes a network address and broadcast address, yielding 254 assignable hosts under those explicit rules. That subtraction is not a universal rule for every IPv4 prefix or for IPv6.
Some address ranges are reserved for private, loopback, documentation or other special purposes. Allocation and protocol rules determine which patterns can serve which roles. In a question, establish the width, prefix and exclusions before writing the expression. Keep a MAC count, an IPv4 block count and the number of users or devices separate: none automatically equals the others.
| Address model | Width | Typical written form |
|---|---|---|
| IPv4 | 32 bits | Four decimal octets |
| IPv6 | 128 bits | Hexadecimal groups with valid compression |
| Common Ethernet MAC | 48 bits | Six hexadecimal octets |
Work through the problem
Attempt the task before opening its worked response. Record each change of state, explain the rule used, and check the result against the original requirements. Code examples labelled Python 3 use that language’s conventions; pseudocode states its own assumptions.
Example 1Find the raw address count in an IPv4 /24 block and the host count if the question explicitly excludes two addresses.
Example 2How many times as many raw patterns does a 128-bit field have as a 32-bit field?
Common mistakes to avoid
Key takeaways
- Widths and written forms differ across address models.
- IP routing and local link delivery have different roles.
- Count available addresses only after defining scope and exclusions.
Explore further
- Pearson YCP01 official specification (opens in a new tab)
Check the International A-level requirements and relevant numbered points; this course remains in progress.
- Pearson International Computer Science subject guide (opens in a new tab)
Official introduction to the four examined units and their theory/practical purposes.
- Topic reading and reference (opens in a new tab)
Use the relevant board requirement or primary technical reference alongside the written examples.
- 154. AQA A Level (7517) SLR22 - 4.9.4 The structure of IP addresses — Craig'n'Dave (opens in a new tab)
Original publisher or creator source for the embedded explanation; apply the stated viewing scope.
- 147. AQA A Level (7517) SLR22 - 4.9.4 The TCP-IP stack and MAC addresses — Craig'n'Dave (opens in a new tab)
Companion explanation: connect its topic to the written Pearson scope and follow-up activities.
Return to this tomorrow
Close the notes and answer from memory. Revisit any explanation you cannot yet reconstruct.
- A MAC address is an immutable proof of user identity:
- The expression 2ʰ−2 is a universal host rule for all address systems:
Test yourself
Answer a few questions, then review anything you missed.
Keep practising
Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.
Related lessons
All 3 lessons- Same chapterNetwork Components and Transmission MediaExplain NIC, switch, router, modem, WAP and firewall roles
- Same chapterNetwork Rate, Latency and Transfer TimeDistinguish bandwidth, throughput, latency and range
- Numbers and UnitsBinary, Hexadecimal and DenaryExpand binary and hexadecimal into denary