Introduction to the Border Gateway Protocol – Case Study Using GNS3
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to The Border Gateway Protocol – Case Study using GNS3 Sreenivasan Narasimhan1, Haniph Latchman2 Department of Electrical and Computer Engineering University of Florida, Gainesville, USA [email protected], [email protected] Abstract – As the internet evolves to become a vital resource for many organizations, configuring The Border Gateway protocol (BGP) as an exterior gateway protocol in order to connect to the Internet Service Providers (ISP) is crucial. The BGP system exchanges network reachability information with other BGP peers from which Autonomous System-level policy decisions can be made. Hence, BGP can also be described as Inter-Domain Routing (Inter-Autonomous System) Protocol. It guarantees loop-free exchange of information between BGP peers. Enterprises need to connect to two or more ISPs in order to provide redundancy as well as to improve efficiency. This is called Multihoming and is an important feature provided by BGP. In this way, organizations do not have to be constrained by the routing policy decisions of a particular ISP. BGP, unlike many of the other routing protocols is not used to learn about routes but to provide greater flow control between competitive Autonomous Systems. In this paper, we present a study on BGP, use a network simulator to configure BGP and implement its route-manipulation techniques. Index Terms – Border Gateway Protocol (BGP), Internet Service Provider (ISP), Autonomous System, Multihoming, GNS3. 1. INTRODUCTION Figure 1. Internet using BGP [2]. Routing protocols are broadly classified into two types – Link State In the figure, AS 65500 learns about the route 172.18.0.0/16 through routing (LSR) protocol and Distance Vector (DV) routing protocol.. ISP A. Suppose that route is announced to ISP B. ISP B may decide In Distance vector routing protocol, each node shares its routing table that the best path to 172.18.0.0/16 in ISP A is through AS 65500. with the neighbors periodically in contrast to Link State where Thus AS 65500 becomes a transit AS between 172.18.0.0/16 in ISP updates are event-triggered. Examples of Link State would be Open A and ISP B. This may not be acceptable for AS 65500 which is Shortest Path First (OSPF) and Intermediate System-to-Intermediate connected to both ISP A and ISP B in order to provide redundant System (ISIS) while Routing Information Protocol (RIP v1 and 2) are connection to the Internet rather than to be a transit AS. BGP’s policy examples of Distance Vector. BGP is called a Policy Based routing based routing helps mitigate such problems. protocol because the route-selection is done based on routing policies Version 4 of BGP has been deployed in the Internet since 1994. of an Autonomous System(AS). BGPv4 supports Classless Inter-Domain Routing (CIDR) and When BGP is running between routers belonging to different Variable Length Subnet Masking (VLSM). CIDR incorporates Autonomous Systems, it is called EBGP while BGP running between VLSM techniques and aggregation wherever necessary so that the routers belonging to the same Autonomous system is called IBGP. number of routes in the global routing table does not increase Administrative Distance (AD value) is the first criterion that a router exponentially. With the growing use of the Internet, the routing table uses to determine which routing protocol to use if two protocols of a core router of a major ISP, without CIDR, would typically provide route information for the same destination [5]. BGP has an contain more than 2000000 entries. However, by using CIDR the AD (Administrative Distance) value of 200 for IBGP (Inter-domain BGP routes in the routing table would be reduced to just about routes learnt by BGP) routes and 20 for EBGP (Exterior routes learnt 170000 routes, thereby reducing the memory and CPU power wasted by BGP) routes. BGP allows path- manipulations to be done by the on lookup. AS. However, It is expected that the System Administrator has a clear understanding of its working. 2. BGP AND OTHER IGP PROTOCOLS 5. ATTRIBUTES Firstly, IGPs are routing protocols which are used to route packets BGP has a number of metrics each of which is called an “attribute”. within an autonomous system. On the other hand, BGP is an example When routers exchange routing information, attributes are also of Exterior Gateway Protocol which is used to route packets between exchanged so that the path-selection process is based on a particular autonomous systems. IGPs decide the best path based on a certain attribute known to both the routers. predefined metric. For e.g. RIP uses hop count (number of layer 3 devices to be passed). EIGRP uses composite metric. BGP is a policy Attributes are basically of four types: based routing protocol used for traffic flow control between autonomous systems. Unlike IGPs, it has multiple metrics - which 1. Well-known– most popularly used attributes. are called as “attributes” using which it decides the route to the 2. Mandatory– as the name suggests, are mandatory destination. 3. Transitive or Non-Transitive. BGP is a complicated routing protocol which should not be used 4. Partial. unless one has a complete understanding of route filtering and BGP’s path Selection process. It is not advisable to configure BGP on Combinations of these path attributes are also possible as in well- routers having low memory or when there is low bandwidth link known - mandatory, well- known - discretionary etc. between autonomous systems. An alternative is to use static (routes Well-known attributes are usually the most manipulated attributes on entered manually by the network administrator) or default routes. all BGP implementations. They are usually propagated through the BGP provides multi-homing options, that is, BGP can be configured BGP routing information that is exchanged between BGP routers. when the flow of traffic entering and leaving the AS has to be They can be mandatory or discretionary. manipulated. Multi-roam is another scenario in which BGP is used. Attributes that are not well-known are termed as optional attributes. Optional attributes are not required to be supported by BGP configured routers. They can be transitive or Non- transitive. 3. GRAPHIC NETWORK SIMULATOR 3 AND THE CISCO IOS Optional- transitive attributes are also called as partial attributes. Upon receiving an optional- transitive attribute, which it does not support, a router still has to pass it to its peers. On the other hand, if it For implementing BGP,we use a software called as GNS3 which is a receives a non-transitive attribute, it can be dropped. graphical network simulator that allows simulation of complex networks. It is an open source, free program [6]. BGP has the following attributes: Cisco IOS (originally Internetwork Operating System) is the software used on the vast majority of CISCO routers and switches. CISCO a. AS path – Autonomous System-Path or AS-path is a list of IOS uses a command –line interface. According to the privilege level AS numbers the packet traverses to reach the destination of the user, CISCO IOS allows only a set of commands to be used in b. Next-hop –(if from a network belonging to a different AS)is each mode to ensure security and efficient operation. That is, the an IP address of the entry point of the AS along the path to mode you are in determines the command you can use. Upon first the destination connecting to the router, you are by default in unprivileged mode c. Origin – is used to inform all AS in the Internet how the (characterized by “>” sign). You could then log on to enter the prefixes (in BGP routing table, see Fig.2) originated. Legal privileged mode (characterized by “#” sign) if a password has been values are IGP (i) – by the use of network command, EGP set. The privileged mode is parent to many sub modes like Global (e) – redistributed from EGP and Incomplete (?) – configuration mode (characterized by “#(config)” sign) etc which is redistributed from IGP or declared as a static route. used to configure all features [4]. d. Local preference – is local to the AS. Default value is 100. It is assumed that the reader has a basic understanding of networking Higher the value, higher is the preference concepts like routers, Autonomous Systems, VLSM etc. e. MED – Multi-Exit Discriminator or MED is used to advertise to EBGP neighbors an exit path to the destination 4. NEIGHBOR-SHIP IN BGP network. Lowest MED is most desirable f. Weight (CISCO proprietary) – is not propagated to other There are thousands of routers all over the internet that run BGP routers. Local to the router only. representing over 21000 ASs. Any two routers that have formed a g. Others TCP connection to exchange BGP routing information are called BGP neighbors or BGP peers [2]. Items a, b, c are well-known mandatory attributes while d is an A BGP router has direct relationship with only a few number of example of well-known-discretionary attribute. MED is an optional BGP routers. As per rules, EBGP neighbors are to be directly non-transitive attribute. Weight has the greatest priority among all the connected. On the other hand, IBGP neighbors can be indirectly attributes listed above. connected. The route to a particular neighbor can be learnt dynamically through any routing protocol or can be statically 6. BGP PATH SELECTION PROCESS. assigned. Information exchanged between BGP neighbors is what enables them BGP supports Multi-homing and Multi-roaming. Hence, the BGP to learn routes to any advertised network. Every router which has forwarding table has multiple options to choose from to reach a BGP configured on it is called a BGP speaker. BGP peer on the other particular network.