Wednesday, April 23, 2014

CCNP ROUTE: 1. BGP Basics

Unlike IGPs, BGP does not require neighbors to be attached to the same subnet.
Instead, BGP routers use a TCP connection (port 179) between the routers to pass BGP messages, allowing neighboring routers to be on the same subnet, or to be separated by several routers.
Another difference lies in how the routing protocols choose the best route.
Instead of choosing the best route just by using an integer metric, BGP uses a more complex process, using a variety of information, called BGP path attributes, which are exchanged in BGP routing updates much like IGP metric information.
BGP advertises prefix/length, called Network Layer Reachability Information (NLRI.)
By default, if no BGP PAs have been explicitly set, BGP routers use the BGP AS_PATH (autonomous system path) PA when choosing the best route among many competing routes.

When a router uses BGP to advertise a route, the prefix/length is associated with a set of PAs, including the AS_Path.
The AS_Path PA associated with a prefix/length lists the ASNs that would be part of an end-to-end route for that prefix as learned using BGP.
The BGP path selection algorithm uses the shortest AS_Path (something similar to RIP's hop count).
BGP uses the AS_Path to perform two key functions:
- Choose the best route for a prefix based on the shortest AS_Path (fewest number of ASNs listed).
- Prevent routing loops.

BGP routers prevent routing loops using the ASNs listed in the AS_Path. When a BGP router receives an update, and a route advertisement lists an AS_Path with its own ASN, the router ignores that route.

Internal and External BGP

BGP defines two classes of neighbors (peers): internal BGP (iBGP) and external BGP (eBGP) - referring to whether a BGP neighbor is in the same ASN (iBGP) or a different ASN (eBGP).

When advertising to an eBGP peer, a BGP router updates the AS_Path PA, but it does not do so when advertising to an iBGP peer.

Outbound routing toward the Internet

Enterprises typically have two major classes of options for outbound routing toward the Internet: default routing and BGP.

An entire Enterprise often has only a few connections to the Internet.
If one of those connections is considered better than the others, then all packets sent from the Enterprise toward the Internet would normally follow that one Internet link, for all Internet destinations.
Likewise, the ISPs, similar to WAN distribution routers in this analogy, could configure static routes for the Enterprise’s public IP address prefix and then use BGP in the Internet to advertise those routes.

It makes most sense to use BGP when you have at least two Internet connections.
BGP becomes most useful when you want to choose one outbound path over another path for particular destinations in the Internet.
In short, when you have multiple Internet connections, and you want to influence some packets to take one path and some packets to take another, consider BGP.

Outbound routing is considered to be routes that direct packets from the Enterprise toward the Internet, and inbound routing refers to routes that direct packets into the Enterprise from the Internet.
There are four separate cases of outbound routing:
- Single homed (1 link per ISP, 1 ISP)
- Dual homed (2+ links per ISP, 1 ISP)
- Single multihomed (1 link per ISP, 2+ ISPs)
- Dual multihomed (2+ links per ISP, 2+ ISPs)


To help reduce the memory requirements of receiving full BGP updates (BGP updates that include all routes), ISPs give you three basic options for what routes the ISP advertises:
- Default route only: The ISP advertises a default route with BGP, but no other routes.
- Full updates: The ISP sends you the entire BGP table.
- Partial updates: The ISP sends you routes for prefixes that might be better reached through that ISP, but not all routes, plus a default route (to use instead of the purposefully omitted routes as needed).

No comments:

Post a Comment