Generating PDF…

Preparing…
← Back

Introduction to Networks

Week 8 — IPv6 Subnetting

Reza Farashahi — NZSE

Quick Review

Week 6 — IPv6 Fundamentals Recap

IPv6 Address — Quick Recap

  • 128 bits long (vs. 32 bits in IPv4)
  • Written as 8 groups of 4 hex digits separated by colons
    • Example: 2001:0DB8:0000:0000:0000:0000:0000:0001
  • Simplification rules:
    • Drop leading zeros in each group: 0DB8DB8
    • Replace the longest run of all-zero groups with :: (once only)
    • Simplified: 2001:DB8::1
Global Routing Prefix
48 bits (assigned by ISP)
Subnet ID
16 bits
Interface ID
64 bits (host part)

IPv6 Address Types

Type Prefix Meaning Example
Global Unicast (GUA) 2000::/3 First 3 bits = 001. Routable on the internet — like a public IPv4 address. 2001:0DB8:ACAD:1::1
Link-Local (LLA) FE80::/10 First 10 bits = 1111 1110 10. Only valid on the local link; auto-assigned on every IPv6 interface. FE80::1
Unique Local (ULA) FC00::/7 First 7 bits = 1111 110. Covers FC00::–FDFF::; in practice only FD00::/8 is used. Like private IPv4 (10.x, 192.168.x). Not routable on the internet. FD12:3456:789A:1::1
Loopback ::1/128 Equivalent to 127.0.0.1 in IPv4. Used to test the local TCP/IP stack. ::1
Multicast FF00::/8 First 8 bits = 1111 1111. One-to-many delivery. Replaces broadcast — no broadcast in IPv6! FF02::1 (all nodes)
Reading the prefix notation: FC00::/7 means the first 7 bits of the address are fixed (1111 110). The 8th bit can be 0 or 1, so the range is FC00:: through FDFF::. The IETF currently only defines the FD range (8th bit = 1), so in practice Unique Local addresses always start with FD.
Multicast — who uses it and why? A multicast address is a destination-only address — it is never assigned as a source. When a device sends to a multicast address, every device that has joined that multicast group receives the packet. Common groups:
FF02::1All nodes on the local link (every IPv6 device listens on this — replaces broadcast)
FF02::2All routers on the local link (only routers listen on this)

Review Quiz

Q1: How many bits are in an IPv6 address?

bits

Q2: What does the :: in an IPv6 address represent?

Q3: Match each address to its type. Select the correct type from the dropdown:

AddressType
FE80::1
2001:DB8:ACAD::1
FF02::1
FD00:ABCD:1234::1
::1

Review Quiz (continued)

Q4: True or False — “IPv6 uses broadcast to send packets to all devices on a network.”

Q5: What prefix do Unique Local addresses start with in practice?

Q6: What is “dual stack”?

IPv6 Simplification Practice

Q1: Simplify: FE80:0000:0000:0000:0210:A4FF:FE01:0023

Q2: Simplify: 2001:0DB8:0000:00A0:0000:0000:0000:0001

Q3: Simplify: FF02:0000:0000:0000:0000:0000:0000:0001

Q4: Expand the shortened address back to full form (8 groups, all leading zeros):

2001:DB8::FF:1

IPv6 Subnetting

Dividing an IPv6 Network into Smaller Subnets

IPv4 vs IPv6 Subnetting

IPv4 Subnetting

  • Borrow bits from the host portion
  • Worry about how many hosts you need
  • Complex binary maths (block sizes, broadcast addresses…)
  • Example: 192.168.1.0/24 → /26 = 4 subnets

IPv6 Subnetting

  • Uses the Subnet ID field (bits 49–64)
  • Host part is always 64 bits — never touched!
  • Much simpler — just change the 4th hextet
  • Example: 2001:DB8:A::/48 → /64 = 65,536 subnets
💡 Key difference: In IPv6 subnetting, we never borrow from the 64-bit Interface ID. The host part always stays /64. This makes IPv6 subnetting much easier than IPv4!

IPv6 Address Structure

A typical IPv6 Global Unicast Address has three parts:

Global Routing Prefix
48 bits
Assigned by ISP / registry
Subnet ID
16 bits
You control this!
Interface ID
64 bits
Host address — never changes

Written as 8 groups (hextets):

2001:0DB8:AAAA : 0001 : 0000:0000:0000:0001
↑ Prefix (48 bits) ↑ Subnet (16 bits) ↑ Interface ID (64 bits)

The /48 Allocation

  • Organisations typically receive a /48 prefix from their ISP
  • This means the first 48 bits are fixed (the Global Routing Prefix)
  • You get 16 bits for the Subnet ID (bits 49–64)
  • 216 = 65,536 subnets available!
48 bits — Prefix (fixed) 16 bits — Subnet ID 64 bits — Interface ID
💡 Bottom line: With a /48, you can create up to 65,536 individual /64 subnets — each supporting an astronomical number of hosts (264 ≈ 18 quintillion).

How IPv6 Subnetting Works

It’s simple — just change the 4th hextet (the Subnet ID):

SubnetNetwork AddressPrefix Length
02001:DB8:AAAA:0000::/64/64
12001:DB8:AAAA:0001::/64/64
22001:DB8:AAAA:0002::/64/64
32001:DB8:AAAA:0003::/64/64
/64
FFFF2001:DB8:AAAA:FFFF::/64/64
That’s it! The prefix stays the same, the 4th hextet counts up (0000 → 0001 → 0002 … FFFF), and the Interface ID is always available for hosts.

Hexadecimal — Quick Refresher

IPv6 uses hexadecimal (base 16). Here’s how it maps to decimal:

Hex0123456789ABCDEF
Dec0123456789101112131415
  • Each hex digit = 4 bits
  • Each hextet (4 hex digits) = 16 bits
  • After F (15), we carry over: F + 1 = 10 (hex) = 16 (decimal)
  • After FF (255), next is 100 (hex) = 256 (decimal)
💡 Count in hex: 0, 1, 2, … 9, A, B, C, D, E, F, 10, 11, … 1F, 20, … FF, 100 …

Hex ↔ Binary Practice

Part A — Convert Hex to Binary (4 bits each)

HexYour Binary
A
F
3
C

Part B — Convert Binary to Hex

BinaryYour Hex
1110
0101
1001
1011

Bonus — Convert full hextet to binary

Convert the hextet CAFE to binary (16 bits):

Example 1

Subnetting a /48 into /64 Subnets

Example 1 — The Scenario

Your company has been assigned the IPv6 prefix:

2001:DB8:CAFE::/48

You need to create subnets for 4 departments:

  1. Engineering
  2. Sales
  3. Finance
  4. IT Support
Question: What will the network address be for each department’s subnet?

Step 1 — Identify the Parts

With a /48 prefix:

48 bits — Global Prefix (fixed) 16 bits — Subnet ID (your choice) 64 bits — Interface ID
  • The prefix 2001:DB8:CAFE takes up the first 48 bits (3 hextets)
  • The 4th hextet is the Subnet ID — this is what we change
  • Each subnet will be a /64
  • We just need to assign a different value in the 4th hextet for each department

Step 2 — Assign Subnet IDs

Simply count up from 1 in the 4th hextet:

DepartmentSubnet IDNetwork Address
Engineering 0001 2001:DB8:CAFE:1::/64
Sales 0002 2001:DB8:CAFE:2::/64
Finance 0003 2001:DB8:CAFE:3::/64
IT Support 0004 2001:DB8:CAFE:4::/64
💡 Notice: The prefix stays the same (2001:DB8:CAFE). Only the 4th hextet changes. Each subnet has room for 264 hosts — more than enough!

Step 3 — Assign Router Addresses

By convention, the router gets ::1 as the Interface ID on each subnet:

SubnetRouter Interface Address
Engineering2001:DB8:CAFE:1::1/64
Sales2001:DB8:CAFE:2::1/64
Finance2001:DB8:CAFE:3::1/64
IT Support2001:DB8:CAFE:4::1/64

And PCs in each subnet can use any Interface ID, for example ::10, ::11, ::A1, etc.

Comparison to IPv4: This is just like using .1 for the router gateway in IPv4 subnetting (e.g. 10.0.0.1).

Your Turn — Example 1 Practice

Given the prefix 2001:DB8:CAFE::/48, what would be the network address for a 5th subnet (e.g. “Marketing”)?

What would be the router address on that 5th subnet?

With a /48, how many total /64 subnets can you create?

Example 2

Subnetting with a /32 Prefix

Example 2 — Larger Allocation

An ISP gives you a /32 prefix:

2001:DB8::/32
32 bits — Prefix 32 bits — Subnet ID 64 bits — Interface ID
  • Subnet ID = 64 − 32 = 32 bits
  • Number of /64 subnets = 232 = 4,294,967,296 (≈ 4.3 billion!)
  • Hextets 3 and 4 are both available for subnetting

Example 2 — Creating Subnets

With a /32, the 3rd and 4th hextets form the Subnet ID:

SubnetNetwork AddressUsage
1 2001:DB8:0001:0000::/64 Auckland Office
2 2001:DB8:0001:0001::/64 Auckland WiFi
3 2001:DB8:0002:0000::/64 Wellington Office
4 2001:DB8:0002:0001::/64 Wellington WiFi
💡 Strategy: Many organisations use the 3rd hextet for site/location and the 4th hextet for VLAN/subnet within that location. This creates a clean, hierarchical scheme.

The Simple Formula

To find how many /64 subnets you can create:

Number of /64 subnets = 2(64 − prefix length)
Prefix You ReceiveSubnet Bits/64 Subnets Available
/3264 − 32 = 32232 = 4,294,967,296
/3664 − 36 = 28228 = 268,435,456
/4064 − 40 = 24224 = 16,777,216
/4464 − 44 = 20220 = 1,048,576
/4864 − 48 = 16216 = 65,536
/5664 − 56 = 828 = 256
/6064 − 60 = 424 = 16
/6464 − 64 = 020 = 1 (no subnetting)

Practice — How Many Subnets?

Q1: You receive the prefix 2001:DB8:1234::/48. How many /64 subnets can you create?

Q2: You receive the prefix 2001:DB8:AB00::/40. How many /64 subnets?

Q3: You receive the prefix 2001:DB8:FACE:FF00::/56. How many /64 subnets?

Example 3

School Network — Step by Step Subnetting

Example 3 — School Network

NZSE has received the following IPv6 prefix from their ISP:

2001:DB8:ACAD::/48

They need subnets for:

SubnetPurpose
1Staff Network
2Student Labs
3Student WiFi
4Servers
5Security Cameras
6Guest WiFi

Example 3 — Solution

SubnetPurposeNetwork AddressRouter (::1)
1Staff 2001:DB8:ACAD:1::/64 2001:DB8:ACAD:1::1
2Labs 2001:DB8:ACAD:2::/64 2001:DB8:ACAD:2::1
3Student WiFi 2001:DB8:ACAD:3::/64 2001:DB8:ACAD:3::1
4Servers 2001:DB8:ACAD:4::/64 2001:DB8:ACAD:4::1
5Cameras 2001:DB8:ACAD:5::/64 2001:DB8:ACAD:5::1
6Guest WiFi 2001:DB8:ACAD:6::/64 2001:DB8:ACAD:6::1
💡 This is the same prefix we used in Practical 6! The subnets 1, 2, 3 match the VLANs 10, 20, 30 from your lab.

Your Turn — NZSE Network

NZSE wants to add a 7th subnet for IoT Devices. What is the network address?

A PC on the Staff network (Subnet 1) has Interface ID ::A1. What is its full IPv6 address?

How many total subnets could NZSE create with their /48 prefix?

Nibble Boundaries

In IPv6, a nibble = 4 bits = 1 hex digit. Subnetting is easiest when the prefix falls on a nibble boundary (a multiple of 4):

PrefixOn Nibble Boundary?Easy to Read?
/32✅ Yes (32 ÷ 4 = 8)Very easy
/48✅ Yes (48 ÷ 4 = 12)Very easy
/52❌ No (52 ÷ 4 = 13.0)Trickier
/56✅ Yes (56 ÷ 4 = 14)Easy
/60✅ Yes (60 ÷ 4 = 15)Easy
/64✅ Yes (64 ÷ 4 = 16)Very easy
💡 Good news: In practice, ISPs almost always assign prefixes on nibble boundaries (/32, /48, /56), so IPv6 subnetting stays straightforward.

Example 4

Home Network with a /56 Prefix

Example 4 — Home Network

Your home ISP gives you a /56 prefix:

2001:DB8:1234:AB00::/56

Q1 — Subnet bits: How many bits are available for subnetting?

Hint: Subnet bits = 64 − Prefix length

Q2 — Number of subnets: How many /64 subnets can you create?

Hint: 2subnet bits

Q3 — Subnet range: The Subnet ID occupies the last 2 hex digits of the 4th hextet. What is the range of values it can take?

From to

Your Turn — /56 Practice

Given 2001:DB8:1234:AB00::/56, what is the network address of the 10th subnet?

Hint: Decimal 10 = Hex 0A

What is the last subnet you can create with this /56? (Subnet 256)

Common Mistakes to Avoid

❌ Don’t Do This

  • Borrowing from the Interface ID
    • In IPv6, the last 64 bits are always for the host
  • Using broadcast addresses
    • IPv6 has no broadcast — use multicast instead
  • Trying to calculate “usable hosts”
    • With 264 hosts per subnet, this is irrelevant

✅ Do This Instead

  • Always subnet within the Subnet ID field
    • Between the prefix and bit 64
  • Use the formula: 2(64 − prefix)
  • Keep subnets at /64
    • This is standard practice for all IPv6 networks
  • Use ::1 for router gateways
    • Convention, just like .1 in IPv4

IPv4 vs IPv6 Subnetting — Side by Side

AspectIPv4IPv6
Where to subnetBorrow from host bitsUse Subnet ID field only
Host part sizeVaries (depends on mask)Always 64 bits
CalculationBinary maths + block sizesJust change the 4th hextet
Broadcast addressMust calculate for each subnetDoesn’t exist
Usable hosts2n − 2 (important!)264 (irrelevant)
Typical example172.16.0.0/16 → /19 = 8 subnets2001:DB8::/48 → /64 = 65,536 subnets
DifficultyComplexSimple!

Final Practice

Test Your IPv6 Subnetting Skills

Challenge 1 — Hospital Network

A hospital receives the prefix 2001:DB8:FACE::/48.

They need subnets for: Emergency, ICU, Radiology, Admin, Patient WiFi.

Q1: Network address for the Emergency subnet (Subnet 1)?

Q2: Network address for Patient WiFi (Subnet 5)?

Q3: Router address on the Admin subnet (Subnet 4)?

Challenge 2 — ISP Allocation

An ISP assigns the prefix 2001:DB8:ABCD:EF00::/56 to a business customer.

Q1: How many /64 subnets can the customer create?

Q2: What is the network address of their 20th subnet? (Hint: 20 decimal = 14 hex)

Q3: What is the first valid host address on the 20th subnet?

Final Quiz

Q1: In IPv6 subnetting, the Interface ID is always how many bits?

Q2: An organisation with a /48 prefix can create how many /64 subnets?

Final Quiz (continued)

Q3: Which part of the IPv6 address do you change when creating subnets from a /48?

Q4: What is the main difference between IPv4 and IPv6 subnetting?

Week 8 — Summary

Key Concepts

  • IPv6 addresses have 3 parts: Prefix, Subnet ID, Interface ID
  • The Interface ID is always 64 bits — never borrow from it
  • Subnets are always /64
  • Formula: subnets = 2(64 − prefix)
  • Subnetting = change the Subnet ID (4th hextet for /48)

Common Prefix Sizes

  • /32 — Large ISP (4B subnets)
  • /48 — Enterprise / organisation (65K subnets)
  • /56 — Home / small business (256 subnets)
  • /64 — Single subnet (no further subnetting)

Next Week

  • Transport Layer — TCP vs UDP