Friday, 19 May 2017

BGP

Border Gateway Protocol (BGP)

Border Gateway Protocol advertises, learns and chooses the best paths inside the global Internet. When two ISPs connect, they typically use BGP to exchange routing information. Enterprises also sometimes uses BGP to exchange routing information with ISPs.
 Can Routers on different subnet become BGP neighbors?
BGP does not require neighbors to be attached to the same subnet. Instead, BGP routers use a TCP connection between the routers to pass BGP messages allowing neighboring routers to be on the same or different subnet.

BGP uses TCP port 179 for the connection.

Difference between eBGP and iBGP neighbor?
In iBGP, neighborship is formed between routers within the same AS (autonomous system) whereas in eBGP, neighborship is formed between routers within different AS.

Loop prevention mechanism in BGP?
BGP uses two mechanism to prevent loops:-
1. When a router learns routes from an iBGP peer, that router does not advertise the same routes to another iBGP peer.
2. By using AS_PATH - When advertising to an eBGP peer, a BGP router adds its own ASN to the AS_PATH. If a BGP router receives an update and the route advertisement lists an AS_PATH with its own ASN, the router ignores that route.
Note - A BGP router does not add its ASN when advertising to an iBGP peer.
Explain various states of BGP?
1. Idle - The BGP process is either administratively down or waiting for the the next retry attempt.
2. Connect - The BGP process is waiting for the TCP connection to be completed. If it is successful, it will continue to the OpenSent state. In case it fails, it will continue to the Active state.
3. Active - BGP will try another TCP three-way handshake to establish a connection with the remote BGP neighbor. If it is successful, it will move to the OpenSent state.
4. Opensent - 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.
5. Openconfirm - An Open message has been both sent to and received from the other.
6. Established - All neighbor parameters matched, the neighbor relationship has been established and the peers can now exchange Update messages

What are different BGP Message Types?
1. Open - It is Used to establish a neighbor relationship and exchange parameters, including autonomous system number and authentication values.
2. Keepalive - It is  Sent periodically to maintain the neighbor relationship. If the Keepalive message is not received within the negotiated Hold timer than BGP neighborship will be turned down.
3. Update - It exchanges Path Attributes and the associated prefix/length (NLRI) that use those attributes.
4. Notification - It is Used to report BGP error. It results in a reset of neighbor relationship.


Explain BGP Path Attributes?
BGP supports a wide variety of Path Attributes. BGP use these path attributes to examine the competing BGP paths (routes) in  BGP table to choose the best path(route).
1. Next Hop - It lists the next-hop IP address used to reach a prefix. If Next hop is reachable? If no route to reach Next Hop, router cannot use this route.
2. Weight - It is a numeric value set by a router when receiving updates to influence the route for a prefix. It is not advertised to any BGP peers. Bigger is preferred
3. Local Preference - It is a numeric value set and communicated within a single AS for the purpose of choosing best route for all routers in that AS to reach a certain network. Bigger is preferred
4. Locally injected routes - Locally injected routes (routes injected using network command) are better than iBGP/eBGP learned.
5. AS Path - It is the number of ASNs in the AS Path. Smaller is preferred.
6. Origin - Preferred I over E & E over ?. It implies that the route was injected into BGP as I (IGP), E (EGP) or ? (incomplete information).
7. Multi-Exit Discriminator (MED) - Allows an AS to tell a neighboring AS the best path to forward packets
into the first AS. Smaller is preferred.
8. Neighbor type - eBGP is preferred over iBGP.
9. IGP metric  - Route with nearest IGP neighbor (lowest IGP metric) is preferred.
10. eBGP route - Oldest (longest known) route is preferred.
11. Neighbor Router ID - Lowest is preferred.
12. Neighbor IP address - Lowest is preferred.






No comments:

Post a Comment