Generating PDF…

Preparing…
← Back

Introduction to Networks

Week 6 — IPv6 Fundamentals

Reza Farashahi — NZSE

Why IPv6?

Limitations of IPv4 & the Need for a New Protocol

Disadvantages of IPv4

  • Not enough addresses
    • Approximately 4.3 billion public IP addresses (232)
    • World population: ~8 billion people
    • Multiple devices per user — laptops, phones, smart TVs, IoT devices…
  • Less efficient routing compared to IPv6
  • Security is optional
    • Encryption (IPSec) is not required in IPv4

IPv6 Solutions

  • Plethora of Addresses
    • 128-bit address space → 340 trillion trillion trillion addresses
    • 5 × 1028 addresses for each person on the planet
  • Simplified Routing
    • Fixed 40-byte header (vs. variable-length IPv4 header)
  • Easier Configuration
    • Stateless Auto-Configuration (SLAAC) — no DHCP needed
  • Security is Required
    • IPSec is mandatory — source authentication + encryption

IPv4 vs IPv6 — At a Glance

FeatureIPv4IPv6
Deployed19811999
Address Size32-bit128-bit
Number of Addresses~4.3 billion (232)~3.4 × 1038 (2128)
Address FormatDotted decimal (192.168.1.1)Colon-separated hex (2001:db8::1)
Header SizeVariable (20–60 bytes)Fixed (40 bytes)
AddressingClass-based / CIDRClassless only
ConfigurationManual / DHCPSLAAC / DHCPv6 / Manual
SecurityIPSec optionalIPSec required
BroadcastYesNo — replaced by multicast

Quick Check — Why IPv6?

Q1: What is the main reason IPv4 addresses are running out?

Q2: Which of the following is NOT an advantage of IPv6 over IPv4?

Why Is IPv4 Still Around?

Three techniques have extended IPv4's life well beyond expectations:

  • Subnetting / CIDR
    • More efficient allocation of address blocks (no wasted addresses)
  • Private IP Addresses
    • 10.x.x.x, 172.16–31.x.x, 192.168.x.x can be reused in every network
  • Network Address Translation (NAT)
    • Many private devices share one public IPv4 address
💡 Key insight: These are workarounds, not solutions. IPv6 is the long-term answer.

IPv6 Addressing

128-bit Hexadecimal Addresses

IPv6 Address Format

  • 128-bit address written as eight 16-bit hexadecimal blocks, separated by colons
  • Each hex digit = 4 binary bits
  • Full form has 32 hex digits
Example:
2001:0DB8:85A3:0000:0000:8A2E:0370:7334
Decimal
(Base 10)
Binary
(Base 2)
Hexadecimal
(Base 16)
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F
IPv6 Address Format

Network & Interface IDs

Every IPv6 address is divided into two main portions:

Site Prefix (48 bits)
Subnet ID (16 bits)
Interface ID (64 bits)
2001:0DB8:AAAA
0001
0000:0000:00A1:0B2C
  • Network ID (64 bits)
    • Site Prefix — Used for routing over the Internet
    • Subnet ID — Used for subnets on internal networks
  • Interface ID (64 bits)
    • The host portion — auto-configured from MAC address or manually set (EUI-64)

IPv6 Address Simplification

Two rules to shorten IPv6 addresses:

  • Rule 1 — Omit leading zeros
    • 0DB8DB8
    • 00000
  • Rule 2 — Replace one contiguous group of all-zero blocks with ::
    • :0000:0000:::
    • Can only be used once per address!
Full: 2001:0DB8:0000:0000:0000:0000:0000:0001
Step 1: 2001:DB8:0:0:0:0:0:1
Step 2: 2001:DB8::1

Practice — Simplify These IPv6 Addresses

1. Simplify: FE80:0000:0000:0000:0000:00AA:0030:0001

2. Simplify: 2001:0DB8:0000:0000:0008:0800:200C:417A

3. Simplify: FF02:0000:0000:0000:0000:0000:0000:0001

4. Expand: 2001:DB8::1

5. Expand: FE80::A1:B2

IPv6 CIDR Notation

  • CIDR notation works the same way as IPv4 — a /prefix-length after the address
  • The standard prefix for a subnet is /64
Example: FE80::8A:0:8398:85A3/64

Network ID (64 bits): FE80:0000:0000:0000
Interface ID (64 bits): 008A:0000:8398:85A3
  • A standard /64 subnet can hold 264 addresses:
    18,446,744,073,709,551,616 addresses per subnet!

Quick Check — IPv6 Addressing

Q1: How many bits are in an IPv6 address?

Q2: How many times can you use :: in a single IPv6 address?

IPv6 Transmission Types

Unicast, Multicast & Anycast

IPv6 Transmission Types

  • Unicast — One-to-One
    • Packet sent from one source to one specific destination
    • Same concept as IPv4 unicast
  • Multicast — One-to-Many
    • Replaces IPv4 broadcast — IPv6 has no broadcast
    • Packet sent to a group of interested receivers
    • Example: A router sends a routing update (FF02::A) — only routers running EIGRP listen and receive it, all other devices ignore it
    • Example: Video live-stream to subscribers — the server sends one copy, and the network delivers it to all group members
  • Anycast — One-to-Nearest
    • Same address assigned to multiple interfaces
    • Packet delivered to the nearest one (used in routing)
    • Example: A company has data centres in Auckland, Sydney & Tokyo with the same anycast address — users in NZ are routed to the Auckland server automatically

Quick Check — Transmission Types

Q1: IPv6 replaced broadcast communication with which type?

Q2: A DNS server address is assigned to multiple routers globally. When a user sends a query, it reaches the geographically closest router. What type of communication is this?

Types of IPv6 Addresses

Global, Unique Local, Link-Local & Loopback

IPv6 Unicast Address Types

TypePrefixSimilar to IPv4Routable?
Global Unicast2000::/3Public IPYes — Internet
Unique LocalFC00::/7 or FD00::/8Private IPInternal only
  • Global — publicly routable, like a public IPv4 address
  • Unique Local — for internal networks, like 10.x or 192.168.x
  • Link-Local — auto-assigned, used for local communication (always starts with FE80)
IPv6 Unicast Address Types

IPv6 Address Types — Comparison with IPv4

IPv4

TypeExample
Public203.0.113.5
Private192.168.1.10
APIPA169.254.1.1
Loopback127.0.0.1

IPv6

TypeExample
Global Unicast2001:DB8::1
Unique LocalFD00::1
Link-LocalFE80::1
Loopback::1

IPv6 Loopback Address

  • IPv4 loopback: 127.0.0.1
  • IPv6 loopback: ::1
Full form: 0000:0000:0000:0000:0000:0000:0000:0001
Simplified: ::1
  • Used to test the IPv6 stack on the local machine
  • Traffic never leaves the device
  • Try it: open a terminal and type ping ::1
  • macOS note: use ping6 ::1 in Terminal (older macOS versions), or ping -6 ::1

Quick Check — IPv6 Address Types

Q1: An IPv6 address begins with FE80. What type of address is it?

Q2: Which IPv6 address type is most similar to IPv4 private addresses (e.g. 192.168.x.x)?

Q3: What is the IPv6 loopback address?

IPv4 to IPv6 Transition

Dual Stack, Tunneling & Translation

The Transition Challenge

  • IPv6 is not natively backward compatible with IPv4
  • We can't switch the entire Internet overnight
  • Both protocols must coexist during the transition

Two key transition technologies:

1. Dual IP Stack

Device runs both IPv4 and IPv6 simultaneously

2. Tunneling

Encapsulate one protocol inside the other to cross incompatible networks

Dual IP Stack

  • Both IPv4 and IPv6 protocols co-exist within the operating system
  • The device has both an IPv4 address and an IPv6 address
  • Can communicate with IPv4-only and IPv6-only devices
  • Used by most modern operating systems today:
    • Windows, macOS, Linux, iOS, Android
💡 Real world: Your laptop likely already has both an IPv4 and an IPv6 address — check with ipconfig (Windows) or ifconfig / ip a (macOS/Linux).
🌐 Check your IPv6 connectivity online:
  • Test-IPv6.com — Runs a quick script and gives you a score (e.g. 10/10) with a clear Yes/No on your IPv6 connectivity
  • Google's IPv6 Test — A minimalist page that instantly tells you if you're reaching Google via IPv4 or IPv6

Tunneling Protocols

Tunneling encapsulates one IP version inside the other to cross incompatible networks:

ProtocolWhat It DoesNAT Support?
4to6Encapsulates IPv4 data into an IPv6 tunnel
6in4Encapsulates IPv6 data into an IPv4 tunnelYes
TeredoMicrosoft's IPv6 tunneling over IPv4 with NATYes
MiredoOpen-source (Linux/Unix) version of TeredoYes
Tunneling Protocols

Tunneling — How It Works

Think of tunneling like putting a letter (IPv6) inside a different envelope (IPv4) to travel through a mail system that doesn't understand the original format.

IPv6 Network

Source

IPv4-Only Network

IPv6 packet wrapped
inside IPv4 header

IPv6 Network

Destination

Key point: The IPv4-only network in the middle never sees or understands the IPv6 data — it just forwards the outer IPv4 packet.

Neighbor Discovery Protocol

How IPv6 Devices Find Each Other

IPv6 Neighbor Discovery (NDP)

NDP replaces IPv4's ARP (Address Resolution Protocol) and performs several functions:

  • Neighbor Solicitation (NS)
    • A new device joins the network and sends a multicast message: "I'm new — who's out there?"
  • Neighbor Advertisement (NA)
    • Other devices respond with their IPv6 addresses: "Hello! Here's my address."
💡 IPv4 comparison: In IPv4, ARP broadcasts "Who has 192.168.1.1?" to every device. IPv6 NDP uses multicast — more efficient because it targets specific groups instead of flooding the whole network.
IPv6 NDP

NDP — What Else Does It Do?

Router Discovery

  • Hosts send Router Solicitation (RS) messages
  • Routers respond with Router Advertisement (RA)
  • This is how hosts learn their default gateway and network prefix

Duplicate Address Detection

  • Before using a new address, a device sends a Neighbor Solicitation for its own address
  • If no one responds → address is unique and safe to use
  • If someone responds → duplicate detected, address not used
Summary: NDP handles address resolution, router discovery, auto-configuration, and duplicate detection — all without the need for ARP or broadcast.

IPv4 Subnetting Review

Class B Network → 4 Subnets (Walkthrough)

The Scenario

🏢 You are the network administrator for a small company.
You have been assigned the Class B network 172.16.0.0/16.
You need to divide it into 4 subnets — one for each department.
Sales
Engineering
HR
Management

Questions we need to answer:

  • How many bits do we borrow?
  • What is the new subnet mask?
  • What are the subnet addresses, ranges & broadcast addresses?

Step 1 — Borrow Bits

Class B default: /16 → 16 network bits, 16 host bits

Network (16 bits) Host (16 bits)

We need 4 subnets. How many bits do we borrow?

2x ≥ 4  →  22 = 4  →  Borrow 2 bits

Network (16) +2 Host (14)
New prefix: /16 + 2 = /18
New subnet mask (decimal): 255.255.192.0
New subnet mask (binary):
11111111.11111111.11000000.00000000
Blue = original network bits  |  Red = borrowed bits  |  Green = host bits

Step 2 — Hosts per Subnet

We borrowed 2 bits, so 14 host bits remain. How many usable hosts per subnet?

Net (16) +2 Host (14)

Total addresses per subnet:

214 =

Usable hosts per subnet:

214 − 2 =

Step 3 — Block Size

The block size tells us the increment between each subnet's network address.

Block Size = 256 − 192 = 64

(256 minus the interesting octet value in the subnet mask)

So the third octet of each subnet increments by 64:

The 2 borrowed bits give us 4 combinations. Each combination is the starting value of a subnet's third octet:

SubnetBorrowed BitsRemaining 6 BitsFull Octet BinaryDecimal
1 0 0 000000 00000000 0
2 0 1 000000 01000000 64
3 1 0 000000 10000000 128
4 1 1 000000 11000000 192
Subnet 1
172.16.0.0
Subnet 2
172.16.64.0
Subnet 3
172.16.128.0
Subnet 4
172.16.192.0
Pattern: 0, 64, 128, 192 — each subnet starts 64 addresses apart in the third octet.

Step 4 — The Complete Subnet Table

Subnet Mask: 255.255.192.0  →  11111111.11111111.11000000.00000000
Subnet Network Address Subnet Mask First Usable Last Usable Broadcast CIDR
1 — Sales 172.16.0.0 255.255.192.0 172.16.0.1 172.16.63.254 172.16.63.255 /18
2 — Engineering 172.16.64.0 255.255.192.0 172.16.64.1 172.16.127.254 172.16.127.255 /18
3 — HR 172.16.128.0 255.255.192.0 172.16.128.1 172.16.191.254 172.16.191.255 /18
4 — Management 172.16.192.0 255.255.192.0 172.16.192.1 172.16.255.254 172.16.255.255 /18
How broadcast is calculated: Next subnet's network address − 1.
Subnet 1 broadcast = 172.16.64.0 − 1 = 172.16.63.255

Your Turn — Fill in the Blanks

Given: 172.16.0.0/18 — Subnet 2

Given: 172.16.0.0/18 — Subnet 3

The Big Picture — 172.16.0.0/16 → /18

172 . 16 SN Host Bits (14)
Subnet 1 — Sales
172.16.0.0 – 172.16.63.255
Subnet 2 — Engineering
172.16.64.0 – 172.16.127.255
Subnet 3 — HR
172.16.128.0 – 172.16.191.255
Subnet 4 — Management
172.16.192.0 – 172.16.255.255
Key Takeaways:
  • We borrowed 2 bits from the host portion → 4 subnets
  • New subnet mask: 255.255.192.0 (/18)
    11111111.11111111.11000000.00000000
  • Block size: 64 (each subnet is 64 × 256 = 16,384 addresses)
  • 16,382 usable hosts per subnet

Quick Check — Subnetting Review

Q1: To create 4 subnets from a Class B network, how many bits must you borrow?

Q2: What is the subnet mask for 172.16.0.0/18?

Q3: The IP address 172.16.100.50/18 belongs to which subnet?

Final Review — IPv6 Fundamentals

Q1: What does SLAAC stand for, and why is it useful?

Q2: A company uses the address prefix FD00:ABCD:1234::. What type of IPv6 address is this?

Q3: Which protocol replaced ARP in IPv6?

Week 6 — Summary

IPv6 Addressing

  • 128-bit addresses in 8 hex blocks
  • Simplify: omit leading zeros, use :: once
  • Standard prefix: /64
  • Network ID (64 bits) + Interface ID (64 bits)
  • Address types: Global, Unique Local, Link-Local
  • Loopback: ::1

Transition & Discovery

  • IPv6 is NOT backward compatible with IPv4
  • Dual Stack — run both protocols
  • Tunneling — 4to6, 6in4, Teredo, Miredo
  • No broadcast in IPv6 → multicast
  • NDP replaces ARP (Neighbor Solicitation/Advertisement)
  • NDP also handles router discovery & duplicate detection