BGP
***************
✓ It fall under the categories of Exterior Gateway Protocols (EGP).
✓ The Main Purpose of BGP is to exchange routes between 2 Autonomous Systems.
✓ It serves as a gateway protocol that facilitates the exchange of routing information between autonomous systems (AS).
✓ There is a flavor of BGP that is run within the Autonomous System. This is called iBGP.
✓ Imagine you’re dealing with a large number of external BGP (eBGP) routes (500,000 routes) across multiple locations.
✓ BGP can handle a significantly larger number of routes than IGP protocols like OSPF , IS-IS & EIGRP.
✓ iBGP is to allow the propagation of BGP routes from one edge to another maintaining BGP Attributes like the AS-Path.
➢ Path Attributes: BGP includes various path attributes that describe the characteristics of the advertised routes.
✓ These attributes include things like AS path, next-hop, origin, local preference, and others.
✓ Path attributes used for BGP route selection and policy enforcement.
✓ AS-Path attribute represents the sequence of AS through which a route advertisement has traversed. It helps prevent routing loops
BGP Neighbour:
✓ BGP Neighbor router is also known as BGP Peer.
✓ As Neighbor is manually defined, unlike other routing protocols, it doesn’t form neighborship automatically.
✓ TCP Connection is formed with the manually defined neighbor using TCP port 179.
✓ TCP is used for retransmitting lost data, avoiding duplicate data, and ensuring accurate transmission
✓ Administrative Distance:
• 20 for External BGP (EBGP)
• 200 for Internal BGP (IBGP).
BGP Tables:
➢ Neighbour Table:
•Information about all the manually defined neighbors will be managed in the neighbor table
•# show ip BGP neighbors
• # show ip BGP summary
➢ BGP Database Table:
•The list of all possible networks learned by BGP & their attributes and paths in this table.
• # show ip BGP
➢ Routing Table:
• Only the best path will be available in the IP routing table.
• # show ip Route BGP
(such as Authentication)
(NLRI) Network layer reachability information
Used to report errors or terminate the session.
1-Idle:
• The initial state where BGP resources are initialized.
• In this state, inbound connection attempts are refused.
2-Connect:
• BGP waits for the 3-way handshake to complete.
• If successful, the OPEN message is sent to the peer
• BGP transitions to the Open Sent state.
3-Active:
• If the 3-way handshake fails, BGP moves to this state.
• It retries the connection.
4-OpenSent:
• BGP has initiated the TCP connection and sent the OPEN message.
• It awaits acknowledgment from the peer.
5-Open Confirm:
• The peer acknowledges the OPEN message,
• BGP confirms the session establishment.
6-Established:
• The BGP neighbor adjacency is complete,
• routers exchange UPDATE packets containing routing information.
•Following reasons:
• Neighbor is peering with the wrong address.
• Neighbor does not have a neighbor statement for this router.
• AS number is misconfigured.
• Neighbor does not have a route to the source IP address of the BGP open packet generated by this router.
• Any extra command missing (update source).
BGP Attributes and Path Selection
• (BGP), route advertisements consist of the (Network Layer Reachability Information (NLRI) and the path attributes (PAs).
• The NLRI consists of the network prefix and prefix length; BGP attributes such as AS Path and origin are stored in the PAs.
• A BGP route may contain multiple paths to the same destination network.
• Every path’s attributes impact the desirability of the route when a router selects the best path.
✓ BGP use attributes to decide the best route.
✓ BGP attributes are similar to metrics in OSPF and EIGRP.
✓ BGP selects the best path based on a list of attributes.
✓ BGP has 0 to 14 attributes for Cisco.
✓ BGP does not use metrics but use set of attributes.
✓ BGP has four main types of attributes.
✓ Well-Known Mandatory.
✓ Well-Known Discretionary.
✓ Optional Transitive.
✓ Optional Non-Transitive.
Well-Known Mandatory:
✓ These attributes are required by all BGP peers. (BGP Implementation)
✓ These attribute must be included in all BGP updates.
✓ If these attribute are missing a Notification, error is generated.
✓ If these attribute are missing the session will be closed.
✓ Well-Known mandatory attributes are AS Path, Next Hop Address, & Origin
Well-Known Discretionary: (Not need to be in update)
✓ These attributes are recognized & supported by all BGP speakers.
✓ May or may not appear in every BGP Update message (Not mandatory)
✓ Well-Known Discretionary attributes are Local Preference & Atomic Aggregate.
Optional Transitive:
✓ These attributes are recognized by some BGP routers but not necessarily by all.
✓ Will be passed on if not recognized by the receiver.
✓ Transitive, these attributes are across AS boundaries (inter-AS routing)
✓ Optional Transitive attributes are Aggregator and Community.
Optional Non-Transitive:
✓ These attributes are specific to a particular vendor or implementation and are not understood by all BGP routers
✓ The attribute should be ignored and not passed on to other peers.
✓ Non-transitive, these attributes are restricted to the same AS.
✓ Optional Non-Transitive attributes are MED, Originator ID and Cluster List.
Next hop 0.0.0.0
✓ The BGP community is the tagging mechanism we use to mark our BGP prefixes.
✓ When the neighbor receives the prefix, it will examine the community value and take specific action
✓ They are often used for traffic engineering, dynamic routing policies, and route filtering.
✓ It is an Optional, Transitive BGP attribute, By default, are not sent with BGP updates,
✓ you need to explicitly use the send-community command.
✓ Any BGP prefix can have more than one tag (BGP community); leads to specific unique action.
✓ Can attach up to 32 communities to a single route
There are three types of BGP communities:
➢ Standard communities Well-known & user defined
➢ Extended communities
➢ • Large communities
Well-known Standard BGP communities
There are four well-known Standard BGP communities that can use instead of picking a numeric value
•No-Export: Don’t advertise this tagged route to EBGP peers, in other meaning
(Only advertise to IBGP neighbors & BGP confederations.)
•No-Advertise: Don’t advertise this tagged route to any peer, (eBGP& iBGP)
(Tell receiving router to keep the tag to yourself and do not pass to any neighbor).
*************************************************
•Local-as: prevent sending tagged routes outside the local AS within the Confederation.
•Internet: advertise these tagged routes to all neighbors (IBGP & EBGP).
There are three types of BGP communities:
➢ Standard communities Well-known & user defined
➢ Extended communities
➢ • Large communities
Standard communities user defined :-written as numeric 32-bit tags
in (AS : Action) format
The first 16 bits is the (AS) number 65000 : 10
The second 16 bits have the local significance (Action)
The primary purpose of standard communities is to the group
and tag routes so that Actions can perform.
Extended communities:- written as numeric 64-bit tags in ( AS: Membership)
Route Target (RT) extended community use to control the exporting and importing of VPN routes.
(RT) used in MPLS L3 VPN with MP-BGP
Other types of extended communities, such as to Site of Origin (SOO), Ethernet VPN (EVPN), OSPF Domain Identifier.
Large communities :- 96-bit tags in (AS: Action : Target AS)
Well-known Standard BGP communities
There are four well-known Standard BGP communities that can use instead of picking a numeric value
•No-Export: Don’t advertise this tagged route to EBGP peers, in other meaning
(Only advertise to IBGP neighbors & BGP confederations.)
•No-Advertise: Don’t advertise this tagged route to any peer, (eBGP& iBGP)
(Tell receiving router to keep the tag to yourself and do not pass to any neighbor).
*************************************************
•Local-as: prevent sending tagged routes outside the local AS within the Confederation.
LOCAL AS (only for IBGP (NOT eBGP & eBGP Confederation )
•Internet: advertise these tagged routes to all neighbors (IBGP & EBGP).
Full Mesh Problem:
➢ In a typical IBGP setup, all routers within an AS must be fully meshed
➢ Establish peering session with every other router.
➢ Large number of TCP sessions
➢ Manual configuration
Solutions:-
1-Route Reflector Clusters
2-Confederations
BGP Confederations:-
✓ Feature used to split large Autonomous System into Sub-Autonomous Systems
✓ Internal BGP: Each sub-AS, routers use (IBGP) to share routing information. to keep routing updates within the sub-AS efficient
✓ Confederation Peers: Routers at the borders of sub-ASes communicate with each other
✓ Using a special type of BGP session called a confederation peer session.
✓ These sessions exchange routes between sub-ASes.
BGP Confederations Benefits :-
✓ Management.
✓ Using different BGP Attributes within sub-AS
Next hop 0.0.0.0
•Large networks sometimes use multiple, separate BGP Autonomous Systems (ASes) for administrative reasons,
•even though they're under a single management domain.
•Traditional BGP relies on attributes like AS path length, which doesn't consider the "internal" costs within each AS.
•This can lead BGP to choose suboptimal paths across the entire network.
•AIGP is the Solution: (Accumulated Interior Gateway Protocol) (metric attribute )
•AIGP is an optional non-transitive BGP attribute. This means it's not passed on indefinitely between BGP routers.
•The AIGP attribute carries the accumulated metric from an Interior Gateway Protocol (IGP) within an AS.
•All ASes must be under the control of single domain
•BGP routers can advertise this AIGP metric to their neighbors, providing visibility into the "internal costs" of paths within other ASes.
•AIGP metric:- can make decisions and choose the best path for traffic flow even if it traverses multiple Ases under the same administrative control.
✓ Prior to January 2009, BGP AS numbers were 16-Bit 2-octet numbers in the range from 1 to 65535
✓ Due to increased demand, the Internet Assigned Number Authority (IANA) started allocating 4-octet AS numbers
✓ An extension has been created that supports 32-Bit or 4-Octed or 4-Bytes AS numbers total about 4294967296 .
64512
•AS 23456, also known as AS_TRANS, is a reserved specifically for use in BGP communication between routers.
•When a new router (supporting 4-byte AS numbers) communicates with an old router (supporting only 2-byte AS
numbers), it can use AS_TRANS instead of its actual 4-byte AS number.
2 . 18928
150000/65536=2
2*65536=131,072