Week 9 IPv6 Routing in IP networks
Week 9IPv6
Routing in IP networks
Agenda
• IPv6
• Addressing architecture
• Packets
• ICMPv6
• Routing in IP networks
IPv6 unicast addresses
interface ID
128 bits
N bits M bits 128-N-M bits
Usually 64 bitsBased on MAC Address
Can be used to identify the ISP responsible for this address
A subnet in this ISP ora customer of this ISP
global routing prefix subnet ID
IPv6 link-local
addresses• Used by devices on same LAN to exchange
IPv6 packets when they don't have/need
globally routable address
• Each host/router must generate one link
local address for each of its interfaces
• Each IPv6 host uses several IPv6
addresses
interface ID
128 bits
10 bits 54 bits 64 bits
FE80 0000000000.....00000000000
IPv6 Multicast• An IPv6 multicast address identifies
a group a receivers
Group ID
128 bits
8 bits 4 bits 112 bits4 bits
Node local-scopeLink-local scopeSubnet local-scopeSite local-scopeOrganisation local-scopeGlobal scope
Permanent AddressTemporary Address
11111111 flags scope
• All hosts : FF02::1 • All routers : FF02::2
Agenda
• IPv6
• Addressing architecture
• Packets
• ICMPv6
• Routing in IP networks
IPv6 packet format
32 bits
Ver Tclass Flow Label
NxtHdr Hop Limit
Source IPv6 address(128 bits)
Payload Length
Destination IPv6 address(128 bits)
Version=6
Traffic class
Size of packetcontent in bytes
Unclear utilisation
Same as TTL
Used to identify the typeof the next header found
in the packet payload
Sample IPv6 packets
• Identification of a transport (UDP/TCP) flow
• IPv6 source/destination, Source/Destination ports
32 bits
Ver Tclass Flow Label
NxtHdr Hop Limit
Source IPv6 address(128 bits)
Payload Length
Destination IPv6 address(128 bits)
Source port Destination port
Length Checksum
UDP
32 bits
Ver Tclass Flow Label
NxtHdr Hop Limit
Source IPv6 address(128 bits)
Payload Length
Destination IPv6 address(128 bits)
Source port Destination port
Checksum Urgent pointer
THL Reserved Flags
Acknowledgment number
Sequence number
Window
TCP
UDP
TCP
Packet forwarding• IPv6 uses longest match
• Example
Packets to 2001:6a8:3080::1234,
2001:1890:123a::1:1e,
2001:6a8:3880:40::2
Destination Gateway
::/0 fe80::dead:beef
::1 ::1
2a02:2788:2c4:16f::/64 eth0
2001:6a8:3080::/48 fe80::bad:cafe
2001:6a8:2d80::/48 fe80::bad:bad
2001:6a8::/32 fe80::aaaa:bbbb
Extension headers
• Hop-by-Hop Options
• Routing (Type 0 and Type 2)
• Fragment
• Destination Options
• Authentication
• Encapsulating Security Payload
• Each header must be encoded as n*64
bits
Packet fragmentation
• How to handle this network ?
R1 R2
MTU:1500MTU:1400
MTU:1300
Packet fragmentation• IPv4 used packet fragmentation on routers
• All hosts must handle 576+ bytes
packets
• experience showed fragmentation is
costly for routers and difficult to
implement in hardware
• PathMTU discovery
• widely implemented in TCP stacks
Packet fragmentation• IPv6 requires that every link in the
internet have an MTU of 1280 octets or
more
• Routers do not perform fragmentation
• Only end hosts perform
fragmentation and reassembly by
using the fragmentation header
• But PathMTU discovery should
avoid fragmentation most of the
time
A fragmented packet
32 bits
Ver Tclass Flow Label
NxtHdr Hop Limit
Source IPv6 address(128 bits)
Payload Length
Destination IPv6 address(128 bits)
Source port Destination port
Length Checksum
UDP (first part)
44:fragment
Nxt Hdr Zero Frag. Offset 0 M
Fragment identification = 1234
UDP
32 bits
Ver Tclass Flow Label
NxtHdr Hop Limit
Source IPv6 address(128 bits)
Payload Length
Destination IPv6 address(128 bits)
44:fragment
Nxt Hdr Zero Frag. Offset 0 M
Fragment identification = 1234
None
True
False
First fragment Second (and last) fragment
(end of UDP segment)
Agenda
• IPv6
• Addressing architecture
• Packets
• ICMPv6
• Routing in IP networks
ICMPv6• Types of ICMPv6 messages
• Destination (addr,net,port) unreachable
• Packet too big
• Used for PathMTU discovery
• Time expired (Hop limit exhausted)
• Echo request and echo reply
• Multicast group membership
• Router advertisments, Neighbor discovery
• Autoconfiguration
ICMPv6 packet
• Type• ICMPv6 error messages • 1 Destination Unreachable • 3 Time Exceeded • 2 Packet Too Big • 4 Parameter Problem
• ICMPv6 informational messages:• 128 Echo Request • 129 Echo Reply
Type Code Checksum
Message body
Ver Tclass Flow Label
NxtHdr Hop Limit
Source IPv6 address(128 bits)
Payload Length
Destination IPv6 address(128 bits)
58 for ICMPv6
Covers ICMPv6 message and part of IPv6 header
traceroute6 in details
• Source sends UDP segments with
increasing hop limit
• Intermediate routers reply with ICMP
Time Exceeded messages
traceroute6traceroute6 to star.c10r.facebook.com (2a03:2880:2130:cf05:face:b00c::1) from 2001:6a8:3080:2:451c:db2:a92f:3d50, 64 hops max, 12 byte packets
1 2001:6a8:3080:2::1 0.329 ms
2 2001:6a8:3000:8000::1 0.582 ms
3 2001:6a8:0:6009::1 1.505 ms
4 2001:7f8:1::a503:2934:1 8.167 ms
5 2620:0:1cff:dead:beef::34c 8.091 ms
6 2620:0:1cff:dead:beef::2d9 13.922 ms
7 2620:0:1cff:dead:beef::2dc 108.487 ms
8 2620:0:1cff:dead:beef::9a7 106.722 ms
9 2620:0:1cff:dead:beef::12a8 103.758 ms
10 2620:0:1cff:dead:beef::999 105.648 ms
traceroute
A’s routing table
destination interface/NH
::/0 2001:db8:7::B
2001:db8:7/48 2001:db8:4::C
2001:db8:1/48 West
2001:db8:4/48 East
2001:db8:7/48 North
B’s routing table
destination interface/NH
::/0 2001:db8:5::C
2001:db8:2/47 2001:db8:6::E
2001:db8:5/48 South
2001:db8:6/48 East
2001:db8:7/48 West
C’s routing table
destination interface/NH
2001:db8:1/48 2001:db8:5::B
2001:db8:2/47 2001:db8:3::E
2001:db8:2/48 2001:db8:5::B
2001:db8:3/48 East
2001:db8:4/48 West
2001:db8:5/48 North
2001:db8:6/47
2001:db8:5::B
E’s routing table
destination interface/NH
::/0 2001:db8:6::B
2001:db8:2/48 East
2001:db8:3/48 West
2001:db8:6/48 North
RA
RB
RC RE
2001:db8:1/48
2001:db8:7/482001:db8:6/48
2001:db8:5/48
2001:db8:4/48 2001:db8:3/482001:db8:2/48
Agenda
• IPv6
• Routing in IP networks
• IPv6 subnets
• Routing organization
• Interdomain routing
Datalink layer service
• Each device is identified by a 48 bits
MAC address in the datalink layer
• Ethernet, WiFi
• Unicast transmission
• Multicast transmission
IPv6 subnet
• A subnet gathers hosts and routers that
can directly exchange frames without
passing through an intermediate route
R
2001:db8:1234:5678::/64
2001:db8:1234:5678::AA
2001:db8:1234:5678::BB
2001:db8:1234:5678::CC
2001:db8:1234:5678::1
Issues
• How to easily assign IPv6 addresses to
hosts ?
• Manual configuration is not viable
• How to map IPv6 addresses onto the
corresponding MAC addresses ?
IPv6 over Ethernet
IPv6: 2001:0:0:0:8::AEth : A
2001:0:0:0:8::A wants to send a packet to 2001:0:0:0:8::C
Neighbor solicitation: Addr Eth 2001:0:0:0:8::C ? sent to IPv6 multicast address
1
2
3
IPv6: 2001:0:0:0:8::EEth : E
Ipv6: 2001:0:0:0:8::CEth : C
Ipv6: 2001:0:0:0:8::CEth : C
IPv6: 2001:0:0:0:8::EEth : E
IPv6: 2001:0:0:0:8::AEth : A
Neighbor advertisement: 2001:0:0:0:8::C is reachable via Ethernet Add : C
IPv6: 2001:0:0:0:8::CEth : C
IPv6: 2001:0:0:0:8::EEth : E
IPv6: 2001:0:0:0:8::AEth : A
Agenda
• IPv6
• Routing in IP networks
• IPv6 subnets
• Routing organization
• Interdomain routing
Internet organisation
• Internet is an internetwork with a large number of Autonomous Systems (AS)
• an AS is a set of routers that are managed by the same administrative entity
• Autonomous Systems are interconnected to allow the transmission of IP packets from any source to any destination
• On the Internet, most packets need to travel through several transit Autonomous Systems
Types of domains
• Transit domain
• A transit domain allows external domains to use its infrastructure to send packets to other domains
• Examples
• UUNet, OpenTransit, GEANT, Internet2, RENATER, EQUANT, BT, Telia, Level3,...
T1 T2
T3
S1
S2 S3
S4
Stub domainsA stub domain does not allow external domains to use its infrastructure to send packets to other domains
A stub is connected to at least one transit domain
Content-rich stub domain : Yahoo, Google, MSN, TF1, BBC,...
Access-rich stub domain : ISPs providing Internet access via CATV, ADSL, ...
T1 T2
T3
S1
S2 S3
S4
Internet routing
• Exterior Gateway Protocol (EGP)
• Routing of IP packets between domains
• Each domain is considered as a blackbox
• Interior Gateway Protocol (IGP)• Routing of IP packets inside each domain• Only knows topology of its domain
Domain1
Domain2
Domain3
Domain4
Intradomain routing
• Static routing
• Only useful in very small domains
• Distance vector routing
• Routing Information Protocol (RIP)
• Link-state routing
• Open Shortest Path First (OSPF)
• Intermediate System- Intermediate-System (IS-IS)
Intradomain routing
• Goal
• Allow routers to transmit IP packets along the best path towards their destination
• best usually means the shortest path
• Shortest measured in seconds or hops
• sometimes best means the less loaded path
• Alternate routes in case of failures
• Behaviour
• All routers exchange routing information
Agenda
• IPv6
• Routing in IP networks
• IPv6 subnets
• Routing organization
• Interdomain routing
Interdomain routing• Goals
• Allow to transmit IP packets along the best path towards their destination through several transit domains while taking into account their routing policies of each domain without knowing their detailed topology
• From an interdomain viewpoint, best pathoften means cheapest path
• Each domain is free to specify inside its routing policy the domains for which it agrees to provide a transit service and the method it uses to select the best path to reach each destination
Interdomain links
• Private link
• Usually a leased line between two routers belonging to the two connected domains
R1 R2
DomainA DomainB
Interconnection
exchanges• How to efficiently connect several
domains together ?
R1
R2R3
R4
Physical link
Interdomain link
Routing policies
• In theory BGP allows each domain to define its own routing policy...
• In practice there are two common policies
• customer-provider peering
• Customer c buys Internet connectivity from provider P
• shared-cost peering
• Domains x and y agree to exchange packets without any payment
Customer Provider
Customer-provider peering
• Principle
• Customer sends to its provider internal routes and routes learned from its customers
• Provider will advertise those routes to the entire Internet to allow anyone to reach the Customer
• Provider sends to its customers all known routes
• Customer will reach anyone on the Internet
AS2AS1
AS3 AS4
AS7
$ $ $
$
$
Customer-provider peering : example
• AS7-AS4 peering link
• AS7 advertises its routes to AS4
• AS4 advertises to AS7 all its routes
• AS4-AS2 peering link
• AS4 advertises its own routes and those of its customers (AS7)
• AS2 advertises to AS2 all known routes
AS2AS1
AS3 AS4
AS7
$Customer-provider
$ $ $
$
Shared-cost peering
AS2AS1
AS3 AS4
AS7
$Customer-provider
$ $ $
$
Shared-cost
• Principle
• PeerX sends to PeerY its internal routes and the routes learned from its own customers
• PeerY sends to PeerX its internal routes and the routes learned from its own customers
Routing policies
• A domain specifies its routing policy by defining two sets of filters for each peer
• Import filter
• Specifies which routes can be accepted by the router among all the received routes from a given peer
• Export filter
• Specifies which routes can be advertised by the router to a given peer
Routing policies
AS2AS1
AS3 AS4
AS7
$Customer-provider
$ $ $
$
Shared-cost
Import policy for AS4Import: from AS3 accept AS3import: from AS7 accept AS7import: from AS1 accept ANYimport: from AS2 accept ANY
Export policy for AS4export: to AS3 announce AS4 AS7export: to AS7 announce ANYexport: to AS1 announce AS4 AS7export: to AS2 announce AS4 AS7
Import policy for AS7Import: from AS4 accept ANY
Export policy for AS4export: to AS4 announce AS7