Course Content
Spanning Tree
An overview of how switches become aware of other switches and prevent loops.
0/2
Multiple Spanning Tree Protocol (MST)
0/1
Advanced OSPF
The (OSPF) protocol scales well with proper network planning. IP addressing schemes, area segmentation, address summarization, and hardware capabilities for each area should considered when designing a network.
0/6
Introduction to Automation Tools  
To provide a high-level overview of some of the most common configuration management and automation tools that are available.
0/3
ENCOR Course
About Lesson

BGP Fundamentals

an overview of the fundamentals of the BGP routing protocol.

  • EGP standardized path vector routing protocol that provides scalability, flexibility, and network stability.
  • When BGP created, the primary design consideration was for IPv4 inter-organization connectivity on public networks like the Internet and on private dedicated networks.

AS Numbers

An AS is a collection of routers under a single organization’s control, using one or more IGPs and common metrics.

  • Obtain an ASN from the Internet Assigned Numbers Authority (IANA).
  • RFC 4893 expanded the ASN field from 2 bytes (65,535 ASNs) to accommodate 4 bytes (32-bit range – 4,294,967,295 unique ASNs).
  • The IANA requires organizations or individuals requesting AS numbers to meet the following conditions:
    • Proof of a publicly allocated network range
    • Proof that Internet connectivity provided through multiple connections
    • Demonstrated need for a unique routing policy from their providers.

ASN

  • ASNs 64,512–65,535 are private ASNs in the 16-bit ASN range.
  • ASNs 4,200,000,000–4,294,967,294 are private ASNs within the extended 32-bit range.
  • Use only the ASN assigned by IANA, by your ISP, a private ASN.
  • Using another organization’s ASN without permission could result in traffic loss and cause havoc on the internet.

Path Attributes

BGP uses PAs associated with each network path. The PAs provide BGP with granularity and control of routing policies within BGP. The BGP prefix PAs are classified as follows:

  • Well-known mandatory
  • Well-known discretionary
  • Optional transitive
  • Optional non-transitive

Per RFC 4271, well-known attributes must be recognized by all BGP implementations. Well-known mandatory attributes must be included with every prefix advertisement; well-known discretionary attributes may or may not be included with a prefix advertisement.

Loop Prevention

BGP is a path vector routing protocol and does not contain a complete topology of the network. BGP behaves like distance vector protocols, ensuring that a path is loop free.   The Loop Prevention Mechanism:

  • AS 100 advertises the 172.16.1.0/24 prefix to AS 200.
  • AS 200 advertises the prefix to AS 400, which then advertises the prefix to AS 300.
  • AS 300 advertises the prefix back to AS 100 with an AS_Path of 300 400 200 100. AS 100 sees itself in the AS_Path variable and discards the prefix.

Address Families

  • RFC 2858 added MP-BGP capability by adding an extension called the address family identifier (AFI).
  • An address family correlates to a specific network protocol, (IPv4/IPv6), and additional granularity is provided through a subsequent address-family identifier (SAFI) such as unicast or multicast.
  • MBGP achieves this separation by using the BGP PAs MP_REACH_NLRI and MP_UNREACH_NLRI to carry different reachability information for the different address families.
  • Every address family maintains a separate database and configuration for each protocol (address family + sub-address family) in BGP.

Inter-Router Communication

  • BGP does not use hello packets to discover neighbors. It cannot discover neighbors dynamically.
  • BGP neighbors are defined by IP address.
  • BGP uses TCP p179 to communicate with other routers.
  • Most recent implementations of BGP set the do-not-fragment (DF) bit to prevent fragmentation and rely on path MTU discovery.
  • BGP uses TCP. It can form adjacencies with routers that are multiple hops away.
  • A BGP session refers to the established adjacency between two BGP routers.
  • Multi-hop sessions require that the router use an underlying route installed in the RIB to establish the TCP session with the remote endpoint.

Inter-Router Communication

  • BGP can be thought of as a control plane routing protocol or as an application because it allows for the exchange of routes with a peer that is multiple hops away.
  • A BGP session refers to the established adjacency between two BGP routers.
  • BGP neighbors connected to the same network use the ARP table to locate the IP address of the peer.
  • Multi-hop BGP sessions require routing table information for finding the IP address of the peer.
  • A default route is not sufficient to establish a multi-hop BGP session.

BGP Session Types

  • Internal BGP (iBGP) – Sessions established with an iBGP router that are in the same AS or that participate in the same BGP confederation. iBGP prefixes are assigned an AD of 200 upon installation in the router’s RIB.
  • External BGP (eBGP) – Sessions established with a BGP router that are in a different AS. eBGP prefixes are assigned an AD of 20 upon installation in the router’s RIB.

BGP Session Types

iBGP

Service providers provide transit connectivity. Enterprises should not. Preventing an AS from becoming a transit AS by redistributing BGP routes into the IGP is not a viable solution for the following reasons:

  • Scalability – The internet has over 780,000 IPv4 network prefixes, IGPs cannot scale to that level of routes.
  • Custom routing – IGPs use metrics as the primary method of route selection. BGP uses multiple steps to identify the best path or to manipulate the path for a specific network prefix.
  • Path attributes – All of the BGP path attributes cannot be maintained within IGP protocols.

Establishing iBGP sessions between IGP routers in a full mesh allows for proper forwarding between AS.

eBGP

The difference in behavior for eBGP sessions and iBGP sessions are:

  • iBGP allows for multi-hop sessions. eBGP packets set the TTL to one, so packets are dropped if multi-hop connections are attempted.
  • The advertising router modifies the BGP next-hop address to the IP address sourcing the BGP connection.
  • The advertising router prepends its ASN to the existing AS_Path variable.
  • The receiving router verifies that the AS_Path variable does not contain an ASN that matches the local routers. BGP discards the NLRI if it fails the AS_Path loop prevention check.

BGP Messages

TYPE NAME FUNCTIONAL OVERVIEW
1 OPEN Sets up and establishes BGP adjacency
2 UPDATE Advertises, updates, or withdraws routes
3 NOTIFICATION Indicates an error condition to a BGP neighbor
4 KEEPALIVE Ensures that BGP neighbors are still alive

BGP Neighbor States

 

  • Idle
  • Connect
  • Active
  • OpenSent
  • OpenConfirm
  • Established

  BGP forms a TCP session with neighbor routers called peers. BGP uses the finite-state machine (FSM) to maintain a table of all BGP peers and their operational status.

  • Idle – The first stage of the BGP FSM. BGP detects a start event and attempts to initiate a TCP session with the BGP peer.
  • Connect – BGP initiates the TCP connection. When the TCP handshake is completed, the ConnectRetryTimer is reset, an Open message is sent to the neighbor, and the state changes to OpenSent. During this stage, the router with the higher IP address manages the connection.
  • Active – BGP starts another TCP three-way handshake. If the connection is established an Open message is sent and the state moves to OpenSent.
  • OpenSent – If the OPEN message that is received by the originating router contains no errors, the connection state moves to OpenConfirm
  • OpenConfirm – In the OpenConfirm state, BGP waits for KEEPALIVE or NOTIFICATION messages. Upon receipt of a neighbor’s KEEPALIVE message, the state is moved to Established.
  • Established – BGP neighbors exchange routes using UPDATE messages.

      Other useful information:

Join the conversation