Electrical and computer Engineering Department Computer Networks Laboratory (ENCS4130) Report [Experiment No. 5] BGP Student Name : Mohammed Qadumy Student # : 1180434 Date : 4/27/2022 Instructor : Dr Ismail Khatir Teaching assistant : Eng. Ayham Hasheesh Abstract: Routing is used for taking a packet from one device and sending it through the network to another device on a different network using routers. In this experiment we will use packet tracer to learn how to configure and verify IP routing, using exterior gateway protocol and interior gateway protocols, to Autonomous systems and learn dynamic routing BGP. II Contents Abstract: ............................................................................................................................ II Chapter 1: Theory ............................................................................................................... 1 Section 1.1: Border Gateway Protocol ............................................................................1 How does BGP work? .................................................................................................1 Difference between internal and external BGP, OSPF ................................................1 Section 1.2 : Dynamic BGP Peering................................................................................2 Section 1.3 : BGP Message Format .................................................................................2 Section 1.4 : BGP Finite State Model ..............................................................................3 Chapter 2: Procedure, Results and discussion .................................................................... 4 Section 2.1 : Building the topology .................................................................................4 Configuring OSPF Routing .........................................................................................5 Section 2.2 : Configuring BGP Routing ..........................................................................6 Define the BGP Over the OSPF ..................................................................................7 Define the OSPF Over the BGP ..................................................................................8 Chapter 3: Conclusion : .................................................................................................... 10 Chapter 4 : References ...................................................................................................... 11 III Table of figures FIGURE 1.1.1 : BGP TERMS AND CONCEPTS 2 FIGURE 2.1.1 : BGP TOPOLOGY 4 FIGURE 2.1.2 : CONFIGURING OSPF ROUTING PROTOCOL FOR ROUTER0 5 FIGURE 2.1.1: CONFIGURING BGP ROUTING ON ROUTER1 6 THE STEPS IN FIGURE 2.1.1 WAS REPEATED FOR JUST ONLY ROUTER 2 WITH ITS OWN IPS 6 FIGURE 2.2.2 DEFINE THE BGP OVER THE OSPF ON ROUTER1 7 FIGURE 2.2.3 DEFINE THE BGP OVER THE OSPF ON ROUTER2 8 FIGURE 2.2.4 :RESULTS OF CONFIGURING ROUTERS USING BGP PROTOCOL 9 FIGURE 2.2.5 :RESULTS OF CONFIGURING ROUTERS USING BGP PROTOCOL 9 IV List of tables TABLE 2.1.1 : BGP NETWORK IP'S V 4 Chapter 1: Theory Section 1.1: Border Gateway Protocol BGP (Border Gateway Protocol) is the protocol underlying the global routing system of the internet. It manages how packets get routed from network to network through the exchange of routing and reachability information among edge routers. BGP directs packets between autonomous systems (AS) as shown in figure 1.1.1, which are networks managed by a single enterprise or service provider [1]. BGP creates network stability by guaranteeing routers can adapt to route failures: when one path goes down, a new path is quickly found. BGP makes routing decisions based on paths, defined by rules or network policies set by network administrators. How does BGP work? Each router maintains a routing table controlling how packets are directed. Routing table information is generated by the BGP process on the router, based on incoming information from other routers, and information in the BGP routing information base (RIB), which is a data table stored on a server on the BGP router. The RIB contains information both from directly connected external peers, as well as internal peers, and based on policies for what routes should be used and what information should be published, continually updates the routing table as changes occur. Difference between internal and external BGP, OSPF When BGP is used to route within a single AS, it is called internal BGP, or iBGP. When used to connect one AS to others, it is called external BGP, or eBGP. The OSPF (Open Shortest Path First) protocol is used only in internal networks. OSPF is focused on finding the shortest route available between nodes, and on failing over to that shortest route as quickly as possible. BGP is slower to fail to a new route but is more scalable. OSPF is essentially hierarchical in structure, while BGP is a mesh. Some networks are replacing OSPF with iBGP [2]. 1 Figure 1.1.1 : BGP terms and concepts Section 1.2 : Dynamic BGP Peering To minimize this configuration overhead, we use the concept of BGP peer Group, where we can group the BGP Neighbors who are sharing the same outbound policies. But first, we need to manually configure 100 Peers and then add to the peer group. Hence the problem is still not resolved. With the Dynamic BGP peering feature, BGP router dynamically establishes peering with a group of remote neighbors that are configured using a range of IP addresses and BGP peer group. After a subnet range is configured for a BGP peer group and a TCP session is initiated by another router for an IP address in the subnet range, a new BGP neighbor is dynamically created as a member of that group Section 1.3 : BGP Message Format BGP runs by sending five types of messages: Open, Update, Notification, Keepalive, and Route-refresh. These messages use the same header format. BGP messages are transmitted based on TCP (port 179). The message length varies from 19 octets to 4096 octets. The header of each BGP message is 19 octets, consisting of three fields. 2 Section 1.4 : BGP Finite State Model The finite-state-machine is a description of what actions should be taken by the BGP routing engine and when. There are six states in the model, and there are specific conditions under which each BGP state will transition to the next during the process of establishing first a TCP connection, and then a BGP session [3]. 3 Chapter 2: Procedure, Results and discussion Section 2.1 : Building the topology The topology was built by connecting the routers with the several PCs were connected on different networks as shown below in figure 2.1.1 Figure 2.1.1 : BGP Topology Table 2.1.1 : BGP Network IP's 4 Configuring OSPF Routing OSPF routing protocol was used to configure router0, router1, router2 and router3 as shown below in the figures. Figure 2.1.2 : Configuring OSPF routing protocol for router0 We notice from figure 2.1.2 that router0 is connected with networks 192.168.(0.0,1.0,1.32). Same procedure was repeated for all routers with their own networks. 5 Section 2.2 : Configuring BGP Routing BGP configuration was done just on Router 1 and Router 2. First, the BGP was configured to enable BGP process and specify the router’s Autonomous System (AS), where the ASNUMBER is the autonomous system number where the router is. we used Router (config)# router bgp <AS-NUMBER>. For router1, the as number is 100 as given, and 200 for router2. to run protocol on routers, after that we use Router(config-router) # neighbor <IPADDRESS-NEXT-INTERFACE> remote-as <AS-OF-REMOTE-NEIGHBOR> Previous command Which was written for each router considering the first router’s neighbor is router2 with 192.168.0.6 ip as in the network ip’s table, and the second router’s neighbor is router1 with 192.168.0.5 ip. to tell router the Ip address of the neighbor router (depends on router is connected to) Figure 2.1.1: Configuring BGP routing on router1 The steps in figure 2.1.1 was repeated for just only router 2 with its own Ips 6 Define the BGP Over the OSPF To allow the OSPF to communicate with the BGP a redistribute command was used to define the BGP protocol over the OSPF protocol: Figure 2.2.2 Define the BGP Over the OSPF on router1 7 Figure 2.2.3 Define the BGP Over the OSPF on router2 10 As shown above in figures 2.2.2, 2.2.3 the first command was written as the following router ospf <PROCESS-ID>, where the process id is 1 as we configured before. The second one is as follows: redistribute bgp <AS-NUMBER> subnets, notice that ASNumber is as mentioned before which is 100 for router1 and 200 for router2. Define the OSPF Over the BGP To allow the BGP to communicate with the OSPF a redistribute command was used to define the OSPF protocol over the BGP protocol: For this part we just inversed previous part to make BGP communicate with redistribute command. Then we used the following commands to see status of all neighbors of BGP . Router# show ip bgp Router# show ip bgp summary Router# show ip route 8 Also I used show running-config command to see the result of my whole work (see running protocols on both routers (BGP Links) that connect area 0 with area 1) as shown in figure 2.2.4 . Figure 2.2.4 :results of configuring routers using BGP protocol Results : Figure 2.2.5 :results of configuring routers using BGP protocol 9 Chapter 3: Conclusion : In this experiment we learned a lot about border gateway protocol (BGP) which is very useful when multiple connections exist to external AS’s since its equipment can handle the additional demands, this protocol truly benefit when controlling how traffic enters the local AS rather than how traffic exists it. Also, it offers network stability that guarantees routers can quickly adapt to send packets through another reconnection if one internet path goes down. BGP makes routing decisions based on paths, rules or network policies configured by a network administrator. 10 Chapter 4 : References [1] https://www.cloudflare.com/learning/security/glossary/what -is-bgp/ Accessed 4/27/2022 on 5:00 pm [2] https://www.techtarget.com/searchnetworking/definition/BGP-Border-Gateway-Protocol Accessed 4/27/2022 on 5:00 pm [3]https://www.inetdaemon.com/tutorials/internet/ip/routing/bgp/operation/finite_state_m odel Accessed 4/27/2022 on 5:00 pm 11