BGP Mind - Map Part
BGP Mind - Map Part
BGP Mind - Map Part
Introduction :
TCP allows for handling of fragmentation, sequencing, and
reliability (acknowledgement and retransmission) of inter-organization connectivity on public networks, such as the Internet, or private dedicated
communication packet Inter-Router networks. BGP is the only protocol used to exchange networks on the Internet
Communication BGP does not advertise incremental updates or refresh network advertisements like OSPF or
ISIS. BGP prefers stability within the network
The OPEN message is used to establish a BGP adjacency.
Both sides negotiate session capabilities before a BGP OPEN
peering establishes. The OPEN message contains the BGP
version number, ASN of the originating router, Hold ASNs 64,512–65,535 are private ASNs
Time, BGP Identifier, and other optional parameters that ASN 2 byte
Autonomous System ASN 4 4,200,000,000–4,294,967,294 are private
establish the session capabilities .Setting a static BGP
RID is a best practice BGP Numbers ASN BYTE ASNs. RFC 4893
Messages
KEEPALIVE
The Internet Assigned Numbers Authority (IANA) is
responsible for assigning all public ASNs
BGP does not rely on the TCP connection state to ensure
that the neighbors are still alive
UPDATE Well-known mandatory
The Update message advertises any feasible routes, Path Attributes Well-known discretionary
withdraws previously advertised routes, or can do both. An
UPDATE message can act as a Keepalive to reduce NOTIFICATION Optional transitive
unnecessary traffic.
BGP Loop Prevention Optional nontransitive
Fundamentals
The BGP attribute AS_PATH is a well-known mandatory attribute
A Notification message is sent when an error is detected with
the BGP session, such as a hold timer expiring, neighbor and includes a complete listing of all the ASNs that the prefix
capabilities change, or a BGP session reset is requested. This advertisement has traversed from its source AS. The AS_PATH is
causes the BGP connection to close Address Families used as a loop prevention mechanism in the BGP protocol
ESTABLISHED
These attributes are processed in the order listed:
1. Weight -Idle: BGP detects a start event, tries to initiate a TCP connection to the BGP peer, and also listens
2. Local Preference for a new connect from a peer router If an error causes BGP to go back to the Idle state for a second
3. Local originated (network statement, redistribution, aggregation) time
the BGP Process is administratively down.
4. AIGP
the BGP Process is awaiting the next retry attempt.
5. Shortest-AS Path
the BGP is just configure on new neighbor Already established BGP Peering is reset.
6. Origin Type
-Connect : Connect BGP initiates the TCP connection If the 3-way TCP handshake completes, the
7. Lowest MED established BGP Session If successful, it will continue to the OpenSent state. if fails, it will
8. EBGP over IBGP continue to the active state. if BGP reset is send it will move back to the idle state
9. Lowest IGP Next-Hop -Active : Active In this state, BGP starts a new 3-way TCP handshake. If a connection is
10. If both paths are external (EBGP), prefer the first (oldest) established,an Open message is sent, the Hold Timer is set to 4 minutes, and the state moves to
11. Prefer the route that comes from the BGP peer with the lower RID OpenSent. If this attempt for TCP connection fails, the state moves back to the Connect state and
12. Prefer the route with the minimum cluster list length resets the ConnectRetryTimer
13. Prefer the path that comes from the lowest neighbor address -OpenSent : In this state, an Open message has been sent from the originating router and is
BGP Fundamentals 2 awaiting an Open message from the other router the matching open message has not been received
Basic Configuration on IOS ,NX OS and IOS XR from peer. BGP will be waiting for an Open message from the remote BGP neighbor.
-OpenConfirm BGP waits for a Keepalive or Notification message. Upon receipt of a neighbor's
Keepalive. the state is moved to Established. If the hold timer expires. a stop event occurs or a
Notification message is received, and the state moved to idle .
-Established
Adj-RIB-in: Contains the NLRIs in original form before
BGP Tables inbound route policies are processed. The table is purged
after all route policies are processed to save memory
Loc-RIB: Contains all the NLRIs that originated locally
or were received from other BGP peers. After NLRIs pass
the validity and next-hop reachability check, the BGP
best path algorithm selects the best NLRI for a specific
prefix. The Loc-RIB table is the table used for presenting
routes to the ip routing table
Adj-RIB-out: Contains the NLRIs after outbound route
policies have processed
■ Connected Network: The next-hop BGP attribute is set to 0.0.0.0, the origin
attribute is set to i (IGP), and the BGP weight is set to 32,768.
■ Static Route or Routing Protocol: The next-hop BGP attribute is set to the next-
hop IP address in the RIB, the origin attribute is set to i (IGP), the BGP weight is set
to 32,768; and the MED is set to the IGP metric.
RFC 1966 introduces the concept that an IBGP peering can be
IBGP Advertising the full Scalability: IPv4 networks and
configured so that it reflects routes to another IBGP peer. The
router reflecting routes is known as a route reflector (RR), and continues to increase in size. IGPs
The need for BGP within an AS BGP table into an IGP is
the router receiving reflected routes is a route reflector client cannot scale to that level of routes
Route Reflectors typically occurs when the multiple not a viable solution for
Rule #1: If a RR receives a NLRI from a non-RR client, the Custom Routing: The path could be
RR advertises the NLRI to a RR client. It does not advertise routing policies exist, or when the following reasons:
longer, which would normally be
the NLRI to a non-route-reflector client. transit connectivity is provided
Rule #2: If a RR receives a NLRI from a RR client, it deemed Subo-ptimal from an IGP
between autonomous systems protocol’s perspective
advertises the NLRI to RR client(s) and non-RR client(s).
Even the RR client that sent the advertisement receives a copy
of the route, but it discards the NLRI because it sees itself as
Path Attributes: All the BGP path
the route originator. attributes cannot be maintained
Rule #3: If a RR receives a route from an EBGP peer, it within IGP protocols.
advertises the route to RR client(s) and non-RR client(s).
Loop Prevention in Route Reflectors IBGP peers do not prepend their ASN
ORIGINATOR_ID, an optional nontransitive BGP attribute to the AS_PATH, because the NLRIs
is created by the first route reflector and sets the value to the IBGP Full Mesh would fail the validity check and
RID of the router that injected/advertised the route into the
AS. If the ORIGINATOR_ID is already populated on an
Requirement: would not install the prefix into the IP
NLRI, it should not be overwritten. If a router receives a NLRI routing table RFC 4271
with its RID in the Originator attribute, the NLRI is discarded. IBGP Scalability states that all BGP routers within a
CLUSTER_LIST, a nontransitive BGP attribute, is updated single AS must be fully meshed to
by the route reflector. This attribute is appended (not
overwritten) by the route reflector with its cluster-id. By provide a complete loop-free routing
default this is the BGP identifier. The cluster-id can be set EBGP table and prevent traffic blackholing
with the BGP configuration EBGP peerings are the core best practice is Peering via
command bgp cluster-id cluster-id on IOS and IOS XR component of the BGP protocol on the Loopback Addresses because is more
nodes. NX-OS devices use the command cluster-id cluster-id.
Out-of-Band Route Internet. EBGP is the efficient and preferable
If a route reflector receives a NLRI with its cluster-id in the
Cluster List attribute, the NLRI is discarded Reflectors exchange of network prefixes between
autonomous systems. The following
■ Time to Live (TTL) on BGP
RFC 3065 introduced the concept of BGP confederations behaviors are different on EBGP
as an alternative solution to IBGP full mesh scalability BGP Fundamentals 3 sessions when compared to IBGP
packets is set to one. (TTL on IBGP
issues A confederation consists of sub-ASs known as a packets is set to 255, which allows for
sessions:
Member-AS that combine into a larger AS known as an AS multihop sessions).
Confederation. Member ASs normally use ASNs from the ■ The advertising router modifies the
private ASN range (64512-65535). EBGP peers from the BGP next-hop to the IP address
confederation have no knowledge that they are peering sourcing the BGP connection.
with a confederation, and they reference the confederation ■ The advertising router prepends its
identifier in their configuration EBGP and IBGP
ASN to the existing AS_PATH.
Topologies ■ The receiving router verifies that the
Confederations share behaviors from both IBGP sessions
and EBGP sessions. The changes are as follows: AS_PATH does not contain an ASN
Confederations
■ The AS_PATH attribute contains a subfield called that matches the local routers. BGP
AS_CONFED_SEQUENCE. discards the NLRI if it fails the
The AS_CONFED_SEQUENCE is displayed in parentheses AS_PATH loop prevention check.
before any external ASNs in the AS_PATH. As the route
passes from Member-AS to Member-AS, the
AS_CONFED_SEQUENCE is appended to contain the Combining EBGP sessions with IBGP
Member-AS ASNs. The AS_CONFED_SEQUENCE sessions can cause confusion in
attribute is used to prevent loops, but it is not used (counted) terminology and concepts The most
when choosing shortest AS_PATH. common issue involves the failure of the
■ Route reflectors can be used within the Member-AS like next-hop accessibility.
normal IBGP peerings. IBGP peers do not modify the next-hop
■ The BGP MED attribute is transitive to all other Member- address if the NLRI has a next-hop
ASs, but does not leave the confederation. address other than 0.0.0.0. The next-hop
■ The LOCAL_PREF attribute is transitive to all other address must be resolvable in the global
Member-ASs, but does not leave the confederation. RIB for it to be valid and advertised to
■ IOS XR nodes do not require a route policy when peering other BGP peers.To correct the issue,by
with a different two possible technique
Next-Hop Manipulation
Member-AS, even though the remote-as is different. ■ IGP advertisement. Remember to use
■ The next-hop address for external confederation routes Configuring the next-hop-self address-family the passive interface to prevent an
does not change as the route is exchanged between Member- feature modifies the next-hop address in all accidental
AS to Member-AS. external NLRIs using the IP address of the BGP adjacency from forming. Most IGPs do
■ The AS_CONFED_SEQUENCE is removed from the not provide the filtering capability like
AS_PATH when the route is advertised outside of the
neighbor BGP.
confederation ■ Advertising the networks into BGP
Summarizing prefixes conserves router resource(s) and accelerates best BGP communities provide additional capability for tagging routes and for
modifying BGP routing policy on upstream and downstream routers. BGP
path calculation by reducing the size of the table. Summarization also communities can be appended, removed, or modified selectively on each
provides the benefit(s) of stability by reducing routing churn by hiding attribute as the route travels from router to router. BGP communities are an
route flaps from downstream routers optional transitive
The two techniques for BGP summarization are the following: A BGP community can be displayed as a full 32-bit number
■ Static: Create a static route to Null 0 for the prefix, and then advertise the (0-4,294,967,295) or as two 16-bit numbers (0-65535):(0-65535) commonly
network via a network statement. The downfall to this technique is that the summary referred to as new-format Private BGP communities follow the convention
route will always be advertised even if the networks are not available. that the first 16-bits represent the AS of the community origination, and the
■ Dynamic: Configure an aggregation network range. When viable routes that second 16-bits represent a pattern defined by the originating AS In 2006,
match the network range enter the BGP table, an aggregate route is created. On the RFC 4360 expanded BGP communities’ capabilities by providing an
originating router, the aggregated prefix sets the next-hop to Null 0. The route to Route BGP Communities extended format. Extended BGP communities provide structure for various
Null 0 is automatically created by BGP as a loop-prevention mechanism. Summarization classes of information and are commonly used for VPN Services
In both methods of route aggregation, a new network prefix with a shorter prefix
IOS XR and NX-OS devices display BGP communities in new-format by
length is advertised into BGP. Because the aggregated prefix is a new route, the
default, and IOS nodes display communities in decimal format by default
summarizing router is the originator for the new aggregate route
ip bgp-community new-format
summary-only – suppress all less specific, by IOS and NX-OS devices do not advertise BGP communities to peers by
default the aggregate does not do that default
IOS XR advertises BGP communities to IBGP peers by default
Flexible Route Suppression
Some traffic engineering designs require “leaking”
routes, which is the advertisement of a subset of no-advertise – do not send beyond local router (0xFFFFFF02)
more specific routes in addition to performing the
summary Aggregate-Address no-export – do not send beyond local AS (0xFFFFFF01)
Well known
Leaking Suppressed Routes The
summary-only keyword suppresses BGP Fundamentals 4 local-as – do not send to ebgp sub-AS peers within confed
all the more specific routes of an (0xFFFFFF03)
aggregate address from being Selective Prefix Suppression
advertised. After a route is Selective prefix suppression
suppressed, it is still possible to explicitly lists the networks that internet – permit any – overwrite all communities and allow prefix
advertise the suppressed route to a should not be advertised along with to be announced everywhere
the summary route to neighbor
specific neighbor unsuppress-map routers suppress-map
gshut – gracefull shutdown, like overload bit in ISIS, „go around me” signal
The Atomic Aggregate attribute indicates that a loss of path Atomic to all BGP speakers
information has occurred. Aggregate
remove private AS feature:
To keep the BGP path information history, the optional as-set keyword ■ Removes only private ASNs on routes advertised to EBGP peers.
may be used with the aggregate-address command. As the router ■ If the AS-Path for the route has only private ASNs, the private ASNs are
generates the aggregate route, BGP attributes from the summarized routes Remove Private AS removed.
Route Aggregation
are copied over to it The AS_SET is ■ If the AS-Path for the route has a private ASN between public ASNs, it is
displayed within brackets with AS_SET assumed that this is a design choice, and the private ASN is not removed
■ If the AS-Path contains confederations (AS_CONFED_SEQ), BGP
removes the private AS numbers only if they are included after the
Using the AS-SET feature with network aggregation combines all the
Route Aggregation AS_CONFED_SEQ (Confederation AS-Path) of the path.
attributes of the original prefixes into the aggregated prefixes. This might with Selective
cause issues with your routing policy. be aware about that you can use
the advertise-map option allows for conditionally matching and denying
Advertisement of AS- The Allow AS feature allows for routes to be received and processed even if
SET Allow AS the router detects its own ASN in the AS-Path
attributes that should be permitted or denied in the aggregated route
The LocalAS feature is configured on a per peer basis, and allows for BGP sessions
Advertising a default route into the BGP table requires the default route to establish using an alternate ASN than the ASN that the BGP process is running on.
to exist in the RIB and the BGP configuration command default- The LocalAS feature works only with EBGP peerings One problem with the alternate
information originate to be used. The redistribution of a default route or
use of a network 0.0.0.0/0 does not work without the default-information
Default Route ASN being prepended when receiving the routes is that other IBGP peers drop the
network prefixes as part of a routing loop detection.
originate command Advertisement ■ To stop the alternate ASN from being prepended when receiving routes, the
Local AS optional keyword no-prepend is used.
Some network topologies restrict the size of the BGP advertisements to a Default Route ■ To stop the alternate ASN from being prepended when sending routes, the optional
neighbor because the remote router does not have enough processing keywords no-prepend replace-as is used.
power or memory for the full BGP routing table neighbor ip-address
Advertisement per ■ If both no-prepend replace-as keywords are used, all routers see the BGP
default-originate Neighbor advertisements as if they were running the original AS in the BGP process.
Troubleshoot Blocked Process in IOS XR IOS XR is a distributed operating system, and every Decode BGP Messages BGP generates a hex ■ During establishment of BGP sessions because of misconfiguration
component (feature) runs as a separate process with its own set of threads that manages dump of the message. These hex dumps can ■ Triggered by network migration or event, or software or hardware upgrades
various tasks of the component.Unlike traditional IOS , In IOS XR, the BGP Process Manager then be analyzed to understand why the BGP ■ Failure to maintain BGP keepalives due to transmission problems
(BPM) and BGP processes create the BGP protocol functionality.The BPM process also has the router was unable to process the message. The peering down issue occurs ■ High CPU
responsibility to calculate the router-id if one is not explicitly configured. It interacts with There are external websites that help decode because of one of the following ■ Blocked or stuck processes
NETIO, TCP, and a few other processes internally to perform the necessary tasks in the system BGP messages; for example, ■ Firewall or ACL misconfiguration
and finally installs the routes in the Routing Information Base (RIB) http://bgpaste.convergence.cx circumstances ■ Software defects
Convergence Issues show bgp afi safi prefix/prefix-length and show ip route next-hop-IP-address
Next-Hop Check Failures The next-hop IP address could be not available in the RIB.
■ advertises the peering link into BGP
A BGP speaker faces convergence issues primarily because of a large BGP table size
■ Establish an IGP routing protocol within AS and advertise the peering link
and an increase in the number of BGP peers. The different dimensional factors while investigating
but make the peering link interface passive
BGP convergence issues that need to be considered include the following:
■ configure the next-hop-self feature in the address-family for the BGP peering
■ Number of peers
■ Number of address-families there are many solution it's depending in design and other factors .
■ Number of prefixes/paths per address-family
■ Link speed of individual interface, individual peer
Common BGP Bad Network Design Networks that use BGP are more sensitive to design flaws than networks that
use only IGP routing protocols. An improperly design BGP network can result
■ Different update group settings and topology
■ Complexity of attribute creation and parsing for each address-family Troubleshooting in an inconsistent routing policy, missing routes, or worse.
Jumbo MTU for Faster Convergence 9176 byte update messages can be sent to the neighbors
Issues Aggregation After configuring the as-set keyword on Rtr, Rtr includes the PAs
from the smaller aggregate routes
instead of the default 536 byte update messages. This increases the efficiency because fewer ■ Identifying the router’s RID in as the Route-Originator ID
update messages need to be sent to the peer ■ Identifying the router’s RID as the Cluster ID
BGP communities provide additional capability for tagging routes and are
Slow Convergence due to Periodic BGP Scan To overcome this issue, the BGP scan time is
considered either well-known or private BGP communities. Private BGP
reduced by using the command bgp scantime time-in-seconds, where the timer can be set to any
value between 5 seconds and 60 seconds. But this is not an effective solution A better way to
BGP Communities communities are used for conditional matching for a router’s route policy
overcome this issue is by using the BGP next-hop tracking (NHT) feature
BGP Slow Peer Symptoms BGP Slow Peer There are three well-known communities that affect only outbound route
There are two common symptoms advertisement: No-Advertise, No-Export, and Local-As
when the BGP slow peer condition is show bgp afi safi [community {local-AS | no-advertise | no-export}]
Slow Convergence due to Default Route in RIB Default route makes the configuration simpler seen: BGP Communities: No-Advertise
by allowing all traffic, but it is very important to understand where the default route needs to be ■ High CPU due to BGP Router The No_Advertise community (0xFFFFFF02 or 4,294,967,042) specifies that
advertised in the network and what impact it can potentially have. Although at times a default process routes with this community should not be advertised to any BGP peer.
route is required, if configured inappropriately, it can lead to convergence issues and traffic black ■ Prefixes not getting replicated and BGP Communities: No-Export
hole traffic black hole The No_Export community (0xFFFFFF01 or 4,294,967,041) specifies that
when a route is received with this community, the route is not advertised to any
Selective Next-Hop Tracking BGP NHT overcomes the problem faced because of periodic BGP EBGP peer. If the router receiving the No-Export route is a confederation
scan by introducing the event-driven quick scan paradigm, but it still does not resolve the member, the route can be advertised to other sub-ASs in the confederation.
inconsistencies caused by default route or summarized route present in the RIB. To overcome BGP Communities: Local-AS (No Export SubConfed)
these problems, a new enhancement was introduced in BGP NHT called the BGP SelectiveNext- The No_Export_SubConfed community (0xFFFFFF03 or 4,294,967,043)
Hop Tracking or BGP Selective Next-Hop Route Filtering the command bgp nexthop route-map known as the Local-AS community specifies that a route with this community
route-map-name is not advertised outside of the local AS. If the router receiving a route with the
Local-AS community is a confederation member, the route can be advertised
Slow Convergence due to Advertisement Interval BGP neighbor advertisement interval or BGP Slow Peer Detection only within the sub-AS (Member-AS) and is not advertised between Member-
MRAI causes delays in update generation if set to a higher value configured manually. It is a good BGP slow peer condition can be easily detected with the help of show ASs.
practice to have the same MRAI timer at both ends of the neighbor and also across different commands. The The last component for finding missing BGP routes is through the examination
following steps help identify a BGP slow peer:
Filtering of Prefixes by
platforms of the BGP routing policies. As stated before, BGP route policies are applied
Step 1. Verify OutQ in show bgp ipv4 unicast summary output. Route Policy before routes are inserted into the Loc-RIB table and as prefixes leave the Loc-
Step 2. Verify SndWnd field in the show bgp ipv4 unicast neighbor ip-address RIB before they are advertised to a BGP peer.
Computing and Installing New Path BGP always selects only one best path (assuming BGP Step 3.Verify CSize along with Current Version and Next Version fields in ■ Prefix-list: A list of prefix matching specifications that permit or deny
multipath is not configured). In case of failure of the best path, BGP has to go through the path show bgp ipv4 unicast replication output. network prefixes in a top-down fashion similar to an ACL.
selection process again to compute the alternative best path. This takes time and thus impacts Step 4. Verify CPU utilization due to BGP Router process. ■ AS-Path ACL/Filtering: A list of regex commands that allows for the permit
convergence time. Also, features such as BGP NHT help improve the convergence time by or deny of a network prefix based on the current AS-Path values.
providing fast reaction to IGP events, but that is still not significant because it depends ■ Route-maps: Route-maps provide a method of conditional matching on a
on the total number of prefixes to be processed for best-path selection. With the BGP multipath variety of prefix attributes and taking a variety of actions. Actions could be a
feature, equal cost paths can be used for both redundancy and faster failover simple permit or deny or could include the modification of BGP path attributes.