05 BGP

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Lab Course

RouterLab
BGP - Border Gateway Protocol
(RFC 4271)

Some of the slides come from: http://www.ietf.org/proceedings/07dec/slides/IDRTut-0.pdf


1

Miscellaneous
Anything that needs discussion?

BGP

Miscellaneous
Anything that needs discussion?
SUBMIT YOUR CONFIG
FILES, TRACES, COMMAND
DUMP!!!

BGP

Internet Routing
There is no single....
-

Routing Protocol
Routing Configuration
Routing State,
Routing Management

....... for the entire Internet!


Routing System is a collection of many

components hopefully operating in a consistent


manner
BGP

Internet Routing
Distance Vector
-

I tell you all my best


routes for all
destinations that I
know and you tell me
yours.
Build simplified
topology from local
perspective
E.g. RIP

BGP

Link State
-

I announce to everyone
about my links and the
addresses I originate on
each link and listen to
everyones
announcement.
Build full topology
E.g. OSPF

Internet Routing
The Routing Architecture uses a 2-level

hierarchy, based on the concept of a routing


domain (Autonomous System - AS)

An AS is an interconnected network with a

single exposed topology, a coherent routing


policy, and a consistent metric framework

Within an AS: Interior Gateway Protocols - IGP


Among ASes: Exterior Gateway Protocols - EGP
BGP

IGPs and EGPs


IGPs
-

Distance Vector: RIP, IGRP, EIGRP


Link State: OSPF, IS-IS

Distance Vector: (EGP, BGPv3) BGPv4

EGPs

BGP

OSPF

RIP/OSPF

RIP/OSPF

What the Internet looks like!


IS-IS/OSPF

AS1

AS666
RIP/OSPF

AS3
OSPF

AS2

OSPF

AS7
RIP

BGP

EGP
IGP

IS-IS

AS69
7

Why BGP?
!

!
!

!
!

Simple protocol to implement and


operate
Very simple distance metric
Occludes local policies from external
inspection
Limited inter-SP coordination required
Mature deployment

Source: http://www.ietf.org/proceedings/07dec/slides/IDRTut-0.pdf

BGP

Why BGP?
!

!
!

!
!

Simple protocol to implement and


operate
Very simple distance metric
Occludes local policies from external
inspection
Limited inter-SP coordination required
Mature deployment

Source: http://www.ietf.org/proceedings/07dec/slides/IDRTut-0.pdf

BGP

So simple that to have full knowledge


you should read 15 RFCs (~400 Pages!)

RFC 4271, A Border Gateway Protocol 4


(BGP-4)

RFC 4456, BGP Route Reflection - An


Alternative to Full Mesh Internal BGP (IBGP)

RFC 4278, Standards Maturity Variance


Regarding the TCP MD5 Signature Option
(RFC 2385) and the BGP-4 Specification

RFC 4277, Experience with the BGP-4


Protocol

RFC 4276, BGP-4 Implementation Report

RFC 4275, BGP-4 MIB Implementation Survey

RFC 4274, BGP-4 Protocol Analysis

RFC 4273, Definitions of Managed Objects for


BGP-4

RFC 4272, BGP Security Vulnerabilities


Analysis

RFC 3392, Capabilities Advertisement with


BGP-4

RFC 5065, Autonomous System


Confederations for BGP

RFC 2918, Route Refresh Capability for BGP-4

RFC 1772, Application of the Border Gateway


Protocol in the Internet Protocol (BGP-4) using
SMIv2

RFC 4893, BGP Support for Four-octet AS


Number Space

Why BGP?
!

!
!

!
!

Simple protocol to implement and


operate
Very simple distance metric
Occludes local policies from external
inspection
Limited inter-SP coordination required
Mature deployment

AS-Path, which is a variation of the


Distance-Vector Algorithm.
Guess what: it still doesnt scale!!!

Source: http://www.ietf.org/proceedings/07dec/slides/IDRTut-0.pdf

BGP

Why BGP?
!

!
!

!
!

Simple protocol to implement and


operate
Very simple distance metric
Occludes local policies from external
inspection
Limited inter-SP coordination required
Mature deployment

Consequence of the Distance-Vector


Algorithm.

Source: http://www.ietf.org/proceedings/07dec/slides/IDRTut-0.pdf

BGP

Why BGP?
!

!
!

!
!

Simple protocol to implement and


operate
Very simple distance metric
Occludes local policies from external
inspection
Limited inter-SP coordination required
Mature deployment

BGP sessions are statically set up and


manually managed, is this limited interSP coordination?
Well.... they can do dirty things in the
route selection process without the
need to talk to each other!
(You will do it in the worksheet)

Source: http://www.ietf.org/proceedings/07dec/slides/IDRTut-0.pdf

BGP

Why BGP?
!

!
!

!
!

Simple protocol to implement and


operate
Very simple distance metric
Occludes local policies from external
inspection
Limited inter-SP coordination required
Mature deployment

On this they are right! It is the De


Facto Standard.

Source: http://www.ietf.org/proceedings/07dec/slides/IDRTut-0.pdf

BGP

BGP Basics
BGP obtains route to prefixes from neighboring
ASes

BGP Propagate best routes to other neighbors


-

best depends on policies that depend on neighbors


business relationship (customer-provider model, peering)

Each BGP routing object is a Prefix and a set of


attributes:

<AS Path vector, Origin, Next Hop, Local Pref, >

AS Path Vector is a vector of AS identifiers that form a viable path

Used for loop prevention and best-path selection


BGP

OSPF

RIP/OSPF

RIP/OSPF

Prefix Announcements
AS1

AS666

AS3
AS2
AS7
10.0.0.0/8

BGP

AS69
10

OSPF

RIP/OSPF

RIP/OSPF

Prefix Announcements
AS1

AS666

AS3
AS2
10.0.0.0/8
AS7

BGP

AS7
10.0.0.0/8

10.0.0.0/8
AS7

AS69
10

OSPF

RIP/OSPF

RIP/OSPF

Prefix Announcements
10.0.0.0/8
AS2 AS7

AS1
10.0.0.0/8
AS2 AS7

AS3

AS666

10.0.0.0/8
AS3 AS7

AS2
10.0.0.0/8
AS7

BGP

AS7
10.0.0.0/8

10.0.0.0/8
AS7

AS69
10

OSPF

RIP/OSPF

RIP/OSPF

Prefix Announcements

10.0.0.0/8
AS1 AS2 AS7

10.0.0.0/8
AS2 AS7

AS1
10.0.0.0/8
AS2 AS7

AS3

AS666

10.0.0.0/8
AS3 AS7

AS2
10.0.0.0/8
AS7

BGP

AS7
10.0.0.0/8

10.0.0.0/8
AS7

AS69
10

OSPF

RIP/OSPF

RIP/OSPF

Prefix Announcements

10.0.0.0/8
AS1 AS2 AS7

10.0.0.0/8
AS2 AS7

AS1

AS666

Prefix
AS Path
* 10.0.0.0/8 AS3 AS7
10.0.0.0/8 AS1 AS2 AS7

10.0.0.0/8
AS2 AS7

AS3

10.0.0.0/8
AS3 AS7

AS2
10.0.0.0/8
AS7

BGP

AS7
10.0.0.0/8

10.0.0.0/8
AS7

AS69
10

BGP = DV Protocol
Maintains a collection of local best paths for all
advertised prefixes

Passes changes to all neighbors containing:


-

One single best-path for each prefix


Only incremental updates never a full dump (unless
opening the session or other specific events)

Changes reflect only events in the local


database:

New reachability information to a prefix (update)


Reachability information lost for a prefix (withdraw)
BGP

11

BGP Messages
Peers exchange messages over TCP sessions
-

Port:179
Can span several physical links

Open TCP Connection


Authenticate peers

Advertises new paths


Withdraw old paths
Carry all the attributes of the path

OPEN

UPDATE
BGP

12

BGP Messages
KEEPALIVE
-

Keeps connection alive in the absence of updates


Otherwise connection is reset due to inactivity

Reports errors in previous messages


Used to close a session

Request for full routing information without breaking TCP


connection
There are BGP sessions that have lasted years!

NOTIFICATION

ROUTE_REFRESH
-

BGP

13

BGP Messages over TCP


BGP is not a byte stream protocol like TCP
The byte stream is divided into messages using
BGP-defined markers

Each message is a standalone protocol element


Maximum message size: 4096 bytes

BGP

14

Path Attributes (I)


Origin
-

How this route was injected into BGP in the first place

Exit border router

Preference between 2 or more sessions among the same


AS pair

Next_hop

Multi-Exit-Discriminator
Local-Pref
-

Local preference setting


BGP

15

Path Attributes (II)


Atomic Aggregate
-

The path is the result of aggregation

ID of proxy aggregator

Locally defined information field

Preference setting for remote AS

Aggregator

Community

Destination-Pref
BGP

16

OSPF

RIP/OSPF

RIP/OSPF

Local_Pref
AS1

AS666
Prefix
AS Path
* 10.0.0.0/8 AS3 AS7
10.0.0.0/8 AS1 AS2 AS7

AS3
AS2
AS7
10.0.0.0/8

BGP

AS69
17

OSPF

RIP/OSPF

RIP/OSPF

Local_Pref
AS1

AS666
Prefix
ASAS
Path
Prefix
Path
AS3AS3
AS7AS7
* 10.0.0.0/8
10.0.0.0/8
* 10.0.0.0/8 AS1 AS2 AS7

LP
10
20

10.0.0.0/8 AS1 AS2 AS7

AS3
AS2
AS7
10.0.0.0/8

BGP

AS69
17

OSPF

RIP/OSPF

RIP/OSPF

Peering & C-P Relationship


AS1

$$
$$

AS666
=
$$

Prefix
AS Path
10.0.0.0/8 AS3 AS7
* 10.0.0.0/8 AS1 AS2 AS7

LP
10
20

AS3
AS2
$$

$$
AS7
10.0.0.0/8

BGP

$$ Customer- Provider AS69


= Peering

18

OSPF

RIP/OSPF

RIP/OSPF

MED Example
10.0.0.0/8 MED 10
11.0.0.0/8 MED 20
AS2

10.0.0.0/8
11.0.0.0/8

10.0.0.0/8 MED 20
11.0.0.0/8 MED 10
AS2

AS1

Text

AS666

AS3

AS2
AS7
AS69
BGP

19

eBGP and iBGP


eBGP is used across AS boundaries
To synchronize all eBGP speakers of an AS
iBGP is used

iBGP sessions are manually configured


iBGP needs a full mesh (or at least a flooding
hierarchy - Route Reflectors)

iBGP does not detect loops


iBGP does not prepend AS number
BGP

20

iBGP

eBGP
iBGP
BGP

21

iBGP

eBGP
iBGP
BGP

21

iBGP + RR
Route-Reflector

eBGP
iBGP
BGP

22

Anything Missing?

BGP

23

(Best) Route Selection


For a set of received advertisements of the

same prefix the local best selection is based


on:

1.
2.
3.
4.
5.
6.

Highest value Local_Pref


Shortest AS Path length
Lowest MED
Minimum IGP cost to Next_Hop Address
eBGP-learned routes preferred to iBGP-learned routes
Prefer paths learned from router with smaller ID (selected
in the same way as for OSPF)
BGP

24

Worksheet 5
Use New VLANs topology
Target: Configure BGP and learn to use policies
Readings:

Cisco BGP
Juniper BGP
RFC 4271

BGP

25

Any other Question?

BGP

26

You might also like