3.1.3IAS Networks and CryptographyCore

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.

35 min Video by Craig'n'Dave Network Foundations
154. AQA A Level (7517) SLR22 - 4.9.4 The structure of IP addressesCurated by Kepler, not produced by us. Watch it before the notes below.
Open on YouTube

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
1

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.

2

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.

3

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 modelWidthTypical written form
IPv432 bitsFour decimal octets
IPv6128 bitsHexadecimal groups with valid compression
Common Ethernet MAC48 bitsSix hexadecimal octets
Scroll horizontally to see the full code or table.
Logical role, scope and assignment rules matter as well as bit width.
4

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.
132−24=8 variable bits.
22⁸=256 address patterns.
3Apply the stated two exclusions only for this model.
Answer
256 addresses; 254 assignable hosts under the supplied exclusions.
Example 2How many times as many raw patterns does a 128-bit field have as a 32-bit field?
1Take the ratio 2¹²⁸/2³².
2Subtract exponents: 128−32=96.
Answer
2⁹⁶ times as many patterns, not a count of active devices.

Common mistakes to avoid

Equating raw address patterns with globally usable hosts.
Apply scope, prefix and reservation rules explicitly.
Using a hardware-style address as proof of a person’s identity.
Distinguish delivery addressing from authentication.

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

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.

Next step

Keep practising

Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.

Browse practice topics

Related lessons

All 3 lessons