Border Gateway Protocol BGP4 (2) Professor Richard Harris School of Engineering and Advanced Technology (SEAT)
Presentation Outline Border Gateway Protocol - Continued Computer Networks - 1/2
Learning Objectives You will be able to: Discuss the operation of the BGP4 protocol Determine when it is appropriate for use in networking Computer Networks - 1/3
References Tanenbaum, Computer Networks, 4 th Edition Forouzan, Data Communications and Networking, 4 th Edition Cisco CCNA1 Module 10 - part 1 Stallings, William 2000 Data and Computer Communications, Prentice Hall, Sixth Edition Russell, Travis 1997 Telecommunications Protocols, McGraw Hill Computer Networks - 1/4
BGP Path Selection Overview Unlike other routing protocols, BGP doesn t use shortest path technology. BGP is regarded as a path vector protocol since it works by sending route advertisements. A route advertisement indicates the reachability of a network, viz: A network address and a netmask representing a block of contiguous IP addresses. It also contains the list of all the transit AS s that must be used to reach the announced network. It can also contain some optional attributes. Computer Networks - 1/5
BGP Attributes 1 Unlike other routing protocols, BGP does not use a single routing metric to decide the preferred route. It uses multiple parameters that have different degrees of significance as well as differences in the way they are distributed within BGP. These metric parameters are called path attributes. Attributes are classified into two types: Well-known Optional Computer Networks - 1/6
BGP Attributes 2 Attributes Well-known Optional Mandatory Discretionary Transitive Non-transitive Computer Networks - 1/7
Summary of Attributes The following attributes have been identified for use with BGP: AS-Path Origin Next-hop Weight Local Preference Metric (Multi Exit Discriminator MED) Community Computer Networks - 1/8
Simplified Operation of BGP Router[3] Peer N Peer 1.. Inbound Inbound filter Attribute Inbound filter Attribute manipulation filter Attribute manipulation manipulation Selects acceptable advertisements BGP routing table BGP Decision Process 1. Highest LOCAL-PREF 2. Shortest AS-PATH 3. Lowest MED 4. ebgp over ibgp 5. Nearest IGP neighbour Outbound Outbound filter Attribute Outbound filter Attribute manipulation filter Attribute manipulation manipulation Selects acceptable routes to advertise Peer 1.. Peer N Forwarding table Select best route based on decision list. Place in the forwarding table Computer Networks - 1/9
Brief Review of Attributes The following slides will review what is meant by the key attributes that have been identified for use with BGP. At the conclusion of these discussions, a hierarchical structure will be presented that shows in more detail the policy based approach used to identify routes employed by BGP. The simplified operation of BGP slide shown previously gave a general overview of the strategy that is used. Computer Networks - 1/10 10
AS-Path Attribute 1 As a BGP update passes through an AS, that AS number gets appended as an update. So an arriving update at a router will have passed through a number of AS s and these will be stored in the AS-path The AS-path attribute is a well-known mandatory attribute. It is recognised by all BGP implementations. Computer Networks - 1/11 11
AS-Path Attribute 2 Sequence of AS s a route has traversed. Provides a mechanism for loop detection. Policies may be applied based on the AS path. Local AS added only when sent to external peer. * Shortest AS path preferred AS3561 204.70.0.0/15 AS701 192.67.95.0/24 AS3847 207.240.0.0/16 AS1673 C 140.222.0.0/16 B D G F E A AS6201 192.67.95.0/24 3847 701 i 140.222.0.0 3847 1673 i 204.70.0.0/15 3847 3561 i 207.240.0.0/16 3847 i Computer Networks - 1/12 12
Origin This attribute is included in all BGP routing updates and its purpose is to indicate the origin of the path information. It is permitted to have one of only three values, viz: IGP: Network was redistributed from and IGP to BGP EGP: The origin is EGP (almost obsolete now) INCOMPLETE: The origin is unknown. The Origin attribute is a well-known mandatory attribute. It is recognised by all BGP implementations. Computer Networks - 1/13 13
Next-hop It is the IP address of the next hop associated with a BGP update. The Next-hop attribute is a wellknown and mandatory attribute. Router A will advertise 198.3.97.0/24 to router B with a next-hop of 207.240.24.202. AS 6201 198.3.97.0/24 A.202 207.240.24.200/30.201 AS 3847 B C Computer Networks - 1/14 14
Weight This influences path selection from a router when more than one route to the destination is present. It is configurable on a per-neighbour basis but has no significance outside of that router. It is classified as an optional attribute and is not transitive The default weight on a Cisco router for a route that is originated by the local router is 32,768 and it is 0 for all other routes. R 1 W=30 W=20 R 3 BGP AS670 140.1.0.0 R 2 Computer Networks - 1/15 15
Local Preference An often-used attribute, local_pref (normally 100) overrides AS_PATH, and is transitive throughout your network. It is never advertised to an ebgp peer. G C AS 3847 F D E 208.1.1.0/24 80 For example, you can express the policy prefer A private interconnects by setting the local_pref to 150 and leaving all other peers at 100. AS 6201 B 208.1.1.0/24 208.1.1.0/24 100 Preferred by all AS3847 routers Computer Networks - 1/16 16
Metric (Multi Exit Discriminator MED) Indication to external peers of the preferred path into an AS. Affects routes with the same AS path. Advertised to external neighbours Usually based on IGP metric * Note that the lowest MED is preferred The MED (multi-exit discriminator) is a commonly used attribute. It comes after the AS_PATH in evaluation sequence. Commonly, MED is used to append a distance on BGP routes as they move within your network. Computer Networks - 1/17 17
Community This attribute is a means of grouping a set of destinations so that a common policy can be applied to them. The attribute is an optional transitive attribute. (If a router receives this and doesn t understand it it simply passes it on transparently in its own update.) This attribute is largely used by ISPs to set routing policies. Computer Networks - 1/18 18
BGP Attributes Summary Attributes Well-known Optional Mandatory Discretionary Transitive Non-transitive AS-Path Local Preference Weight Metric - MED Origin Community Next-hop Computer Networks - 1/19 19
BGP Route Selection - Detail The following hierarchical rule set is followed for BGP: The path is ignored if the next hop is inaccessible Highest weight is preferred (if this optional proprietary attribute is in use on the router). Highest local preference is preferred. Prefer a route that has originated from the router that is advertising it. Shortest AS path. This means the path with the least number of AS entries in it. Lowest Origin Code (IGP > EGP > INCOMPLETE). Lowest Metric or MED value External path is preferred to internal. The administrative distance for an EGP path is 20 and 200 for an IBGP route If only internal paths exist and IGP synchronisation is turned off, the path through the closest IGP neighbour is preferred. Choose the path through the router with the lowest BGP router ID. Computer Networks - 1/20
Comment on Selection Criteria These criteria act as filters, and the N th criterion is only evaluated if more than one route has passed the (N 1) th criterion. It should be noted that most BGP implementations allow the network administrator to optionally disable some of the criteria of the BGP decision process. Also note that we continue to process these criteria only if more than one path satisfies the previous criterion. Computer Networks - 1/21
Control of Outgoing Traffic [3] - 1 Two approaches have been used: 1. Use local_pref to be manipulated based on passive or active measurements. These solutions usually measure the load on each inter-domain link, and some rely on active measurements to evaluate the performance of inter-domain paths. Based on these measurements and some knowledge of the Internet topology (obtained either through a central server or from the BGP router to which they are attached), they attach appropriate values of the local_pref attribute to indicate which route should be considered as the best route by the BGP routers. Computer Networks - 1/22
Control of Outgoing Traffic [3] - 2 2. Use the intra-domain routing protocol to influence how a packet crosses the transit ISP. As shown in the slide depicting BGP router operation, the BGP decision process will select the nearest IGP neighbour when comparing several equivalent routes received via ibgp. For example, suppose router R 27 receives one packet whose destination is R 45 : The BGP decision process of router R 27 will compare two routes toward R 45, one received via R 28 and the other received via R 26. By selecting router R 28 as the exit border router for this packet, AS2 will ensure that this packet will consume as few resources as possible inside its own network. If a transit AS relies on a tuning of the weights of its intra-domain routing protocol this tuning will indirectly influence its outgoing traffic. R 51 R 11 AS 5 R 12 R 14 R 13 AS 2 R 21 R 22 R 27 AS 1 R 23 R 25 R 28 R 24 R 26 R 41 R 43 R 44 R 31 R 32 R 33 R 34 R 42 R 35 R 36 R 45 R 61 AS 4 AS 6 AS 3 Computer Networks - 1/23
Control of Incoming Traffic [3] 1 The first method that can be used to control the traffic that enters an AS is to rely on selective advertisements and announce different route advertisements on different links. Another method would be to allow an AS to indicate a ranking among the various route advertisements that it sends. Based on the utilisation of the length of the AS-path as the third criteria in the BGP decision process, a possible way to influence the selection of routes by a distant AS is to artificially increase the length of the AS path attribute. R 51 R 11 AS 5 R 12 R 14 R 13 AS 2 R 21 R 22 R 27 AS 1 R 23 R 25 R 28 R 24 R 26 R 41 R 43 R 44 R 31 R 32 R 33 R 34 R 42 R 35 R 36 R 45 R 61 AS 3 AS 4 AS 6 Computer Networks - 1/24
Conclusions BGP4 is a complex routing protocol and requires significant expertise to tune the path selection. Powerful and widely used within the industry. A number of potential problems that can cause difficulties for network managers. Computer Networks - 1/25