Nicholas Morrison - Networking Specialist

flokinet-011 - basic BGP

The Border Gateway Protocol

  • BGP is the Internet’s routing protocol
  • Traditionally used for:
    • distributing reachability information within an Autonomous System (AS) => internal BGP
    • exchanging network information between different AS’s => external BGP
    • Autonomous System: a network (or group of networks) managed and controlled by a single entity.
  • Lately also:
    • distributing reachability information within a datacentre (EVPN, MPLS)
    • high-speed failure detection and re-routing (with the help of BFD (Bi-directional Forwarding Detection))

IANA

  • Internet Assigned Numbers Authority
  • AS number allocations (and IP address allocations, and DNS TLDs) are goverened by IANA
    • via the five Regional Internet Registries (RIRs)
      • AFRINIC (Africa)
      • ARIN (Antarctica, Canada, some of the Caribbean, US)
      • APNIC (East Asia, Oceana, South Asia, Southeast Asia)
      • LACNIC (most of the Caribbean, Latin America)
      • RIPE (Europe, Central Asia, Russia, West Asia)
    • via Local Internet Registries (LIRs)

Who uses BGP?

  • you do
  • ISPs
  • IXs
  • Organisations, who have their own public and portable IPv4 and IPv6 allocations
  • potentially any company running a datacentre
    • modern layer 3 leaf-spine networks can optionally use BGP as an IGP

A brief history of BGP

  • inspired by the Exterior Gateway Protocol (EGP), originally defined in RFC 827 (October 1982)
  • "It is proposed to establish a standard for Gateway to Gateway procedures
    that allow the Gateways to be mutually suspicious."
    
  • "1  INTRODUCTION
    The DARPA Catenet is expected to be a continuously expanding
    system,  with  more  and  more  hosts  on  more and more networks
    participating in it.  Of course, this will require more and  more
    gateways.   In  the  past,  such  expansion  has taken place in a
    relatively unstructured manner.  New gateways,  often  containing
    radically different software than the existing gateways, would be
    added and would immediately begin  participating  in  the  common
    routing algorithm via the GGP protocol.  However, as the internet
    grows larger and larger, this simple method of expansion  becomes
    less and less feasible."
    
  • (did you know: the internet used to be called the Catenet? https://www.rfc-editor.org/in-notes/ien/ien48.txt)

A brief history of BGP (cont…)

What’s special about BGP?

  • it makes connections to peers over TCP/IP (tcp/179)
    • as opposed to OSPF and RIP, which use IP multicast
  • it can’t discover peers
    • you have to manually configure them
  • it has very strong filtering capabilities
    • route-maps, prefix-lists and access-lists
  • it has a “tagging” system called BGP Communities
    • eg the BGP Community #666 means “please blackhole this prefix”
  • it considers AS Path Length (among other things) when selecting the best path

Basic BGP configuration

!
router bgp 64512
   router-id 10.0.0.1
   neighbor 10.0.0.2 remote-as 64838
   neighbor 10.0.0.2 description Amazing ISP GmbH
   network 192.168.0.0/24
!

r1#show ip bgp summary
r1#show ip route bgp
r1#show ip bgp neighbor 10.0.0.2 advertised-prefixes