You are on page 1of 49

Week 10

Routing in IP networks
Interdomain routing with BGP

Agenda
Routing in IP networks
IPv6 subnets
Routing organisation
RIP
OSPF
Interdomain routing

Neighbour discovery
1

IPv6: 1080:0:0:0:8:A
Eth : A

IPv6: 1080:0:0:0:8:E
Eth : E

Ipv6: 1080:0:0:0:8:C
Eth : C

1080:0:0:0:8:A wants to send a packet to 1080:0:0:0:8:C


2
IPv6: 1080:0:0:0:8:A
Eth : A

IPv6: 1080:0:0:0:8:E
Eth : E

Ipv6: 1080:0:0:0:8:C
Eth : C

Neighbour solicitation: Addr Eth 1080:0:0:0:8:C ? sent to IPv6 multicast address


3

IPv6: 1080:0:0:0:8:A
Eth : A

IPv6: 1080:0:0:0:8:E
Eth : E

Ipv6: 1080:0:0:0:8:C
Eth : C

Neighbour advertisement: 1080:0:0:0:8:C is reachable via Ethernet Add : C

ICMPv6 Neighbor
Discovery

Neighbour solicitation

Type : 135 Code:0

The IPv6 address for which the link-layer


(e.g. Ethernet) address is needed.
May also contain an optional field with the link-layer (e.g.
Ethernet) address of the sender.

R : true if node is a router


S : true if answers to a neighbour solicitation

Checksum

Reserved
Target IPv6 Address

Type : 136 Code:0


RSO

The IPv6 and link-layer addresses

Neighbour advertisement

Checksum

Reserved
Target IPv6 Address
Target link layer Address

Router
advertisements

Maximum hop limit to avoid spoofed packets from


outside LAN

Ver Tclass

Flow Label

Payload Length

58

255

Router IPv6 address


(link local)
FF02::1
(all nodes)
Type:134

Code : 0

CurHLim

M O Res

Checksum
Router lifetime

Value of hop limit to be used by hosts when sending


IPv6 packets
The lifetime associated with the default router in units
of seconds. 0 is the router sending the advertisement
is not a default router.
The time, in milliseconds, that a node assumes a
neighbour is reachable after having received a
reachability confirmation.

Reachable Time
Retrans Timer
Options

The time, in milliseconds, between retransmitted


Neighbor Solicitation messages.
MTU to be used on the LAN
Prefixes to be used on the LAN

RA options
Format of the options
MTU option

Type

Prefix option

The validity period of the prefix in seconds


The duration in seconds that addresses generated from
the prefix via stateless address autoconfiguration remain
preferred.

Options

Options (cont.)

Type : 5

Length:1

Reserved

MTU

Type : 3

Number of bits in IPv6 prefix that identify subnet

Length

Length:4 PreLen

L A Res.

Valid Lifetime
Preferred Lifetime
Reserved2
IPv6 prefix

Autoconfiguration
What happens when an endsystem
boots ?

ICMPv6 : Neighbour Solicitation


Sent to multicast address
Is someone using IPv6 address :
Ethernet : 0800:200C:417A
FE80::M (800:200C:417 FE80::M64(800:200C:417A) ?
A)

64

Address is valid if nobody answers

Use Link-local IPv6 address


(FE80::/64)

Each host, has a link-local IPv6


address

Global IPv6 address

How to obtain the IPv6 prefix of the


subnet ?

Wait for router advertisements


Solicit router advertisement
R

Ethernet : 0800:200C:417A
FE80::M64(800:200C:417A)

ICMPv6 : Router Solicitation


IPv6 Src: FE80::M64(800:200C:417A)

IPv6 Dest: FF02::2

Global IPv6
address
R

Ethernet : 0800:200C:417A
FE80::M64(800:200C:417A)

ICMPv6 : Router Advertisement


IPv6 Src: FE80::M64(EthernetR)
IPv6 Dest: FF02::1
IPv6 Prefix = 2001:6a8:1100::/48
Prefix lifetime

IPv6 addresses are allocated for limited


lifetime

This allows IPv6 to easily support


renumbering

Privacy issues

Autoconfigured IPv6 addresses

contain the MAC address of the hosts

How to maintain privacy with IPv6 ?


Use DHCPv6 and never reallocate
the same IPv6 address

Allow hosts to use random host ids


algorithms have been
implemented to generate such
random host ids on nodes with
and without stable storage

ICMP Redirect
2001:db8:1234:5678::BB

2001:db8:1234:5678::1

2001:db8:1234:5678::AA
R1

::/0

2001:db8:1234:5678::/64
R2

2001:db8:2345::/48

2001:db8:1234:5678::2

Agenda
IPv6
Routing in IP networks
IPv6 subnets
RIP
OSPF

RIP
default period : 30 seconds (with
Distance vector

jitter)

distance vector is multicasted in UDP


message to all RIP routers in local
subnets
Optional extension :

distance vector after each


send
change

but some links flaps...


send distance vector if routing

table changed and did not send

RIP : message
format

RIP messages are sent over UDP

port 520

RIP : Route
Entries

Agenda
Routing in IP networks
IPv6 subnets
RIP
OSPF

OSPF
Standard link-state routing

protocol for TCP/IP architecture

Builds upon link-state routing


with some extensions

Hierarchical routing with areas


Designated routers on subnets
Equal Cost Multipath

Operation

OSPF

HELLO packets to discover


neighbours

Update of routing tables

Link state packets

acknowledgements, sequence
numbers, age
periodic transmission/ link changes

Database description

Link state Request

used when a router boots to


request link state packets from

OSPF details

2001:db8:1::A/48

2001:db8:1::B/48 2001:db8:1::C/48

2001:db8:1::D/48

2001:db8:1::B/48

2001:db8:1::C/48

2001:db8:1::A/48

2001:db8:1::D/48

OSPF details
(2)
R

2001:db8:1::A/48

2001:db8:1::B/48 2001:db8:1::C/48

2001:db8:1::D/48

2001:db8:1::B/48

2001:db8:1::A/48

LAN

2001:db8:1::D/48

2001:db8:1::C/48

OSPF in large
networks

Divide network in areas

Backbone area : network backbone

all routers connected to two or more


areas belong to the backbone area
All non-backbone areas must be
attached to the backbone area

at least one router inside each area


must be attached to the backbone

routing must allow any router to


OSPF
send packets to any other router

OSPF details
(4)
R1

Inside each non-backbone area


l
Routers exchange link state packets to
distribute the topology of the area
D3
l
Routers do not know the topology R
of
other areas, but each router knows how
to reach the backbone area

Inside backbone area


l
Routers exchange link state packets to
distribute the topology of the backbone area
l
Each router knows how to reach the other
R7
areas and distance vectors are used to
distribute inter-area routes

Stub AREA 1
RE
4
RA
RB

AREA 0

RC

R8

AREA 2
RD
9

RE
10

R5C

OSPF areas

Equal Cost
Multipath
How to use all paths without
hurting TCP performance
R3

R1

R2

R4

R7

R5

R8

R6

R9

RD

Agenda
Routing in IP networks
Interdomain routing
Peering links
BGP basics

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


path often 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

Interdomain links
Private link

Usually a leased line between two


routers belonging to the two
connected domains
DomainA

R1

R2

DomainB

Interconnection
exchanges
How to efficiently connect several
domains together ?

R2

Physical link
Interdomain link

R3

R1
R4

An Internet
exchange point

AMS-IX

Largest IX in the world

AMS-IX

Routing
policies

A domain specifies its routing policy by


defining on each BGP router 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
with RPSL
AS1
$

AS3
Import policy for AS4
Import: from AS3 accept AS3
import: from AS7 accept AS7
import: from AS1 accept ANY
import: from AS2 accept ANY
Export policy for AS4
export: to AS3 announce AS4 AS7
export: to AS7 announce ANY
export: to AS1 announce AS4 AS7
export: to AS2 announce AS4 AS7

AS2
$

AS4

Shared-cost
Customer-provider

AS7
Import policy for AS7
Import: from AS4 accept ANY
Export policy for AS4
export: to AS4 announce AS7

Agenda
Routing in IP networks
Interdomain routing
Peering links
BGP basics

Border Gateway
Protocol
Path vector protocol

BGP router advertises its best route to


each destination
l

AS2

2001:db8:1/48AS1

l
l

prefix:2001:db8:1/48
ASPath: AS1

AS5

prefix: 2001:db8:1/48
ASPath: AS1

AS4

... with incremental updates

prefix: 2001:db8:1/48
ASPath: AS4:AS1

prefix: 2001:db8:1/48
ASPath: ::AS2:AS4:AS1

BGP : Principles

BGP relies on the


incremental exchange of path
vectors
BGP session established
over
TCP connection between
peers

Each peer sends all its


active routes

AS3
R1

BGP
session
BGP Msgs

R2

AS4
As long as the BGP session
remains up
Incrementally update BGP routing
tables

BGP basics (2)


2 types of BGP messages

UPDATE (path vector)

advertises a route towards one


prefix

Destination address/prefix

Interdomain path (AS-Path)

Nexthop

WITHDRAW

a previously announced route is not


reachable anymore

Unreachable destination

BGP router
BGP Adj-RIB-In
Peer[N]
BGP Msgs
from Peer[N]
BGP Msgs
from Peer[1]

Peer[1]

BGP Loc-RIB
All
acceptable
routes

Import filter

Attribute
manipulation

Import filter(Peer[i])
Determines which BGM Msgs
are acceptable from Peer[i]

BGP Decision
Process
One best
route to each
destination

BGP Adj-RIB-Out
Peer[N]
Peer[1]
Export filter

Attribute
manipulation

BGP Msgs
to Peer[N]
BGP Msgs
to Peer[1]

Export filter(Peer[i])
Determines which
routes can be sent to Peer[i]

BGP Routing Information Base


Contains all the acceptable routes
learned from all Peers + internal routes
l
BGP decision process selects
the best route towards each destination

Example
AS10

UPDATE
l
prefix: 2001:db8:12/48,
l
NextHop:R2
l
ASPath: AS20:AS10

UPDATE
l
prefix: 2001:db8:12/48,
l
NextHop:R1
l
ASPath: AS10

AS20

R1

BGP

2001:db8:12/48
UPDATE
l
prefix: 2001:db8:12/48,
l
NextHop:R1
l
ASPath: AS10

R2

AS30
R3

BGP

BGP

UPDATE
l
prefix: 2001:db8:12/48,
l
NextHop:R4
l
ASPath: AS40:AS10

R4

AS40

What happens if link AS10-AS20 goes down ?

How to prefer some


routes over others ?
RA

AS2

Backup: 2Mbps

RB
Primary: 34Mbps

R1

AS1

BGP router
Peer[N]
BGP Msgs
from Peer[N]
BGP Msgs
from Peer[1]

Peer[1]
Import filter

Attribute
manipulation

BGP RIB
All
acceptable
routes
BGP Decision
Process
One best
route to each
destination

Import filter
l
Selection of acceptable routes
l
Addition of local-pref attribute
inside received BGP Msg
l Normal quality route : local-pref=100
l Better than normal route :local-pref=200
l Worse than normal route :local-pref=50

Peer[N]
Peer[1]
Export filter

Attribute
manipulation

BGP Msgs
to Peer[N]
BGP Msgs
to Peer[1]

Simplified BGP Decision Process


l
Select routes with highest
local-pref
l
If there are several routes,
choose routes with the
shortest ASPath
l
If there are still several routes
tie-breaking rule

How to prefer
some routes over
others
Limitations
RA

AS2

RB

R3

Expensive

AS1 R1

AS3
R5

Cheap

R2

AS4

AS5

How to prefer
routes ?
RA

AS2

Backup: 2Mbps

RB
Primary: 34Mbps

R1

AS1
RPSL-like policy for AS1
aut-num: AS1
import: from AS2 RA at R1 set localpref=100;
from AS2 RB at R1 set localpref=200;
accept ANY
export: to AS2 RA at R1 announce AS1
to AS2 RB at R1 announce AS1

RPSL-like policy for AS2


aut-num: AS2
import: from AS1 R1 at RA set localpref=100;
from AS1 R1 at RB set localpref=200;
accept AS1
export: to AS1 R1 at RA announce ANY
to AS2 R1 at RB announce ANY

How to prefer
routes ?
RA

AS2

RB

R3

AS3

Expensive

R5

AS1 R1

Cheap

R2

AS5

AS4

RPSL policy for AS1


aut-num: AS1
import: from AS2 RA at R1 set
localpref=100;
from AS4 R2 at R1 set localpref=200;
accept ANY
export: to AS2 RA at R1 announce AS1
to AS4 R2 at R1 announce AS1

AS1 will prefer to send over cheap


link

But the flow of the packets destined


to AS1 will depend on the routing

local-pref and
economical
In practice, local-pref is often
relationships
combined with filters to enforce
economical relationships
Prov1

Prov2
$

Peer1

AS1

Peer2

Cust1
Local-pref values used by AS1
> 1000 for the routes received from a Customer
500 999 for the routes learned from a Peer
< 500 for the routes learned from a Provider

Peer3
Peer4

Cust2
$

Shared-cost
Customer-provider

local-pref
Which route will be used by AS1 to reach AS5 ?

AS2
$

AS3
$

AS8

AS4
$

AS7

AS5
$

AS6

Shared-cost
Customer-provider

AS1

and how will AS5 reach AS1 ?


Internet paths are often asymmetrical

NSFNet
Internet
1990s
American
backbone

no commercial
traffic

Some regional
networks

US regions,

national networks
in Europe

Universities/research
labs

Internet early
2000s Tier-1 ISPs

Dozen transit ISPs


shared-cost

Tier-2 ISPs
Regional/ National
ISPs

Tier-3 ISPs
Smaller ISPs,
Entreprises,

shared-cost with

Todays Internet
Hyper Giants

google, microsoft,

yahoo, amazon, ..

google peers 70%


ISPs

Tier-1 ISPs
Tier-2 ISPs
Tier-3 ISPs
Many peerings at

Craig Labovitz), Scott Iekel-Johnson, Danny McPherson, Jon Oberheide, Farnam Jahanian,
Internet Inter-Domain Traffic, SIGCOMM 2010

IXPs

You might also like