- Uses TCP to transfer data, this ensures reliable delivery of protocol updates (port 179)
- Sends updates only after network changes (no periodic updates)
- Periodically sends keepalive messages to verify TCP connections.
- The protocol metric is called path vector or attributes.
Following are the default administrative distance for BGP routes:
- External BGP route=20
- EGP route=140
- External EIGRP route=170
- Internal BGP route=200
If no path selection policies are configured for BGP on the Cisco router. Then router will go to each next step only if the values match the previous one.
- The maximum weight value (local to the router).
- The maximum value of local preference (for the whole AS).
- Prefer the local route of the router (next hop = 0.0.0.0).
- The shortest path through autonomous systems. (shortest AS_PATH)
- The minimum value of the origin code (IGP
- The minimum value of MED (distributed between autonomous systems).
- The eBGP path is better than the iBGP path.
- Choose a path through the nearest IGP neighbor.
- Select the oldest route for the eBGP path.
- The neighbor with the lowest BGP router ID.
- In last the neighbor with the smallest IP address.
There are two mechanisms to prevent loops in BGP:
- When we are advertising to an eBGP router/peer, a BGP router adds its own A SN to the AS-PATH. If a
BGP router receives an update & route advertisement lists an AS-PATH with its own ASN, then the router
ignores that route. - When a router learns routes from an iBGP peer, that router does not advertise the same routes to another
iBGP peer.
Border Gateway Protocol uses TCP port number 179 for creating connection.
iBGP: BGP working within the single AS and transfer BGP routes within a single autonomous system.
eBGP: BGP running between autonomous systems. By default, eBGP neighbors must be directly connected.
In BGP you are required to manually configure each neighbor in order to establish a neighborhood relationship.
There are type of neighbors in BGP:
- An internal BGP neighbor (iBGP neighbor) is a neighbor that resides on the same AS as the local router. iBGP neighbors do not have to be directly connected.
- An external BGP neighbor (eBGP neighbor) is a neighbor that is in an AS other than the local router. EBGP neighbors must be directly connected by-default.
The type of neighbor has little effect on the setting of neighborhood relations. More significant differences between the different types of neighbors appear in the process of sending BGP updates and adding routes to the routing table.
BGP performs these checks when it forms neighborhood relationships: - The router should receive a request for a TCP connection with the address of the sender, which the router
will find listed in the list of neighbors (the neighbor command). - The autonomous system number of the local router must match the autonomous system number, which is
indicated on the neighboring router by the command neighbor remote-as (this requirement is not observed when setting up confederations). - Router IDs must not be the same.
- The neighbors must pass the authentication information if it is configured.
It is an important concept regarding BGP Interview Questions, following are Neighbor Adjacency States Of BGP:
Idle: The BGP process is either administratively down or waiting for new neighbor adjacency.
Connect: During the BGP process, if the TCP connection is successful, it will continue to the Open=Sent state. In case it fails, it will continue to the Active state.
Active: BGP will try another TCP three way handshake to create a connection to remote BGP-neighbor. If it is successful, it will move to the Open-Sent state.
Open-sent: The TCP connection exists, and a BGP Open message has been sent to the peer, but the matching Open message has not yet been received from the other router.
Open-confirm: When an Open message has been received from neighbor router, a BGP Neighbor Adjacency is complete. A hold down timer will starts once this done.
Established: All BGP neighbor parameters matched, the neighbor relationship has been established and the peers can now exchange Update messages.
BGP path selection depends on the following attributes values:
- Weight(Cisco proprietary attributes )
- Local Preference (highest local value will be preferred, default value is 100)
- Originate
- AS path length
- Origin code
- MED
- eBGP path over iBGP path
- Shortest IGP path to BGP next hop
- Oldest path
- Router ID
- Neighbor IP address
Open: Open message is Used to create a neighbor relationship and exchange BGP=parameters, including AS number and authentication values.
Keep-alive: These keepalive messages are sent periodically to keep the neighbor relation-ship. If the Keep-alive messages are not received within a Hold timer than BGP neighbor-ship will be break down.
Update messages: These messages are used to exchanges Path Attributes and the associated prefix /l ength that use those attributes.
Notification: In BGP notifications are used to report BGP problem or errors. It results in a reset of neighbor relationship.
BGP path selection depends on the following attributes values:
- Weight(Cisco proprietary attributes )
- Local Preference (highest local value will be preferred, default value is 100)
- Originate
- AS path length
- Origin code
- MED
- eBGP path over iBGP path
- Shortest IGP path to BGP next hop
- Oldest path
- Router ID
- Neighbor IP address
You can configure BGP protocol according to your memory and hardware requirements with following ways:
Default route: In this mode of configuration ISP only advertise the default route with BGP, and all other routes are accessible through this default route. This is most efficient way of configuration when you have a small amount of memory.
Full updates: In this mode of configuration you will receive the full routing table from ISP. This mode required a lot amount of memory.
Partial updates: In partial update configuration mode of BGP you will receive the routes for prefixes which are suitable to reach from your ISP router. For other routes you will also have a default route.
BGP path selection depends on the following attributes values:
- Weight(Cisco proprietary attributes )
- Local Preference (highest local value will be preferred, default value is 100)
- Originate
- AS path length
- Origin code
- MED
- eBGP path over iBGP path
- Shortest IGP path to BGP next hop
- Oldest path
- Router ID
- Neighbor IP address
Open: Open message is Used to create a neighbor relationship and exchange BGP=parameters, including AS number and authentication values.
Keep-alive: These keepalive messages are sent periodically to keep the neighbor relation-ship. If the Keep-alive messages are not received within a Hold timer than BGP neighbor-ship will be break down.
Update messages: These messages are used to exchanges Path Attributes and the associated prefix /l ength that use those attributes.
Notification: In BGP notifications are used to report BGP problem or errors. It results in a reset of neighbor relationship.
BGP path selection depends on the following attributes values:
- Weight(Cisco proprietary attributes )
- Local Preference (highest local value will be preferred, default value is 100)
- Originate
- AS path length
- Origin code
- MED
- eBGP path over iBGP path
- Shortest IGP path to BGP next hop
- Oldest path
- Router ID
- Neighbor IP address
If you would like to know more about this subject or others, leave a comment below with you questions for the folks at Functionkey, Inc.