You are on page 1of 36

Internal

ODA030010 BGP Routing Protocol
ISSUE 1.4
www.huawei.com

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Upon completion of this course, you will be able to:  Understand the principle of BGP  Understand the features of Attributes

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 1

Chapter 1 Principle of BGP

Chapter 2 BGP Route Attributes

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 2

It provides additional attribute information for the route  Transfer protocol: TCP. used to transmit routing information between ASs  It is a kind of distance-vector routing protocol and avoids the occurrence of loop in design..: 179  It supports Classless Inter-Domain Routing (CIDR)  Route updating: transmit incremental routes only  Abundant route filtering and routing policies HUAWEI TECHNOLOGIES CO.Overview Of BGP  BGP is an exterior routing protocol. port No. All rights reserved Page 3 . LTD.

which are managed by the same technical management organization and adopt the unified routing strategy..  which routing protocol running inside the AS IGP routing protocol such as static route. IS-IS etc  Which routing protocol running between ASs BGP only HUAWEI TECHNOLOGIES CO.Autonomous System  What is an Autonomous System (AS)? The Autonomous System (AS) refers to a set of routers. LTD. All rights reserved Page 4 . Each AS has a unique AS number. which is allocated by the management organization authorized by the Internet. OSPF .

All rights reserved Page 5 .. LTD.Working Mechanism Of BGP AS1 AS2 AS3 AS4 AS5 AS7 AS6 HUAWEI TECHNOLOGIES CO.

LTD.. All rights reserved Page 6 .IBGP Neighbor & EBGP Neighbor RTA AS100 AS300 RTE EBGP IBGP EBGP RTB RTD AS200 RTC HUAWEI TECHNOLOGIES CO.

LTD. the BGP Speaker will not advertise them to its IBGP neighbors  For the routes obtained from IBGP.Route Advertising Principles of BGP  BGP Speaker only selects the best one for its own use  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. 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. All rights reserved Page 7 . the BGP Speaker will advertise all its BGP routes to the new neighbors HUAWEI TECHNOLOGIES CO.

1.BGP Synchronization E0:10..1/24 RTA AS100 S0 EBGP EBGP AS300 RTF RTB S1 IBGP RTE RTC AS200 RTD HUAWEI TECHNOLOGIES CO. LTD.1. All rights reserved Page 8 .

. All rights reserved Page 9 .1/8 OSPF RTB  OSPF discovers route 18.0.0. LTD.0.1/8  Dynamically redistribute the route discovered by IGP (OSPF) into the BGP routing table of RTB HUAWEI TECHNOLOGIES CO.Full Dynamic Redistribution AS200 18.0.

All rights reserved Page 10 . LTD.1/8 OSPF RTB  OSPF discovers the route 18.1/8  Semi-dynamically redistribute the route discovered by IGP (OSPF) into the BGP routing table of RTB HUAWEI TECHNOLOGIES CO.0.0..Semi Dynamic Redistribution AS200 18.0.0.

0.Static Redistribution AS200 18.1/8  Redistribute the static route manually configured into the BGP routing table of RTB HUAWEI TECHNOLOGIES CO. All rights reserved Page 11 .0. LTD.1/8 RTB  Manually configure the static route 18..0.0.

. let's make friends!"  Keepalive: I'm alive. don't leave me alone  Update: fresh news.. LTD.BGP Messages  There are four types of BGP messages:  Open: greeting--"hello. All rights reserved Page 12 ..  Notification: i won't play with you any more! HUAWEI TECHNOLOGIES CO.

. All rights reserved Page 13 .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) HUAWEI TECHNOLOGIES CO. LTD.

LTD.. All rights reserved Page 14 .Open Message  Open Message consists of the Message header and the structure below Version(1byte) My Autonomous System (2byte) Hold Time (2byte) BGP Identifier (4byte) Optional Parameters Length (1byte) Optional Parameters HUAWEI TECHNOLOGIES CO.

Keepalive Message  Keepalive Message only has the header Marker(16 byte) Length(2 byte) Type(1 byte) HUAWEI TECHNOLOGIES CO.. All rights reserved Page 15 . LTD.

.Update Message  An Update Message consists of the header and the following structure Unfeasible Routes Length (2byte) Withdrawn Routes (variable length) Path Attribute Length (2byte) Path Attributes (variable length) Network Layer Reachability Information (variable length) HUAWEI TECHNOLOGIES CO. All rights reserved Page 16 . LTD.

All rights reserved Page 17 .. LTD.Notification Message  A Notification packet consists of the header and the structure below Error Code (1byte) Error Subcode (1byte) Data (variable length) Error Code Error Type 1 Header error 2 OPEN Massage error 3 UPDATE Massage error 4 Hold time expiry 5 State Machine error 6 Exit HUAWEI TECHNOLOGIES CO.

. Update received 3. LTD. KeepAlive received HUAWEI TECHNOLOGIES CO. KeepAlive timer expiry 2. All rights reserved Page 18 .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.

LTD.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. All rights reserved Page 19 . NOTIFICATION message shall be sent to notify the BGP peer HUAWEI TECHNOLOGIES CO. 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..

Chapter 1 Principle of BGP Chapter 2 BGP Route Attributes HUAWEI TECHNOLOGIES CO. LTD.. All rights reserved Page 20 .

BGP Path Attributes  A Path Attribute is a characteristic of an advertised BGP route.  Each Path Attribute falls into one of four categories:  Well-known mandatory  Well-known discretionary  Optional transitive  Optional nontransitive HUAWEI TECHNOLOGIES CO. LTD.. All rights reserved Page 21 .

LTD.Path Attribute Well-known mandatory ORIGIN AS-Path Next hop Optional nontransitive Multi-Exit-Disc (MED) ORIGINATOR-ID Cluster-List Well-known discretionary Local-Preference Atomic-Aggregate Destination Pref (MCI) Advertiser (Baynet) Rcid-Path (Baynet) MP_Reach_NLRI MP_Unreach_NLRI Extended_Communities Optional transitive Aggregator Community HUAWEI TECHNOLOGIES CO. All rights reserved Page 22 ..

 Incomplete NLRI was learned by some other means. LTD. Routes that BGP learns through redistribution carry the incomplete origin attribute. BGP routes are given an origin of IGP if they are learned from an IGP routing table via the network statement.  EGP NLRI was learned from the Exterior Gateway Protocol.ORIGIN Attribute  ORIGIN specifies the origin of the routing update. it uses ORIGIN as one factor in determining the preferred route. All rights reserved Page 23 . Incomplete imply that the information for determining the origin of the route is incomplete. When BGP has multiple routes..  Which one is preferred? IGP > EGP > Incomplete HUAWEI TECHNOLOGIES CO.  IGP NLRI (Network layer Reachability Information) was learned from a protocol internal to the originating AS.

2 RTB AS500 HUAWEI TECHNOLOGIES CO.  AS-PATH describes all AS it has passed through . All rights reserved Page 24 ..beginning with the most recent AS and ending with the originating AS.0.0.0/8) AS200 RTA 30. LTD.0.0. AS300 AS400 D(18.1 D (400 300 200) AS100 D (500 200) 30.AS_PATH Attribute  AS-PATH uses a sequence of AS numbers to describe the inter-AS path or route to the destination specified by the NLRI.0.0.

200) HUAWEI TECHNOLOGIES CO.AS_PATH Attribute  The Function of AS-PATH  AS can influence its incoming traffic by changing the AS_PATH of its advertising route  AS_PATH can be used for loop avoidance AS300 AS400 D(18.200.0. LTD.0.0..0.0.1 D (400 300 200) D (200 200 200) 30.0.2 RTB AS500 AS100 D (500 200. All rights reserved Page 25 .0/8) AS200 RTA 30.

0.0/8 IBGP 10.1 I can reach 20.0.0.0.3 I can reach 19.3 HUAWEI TECHNOLOGIES CO.0.0/8 via the next hop 10.0.0.0.0.0. LTD.0.0.0.0.0/8 via the next hop 21.2 AS200 18.0.1 20.1 10.0..0.2 EBGP IBGP 21.0.0.0.0.0.0.0.0/8 via the next hop 10.0.1 RTC I can reach 19.0.0/8 via the next hop 10.2 I can reach 20.0.0.0.0/8 via the next hop10.0/8 10.0.0.3 19.0.0/8 via the next hop 10.3 RTB I can reach 18.0.0.0/8 RTD RTB RTA I can reach 18.0.0. All rights reserved Page 26 .0.0.Next Hop Attribute RTC RTA AS100 21.0/8 via the next hop 10.0.0.0.0.0.2 I can reach 20.0.

All rights reserved Page 27 .  The LOCAL_PREF attribute affects only traffic leaving the AS.. it compares the LOCAL_PREF attribute of the routes. LTD.  LOCAL_PREF is only in updates between internal BGP peers and it is not passed to other AS.  If an internal BGP speaker receives multiple routes to the same destination.LOCAL_PREF Attribute  LOCAL_PREF is used to communicate a BGP router’s degree of preference for an advertised route. The route with highest LOCAL_PREF is selected. HUAWEI TECHNOLOGIES CO.

0.0.0.0.2 RTB D,local-pref1 100 RTA   AS100 20.LOCAL_PREF Attribute AS400 D (18.0.0.1 20.0.1 AS300 RTE 30.0.2 RTC D,local-pref2 200 D,local-pref1 D,local-pref2 100 200 RTA will select local-pref2 that has higher local preference All rights reserved Page 28 HUAWEI TECHNOLOGIES CO..0. LTD.0/8) RTF AS200 RTD 30. .0.

 The MED is passed between internal peers of the receiving AS but not passed beyond the receiving AS. All rights reserved Page 29 . HUAWEI TECHNOLOGIES CO.  If all else is equal .  MED attribute affects only the incoming traffic to the AS..MULTI-EXIT-DISC (MED) Attribute  MED is carried in EBGP updates and allows an AS to inform another AS of its preferred ingress points. an AS receiving multiple routes to the same destination compare the MED of the routes. MEDs are not compared if two routes to the same destination are received from two different AS. MED is used only to influence traffic between two directly connected AS. LTD. The lowest MED value is prefered. It is meant only for a single AS to demonstrate a degree of preference when it has multiple ingress points.

metric2 20 RTA 30.0. LTD.2 20.metric2 20 RTC IBGP D(18.0.0/8) AS200 HUAWEI TECHNOLOGIES CO.metric1 10 RTB 30..0.0.metric1 10 D.MULTI-EXIT-DISC (MED) Attribute AS100 D.0.0. All rights reserved Page 30 .0.1 20.1 RTA will select the lower metric D.0.0.0.2 D.

.Community Attribute  Community is designed to simplify policy enforcement.  The COMMUNITY attribute is a set of four octets values AA:NN. NN is an administratively defined identifier. HUAWEI TECHNOLOGIES CO. AA is AS number. LTD. All rights reserved Page 31 . It identifies a destination as a member of some community of destinations that share one or more common properties.

LTD. Received routes belonging to this community are advertised freely HUAWEI TECHNOLOGIES CO.Well-known Community  NO_EXPORT − Routes received carrying this value cannot be advertised to EBGP peers and outside of the confederation  NO_ADVERTISE − Routes received carrying this value cannot be advertised at all to either EBGP or IBGP peers.  INTERNET − All routes belong to this community by default. All rights reserved Page 32 .  LOCAL_AS − Routes received carrying this value cannot be advertised to EBGP peers including peers in other AS within a confederation..

EGP lower than Incomplete ). All rights reserved Page 33 .  5. Select the route with a higher local preference. Select the route with shortest AS path.. this route is not selected.  2. LTD. Select the route with smallest MED .  7.BGP Route Selection Procedure  In general.  6.  3. HUAWEI TECHNOLOGIES CO. Select the route with lowest origin code (IGP lower than EGP. Select the originated route by the local router (same local precedence). the procedure of local BGP route selection is:  1. If the next hop of this route is unreachable.Performing load sharing on multiple routes according to the configured number of routes (in case load sharing is configured and there are multiple external routes to the same AS)  8.  4. Select the route with smallest Router ID .

. All rights reserved Page 34 .Summary  Feature of BGP  Difference with the IGP and EGP  Principle of BGP  The route attributes of BGP HUAWEI TECHNOLOGIES CO. LTD.

Thank You www.huawei.com .