Notes9:WANRoutingBGP - echadbourne/NET-330 GitHub Wiki

Routing Protocols

Exterior Gateway Protocol: Responsible for building and updating routing tables between organizations - across large internetworks like the internet

  • Border Gateway Protocol (BGP): Is the EGP Used on the internet
  • Used to help secure the WWI, if we used OSPF other routers could advertise other networks

BGP Overview

  • Exchanges routing and reachability information among autonomous systems (AS) on the internet
  • The protocol is classified as a path vector protocol
  • Makes routing decisions based on paths, network policies, or rule-sets configured by a network administrator
  • Some very large organizations may also use BGP as an IGP

Autonomous Systems

  • A collection of connected Internet Protocol (IP) routing prefixes
  • Under the control of a single administrative entity (eg company, university, ISP)
  • That presents a common, clearly defined routing policy to the Internet

AS Numbers

  • Unique ASN is allocated to each AS for use in BGP routing
  • AS numbers are important because the ASN uniquely identifies each (aggregated) network on the internet
  • IANA handles AS number assignments
  • Until 2007, AS numbers were defined as 16-bit integers, which allowed for a maximum of 65536 assignments
  • Now registries can hand out 32 bit AS numbers (over 4 billion)

AS Number Growth

The number of unique autonomous networks in the routing system of the Internet exceeded 5000 in 1999

  • 30,000 in late 2008
  • 35,000 in mid 2010
  • 42,000 in late 2012
  • 54,000 in mid 2016
  • 118,000 in Oct 2024

{47EDA3EA-D9FA-4CA3-8C66-51C634A53BFD}

{CCDC3747-34AF-4CBD-9BF9-AC5D2808DF10}

BGP Operation

  • BGP neighbors, called peers, are established by manual configuration between routers
  • Creates a TCP session on port 179
  • A BGP speaker sends 19-byte keep-alive messages every 60 seconds to maintain the connection
  • Among routing protocols, BGP is unique in using TCP as its transport protocol
    • Others are their own layer 4 protocols

BGP Peering

  • So, organizations must "peer" with their ISP(s) and other networks with which they share an external link
  • This allows for multi-homed networks (aka multiple connections to the internet)
  • Your AS will be advertised through your multiple peers - this allows multiple paths to your IP networks from the internet
  • Other routers pick the best "path" to your network

{985E31DF-1630-42E3-9AB7-5E12FC0D2F64}

BGP - Path Vector Protocol

Distance Vector Protocols

  • Like RIP - use "distances" as route selection metric
  • Routing table includes how many hops/routers to a remote network
  • Only knows IP of next router - not the full path to destination

Path Vector Protocols

  • Routing table includes the "path" of AS numbers to get remote networks

{B8CBAE6E-6A32-4A25-83EE-D38F69556723}

BGP Best Path Algorithm

  • BGP Best Path Selection Algorithm is used to choose and install the best routes into the router's routing table
  • The full internet BGP routing table includes over 400,000 routes
  • BGP router can receive numerous copies of those routes from various providers
  • So it has to compare the multiple routing tables and choose the optimal route on the router

BGP Attributes for selecting path

{E346818E-5338-470E-A59B-6A518C09B7E2}

BGP Update Message

  • Sent to peers
  • Includes AS Path and IPv4 nets
    • 10.0.0.0/8 in this example

{A6D6E925-FA2A-40DF-A054-98BAAD7A1F45}

Configuring BGP

A basic configuration of BGP is pretty simple

3 steps

  1. Create BGP instance
  2. Identify peer neighbors by IP Address
  3. Identify any networks that the router is responsible 10 advertise

BGP on Cisco

  1. Define router instance
    • router bgp *AS_Number_for_Router*
    • router bgp 1010
  2. Identify peers
    • (config-router) neighbor *ip_of_peer* remote-as *as-number_of_peer*
    • (config-router) neighbor 192.168.1.2 remote-as 2352
  3. Advertise Networks
    • (config-router) network 10.10.52.0 mask 255.255.255.0

Additional Notes

  • Configuring redistribution of OSPF on border router
  • To advertise networks shared through OSPF - the following command must be included in BGP config
    • redistribute ospf *instance_number*

with bgp the network between routers can only live on one AS number