Update:

First time ever I met Yakov Rekhter!!!

MTU made me cry :-)

BGP

BGP Best path selection:

        Prefer highest weight (local to router)

        Highest local preference (Global within same AS)

        Prefer routes that the router originated (using network/redistribute/aggregate/default-information originate commands)

        AS Path (AS length; this step will be skipped if bgp bestpath as-path ignore is configured.)

        Lowest Origin Code (IGP <EGP <Incomplete)

        MED (Lowest MED will be preferred, applicable to very next AS)

        Prefer EBGP (AD of 20) over IBGP (AD of 200)

        For IBGP Paths: Prefer path through closest IGP neighbor (lowest metric path to the BGP next-hop)

        For EBGP Paths: Prefer oldest path.(most stable path)

10·     Prefer path with lower BGP router-ID.

11·     BGP prefer path coming from lowest neighbor address, this is IP address used in neighbor configuration command.


BGP processes on Cisco Router:
        
            1. OPEN: Establish the TCP session between TCP speakers.
            2. I/O: It does BGP packet processing.
            3. Scanner: It scan or walk through the BGP table. (Default scan time is 60 seconds)
            4. Router: Take care of BGP session establishment and maintenance. handle the BGP path selection process. Process the new routes and advertisement to peers.

 BGP MED: If you are going to use MED as best path selection attributes, use following two commands. (Cisco Document)

  • bgp-always-compare-med: This command enables the comparison of MED for the same destination received from the two different AS.
  • bgp deterministic-med: This command first of all make a group of routes from the same AS and then do the MED comparison.


BGP Capability:

    BGP negotiate all capability using OPEN message.

    Capabilities:

·        Multiporotcol

·         Route Refresh

·        Graceful Restart

·        Outbound Route Filter.

BGP AFI and SAFI:

    SAFI for IPv4 addresses family:

·        Unicast, SAFI 1

·        Multicast SAFI 2

·         IPv6 Label SAFI 4

·        Label for VPNv4 prefix SAFI 128

 

Advertise Prefix in BGP

·        network” command advertises route in BGP if it has route in IP Routing table

·        aggregate-address” command advertises aggregate only if it have component or subnet of aggregate in BGP table.

BGP Stages:

IDLE

refuse all incoming connection,

CONNECT

process is waiting for TCP connection

ACTIVE

BGP try to initiate TCP connection with neighbor. if successful then sends and OPENT message and transition to OPENSENT, and wait for 4 mins. If fail then transition to connect state. If neighbor is attempting to establish TCP with unexpected IP, local process will stay in ACTIVE state.

 

OPEN SENT

BGP is waiting for open from its neighbor. if open is received and there is no error then local router will send KEEPALIVE message and start the Keep alive timer. In this state it will determine either peer is internal or external based on AS number. Here it transit to open confirm.

 

OPEN CONFIRM

BGP waits for keep-alive or notification. If keep-alive is received state transition to establish. If notification is received or TCP disconnect is received state transition to IDLE.

 

ESTABLISHED

BGP peer connection is fully established and peer can exchange the update, keep-alive and notification messages

 

Attribute Class:

·        ORIGIN                                                          Well-known mandatory

·        AS_PATH                                                       Well-known mandatory

·        NEXT_HOP                                                    Well-known mandatory

·        LOCAL_PREF                                                 Well-known discretionary

·        ATOMIC_AGGREGATE                                 Well-known discretionary

·        AGGREGATOR                                              Optional transitive

·        COMMUNITY                                                Optional transitive

·        MULTI_EXIT_DISC (MED)                            Optional non-transitive

·        ORIGINATOR_ID                                           Optional non-transitive

·        CLUSTER_LIST                                             Optional non-transitive


Attributes Nature:

·        Well-known attributes are either mandatory, meaning that they must be included in all  BGP Update messages, or they are   discretionary, meaning that they may or may not be sent in a specific Update message.

·        If an optional attribute is transitive, a BGP process should accept the path in which it is included, even if it doesn't support the attribute, and it should pass the path on to its peers.

·        If an optional attribute is non-transitive, a BGP process that does not recognize the attribute can quietly ignore the Update in which it is included and not advertise the path to its other peers.

 

 BGP Convergence:

·        Path MTU: Discover the largest MTU in path so it can adjust TCP MSS (default MSS 536bytes), Large MTU can support large update packet (Configuration is on TCP side not on BGP configuration mode)

·        Hold queue variation

·        Fast external failover: This trigger the BGP session to tear-down as soon as link fails instead of waiting for 180 sec.

·        Timers

·        Suppress inactive routes: by default BGP sends all the routes including active and inactive both

·        BGP Scan interval (BGP Processes on router: Router/Scanner/IO)

BGP Optimization:

·        BGP update delay

·        Path MTU

·        Don’t be a transit AS

·        Advertise specific as well as summarized routes as per your external scenarios (Multi-home)

·        TTL Security check (if you have multiple path to reach remote AS then make hop calculation and then configure this feature)

·        Use next-hop self

·        Keep track of bogons list

 

Community:

·        INTERNET: The Internet community does not have a value; all routes belong to this community by default. Received routes belonging to this community are advertised freely.

·        NO_EXPORT (4294967041, or 0xFFFFFF01): Routes received carrying this value cannot be advertised to EBGP peers or, if a confederation is configured, the routes cannot be advertised outside of the confederation.   (Confederations are defined in a later section, "Managing Large-Scale BGP Peering.")

·        NO_ADVERTISE (4294967042, or 0xFFFFFF02): Routes received carrying this value cannot be advertised at all, to either EBGP or IBGP peers.

·        LOCAL_AS (4294967043, or 0xFFFFFF03): RFC 1997 calls this attribute NO_EXPORT_SUBCONFED:  Routes received carrying this value cannot be advertised to EBGP peers, including peers in other autonomous systems within a confederation.

 

BGP unqueal-link bandwidth (link-bandwidth/DMZ-bandwidth):

This feature can be useful in AS having multi-home connectivity, Here local AS having multiple connections to ISP and if you want to achieve unequal load-sharing then configure eBGP peering (Router A &B, use neighbor ebgp dmzlink-bw to ebgp neighbor) to ISP (Router C &D, no need to enable the dmz-bandwidth) with dmz-bandwidth feature and the same eBGP peer router (Router A&B)  peer with their IBGP peer of the local AS and also enable the extended community between all IBGP peers and all  IBGP peer should have enabled “neighbor dmzlink-bw” under bgp router configuration.

Conditional Advertisement:

Two ways to do that (conditionally advertise prefix to neighbor):

    neighbor advertise-map map1 non-exist-map map2;   Advertise the prefix match by map1 only when prefix match by map2 is not in BGP table.

    neighbor advertise-map map1 exist-map map2;   Advertise prefix match by map1 only when prefix match by map2 is in BGP table.

    bgp inject-map” is also one kind of conditional route injection to local BGP RIB.


BGP Route Reflector:

  • Avoid the need for full mesh of IBGP in side the network.
  • Route Advertisement Rule:
    • Route received from EBGP  will be advertised to all IBGP peer & RR Client.
    • Route received from RR Client will be advertised to EBGP peer, IBGP non RR client peer and RR Client
    • Route received from non RR Client will be advertised to all RR client and EBGP peer.
  • There can be multiple RR in network for redundancy. RR use two attributes:
    • CLUSTER ID (set by RR in network) & Originator ID (BGP Router ID of the route originating router) is used to avoid any loop as well as selecting the best path. Sorter the cluster id list route will be preferred.
  • Route reflector can be a route reflector client of other Route Reflector. 
  • Route from the other RR in same cluster will be discarded by local RR.
  • On client update received from one cluster RR will not be advertise to other RR of other cluster if Client is having two connection to two different cluster's RR.


BGPLabs:

LAB Testing:

Goal of this LAB is to merge two BGP AS and have very minimal amount of network outage.
    1. Merge AS2 into AS1 so finally there will be only one BGP AS, AS1.
    2. Migrate OSPF in AS2 to ISIS.
    3. As a additional step we can use different IP addressing in AS1 and AS2.
            AS1 IP addressing: 10.0.0.0/24
            AS2 IP addressing: 20.0.0.0/24
        After merging up both the AS to AS1, IP addressing should be 10.0.0.0/24 in AS1.