10 routing-bgp

49
Week 10 Routing in IP networks Interdomain routing with BGP

Upload: olivier-bonaventure

Post on 05-Jul-2015

468 views

Category:

Engineering


0 download

DESCRIPTION

Tenth lesson of the computer networking class

TRANSCRIPT

Page 1: 10 routing-bgp

Week 10Routing in IP networks

Interdomain routing with BGP

Page 2: 10 routing-bgp

Agenda

• Routing in IP networks

• IPv6 subnets

• Routing organisation

• RIP

• OSPF

• Interdomain routing

Page 3: 10 routing-bgp

Neighbour discovery

IPv6: 1080:0:0:0:8:AEth : A

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

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

1

2

3

IPv6: 1080:0:0:0:8:EEth : E

Ipv6: 1080:0:0:0:8:CEth : C

Ipv6: 1080:0:0:0:8:CEth : C

IPv6: 1080:0:0:0:8:EEth : E

IPv6: 1080:0:0:0:8:AEth : A

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

Ipv6: 1080:0:0:0:8:CEth : C

IPv6: 1080:0:0:0:8:EEth : E

IPv6: 1080:0:0:0:8:AEth : A

Page 4: 10 routing-bgp

ICMPv6 Neighbor

Discovery• Neighbour solicitation

• Neighbour advertisement

Type : 135 Code:0 Checksum

Target IPv6 Address

ReservedThe 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.

Type : 136 Code:0 Checksum

Target IPv6 Address

R S O Reserved

Target link layer Address

The IPv6 and link-layer addresses

R : true if node is a router

S : true if answers to a neighbour solicitation

Page 5: 10 routing-bgp

Router

advertisements

Type:134 Code : 0 Checksum

Retrans Timer

Ver Tclass Flow Label

58 255

Router IPv6 address(link local)

Payload Length

FF02::1 (all nodes)

CurHLim Router lifetime

Maximum hop limit to avoid spoofed packets from

outside LAN

M O Res

Reachable Time

Options

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.

The time, in milliseconds, between retransmitted

Neighbor Solicitation messages.

MTU to be used on the LAN

Prefixes to be used on the LAN

Page 6: 10 routing-bgp

RA options• Format of the options

• MTU option

• Prefix option

Type Length Options

Options (cont.)

Type : 5 Length:1 Reserved

MTU

Type : 3 Length:4 PreLen L A Res.

Valid Lifetime

Preferred Lifetime

Reserved2

IPv6 prefix

Number of bits in IPv6 prefix that identify subnet

The validity period of the prefix in seconds

The duration in seconds that addresses generated from

the prefix via stateless address autoconfiguration remain

preferred.

Page 7: 10 routing-bgp

Autoconfiguration • What happens when an endsystem boots ?

• Use Link-local IPv6 address (FE80::/64)

• Each host, has a link-local IPv6 address

• But another node might have chosen the same address !

R

Ethernet : 0800:200C:417AFE80::M

64(800:200C:417A)

Address is valid if nobody answers

ICMPv6 : Neighbour Solicitation

Sent to multicast address

Is someone using IPv6 address :

FE80::M64(800:200C:417A) ?

Page 8: 10 routing-bgp

Global IPv6 address• How to obtain the IPv6 prefix of the subnet ?

• Wait for router advertisements

• Solicit router advertisement

R

ICMPv6 : Router SolicitationIPv6 Src: FE80::M64(800:200C:417A)

IPv6 Dest: FF02::2Ethernet : 0800:200C:417AFE80::M

64(800:200C:417A)

Page 9: 10 routing-bgp

Global IPv6 address

• IPv6 addresses are allocated for limited lifetime

• This allows IPv6 to easily support renumbering

R

ICMPv6 : Router AdvertisementIPv6 Src: FE80::M

64(EthernetR)

IPv6 Dest: FF02::1IPv6 Prefix = 2001:6a8:1100::/48Prefix lifetime

Ethernet : 0800:200C:417AFE80::M

64(800:200C:417A)

Page 10: 10 routing-bgp

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

Page 11: 10 routing-bgp

ICMP Redirect

R1

2001:db8:1234:5678::/64

2001:db8:1234:5678::AA

2001:db8:1234:5678::BB

2001:db8:1234:5678::2

2001:db8:1234:5678::1

R2

2001:db8:2345::/48

::/0

Page 12: 10 routing-bgp

Agenda

• IPv6

• Routing in IP networks

• IPv6 subnets

• RIP

• OSPF

Page 13: 10 routing-bgp

RIP• Distance vector

• default period : 30 seconds (with jitter)

• distance vector is multicasted in UDP message to all RIP routers in local subnets

• Optional extension :

• send distance vector after each change

• but some links flaps...

• send distance vector if routing table

changed and did not send another

vector within the last 5 seconds

Page 14: 10 routing-bgp

RIP : message format

• RIP messages are sent over UDP

• port 520

Page 15: 10 routing-bgp

RIP : Route Entries

Page 16: 10 routing-bgp

Agenda

• Routing in IP networks

• IPv6 subnets

• RIP

• OSPF

Page 17: 10 routing-bgp

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

Page 18: 10 routing-bgp

OSPF• Operation

• 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 neighbours

Page 19: 10 routing-bgp

OSPF details

R R R R

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

2001:db8:1::C/48

2001:db8:1::B/48

2001:db8:1::A/48

2001:db8:1::D/48

Page 20: 10 routing-bgp

OSPF details (2)

R R R R

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

2001:db8:1::C/48

2001:db8:1::B/48

2001:db8:1::A/48

2001:db8:1::D/48

LAN

Page 21: 10 routing-bgp

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

• OSPF routing must allow any router to send packets to any other router

Page 22: 10 routing-bgp

OSPF details (4)

D E

R7 R8

R9 R10

C

D E

R1 R5

R3 R4

RA

RC

RB

Inside each non-backbone areal Routers exchange link state packets to

distribute the topology of the areal Routers do not know the topology of

other areas, but each router knows how to reach the backbone area

Stub AREA 1

AREA 2

AREA 0

Inside backbone areal Routers exchange link state packets to

distribute the topology of the backbone areal Each router knows how to reach the other

areas and distance vectors are used to distribute inter-area routes

Page 23: 10 routing-bgp

OSPF areas

Page 24: 10 routing-bgp

Equal Cost Multipath

• How to use all paths without hurting

TCP performance

R1 R2

R4

R5

R6

R3 R7

R8

R9

RD

Page 25: 10 routing-bgp

Agenda

• Routing in IP networks

• Interdomain routing

• Peering links

• BGP basics

Page 26: 10 routing-bgp

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

Page 27: 10 routing-bgp

Interdomain links

• Private link

• Usually a leased line between two routers belonging to the two connected domains

R1 R2

DomainA DomainB

Page 28: 10 routing-bgp

Interconnection

exchanges• How to efficiently connect several

domains together ?

R1

R2R3

R4

Physical link

Interdomain link

Page 29: 10 routing-bgp

An Internet exchange

point

Page 30: 10 routing-bgp

AMS-IX• Largest IX in the world

Page 31: 10 routing-bgp

AMS-IX

Page 32: 10 routing-bgp

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

Page 33: 10 routing-bgp

Routing policies with RPSL

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

Page 34: 10 routing-bgp

Agenda

• Routing in IP networks

• Interdomain routing

• Peering links

• BGP basics

Page 35: 10 routing-bgp

Border Gateway Protocol• Path vector protocol

• BGP router advertises its best route to each destination

AS2AS1

AS4

2001:db8:1/48

AS5

lprefix:2001:db8:1/48lASPath: AS1

lprefix: 2001:db8:1/48lASPath: AS4:AS1

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

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

• ... with incremental updates

Page 36: 10 routing-bgp

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

As long as the BGP session remains up

Incrementally update BGP routing tables

AS3

AS4

R1

R2

BGP session

BGP Msgs

Page 37: 10 routing-bgp

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 address/prefix

Page 38: 10 routing-bgp

BGP router

BGP Loc-RIB

Peer[1]

Peer[N]

Import filterAttribute

manipulationPeer[1]

Peer[N]

Export filterAttribute

manipulation

BGP Routing Information BaseContains all the acceptable routes

learned from all Peers + internal routesl BGP decision process selects

the best route towards each destination

BGP Msgs from Peer[1]

BGP Msgs from Peer[N] BGP Msgs

to Peer[N]

BGP Msgs to Peer[1]

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

are acceptable from Peer[i] Export filter(Peer[i])Determines which

routes can be sent to Peer[i]

One bestroute to eachdestination

All acceptable

routes

BGP Decision Process

BGP Adj-RIB-In

BGP Adj-RIB-Out

Page 39: 10 routing-bgp

Example

R2

AS20AS30

R1 R3

AS10

2001:db8:12/48

BGP

R4

AS40

BGPBGP

UPDATElprefix: 2001:db8:12/48,

lNextHop:R1lASPath: AS10

UPDATElprefix: 2001:db8:12/48,

lNextHop:R1lASPath: AS10

UPDATElprefix: 2001:db8:12/48,

lNextHop:R4lASPath: AS40:AS10

UPDATElprefix: 2001:db8:12/48,

lNextHop:R2lASPath: AS20:AS10

l What happens if link AS10-AS20 goes down ?

Page 40: 10 routing-bgp

How to prefer some routes over others ?

R1

RA RB

Backup: 2MbpsPrimary: 34Mbps

AS1

AS2

Page 41: 10 routing-bgp

BGP routerBGP RIB

Peer[1]

Peer[N]

Import filterAttribute

manipulation

Peer[1]

Peer[N]

Export filterAttribute

manipulationBGP Msgs from Peer[1]

BGP Msgs from Peer[N]

BGP Msgs to Peer[N]

BGP Msgs to Peer[1]One best

route to eachdestination

All acceptable

routes

BGP Decision Process

Import filterl Selection of acceptable routesl Addition of local-pref attribute inside received BGP Msg

lNormal quality route : local-pref=100lBetter than normal route :local-pref=200lWorse than normal route :local-pref=50

Simplified BGP Decision Processl Select routes with highest local-pref

l If there are several routes,choose routes with theshortest ASPath

l If there are still several routestie-breaking rule

Page 42: 10 routing-bgp

How to prefer some

routes over others• Limitations

RA

R1 R2

R3RB

Cheap

Expensive

AS1

AS2AS3

AS4

R5 AS5

Page 43: 10 routing-bgp

How to prefer routes ?

R1

RA RB

Backup: 2MbpsPrimary: 34Mbps

AS1

AS2

RPSL-like policy for AS1aut-num: AS1import: 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 AS1to AS2 RB at R1 announce AS1

RPSL-like policy for AS2aut-num: AS2import: 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 ANYto AS2 R1 at RB announce ANY

Page 44: 10 routing-bgp

How to prefer routes ?

RA

R1 R2

R3RB

Cheap

Expensive

AS1

AS2AS3

AS4

R5 AS5

RPSL policy for AS1aut-num: AS1import: 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 AS1to AS4 R2 at R1 announce AS1

u AS1 will prefer to send over cheap link

u But the flow of the packets destined to AS1 will depend on the routing policy of the other domains

Page 45: 10 routing-bgp

local-pref and economical relationshipsl In practice, local-pref is often combined

with filters to enforce economical relationships

AS1

Prov1 Prov2

Peer1

Peer2

Peer3

Peer4

Cust1 Cust2

$ Customer-provider

$

Shared-cost

$

$ $

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

Page 46: 10 routing-bgp

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

• and how will AS5 reach AS1 ?

AS1

AS4

AS2

AS3

AS5$ Customer-provider

Shared-cost

$

$

$

$

$

AS8

$

AS6

AS7

$

$

Internet paths are often asymmetrical

Page 47: 10 routing-bgp

Internet 1990s• NSFNet

• American backbone

• no commercial traffic

• Some regional

networks

• US regions, national

networks in Europe

• Universities/research

labs

• connected to regional

networks or NSFNet

Page 48: 10 routing-bgp

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

other T3 ISPs

Page 49: 10 routing-bgp

Today’s Internet• Hyper Giants

• google, microsoft,

yahoo, amazon, ...

• google peers 70%

ISPs

• Tier-1 ISPs

• Tier-2 ISPs

• Tier-3 ISPs

• Many peerings at IXPs Craig Labovitz), Scott Iekel-Johnson, Danny McPherson, Jon Oberheide, Farnam Jahanian,

Internet Inter-Domain Traffic, SIGCOMM 2010