Presentation is loading. Please wait.

Presentation is loading. Please wait.

BGP V1.1. When is BGP Applicable Basic BGP Peer Configuration Troubleshooting BGP Connections BGP Operation and Path Attributes Route Import/Export Selected.

Similar presentations


Presentation on theme: "BGP V1.1. When is BGP Applicable Basic BGP Peer Configuration Troubleshooting BGP Connections BGP Operation and Path Attributes Route Import/Export Selected."— Presentation transcript:

1 BGP V1.1

2 When is BGP Applicable Basic BGP Peer Configuration Troubleshooting BGP Connections BGP Operation and Path Attributes Route Import/Export Selected Commands Objectives

3 Contents BGP overview BGP terminology BGP packet types and connection status BGP route announcing methods BGP route announcing principles BGP attributes and route selection

4 AS100AS200 AS300 AS400 AS500 Internet development Till Dec,1969 there is only 4 sites Now it has developed to a global network The whole network is divided into several ASs Easy to manage

5 How big is Internet? A router running BGP in Internet has: The size of the route table is bigger than 30 Mb More than 70,000 routes in the route table More than 6,500 AS numbers

6 Autonomous Systems AS(autonomous system ) is a big network that under the same technique management. IGPs work in the same AS ( autonomous system ) EGPs connect different AS ( autonomous system ) Autonomous System 65000 Autonomous System 65500 IGPs: RIP, IGRP, OSPF, EIGRP EGPs: BGP ABCDEFGHIJ

7 AS100 AS ( Autonomous Systems ) Every AS has its own AS number Routing policy in each AS is independent AS number : 1 ~ 65535 ABCDE

8 BGP ( Border Gateway Protocol ) BGP is a kind of EGP BGP is a commonly used standard protocol Version used now : BGPv4 BGP use AS number to avoid route loop Inner routing protocol: RIP/IGRP/OSPF/EIGRP/ISIS AS100 IGRP AS200 OSPF AS300 RIP BGP B A C

9 BGP is used among ASs BGP is used among ASs to ensure that there is no loop in the network BGP AS300 AS100 B C C D A 130.1.0.0/16 AS 400 AS200 130.1.0.0/16 AS:100 130.1.0.0/16 AS:200 100 130.1.0.0/16 AS:200 100 130.1.0.0/16 AS:400 200 100

10 Comparison among some routing protocols Interior or Exterior DV or LS Hierarchy Required OSPF Protocol ISIS Interior LS Yes BGP Exterior Advanced DV Metric Cost Path vectors or attributes No

11 When to use BGP? BGP is suitable in these occasions: One AS allow data stream to pass through it to reach another AS (such as ISP) One AS has several exits to other ASs One AS wants to control the data stream within itself Of course , you need to be familiar with the operation and function of BGP to make good use of it

12 When we don’t use BGP? BGP is not effective for all occasions. In the following occasions we don’t use BGP : There is only one exit to Internet or other AS Within your AS,you don’t care about route policy and route selection If the router is not powerful enough to handle too many changes and updates in route Limited understanding for route filtering and route selection Bandwidth between ASs is limited At this time we can use static route

13 Static Route review ZTE(config)# ip route 10.1.1.0 255.0.0.0 192.168.1.1

14 Static Route example ip route 0.0.0.0 0.0.0.0 10.1.1.2 10.1.1.0 Service Provider Running BGP ISP A AS 65000 10.1.1.1 10.1.1.2 S0 172.16.0.0 AAB

15 Contents. BGP overview BGP terminology BGP packet types and connection status BGP route announcing principles BGP route announcing methods BGP attributes and route selection

16 BGP features BGP is a kind of enhanced distance vector routing protocol Transmission protocol : TCP , port number : 179 Support CIDR ( classless inter domain routing ) Route updates only send added route Rich in route filtering and route policy configuration

17 BGP in IP packet BGP : Run on TCP Port number is 179 ( port 179 ) TCP Header Port No. Segment Payload IP Header Protocol Number Frame Header CRCCRC Packet Payload Frame Payload 6 - TCP 17 - UDP 6 - TCP 17 - UDP 179 - BGP 23 - Telnet 25 - SMTP 179 - BGP 23 - Telnet 25 - SMTP

18 Peers = Neighbors Two routers establish TCP connection between each other to exchange BGP route information , after TCP connection is established, the relationship between them is peer or neighbor. BGP neighbors is divided into two types: IBGP and EBGP. AS 65000 Neighbors AS 65500 Neighbors A C B 1.1.1.1/24 1.1.1.2/242.1.1.1/24 2.1.1.2/24 router bgp 65500 neighbor 1.1.1.2 remote-as 65500 neighbor 2.1.1.2 remote-as 65000 Router B

19 External BGP Neighbors are in different ASs ( autonomous systems ) Neighbors are usually directly connected IBGP Neighbors AS 65000 AS 65500 A C B 1.1.1.1/24 1.1.1.2/242.1.1.1/24 2.1.1.2/24 router bgp 65000 neighbor 2.1.1.1 remote-as 65500 Router A EBGP Neighbors router bgp 65500 neighbor 2.1.1.2 remote-as 65000 Router B

20 Internal BGP Neighbors are in the same AS Neighbors do not need to be directly connected IBGP Neighbors AS 65000 AS 65500 A C B 1.1.1.1/24 1.1.1.2/242.1.1.1/24 2.1.1.2/24 router bgp 65500 neighbor 1.1.1.2 remote-as 65500 Router B EBGP Neighbors router bgp 65500 neighbor 1.1.1.1 remote-as 65500 Router C

21 Internal BGP There can be several non-BGP routers between peers BGP messages can be passed through non-BGP topology AS100 IBGP OSPF R1 loopback 201.7.108.2/32 R2 loopback 201.7.108.1/32 EBGP router bgp 100 neighbor 201.7.108.1 remote-as 100 update-source loopback1 Router R1 router bgp 100 neighbor 201.7.108.2 remote-as 100 update-source loopback1 Router R2 Ensure two peers are reachable

22 Contents. BGP overview BGP terminology BGP packet types and connection status BGP route announcing principles BGP route announcing methods BGP attributes and route selection

23 BGP message types BGP has four kinds of messages: OPEN – used to establish BGP connection KEEPALIVE – used to keep BGP connection UPDATE – used to update or withdraw BGP route NOTIFICATION – BGP error notification

24 OPEN Messages OPEN message is used to establish BGP connection , It includes following contents: Version number: AS number Keep time BGP identification Optional parameters AS100AS200 OPEN

25 BGP KEEPALIVE Message By default keepalive message are sent every 60 seconds(between peers) Hold time interval is 180 seconds Keepalive message will reset Hold timer to 0 If Hold timer expires, the peer will be regarded as dead Keepalive and Hold timer can be changed When establishing BGP,the two parts will use the less value of hold time Keepalive message is 19 bytes long AS100AS200 KEEPALIVES BGP

26 BGP UPDATE Messages The route with same attributes can be sent out in one update message Update message can also be used to withdraw those unreachable routes If the route is stable there is no update message Update can only be aimed at the attributes of the routes Update packets have the same function as keepalive packets to reset hold timer AS100AS200 12.0.0.0/8 13.0.0.0/8 14.0.0.0/8 15.0.0.0/8 Route updates 12.0.0.0/8 13.0.0.0/8 Withdrawn routes 15.0.0.0/8

27 BGP NOTIFICATION Messages When error is detected, Notification message is sent out Notification message will close BGP session Possible error information : certification failure, route loop etc. AS100AS200 NOTIFICATION Authentication failure

28 BGP connection status Idle : This is the first status when BGP initiates Connect : the status when BGP is waiting for the success of TCP connection Active : the status when BGP restart to establish TCP connection Open sent : when TCP establishing succeeds , BGP begin to send OPEN message and wait for OPEN message from counterpart Open confirm : after receiving OPEN message from neighbor, BGP waits for Keepalive message or Notification message Established : this is the last stage or stable status for the neighbors to negotiate , BGP begin to exchange Update packets between each other

29 Contents. BGP overview BGP terminology BGP packet types and connection status BGP route announcing methods BGP route announcing principles BGP attributes and route selection

30 BGP route announcing method 1—Network command 18.0.0.1/8 RTB AS200 OSPF RTB(config)#router bgp 200 RTB(config-router-bgp)#network 18.0.0.0 mask 255.0.0.0 OSPF finds route18.0.0.1/8 。 How to announce this route to the BGP route table of RTB ?

31 BGP route announcing method 2— route redistribution 18.0.0.1/8 OSPF RTB AS200 RTB (config) # router bgp 200 RTB (config-router-bgp) # redistribute ospf-int OSPF finds route18.0.0.1/8 。 How to announce this route to the BGP route table of RTB ?

32 Contents BGP overview BGP terminology BGP packet types and connection status BGP route announcing methods BGP route announcing principles BGP attributes and route selection

33 BGP route announcing principles When there are multiple paths, BGP Speaker will use the best one for itself; BGP Speaker will only announce the routes that it is using to their neighbors; BGP Speaker will announce the routes that it gets from EBGP neighbor to all the BGP neighbors, including EBGP and IBGP neighbors; BGP Speaker will not announce the routes that it gets from IBGP neighbor to all the other IBGP neighbors; If the BGP Speaker will announce the routes that it learns from IBGP neighbor to its EBGP neighbor depends on the synchronous status of IGP and BGP Once the connection is established, BGP Speaker will announce all the BGP routes to the neighbors

34 BGP routes take effect condition BGP routes take effect condition : nexthop of route is reachable AS 64500 172.20.0.0 172.16.0.0 AS 65000 10.10.10.1 10.10.10.3 172.20.10.1 172.20.10.2 B A C 172.16.0.0 Next-hop : 10.10.10.3 Router B 10.10.10.0/24 int1 direct 172.20.0.0/16 int2 direct 172.16.0.0/16 int1 bgp Router C 10.10.10.0/24 int1 ospf 172.20.0.0/16 int1 direct 172.16.0.0/16 int1 bgp 172.16.0.0 Next-hop:10.10.10.3

35 BGP synchronization Because IBGP neighbors may be not directly connected, so these non-BGP routers will take part in the process of packets forwarding based on BGP routes , it is required that IGP routers also have related BGP routes Routes learned from IBGP neighbor that is also learned from IGP can be announced to EBGP neighbor, this is called BGP and IGP synchronization. This function is turned on by default, it needs to be turned off manually 172.20.20.2 AS 65000 10.10.10.1 172.20.10.1 172.20.10.2 D AS 64500 172.16.0.0 10.10.10.3 A B C 172.20.20.1 IBGP DIP:172.16.0.1 All the routers inside AS have to learn BGP routes? Router D 10.10.10.0/24 int1 ospf 172.20.20.0/24 int1 direct 172.20.10.0/24 int1 ospf 172.16.0.0/16 int1 bgp Router C 10.10.10.0/24 int1 ospf 172.20.10.0/24 int1 direct 172.20.20.0/24 int2 direct 172.16.0.0/24 int1 ospf EBGP

36 IBGP full mesh Inside AS, all the routers which BGP routes pass through should establish IBGP neighbor between each other, to ensure that packets still have route guide after disabling BGP synchronization 172.20.20.2 AS 65000 10.10.10.1 172.20.10.1 172.20.10.2 D AS 64500 172.16.0.0 10.10.10.3 A B C 172.20.20.1 IBGP EBGP IBGP

37 Contents BGP overview BGP terminology BGP packet types and connection status BGP route announcing methods BGP route announcing principles BGP attributes and route selection

38 BGP Attributes BGP attributes describe the features of BGP route BGP attributes are a series parameters BGP attributes are sent out in BGP UPDATE messages BGP attributes are used for BGP route filtering and route deciding policy BGP attributes are divided into Well-known and optional

39 HQ Well-known Attributes BGP well-known attributes : all the BGP routers must recognize BGP well-known attributes are divided into “well- know mandatory” and “well-known Discretionary ” two types “well-known mandatory” attributes : must appear in all the update messages “well-known Discretionary ” attributes : may appear in the update messages and may not

40 Optional Attributes BGP optional attributes : BGP routers may or may not support attributes BGP optional attributes are divided into “ Transitive ” and “nontransitive ” two types “optional transitive” attributes : if accepted will be labeled as “global” and then sent out ; if not accepted will be labeled as “local” and then sent out “optional nontransitive ” attributes : if accepted will handle by itself and will not be forwarded to the neighbors ; if not accepted will be discarded

41 BGP commonly used Attributes well-know mandatory : AS-path Next-hop Origin well-known Discretionary : Local preference optional transitive : Community optional nontransitive : Multi-exit-discriminator (MED)

42 AS_Path attribute AS_path is a kind of mandatory attribute It traces the AS the packet passes New AS number will be placed at the beginning of AS_Path AS_Path is used to avoid loop AS number is managed by InterNIC private AS number is : 64512 ~ 65535 Private AS number must be filtered in Internet AS100 130.1.0.0/16 AS200 AS300 130.1.0.0/16 AS:100 130.1.0.0/16 AS:200 100

43 AS100 130.1.0.0/16 AS200 AS300 130.1.0.0/16 AS:100 130.1.0.0/16 AS:200 100 AS400 130.1.0.0/16 AS:400 100 100 130.1.0.0/16 AS:100 100 r1 r2r3 r4 r5r6 Example: R4 will select AS200 to pass AS_Path used for route selection AS_Path is updated by BGP automatically AS_Path is used to select route in BGP The route with the shortest AS_Path will be selected first AS_Path can be increased

44 Next-Hop Attribute “next-hop” attribute signify the IP address of next hop for this route , it is usually the Loopback address of the neighbor “next-hop” attribute is generated by EBGP or IBGP “next-hop” attribute generated by EBGP will be kept in the process of IBGP route forwarding IBGP peer must have the valid route to the next hop address, otherwise this route is invalid The next hop address of BGP route is searched recursively in IGP to find the next hop address of the neighbor router

45 Next-Hop Attribute Router A announce the network 172.16.0.0 to Router B by means of EBGP, the next hop is 10.10.10.3 Router B announce the network 172.16.0.0 to Router C by means of IBGP, keeping the next-hop address as 10.10.10.3 AS 64500 172.20.0.0 172.16.0.0 AS 65000 10.10.10.1 10.10.10.3 172.20.10.1 172.20.10.2 BCA

46 AS100 130.1.0.0/16 AS200 AS300 ip address 201.1.100.1 255.255.255.0 130.1.0.0/16 Next-hop: 201.1.100.1 r1 r2r4 r5 130.1.0.0/16 Next-hop: 100.1.1.1 IBGP r3 Modifying next-hop IBGP peer may not have the route to the next-hop EBGP neighbor In this circumstances, it is required that IBGP neighbor modify Next-hop address as local address.

47 Next-Hop Attribute Example AS100 AS200 AS300 RARB RC RD RERF EBGP IBGP 1.1.3.1/24 1.1.1.1/24 1.1.2.1/24 8.0.0.0 D=8.0.0.0 Next_Hop=1.1.3.1 D=8.0.0.0 Next_Hop=1.1.1.1 D=8.0.0.0 Next_Hop=1.1.2.1 D=8.0.0.0 Next_Hop=1.1.2.1

48 Local Preference Attribute Local Preference is used for BGP route decision During the process of route decision in BGP , Local Preference has the highest priority Local Preference is transmitted within the local AS by IBGP The higher the Local Preference,the higher the priority By default,the Local Preference is set to 100

49 Local Preference Attribute r2 and r3 can all access AS400 The AS_path from r2 and r3 is the same At this time, Local Preference can be used to break the balance AS100AS200 AS300 120.1.0.0/16 AS:100 400 120.1.0.0/16 AS:300 400 AS400 120.1.0.0/16 AS:400 120.1.0.0/16 AS:400 r1 r2r3 r4 r5r6

50 AS100 AS200 IBGP AS300 120.1.0.0/16 AS:100 400 120.1.0.0/16 AS:300 400 AS400 120.1.0.0/16 AS:400 120.1.0.0/16 AS:400 r1 r2r3 r4 r5r6 120.1.0.0/16 Local Pref:300 120.1.0.0/16 Local Pref:100 Local Preference Attribute

51 Local Preference Attribute Example AS10 AS20 EBGP IBGP RA RB RC RD 8.0.0.0 2.1.1.1 3.1.1.1 Local_Pref=200 Local_Pref=100 D=8.0.0.0 Next_Hop=2.1.1.1 Local_Pref=100 >D=8.0.0.0 Next_Hop=3.1.1.1 Local_Pref=200

52 MED Attribute Example AS10 AS20 EBGP IBGP RA RB RC RD 8.0.0.0 2.1.1.1 3.1.1.1 MED=100 MED=0 > D=8.0.0.0 Next_Hop=2.1.1.1 MED=0 D=8.0.0.0 Next_Hop=3.1.1.1 MED=100

53 Origin Attribute IGP (i) the routes announced by command “Network” must be in IGP EGP (e) EGP Redistribute , now the EGP protocol almost disappear Incomplete (?) Coming from IGP or static route redistribution When BGP selects the best route , route origin with I has highest priority ; then EGP , and the last is Incomplete 。

54 BGP Route Selection Decision Process At first , accept those routes without AS loop and has valid next-hop address , then : 1. Select the route with highest local preference ; 2. Select the route generated by local routers such as routes generated by route aggregation; 3. Select the route with shortest AS-path ; 4. Select the route with lowest origin code (IGP < EGP < Incomplete) 5. Select the route with lowest MED; (MED is set by EBGP neighbor) 6. If MED is the same, and they are both announced from IBGP and EBGP, then the route from EBGP will be selected first ; 7. Choose the path to the next hop from the nearest IGP neighbor ; 8. Choose the route with the lowest neighbor Router-ID ; 9. Choose the route with the lowest neighbor interface address.

55 Summary BGP basic concept BGP commonly used attributes Method to select the best route in BGP

56


Download ppt "BGP V1.1. When is BGP Applicable Basic BGP Peer Configuration Troubleshooting BGP Connections BGP Operation and Path Attributes Route Import/Export Selected."

Similar presentations


Ads by Google