IPv6 Basics

Address Format

IPv4

IPv6

32bit

4 294 967 296

  • 08: 11111111
  • 16: 11111111
  • 24: 11111111
  • 32: 11111111

128bit

340 282 366 920 938 463
463 374 607 431 768 211 456

  • 016: 1111 1111 1111 1111
  • 032: 1111 1111 1111 1111
  • 048: 1111 1111 1111 1111
  • 064: 1111 1111 1111 1111
  • 080: 1111 1111 1111 1111
  • 096: 1111 1111 1111 1111
  • 112: 1111 1111 1111 1111
  • 128: 1111 1111 1111 1111

IPv4

IPv6

4 Octets

1 Octet is 8 Bit each

Converted to decimal

and delimited by a dot

255.255.255.255

 

32 Nibbles

1 Nibble is 4 Bit each

Converted to Hexadecimal

4 Nibbles are grouped and delimited by a colon

ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

 

Shortening IPv6 Addresses

2001:0db8:0000:0000:0000:0000:0000:0001
2001:0db8:0000:0000:0000:0000:0000:0001
2001: db8:   0:   0:   0:   0:   0:   1
2001:db8:0:0:0:0:0:1
2001:db8:0:0:0:0:0:1
2001:db8:         :1
2001:db8::1

IPv6 address shortening in the wild

Linux


# ip addr add 2001:db8:0:0:0:0:0:1/64 dev eth0


# ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:db8::1/64 scope global
       valid_lft forever preferred_lft forever
            

IPv6 Basics

Localhost Address

IPv6's localhost address is

very simple

IPv4

IPv6

localhost address

127.0.0.1/8

localhost address

::1/128

localhost address in the wild

Linux

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
            

IPv6 Basics

Link Local Address

IPv6 requires the

Link Local Address!

IPv4

IPv6

link local range

169.254.0.0/16

link local range

fe80::/10

stateless autoconfiguration

ff:fe

51:22:13:ab:ed:96

=

51:22:13:ff:fe:ab:ed:96

stateless autoconfigration

51:22:13:ff:fe:ab:ed:96

Bin 01010001

Bin 01010011

53:22:13:ff:fe:ab:ed:96

stateless autoconfiguration

fe80::/10

+

53:22:13:ff:fe:ab:ed:96

=

fe80::5322:13ff:feab:ed96

... this is true for almost any operting system except

Windows *

* Since Vista the link-local address is randomly generated.

stateless autoconfiguration in the wild

Linux

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:16:17:18:ed:96 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.30/24 brd 192.168.7.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2001:8e0:2003:b200:216:17ff:fe18:ed96/64 scope global dynamic
       valid_lft 86400sec preferred_lft 14400sec
    inet6 fe80::216:17ff:fe18:ed96/64 scope link
       valid_lft forever preferred_lft forever
            

IPv6 Basics

Network Boundaries

IPv6 has no

Network Address!

IPv4

IPv6

192.168.0.111/24

192.168.0.0

IPv6 has no

Broadcast Address!

IPv4

IPv6

192.168.0.111/24

192.168.0.255

The smallest IPv6 prefix is*

/64

IPv4

IPv6

/32 /30 /29
/28 /27 /26
/25 /24 /23
...

/64

Prefixes in the Wild

MacOS

# ifconfig en1
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
  ether 00:16:ce:ff:00:f3
  inet6 fe80::216:ceff:feff:00f3%en1 prefixlen 64 scopeid 0x6
  inet6 2001:db8::216:ceff:feff:00f3 prefixlen 64 autoconf
  inet 192.168.0.13 netmask 0xffffff00 broadcast 192.168.0.255
  media: autoselect
  status: active
            

IPv6 Basics

Routing

IPv6's default Route

is extremly short

IPv4

IPv6

default route

0.0.0.0/0

default route

::/0

Routing in the wild



# ip -6 route
::1 dev lo proto kernel metric 256 pref medium
2001:db8::/64 dev wlo1 proto ra metric 600 pref medium
fddd:c0ff:ee:7ea::/64 dev virbr0 proto kernel metric 256 pref medium
fe80::/64 dev virbr0 proto kernel metric 256 pref medium
fe80::/64 dev wlo1 proto kernel metric 600 pref medium
default via fe80::c0ff:ee:7:ea dev wlo1 proto ra metric 20600 pref medium


# ip -6 route show match ::
default via fe80::c0ff:ee:7:ea dev wlo1 proto ra metric 20600 pref medium
            

IPv6 Basics

Protocol

IPv6 does not use

ARP

Address Resolution Protocol

IPv4

IPv6

ping 192.168.0.1

ARP
who-has 192.168.0.1

ping6 2001:db8::1

Multicast
ICMP6 NS ff02::1:ff00:1

IPv6 Multicast Range

IPv4

IPv6

224.0.0.0/4

ff00::/8

IPv6 replaces Broadcast with

Multicast

ff01::1
ff02::1
ff02::1:ff<last 24 bit of ip>
            

Multicast Sample

# ip -6 addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:16:17:18:ed:96 brd ff:ff:ff:ff:ff:ff
    inet6 2001:db8::a9a7:9c40:8e1a:9a8a/64 scope global temporary dynamic
       valid_lft 86398sec preferred_lft 14398sec
    inet6 2001:db8::216:17ff:fe18:ed96/64 scope global dynamic
       valid_lft 86398sec preferred_lft 14398sec
    inet6 fe80::216:17ff:fe18:ed96/64 scope link
       valid_lft forever preferred_lft forever

#  ip -6 maddr show eth0
2:      eth0
        inet6 ff02::1:ff1a:9a8a
        inet6 ff02::fb
        inet6 ff02::202
        inet6 ff02::1:ff18:ed96 users 2
        inet6 ff02::1
        inet6 ff01::1
            

IPv6 Basics

DNS

IPv4

A

example.com.   IN   A  192.168.0.1

IPv6

AAAA

example.com.   IN   AAAA  2001:db8::1

IPv4

PTR

1.0.168.192.in-addr.arpa.  IN PTR example.com.

IPv6

PTR

1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.\
0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.\
ip6.arpa.  IN   PTR   example.com.
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.  IN   PTR   example.com.

 

=

IPv4

IPv6

CNAME

NS

MX

TXT

SRV

SPF

CNAME

NS

MX

TXT

SRV

SPF

DNS Zone File Sample

$TTL 3600  ; Default TTL
bun.ch. IN SOA asterix.bun.ch. hostmaster.bun.ch. (
        2015041801  ; serial
        ...
        )

$ORIGIN bun.ch.
         IN   NS       asterix.bun.ch.
         IN   NS       c.ns.buddyns.com.

         IN   MX   10  asterix.bun.ch.

bun.ch.  IN   A        178.77.97.122
asterix  IN   A        178.77.97.122

bun.ch.  IN   AAAA     2a01:488:66:1000:b24d:617a:0:1
asterix  IN   AAAA     2a01:488:66:1000:b24d:617a:0:1

mail     IN   CNAME    asterix
www      IN   CNAME    asterix

bun.ch.  IN   TXT      "v=spf1 +mx -all"
bun.ch.  IN   SPF      "v=spf1 +mx -all"
            

Dual Stack

All Modern OS' support both

IPv4 & IPv6

If both Stacks are configured

IPv6 gets
precedence
over IPv4*

Demo

Resources

Certification

Hurricane Electric Free IPv6 Certification

Meetups

Swiss IPv6 Council