Sei sulla pagina 1di 31

ODA000011 BGP Routing Protocol

ISSUE 1.0

Fixed Network Curriculum Development Section

Objectives

Upon completion of this course, you will be able to:

Master principle of BGP protocol

Course Contents

Chapter 1 Overview of BGP Chapter 2 BGP route attributes and its applications

Overview of BGP

BGP is an external routing protocol, used to transmit routing

information between ASs

It is a kind of distance-vector routing protocol and avoids the occurrence of loop in design

It provides additional attribute information for the route Transfer protocol: TCP; port No.: 179 It supports Classless Inter-Domain Routing (CIDR) Route updating: transmit incremental routes only Abundant route filtering and routing strategies

Autonomous System

What is an Autonomous System (AS)?

Why need AS?


The routing protocol inside the AS The routing protocol between ASs -- BGP

Working Mechanism of BGP


AS1 AS2 AS3

AS4

AS5

AS7

AS6

Two Kinds of Neighbors of BGP--IBGP & EBGP

RTA

RTE

EBGP IBGP

EBGP

RTB RTC

RTD

Route Advertising Principles of BGP


The BGP Speaker only selects the best one for its own use The BGP Speaker only advertises the routes used by itself to its neighbors

For the routes obtained from EBGP, the BGP Speaker will advertise them to all its neighbors (including EBGP and IBGP)

For the routes obtained from IBGP, the BGP Speaker will not
advertise them to its IBGP neighbors

For the routes obtained from IBGP, whether the BGP Speaker

will advertise them to its EBGP neighbors depends on the


synchronization state of IGP and BGP

Once the connection is established, the BGP Speaker will advertise all its BGP routes to the new neighbors

BGP Synchronization

E0:10.1.1.1/24 RTA AS100 S0:1.1.1.1/24 EBGP S0:1.1.1.2/24 RTB S1:2.1.1.2/24 RTC IBGP S0:2.1.1.1/24 RTE

AS300
RTF
EBGP

AS200

RTD

One Way to Become the BGP Route -- Full Dynamic Redistribution

AS200
18.0.0.1/8
OSPF

RTB

OSPF discovers route 18.0.0.1/8 Dynamically redistribute the route discovered by IGP (OSPF) into the BGP routing table of RTB

The Second Way to Become the BGP Route: Semi Dynamic Redistribution

AS200
18.0.0.1/8 OSPF

RTB

OSPF discovers the route 18.0.0.1/8 Semi-dynamically redistribute the route discovered by IGP (OSPF) into the BGP routing table of RTB

The Third Way to Become the BGP Route: Static Redistribution

AS200
18.0.0.1/8

RTB

Manually configure the static route 18.0.0.1/8 Redistribute the static route manually configured into the BGP routing table of RTB

BGP Messages

There are four types of BGP messages:


Open: greeting--"hello, let's make friends!"


Keepalive: I'm alive, don't leave me alone Update: fresh news... Notification: i won't play with you any more!

BGP Message Header

BGP messages have the same format: "message header +

packet body"

The BGP header is given as follows:

Marker(16 byte) Length(2 byte) Type(1 byte)

Open Message

Open Message consists of the Message header and the

structure below

Vision My Autonomous System


Hold Time BGP Identifier
Optional Paramenters Length

Optional Paramenters

Keepalive Message

Keepalive Message has the header only

Marker(16 byte)

Length(2 byte)

Type(1 byte)

Update Message

An Update Message consists of the header and the following

structure

Unfeasible Routes Length Withdrawn Routes Path Attribute Length Path Attribute Network Layer Reachability Information

Notification Message

A Notification packet consists of the header and the structure

below

Error Code Error Subcode Data


Error
Code Error Type
Header error OPEN error UPDATE error Hold time expiry State Machine error Exit

Massage Massage

Finite State Machine of BGP


TCP connection fails
Active Connect-Retry timer expiry

Connect-Retry timer expiry


Connect Others Others Start

TCP connection fails

TCP connection setup


TCP connection setup Open-sent Error Correct OPEN packet received Error

Idle

Error

Open-confirm KeepAlive timer expiry

Established KeepAlive packet received

1. KeepAlive timer expiry 2. Update received 3. KeepAlive received

Application of Messages in BGP

The Open message is sent when establishing a BGP

connection via TCP

After the connection is established, the UPDATE message is sent to notify the peer of the routing information if a route needs to be sent or route change occurs

After stabilization, it is necessary to send the KEEPALIVE message periodically to keep the validity of the BGP connection

When an error is found during the running of local BGP, NOTIFICATION message shall be sent to notify the BGP peer

Course Contents

Chapter 1 Overview of BGP Chapter 2 BGP route attributes and its applications

BGP Route Attributes

Describe the features of a route

Transitional and non-transitional


Mandatory and optional Easy to expand

Up to now, 16 kinds of attributes are available

Focus of BGP Protocol

Common BGP Route Attributes

1.Origin 2.AS-Path 3.Next hop 4.MED 5.Local-Preference 6.Atomic-Aggregate 7.Aggregator 8.Community

9.Originator-ID 10.Cluster-List 11.Destination Pref (MCI) 12.Advertiser (Baynet) 13.Rcid-Path (Baynet) 14.MP_Reach_NLRI 15.MP_Unreach_NLRI 16.Extended_Communities

Origin Attribute

In a specific implementations, the Origin of one route is

determined as:

If a route is redistributed into the BGP routing table with the specifically, the origin attribute shall be IGP

If a route is obtained via EGP, the origin attribute shall be EGP Otherwise, the Origin attribute should be Incomplete

AS-Path Attribute
AS300
D(18.0.0.0/8)

AS200 AS400 D,dl 400 300 200 AS100


RTA 30.0.0.1

30.0.0.2 RTB

AS500 D,d2 500 200

D,d1 400 300 200 >D,d2 500 200

Next Hop Attribute


AS200
18.0.0.0/8 10.0.0.2

RTC

RTA
AS100 21.0.0.2

10.0.0.1

EBGP
IBGP
21.0.0.1

IBGP
20.0.0.0/8

10.0.0.3

19.0.0.0/8

RTD

RTB
RTA
I can reach 18.0.0.0/8 via the next hop10.0.0.2 I can reach 20.0.0.0/8 via the next hop 10.0.0.3 I can reach 19.0.0.0/8 via the next hop 21.0.0.1

RTC
I can reach 19.0.0.0/8 via the next hop 10.0.0.1 I can reach 20.0.0.0/8 via the next hop 10.0.0.3

RTB
I can reach 18.0.0.0/8 via the next hop 10.0.0.2 I can reach 20.0.0.0/8 via the next hop 10.0.0.3

Local Precedence Attribute


AS400

D (18.0.0.0/8)
RTF

AS200 RTD 30.0.0.1 20.0.0.1 RTE

AS300

30.0.0.2 RTB Dlocal-pref1 100 RTA


Dlocal-pref1 100 >Dlocal-pref2 200

AS100

20.0.0.2 RTC Dlocal-pref2 200

RTA will select local-pref2 that hashigher local preference

Multi-Exit-DISC (MED) Attribute


AS100 >D,metric1 10 D,metric2 20

RTA 30.0.0.1
RTA will select the lower metric

20.0.0.1

D,metric1 10
RTB

30.0.0.2

20.0.0.2

D,metric2 20 RTC

IBGP
D(18.0.0.0/8)

AS200

Community Attribute

A community is a group of routes that have the same destination.A community is not limited to a network or an AS only. It has no physical boundary.Accepted communities:

no-export

Do not notify the BGP neighbors outside the alliance/AS

no-advertise

Do not notify any BGP neighbors

local-AS

Do notify the EBGP neighbors

Internet

Notify all other routers

BGP Route Selection Procedure

In general, the procedure of local BGP route selection is:

1. If the next hop of this route is unreachable, then neglect this


route.

2. Select the route with a higher local preference. 3. Select the originated route by the local router (same local precedence).

4. Select the route whose AS path is shortest. 5. Select the route whose origin type is IGP, EGP, and

Incomplete in turn.

6. Select the route whose MED is smallest. 7. Select the route whose Router ID is smallest.