Pepe
Pepe
Pepe
2
Configure IPv6 on hosts
n
pla
s
res
dd
6a
Agenda es
s s
e
IPv
dr
6 ad
an
IP v
y
te
tif
n
ea
Ide
Cr
IPv4 Exhaustion Implications
Pre-requisite knowledge & skills
learn.afrinic.net | slide 3
Understanding
Used
Free
Unusable
learn.afrinic.net | slide 5
Central IPv4 pool as at 31.01.2011
Used
Free
Unusable
learn.afrinic.net | slide 6
Global IPv4 address distribution is unbalanced
RIPE NCC
AFRINIC
LACNIC
APNIC
IANA
ARIN
3 Feb 19 Apr 14 Sep 17 Mar 23 Apr 2 Aug
2011 2011 2012 2014 2014 2020
learn.afrinic.net | slide 8
Exhaustion drives up address costs & NATs
Network complexity
$12
Increase in OPEX
/address
NAT Breaks end-to-end
Cripple innovation
learn.afrinic.net | slide 9
AFRINIC runout no reason for complacence!
No hurry,
AFRINIC still has
IPv4 till 2020
learn.afrinic.net | slide 10
Implications for Africa: ‘Scramble for Africa’
§ African networks
deprived of critical IPv4
needed to facilitate
transition to IPv6
§ We are forced to
deploy greenfield IPv6
IPv6 Addresses
Section Objectives
⫞ Work comfortably with IPv6’s hexadecimal notation
⫞ Identify, write and shorten IPv6 addresses
What’s your current IPv6 configuration?
ipconfig /all
Windows
ipv6 if
Linux/Unix ifconfig
learn.afrinic.net | slide 15
Recall: TCP/IP model (IPv4 – 32 bits)
APPLICATION
DNS HTTP IMAP SMTP POP NFS
TRANSPORT
TCP UDP
NETWORK
IPv4 ICMP IGMP IPSec NAT OSPF IS-IS mob. IP
DATA LINK
Ethernet et al NBMA ATM 3GPP
learn.afrinic.net | slide 16
TCP/IP model (IPv6 – 128 bits)
APPLICATION
DNS HTTP IMAP SMTP POP NFS
TRANSPORT
TCP UDP
NETWORK
IPv6 ICMPv6 MLD IPSec ND OSPFv3 IS-IS mob. IP
DATA LINK
Ethernet et al NBMA ATM 3GPP
learn.afrinic.net | slide 17
IPv6 is a network layer replacement of IPv4
Applications
Transport
IPv4
Network
IPv6
Data Link
0010000000000001 0100001010010000
0000000000010000 0000001001001001
1011101011101000 0101011011111111
1111111001001010 1110110011111110
128 bits
learn.afrinic.net | slide 20
How to write IPv6 addresses (2/2)
0010000000000001 0100001010010000 0000000000010000 0000001001001001
2001:4290:0010:0249:bae8:56ff:fe4a:ecfe
learn.afrinic.net | slide 21
The general form of an IPv6 address
X:X:X:X:X:X:X:X/n
§ X = 4 hexadecimal digits (X = hhhh where h = [0 – 9, a – f]
§ n = prefix length: decimal value
hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh/n
learn.afrinic.net | slide 22
Rules for shortening IPv6 addresses
1
The Zero Suppression rule
learn.afrinic.net | slide 23
Example: shortening an IPv6 address
2001:0000:0000:0249:0000:0000:0000:ecfe
2001::249:0:0:0:ecfe
learn.afrinic.net | slide 24
Example: shortening an IPv6 address
2001:0000:0000:0249:0000:0000:0000:ecfe
2001:0:0:0249::ecfe
learn.afrinic.net | slide 25
WRONG! IPv6 address shortening
2001:0000:0000:0249:0000:0000:0000:ecfe
2001::0249::ecfe
learn.afrinic.net | slide 26
Quiz: Compressing Addresses
① 2001:0db8:0000:0000:0008:0800:200C:417a
② ff01:0000:0000:0000:0000:0000:0000:0101
③ 0000:0000:0000:0000:0000:0000:0000:0001
④ 0000:0000:0000:0000:0000:0000:0000:0000
learn.afrinic.net | slide 27
A
N
Q U E S T I O N S
W
E
R
S
Understanding
Tx
Rx Rx Rx Rx Rx Rx
Ex: 2001:4290:10:249:bae8:56ff:fe4a:ecfe
§ Starts with 001 i.e. 2000::/3
§ Global Routing Prefix is managed by IANA > RIRs > ISPs
§ SubnetID is hierarchically managed by network engineer
§ InterfaceID uniquely identifies interfaces in a subnet
learn.afrinic.net | slide 32
Link-local addresses (LLA)
10 bits 54 bits 64 bits
1111111010 0 InterfaceID
fe80
Ex: fe80:0000:0000:0000:bae8:56ff:fe4a:ecfe
§ Every working IPv6 interface has at least one LLA
§ Scope = link-local, thus routers never forwarded packets to/from LLA
§ Used for auto-configuration, neighbour discovery, routing updates
learn.afrinic.net | slide 33
Link-local reachability and scopeID
fe80::1 fe80::3
fe80::1a fe80::1b
Fe 0/0 Fe 0/1
fe80::2 fe80::4
ping fe80::1
§ Which interface does the router send out the packet?
§ You must additionally specify the egress interface
learn.afrinic.net | slide 34
ZoneIDs (scopeIDs) – resolve LLA ambiguity
Identifies address Scope
Automatically generated by OS
Typically a +ve integer or interface name
fe80::hhhh:hhhh:hhhh:hhhh%zoneID
§ Example on Mac OS X: fe80::bae8:56ff:fe4a:ecfe%en0
§ Example on Windows: fe80::bae8:56ff:fe4a:ecfe%10
learn.afrinic.net | slide 35
Quiz: Using ScopeIDs correctly
Node B
fe80::a1%10 fe80::b%eth0
Node A
learn.afrinic.net | slide 37
Unique Local Addresses (ULA)
8 bits 56 bits 64 bits
fc00::/7
learn.afrinic.net | slide 38
IPv4-based IPv6 transition addresses
learn.afrinic.net | slide 40
Generating the InterfaceID (IID)
64 bits 64 bits
Servers
Router interfaces Automatically configured hosts
learn.afrinic.net | slide 41
Reserved InterfaceIDs (RFC 5453)
<prefix>::0000:0000:0000:0000
learn.afrinic.net | slide 44
Important well-known addresses
learn.afrinic.net | slide 45
IPv4-mapped IPv6 address
Example: ::ff:196.1.0.87
§ Represent an IPv4 address to an IPv6-only application
§ These addresses should not appear in the public Internet
learn.afrinic.net | slide 46
Anycast addresses
0 R P T
0 Not based on a network prefix
learn.afrinic.net | slide 49
Well-known multicast scopes
4
bits
learn.afrinic.net | slide 53
Some well-known multicast addresses
hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh
24 bits
ff02::1:ffhh:hhhh/104
§ Computed for each unicast/anycast address
§ Different addresses with same lower 24 bits have same SNMA
learn.afrinic.net | slide 55
Example of a Solicited-Node multicast address
4037::01:800:200E:8C6C
24 bits
FF02::1:FF0e:8F6C/104
learn.afrinic.net | slide 56
Example of a Solicited-Node multicast address
#show ipv6 interface g0/0
GigabitEthernet0/0 is up, line protocol is up
IPv6 is enabled, link-local address is FE80::CA9C:1DFF:FE6B:B6A0
No Virtual link-local address(es):
Description: [Link to R1]
Global unicast address(es):
2001:43F8:90:C0::2, subnet is 2001:43F8:90:C0::/64
Joined group address(es):
FF02::1
FF02::2
FF02::1:FF00:2
FF02::1:FF6B:B6A0
MTU is 1500 bytes
learn.afrinic.net | slide 57
What addresses must a node identify itself by?
learn.afrinic.net | slide 58
What addresses must a router identify itself by?
learn.afrinic.net | slide 59
IPv6 address literals in URLs
learn.afrinic.net | slide 60
IPv6 literals in UNC path names
learn.afrinic.net | slide 61
Testing basic IPv6 connectivity
ping – 6 <hostname>
ping <address[%scopeID]>
learn.afrinic.net | slide 63
A
N
Q U E S T I O N S
W
E
R
S
Creating an
learn.afrinic.net | slide 66
The generic IPv6 subnetting problem
Prefix/L
§ Why we subnet
§ IPv4: conserve address space
§ IPv6: Optimize for routing or security
§ No VLSM in IPv6 – same prefix length on every LAN
§ Think subnets and not hosts
§ There’ll rarely be a need to expand a /64 subnet!
learn.afrinic.net | slide 68
IPv6 subnetting procedure
Inputs Process Formula
Prefix & lengths L , L’ s = L’- L or
OR no. of subnets
Find no. of subnet bits (s) s = log N/log 2
learn.afrinic.net | slide 69
Step #1: How to find the subnet bits (s)
No. of sub-prefixes required
Sub-prefix length
log N
s = L’– L s= log 2
prefix length
learn.afrinic.net | slide 70
Ex: break 2001:db8:c000::/36 to 700 subnets
learn.afrinic.net | slide 71
Step #2: How to find the number of subnet hexits
No. of hexits = s ÷ 4
learn.afrinic.net | slide 72
Ex: break 2001:db8:c000::/36 to 700 subnets
2001:db8:cHHH::/46
learn.afrinic.net | slide 73
Step #3: How to find the increment or Block (B)
Sub-prefix length
B= 2 16 – (L’%16)
learn.afrinic.net | slide 74
Ex: break 2001:db8:c000::/36 to 700 subnets
learn.afrinic.net | slide 75
Step #4: How to list the subnetIDs
<prefix>:<subnetID0>::/L
subnetID0 + B <prefix>:<subnetID1>::/L’
subnetID1 + B <prefix>:<subnetID2>::/L’
’
subnetIDn-1 + B <prefix>:<subnetIDn>::/L
learn.afrinic.net | slide 76
Step #4: Listing subnetIDs – the NERDY way
an = (n-1)B
§ Useful for “what’s the 79th subnet” type questions
learn.afrinic.net | slide 77
Step #4: How to list the subnetIDs with sipcalc
Original prefix & length Sub-prefix length
learn.afrinic.net | slide 79
Step #4: Listing the subnets example
§ Ex: Break 2001:db8:c000::/36 to 700 subnets
§ The nth subnet is an = 4(n-1)
§ 1st subnetID: a1= 4(0) = 0 (0x0)
§ 1st subnet: 2001:db8:c000::/46
§ Last subnet: a1024 = 4(1023) = 4092 (0xFFC)
§ Last subnet: 2001:db8:cffc::/46
§ 264th subnetID: a264 = 4(263) = 1052 (0x41C)
§ 26th subnet: 2001:db8:c41c::/46
learn.afrinic.net | slide 80
Subnetting example : problem
learn.afrinic.net | slide 81
Sipcalc example and output
sipcalc 2001:db8::/32 –v6split=36 | grep Network
Network - 2001:0db8:0000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 1000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 2000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 3000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 4000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 5000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 6000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 7000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 8000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: 9000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: a 000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: b 000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: c000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: d 000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: e000:0000:0000:0000:0000:0000 -
Network - 2001:0db8: f000:0000:0000:0000:0000:0000 -
learn.afrinic.net | slide 82
Solution to subnetting problem
§ Number of subnets: N = 10
§ Subnet bits required: s = log 10 ÷ log 2 = 3.322 ≈ 4
§ 4 bits gives 16 (i.e. 24) subprefixes. 6 spares
§ Length of each sub-prefix L’= 36 (i.e 32 + 4)
§ Number of subnet hexits = s/4 = 1
§ SubnetID increment B = 216-(36%16) = 4096 (0x1000)
learn.afrinic.net | slide 83
Subnetting example : analysis
§ First subnetID
§ a1= 4096(1-1) = 0 (0x0) [from an=(n-1)B]
§ First subnet: 2001:db8:000::/36
§ Last subnetID
§ a16 = 4096(16-1) = 61440 (0xf000)
§ Last subnet: 2001:db8:f000::/36
§ Verify your answer using sipcalc
§ sipcalc 2001:db8::/32 –v6split=36
learn.afrinic.net | slide 84
Some clarifications on address planning
① Don’t fit your network into RIR minimums (/32, /36 & /48)
② Typical prefix lengths
§ Multi-host LAN subnets: /64
§ Inter-router links: /127
§ Loopback addresses: /128
③ Plan a hierarchical scheme to optimize for aggregation
④ Ensure all prefixes fall on nibble (4 bit) boundaries
learn.afrinic.net | slide 85
Best practice: use /127 for inter-router links
<prefix>:<subnetID>::/127
learn.afrinic.net | slide 87
Sample hierarchy for a country ISP network
ASN
16
256
Cities 4096
2
65536
Sites
Campuses
4n 1048576
16777216
Buildings 268435456
etc 4294967296
68719476736
Round up your estimates to the nearest fourth power
learn.afrinic.net | slide 93
Nibble-aligned prefix
2001:db8:3c00::/40 2001:db8:3c00::/42
2001:db8:3c00:: 2001:db8:3c00::
2001:db8:3cff:ffff:ffff:ffff:ffff:ffff 2001:db8:3c3f:ffff:ffff:ffff:ffff:ffff
learn.afrinic.net | slide 94
Calculating how much space to request
learn.afrinic.net | slide 95
Don’t worry, there are enough addresses!
learn.afrinic.net | slide 97
Address planning example – analysis and solution
§ We know
§ #Cities = 10 [round to 16]
§ #SITEs = 50 [round up to 256]
§ #Clientsmax = 2700 [round up to 4096]
§ Calculate
§ Total number of end-network prefixes required is N
§ N =16 x 256 x 4096 = 16,777,216
§ Number of subnet bits required: s = log16,777,216/log 2 = 24.
§ Allocation size:
§ 48 – 24 = 24 [Assuming /48s to end-sites]
§ 52 – 24 = 28 [Assuming /52s to end-sites]
§ Thus the ISP needs to request a /24 or /28 from AFRINIC.
learn.afrinic.net | slide 98
Considerations for virtualized servers
learn.afrinic.net | slide 99
Address planning considerations for virtualisation
§ Management VLAN
§ Management VLAN
§ Storage VLAN
§ Storage VLAN
§ Several data VLANs ()
§ Data VLAN
§ Plan a /64 for each of your
§ One subnet each
data VLANs
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12
http://j.mp/v6Planner
Source Address 40
bytes
Destination Address
Variable
Upper Layer (e.g TCP or UDP) Header
length
Data
Next Header = UL
EH2 Header
Data
learn.afrinic.net | slide 109
List and order of IPv6 extension headers
Order Header Code Description
1 Basic IPv6 header
2 Hop-by-hop options 0 Examined by all hosts in path
3 Destination options 60 Examined only by destination node
Field eliminated from IPv6 Field removed from IPv6 base header
Field renamed in IPv6 header Field maintained
learn.afrinic.net | slide 112
IPv4 vs IPv6 key functionality comparison
IPv4 IPv6
Methods for automatic configuration of hosts & CPEs
§ DHCP § DHCPv6
§ PPPoE § Stateless Address configuration
§ PPPoE
Network to Link-layer Address Resolution
§ ARP § ICMPv6 (NS, NA)
§ Broadcast § Multicasts
IPv4 IPv6
Domain name to address resolution methods
§ DNS § DNS
§ A resource records § AAAA resource records
§ in-addr-arpa reverse zone § ip6.arpa reverse zone
How hosts join a multicast group
§ IGMPv1 and IGMPv2 § MLD
Automatically provisioning default gateway on hosts
§ DHCP , IRD or Passive RIP § RA (ICMPv6)
IPv4 IPv6
Supported Open Dynamic Routing Protocols
§ RIPv1 , RIPv2 § RIPng
§ OSPFv2, IS-IS § OSPFv3 , IS-IS
§ BGPv4 (IPv4 Address Family) § BGPv4 (IPv6 Address Family)
Minimum Supported MTU size
§ 576 bytes § 1280 bytes
Supported Communication Modes
§ Unicast, multicast, broadcast § Unicast, multicast
§ Router discovery
HOST § Parameter discovery (MTU, prefixes, hop limits
etc)
New to IPv6
ND defines and uses 5 ICMPv6 messages
Neighbor Router
Solicitation Solicitation
Redirect
Neighbor Router
Advertisement Advertisement
Destination
FF02::2 (all-routers)
address
Notes ICMP type 133, ICMP code 0
Source
Sending interface’s link local address
address
2001:db8:c001::10
learn.afrinic.net | slide 132
Duplicate Address Detection II
① Host N1 is going to assign address “A” on its interface “I”
② Interface “I” joins multicast groups:
§ ff02::1 -- “All IPv6 nodes”
§ ff02::ff00:0:a – solicited node multicast address for “A”
③ N1 sends NS message to ff02::ff:0:a sourced from “::”
④ N1 listens for any NS messages to ff02::ff00:0:a from “::”
⑤ DAD fails under any of the following circumstances
§ N1 receives an NS for a tentative address prior to sending
one.
§ More NSs are received than those expected based on
loopback semantics
learn.afrinic.net | slide 133
Further DAD details
pltime yes
Valid >0 Preferred
TX RX
pass no NEW
vltime yes
Tentative DAD >0 Deprecated
TX RX TX RX
fail no EXISTING
Duplicate Invalid
TX RX TX RX
Exercise: Examine http://j.mp/v6dad
N1
source 2001:db8c001::10
NS
destination ff02::1:ff00:0020
target 2001:db8:c001::20
source 2001:db8:c001::20
destination 2001:db8:c001::10
NA
N2 target 2001:db8:c001::20
target L2 addr b8:e8:56:4a:fe:ac
2001:db8:c001::20
[b8:e8:56:4a:fe:ac]
learn.afrinic.net | slide 139
Quiz: visit j.mp/v6-MAC-addr-resolv
http://j.mp/OSv6-support
learn.afrinic.net | slide 146
Host Configuration: Windows Vista/7
auto eth0
iface eth0 inet6 static
address 2001:db8:fedc:abcd::1/64
nameserver 2001:db8:c001::53a
nameserver 2001:db8:c001::53b
learn.afrinic.net | slide 149
Using privacy addresses
Mac OS X (/etc/sysctl.conf)
net.inet6.ip6.use_tempaddr=1
net.inet6.ip6.temppltime=XX
Linux (/etc/sysctl.conf)
① IPv6 address(es)
① IPv6 address(es)
② IPv6 default router(s)
② IPv6 default router(s)
③ DNS server(s)
③ DNS server(s)
④ Delegated prefix(es)
learn.afrinic.net | slide 156
There’re 2 key provisioning mechanisms
Default Delegated
Addresses DNS info.
Gateway Prefix
SLAAC Yes Yes No No
Stateful DHCPv6 Yes No Yes Yes
M O L A
In Prefix Information
In RA messages
option within an RA
learn.afrinic.net | slide 159
Use the ‘M’ & ‘A’ flags determine how hosts get addresses
[RA] M = 1 [RA] O = 1
DHCPv6 DHCPv6 No
RFC 6106
client client RFC 6106
Address: 2001:db8:c001:<EUI-64>/64
DNS: 2001:db8:cafe::53 2001:db8:c001::1/64
RS
RA
[PIO] 2001:db8:c001::/64 {A=1}
[RDNSO] 2001:db8:cafe::53
1 [ND]RS
M = 1 [RA] 2
[DHCP6] Solicit
3
Option Request Option
Advertise[DHCP6]
4
2001:db8:c001::face
{DNS} 2001:db8:cafe::53
learn.afrinic.net | slide 169
How stateful DHCPv6 works (2/2)
Address: 2001:db8:c001::face
DNS: 2001:db8:cafe::53
[DHCP6] Request
5
2001:db8:c001::face
Reply [DHCP6]
6
2001:db8:c001::face
learn.afrinic.net | slide 170
Pros & cons of stateful DHCPv6
§ DHCP is a mature, familiar protocol
§ More options to control how addresses are allocated e.g.
§ Restrict assignments to a small range of addresses
§ Map IP addresses to specific clients
§ Support for Dynamic DNS updates
§ Other parameters can be passed using options
§ Centralised accounting logs (troubleshooting and forensics)
§ Some OSes don’t have built-in DHCPv6 clients (e.g, Android)
§ Cannot give default gateway to clients
learn.afrinic.net | slide 171
Quiz: visit j.mp/DHCPv6-1
1 [ND]RS
O = 1 [RA]
[PIO] 2001:db8:c001::/64 {A=1}
2
Address: 2001:db8:c001:<EUI-64>/64
DNS: 2001:db8:c001::53 6
4 [DHCP6] Solicit
Option Request Option
Advertise[DHCP6]
5
{DNS} 2001:db8:c001::53
[DHCP6] Solicit
3 Option IA_PD
Advertise[DHCP6] 4
[DHCP6] Request
5 Option IA_PD
Reply[DHCP6]
6
{IA-PD} 2001:db8:dad:c000::/60
ISC DNS, NTP, NIS, SIP, Lifetime, Prefix Delegation, Relay IDs, FQDN
Dibbler DNS, NTP, NIS, SIP, Lifetime, Timezone, Prefix delegation, FQDN,
Cisco IOS DNS, NTP, NIS, SIP, Lifetime, Relay IDs, Prefix Delegation
Source: http://ipv6int.net/software/index.html
learn.afrinic.net | slide 185
RADIUS & IPv6: how the pieces work
interface Virtual-Template01
ipv6 enable
ipv6 nd other-config-flag
no ipv6 nd ra suppress
ipv6 dhcp server PPP-Radius
learn.afrinic.net | slide 190
Sample RADIUS user definition (FreeRADIUS)