BGP Route Selection: Huawei Technologies Co., Ltd. All Rights Reserved

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 25

BGP Route Selection

www.huawei.com

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved


Foreword

As an external gateway routing protocol, BGP is responsible


for the exchange of NLRI among AS’. Combined with an
abundance of path attributes, BGP is highly effective at
controlling the exchange of this reachability information in order
to realize route selection.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page2


Objective

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


 Understand the function of path attributes
 Understand the behavior of BGP common path attributes
 Understand the BGP routing selection process

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page3


Contents

Overview of routing attribute


BGP routing selection

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page4


BGP Path Attributes

 BGP path attributes are the characteristics of the advertised


BGP routes. It provides the information that allows BGP to
choose a shortest path, detect routing loops, and determine
routing policy.
 There are 4 types of BGP path attributes:

 Well-known mandatory
 Well-known discretionary
 Optional transitive
 Optional non-transitive

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 5


BGP Path Attributes (Cont.)

 Well-known attribute must be recognized by all BGP


implementations
 Well-known mandatory

− must be included in all BGP update messages


 Well-known discretionary

− may or may not be sent in the BGP update message


 All the well-known mandatory attributes must be included in all
BGP update messages and being advertised to all BGP peers.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 6


BGP Path Attributes (Cont.)

 BGP implementation is not necessarily required to support the optional


attributes
 Optional transitive

− BGP process should accept the path in which it is included even


if it doesn't support the attribute and it should pass the path on
to its peers
 Optional non-transitive

− BGP process that does not recognize the attribute can ignore th
e Update in which it is included and not advertise the path to its
other peers.
 The optional attributes (including transitive and non-transitive) may or
may not be carried in the update message

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 7


Common BGP Path Attributes

1 、 Origin 9 、 Originator-ID
2 、 AS_PATH 10 、 Cluster-List
3 、 Next hop 11 、 Destination Pref
4 、 MED 12 、 Advertiser
5 、 Local-Preference 13 、 Rcid_PATH
6 、 Atomic-Aggregate 14 、 MP_Reach_NLRI
7 、 Aggregator 15 、 MP_Unreach_NLRI
8 、 Community 16 、 Extended_Communitie
s

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 8


Common BGP Path Attributes (Cont.)

BGP Attribute Class


========== || ===============
1. Origin (well-known mandatory)
2. AS_Path (well-known mandatory)
3. Next_Hop (well-known mandatory)
4. Multi_Exit_Disc (optional non-transitive)
5. Local_Pref (well-known discretionary)
6. Atomic_Aggregate (well-known discretionary)
7. Aggregator (optional transitive)
8. Community (optional transitive)
9. Originator ID (optional non-transitive)
10. Cluster List (optional non-transitive)

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 10


Origin Attribute

 The implementation methods specified below are used to determine the


origin attribute of a route
 BGP routes that are directly injected into BGP routing table carry the
IGP origin attribute
− BGP routes that are learned from an IGP routing table via the
network command
 For the routes learned from the EGP (RFC904), its origin is EGP.
 The origin attribute is set to incomplete for other circumstances

− BGP routes that are learned from redistribution carry the incomplete
origin attribute, because there is no way to determine the original
source of the route.
 By default, the value of the origin attribute will not be changed by any of
the routers.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 11


Origin Attribute (Cont.)

[RTB]display bgp routing-table

Total Number of Routes: 2

BGP Local router ID is 192.168.2.1


Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn

*> 192.168.1.0 10.1.1.1 0 0 100i


* 192.168.2.0 10.1.1.1 0 0 100i

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 13


AS Path (AS_PATH) Attribute
18.0.0.0/8
AS300
RTA
AS200
AS400
NLRI 18.0.0.0/8
AS_PATH (400 300 200)

AS500
NLRI 18.0.0.0/8
AS_PATH (500 200)
AS 100
NLRI 18.0.0.0/8
AS_PATH (500 200)

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 14


Question

Will RTA accept this route?

RTA
NLRI 10.0.0.0/8
AS_PATH(387 213)

AS 213 AS 387
RTC
10.0.0.0/8
NLRI 10.0.0.0/8
AS_PATH (213)
RTB

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 16


Planning of the AS_PATH

RTC NLRI 10.0.0.0/8 RTD


AS_PATH (123)
10.0.0.0/8
2 Mbps
2 Mbps AS 462

2 Mbps
NLRI 10.0.0.0/8
AS 123 AS_PATH (462 123)

64 kbps
10.0.0.0/8 AS 387
NLRI 10.0.0.0/8
RTA AS_PATH (123 123 123) RTB

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 17


Next Hop Attribute
RTA RTC
I can reach 18.0.0.0/8 via next hop10.0.0.2 I can reach 19.0.0.0/8 via next hop 10.0.0.1
I can reach 20.0.0.0/8 via next hop10.0.0.3 I can reach 20.0.0.0/8 via next hop 10.0.0.3
I can reach 19.0.0.0/8 via next hop 21.0.0.1

RTC AS200
AS100 10.0.0.2
RTA 18.0.0.0/8
EBGP
10.0.0.1
21.0.0.2 IBGP
IBGP
21.0.0.1 20.0.0.0/8
10.0.0.3
19.0.0.0/8 RTD
RTB
RTB
I can reach 18.0.0.0/8 via next hop 10.0.0.2
I can reach 20.0.0.0/8 via next hop 10.0.0.3

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 18


Local-Preference Attribute

ISP1
Internet
Prefix/mask Local-Pref
210.52.83.0 200
210.52.83.0/24
210.52.82.0 100 RT1
210.52.82.0/24

ISP0
RT4 ISP2
RT2
RT5 RT3

Prefix/mask Local-Pref
210.52.83.0 100
210.52.82.0 200

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 20


MED (Multi-Exit-DISC) Attribute
Prefix/mask MED
 MED is an optional non-
210.52.83.0 50
transitive attribute 210.52.82.0 100

 To discriminate among
multiple entry points to
reach the same AS200
neighboring autonomous RT2 RT1
system (the lowest MED
value is preferred).
 The MED value is sent to
the peer via EBGP
RT3
Prefix/mask MED
210.52.83.0 100
210.52.82.0 50 AS100

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 22


Question
 Why is the link towards RTA (smaller MED value) not selected as
the preferred link to reach network 192.10.0.0/16?

E0 192.10.0.0/16 E0

AS500 RTA AS600


RTB
201.1.1.1/24 160.1.1.1/24
MED MED
10 20

201.1.1.2/24 160.1.1.2/24

RTC
AS700

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 24


Community Attribute

 What is a community attribute?

 It is a group of destinations that share some common


nature and routing policy. They work by setting a common
community attribute in the routes and peers receiving those
routes can recognize the community attribute and apply
appropriate policy.
 Community attribute

 Attribute type code: 8


 Optional transitive attribute

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 25


Community Attribute

 The community attribute comprises of a set of four bytes value


(0x00000000—0xFFFFFFFF)
 Reserved community attributes

− 0x00000000—0x0000FFFF
− 0xFFFF0000—0xFFFFFFFF
 Well-known community attribute:

− NO_EXPORT (0xFFFFFF01)
− NO_ADVERTISE (0xFFFFFF02)
− NO_EXPORT_SUBCONFED (0xFFFFFF03)
 Private community attribute

− AS(2B):Number(2B)
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 26
Contents

Overview of routing attribute


BGP routing selection

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page28


BGP Route Selection Process

 If the next hop of this route is unreachable, then ignore this route

 Select the route with highest Preferred-Value

 Select the route with highest local preference

 Prefer the aggregated route to the detailed routes

 Prefer the route with the shortest AS_PATH.

 BGP compares the origin attribute of the route and selects the route with the
lowest origin attribute code: IGP is lower than EGP, which is lower than
Incomplete.
 Select the route with the lowest MED value. This comparison is done only if
the AS number is the same for all the routes being considered.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 29


BGP Route Selection Process (Cont.)

 Prefer EBGP routes over IBGP routes.

 Prefer the route with the shortest path to the BGP NEXT_HOP. This is the
route with the lowest IGP metric to the next-hop router.
 When all the above are identical, they are equivalent route and can be
used for load balancing
− Note: AS_PATH must be the same
− The last 3 route selection rules can be ignored when load balancing
is implemented.
 Selects the route with the shortest cluster-list

 Prefer the route with smaller Originator ID. Select the route with smaller
router ID if Originator ID is unavailable.
 Prefer the route with smaller peer IP address.

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 30


Summary

 What are BGP path attributes?

 How many attributes are available at


present?
 How does the AS_PATH attribute
prevent the routing loop?
 What is the difference between the
MED and LOCAL_PREF attribute?

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 31


Thank You
www.huawei.com

You might also like