Friday, December 17, 2010

Verifying the BGP Table ccna bootcamp training institute in gurgaon

Network Bulls
www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192

When an Enterprise router has established its eBGP neighbor relationships, that router can
advertise and learn routes using BGP. To learn routes, an Enterprise BGP router does not
need additional configuration beyond the configuration of eBGP neighbors as discussed
in the first section of this chapter. To advertise routes to eBGP peers, particularly the public
IP address prefix(es) used by that Enterprise, the Enterprise BGP router needs some additional
configuration, as discussed in the upcoming section “Injecting Routes into BGP
for Advertisement to the ISPs.”
The BGP table plays a key role in the process of learning and using routing information
with BGP. A router stores all learned BGP prefixes and PAs in its BGP table. The router will
later choose which route for each prefix is the best BGP route. The router can then advertise
its BGP table to its neighbors, advertising only the best route for each prefix.
This section begins with a brief examination of the BGP Update process by which BGP
neighbors exchange routing information. Next, the text looks at the various show commands
that can be used to examine and confirm the contents of the BGP table.
The BGP Update Message
When a BGP neighborship reaches the established state, those neighbors begin sending
BGP Update messages to each other. The router receiving an Update places those learned
www.CareerCert.info
Chapter 13: External BGP 437
Length (Bytes) of Withdrawn Routes Section
Withdrawn Routes (Variable)
Length (Bytes) of Path Attributes Section
Path Attributes (Variable)
Prefix Length Prefix (Variable)
Prefix Length Prefix (Variable)
...
2 Bytes Wide
Figure 13-4 Format of the BGP Update Message
prefixes into its BGP table, regardless of whether the route appears to be the best route.
Like EIGRP and OSPF, BGP puts all learned routing information into its table, and then
BGP processes all such potential routes to choose the best route for each prefix.
The BGP Update message itself can be revealing about the motivations behind BGP.
Figure 13-4 shows the format of the Update message.
Interestingly, the format of the Update message tells us something about the nature of
BGP as a Path Vector algorithm. The message lists a set of PAs and then a potentially long
list of prefixes that use that set of PAs. So, you might view the BGP Update message as focusing
on advertising paths, or a set of PAs, along with the associated list of prefixes that
use the advertised path. (Both are important, of course.) Then, because BGP uses the information
in the combined set of PAs to make a decision of which path is best, its underlying
logic is called path vector.
Note: BGP also uses the term Network Layer Reachability Information (NLRI) to
describe the IP prefix and length. This book uses the more familiar term prefix.
BGP uses the Update message to both announce and withdraw routes. For example, when
a router realizes that a route in the router’s BGP table has failed, that router withdraws that
route by sending a BGP Update to its neighbors, listing the prefix in the list of withdrawn
routes. When a router receives an Update that lists a prefix as withdrawn, that router
knows that the route has failed. (Note the field near the top of the Update message that
lists withdrawn routes.) That same Update message may contain other announced prefixes
later in the Update message.
www.CareerCert.info
438 CCNP ROUTE 642-902 Official Certification Guide
Enterprise
ASN 3 ISP3
ASN 1 ISP1
.2
.6
ASN 2
I3-1
E1 I1-1
RID 1.1.1.1
192.168.1.2 RID 3.3.3.3
181.0.0.0/8
182.0.0.0/8
183.0.0.0/8
184.0.0.0/8
185.0.0.0/8
ASN 4
192.135.250.0/28
Customer of ISP3
RID
11.11.11.11
192.1168.1.1
.1
.5
Figure 13-5 Three Prefixes to be Advertised to E1
Examining the BGP Table
One of the key tasks in a BGP verification plan should be to examine the prefixes in the
BGP table and confirm that the right prefixes have been learned from the expected neighbors.
The BGP table should hold all learned prefixes, from each neighbor, except for any
prefixes filtered by an inbound BGP filter. For example, in a router configured a neighbor
route-map in command, the local router would first filter the routes and then add the allowed
routes into the BGP table. (Chapter 14’s section “Route Filtering and Clearing BGP
Peers” discusses the filtering and its impact on the BGP table.)
As an example, consider Figure 13-5, which shows the same basic topology as Figure 13-1
but with only the information pertinent to the upcoming discussions listed in the figure.
In this case, five prefixes exist somewhere in the Internet, with ISP1 and ISP3 learning
these prefixes from ISP2. An additional prefix exists at the site of a customer of ISP3. The
design calls for the following actions by ISP1 and ISP3 in their eBGP advertisements to
the Enterprise:
■ ISP1 should supply a default route plus full BGP updates.
■ ISP3 should supply a default route plus partial BGP updates that include only ISP3’s
customers’ prefixes (for example, 192.135.250.0/28).
www.CareerCert.info
Chapter 13: External BGP 439
The show ip bgp lists the entirety of the BGP routing table. Example 13-6 shows a sample
from Router E1. Note that the configuration of this network is based on Example 13-2,
with Routers E1 and I1-1 still using their loopback interfaces in their neighbor commands.
Example 13-6 E1’s BGP Table with Routes Learned from the ISPs
E1# show ip bgp
BGP table version is 78, local router ID is 11.11.11.11
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 0.0.0.0 192.168.1.2 0 0 3 i
*> 1.1.1.1 0 0 1 i
*> 181.0.0.0/8 1.1.1.1 0 1 2 111 111 i
*> 182.0.0.0/8 1.1.1.1 0 1 2 222 i
*> 183.0.0.0/8 1.1.1.1 0 1 2 i
*> 184.0.0.0/8 1.1.1.1 0 1 2 i
*> 185.0.0.0/8 1.1.1.1 0 1 2 i
* 192.135.250.0/28 1.1.1.1 0 1 2 3 4 i
*> 192.168.1.2 0 3 4 i
First, examine the overall format and the headings in the output of the show ip bgp command.
The Network column lists the prefix/length (NLRI). The Next Hop heading lists the
next-hop IP address that would be used for the route. Then, skipping over to the far right,
the Path heading lists the AS_Path PA. (Note that it is difficult to see the beginning of the
AS_Path, but the weight [another PA] for each route is 0 in this case, so the next number
after the 0, in this case, is the beginning of the AS_Path.)
Next, focus on the last two lines of output from the show ip bgp command. Each of the
last two lines describes a different route to reach 192.135.250.0/28–one with next-hop
1.1.1.1 (router I1-1) and one with next-hop 192.168.1.2 (router I3-1). Because the second of
these two lines does not list a prefix (under the heading “Network”), the output implies
that this line is just another route for the prefix listed on the previous line. Next, examine
the highlighted AS_Path values at the end of each of these lines. For the route through I1-
1 (1.1.1.1), the AS_Path lists ASNs 1, 2, 3, and 4. Similarly, the AS_Path for the other route
lists only ASNs 3 and 4.
Note: BGP show commands list the AS_Path with the first-added ASN on the right and
the last-added ASN on the left. BGP uses this convention because when BGP adds an ASN
to the AS_Path, BGP prepends the ASN to the list, causing the new ASN to show up as the
leftmost ASN in the AS_Path.
Continuing to focus on the final two lines of the show ip bgp output, examine the far left
part of the output, and note that the second of these two lines has a > highlighted. Per the
legend at the top of the command output, the > denotes the chosen best route. In this
www.CareerCert.info
440 CCNP ROUTE 642-902 Official Certification Guide
case, none of the routers inside the various ISPs set PAs for the purpose of influencing the
best path choice, so the first used BGP best path decision is the shortest AS_Path. As a result,
the path through ISP3, ASN 3, is best, having only 2 ASNs, compared to the path
through ISP1, ASN 1, with four ASNs.
You can confirm that all E1’s BGP table entries were learned using eBGP, rather than iBGP,
by the absence of the letter “i” in the third column. Immediately after the *>, a space appears
in the output. If a route was learned with iBGP, an “i” would appear in this third
character position. By implication, all the routes in Example 13-6 are eBGP routes due to
the absence of the letter i in the third character of possible output.
Finally, taking a broader view of the output of the show ip bgp command, consider which
prefixes have two known routes and which have only one. Then, consider the design requirements
listed before Example 13-6: I1-1 would advertise all prefixes, plus a default, but
I3-1 would advertise only partial updates plus a default. As such, I3-1 did not advertise the
prefixes that begin 181 through 185, by design, resulting in Router E1 only learning one
route for each of these prefixes.
E1 chose the route through I3-1 as the best route for prefix 192.135.250.0/28. Example 13-
7 shows the details of the IP routing table entry for this route.
Example 13-7 E1’s IP Route for 192.135.250.0/28
E1# show ip route 192.135.250.0 255.255.255.240
Routing entry for 192.135.250.0/28
Known via “bgp 11”, distance 20, metric 0
Tag 3, type external
Last update from 192.168.1.2 00:10:27 ago
Routing Descriptor Blocks:
* 192.168.1.2, from 192.168.1.2, 00:10:27 ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 3
The output of the show ip route 192.135.250.0 255.255.255.240 command lists the
source of the route (BGP process 11), the next-hop router (192.168.1.2), and the AS Path
length (AS Hops 2). The output also confirms that the route is an external (eBGP) route.
Most of the remaining details in the BGP table relate to BGP PAs, which are discussed in
more detail in Chapter 15, “BGP Path Control.”
Viewing Subsets of the BGP Table
When accepting full or partial BGP updates, the sheer number of BGP table entries can be
much too large for the show ip bgp command to be useful. The command could list thousands,
or even hundreds of thousands, of prefixes. In practice, you need to be comfortable
with a variety of options on the show ip bgp command, each listing a different part of the
BGP table.
www.CareerCert.info
Chapter 13: External BGP 441
Table 13-4 Verification Commands for eBGP-Learned Routes
Verification Step Command
List possible default routes. show ip bgp 0.0.0.0 0.0.0.0
List possible routes, per prefix. show ip bgp prefix [subnet-mask]
List routes learned from one
neighbor, before any inbound filtering
is applied.
show ip bgp neighbors ip-address received-routes
List routes learned from a specific
neighbor that passed any inbound
filters.
show ip bgp neighbors ip-address routes
Lists routes advertised to a neighbor
after applying outbound filtering.
show ip bgp neighbors ip-address advertised-routes
List the number of prefixes
learned per neighbor.
show ip bgp summary
Key
Topic
For example, you will likely want to look at BGP table entries for specific prefixes, including
the default route prefix of 0.0.0.0/0. Additionally, you may want to see routes per
neighbor, and see which routes were heard from that neighbor–and which of those routes
passed through any inbound route filters to make it into the BGP table. Finally, to verify
whether neighboring ISPs sent full or partial updates, you can look at counters for the
number of prefixes learned from each neighbor. Although you probably will never know
the exact number of prefixes to expect, you should see a significant difference in the
number of prefixes learned from a neighbor sending full updates as compared to a neighbor
sending partial updates.
Table 13-4 summarizes some of the key command options that can supply these subsets
of information.
Example 13-8 shows a few samples of these commands on Router E1 from Figures 13-1
and 13-5. The configuration remains unchanged since Example 13-2.
Example 13-8 Command Samples from Table 13-4
E1# show ip bgp 0.0.0.0 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 75
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1
3
192.168.1.2 from 192.168.1.2 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, external
www.CareerCert.info
442 CCNP ROUTE 642-902 Official Certification Guide
1
1.1.1.1 from 1.1.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
E1# show ip bgp 192.135.250.0
BGP routing table entry for 192.135.250.0/28, version 78
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1
1 2 3 4
1.1.1.1 from 1.1.1.1 (1.1.1.1)
Origin IGP, localpref 100, valid, external
3 4
192.168.1.2 from 192.168.1.2 (3.3.3.3)
Origin IGP, localpref 100, valid, external, best
E1# show ip bgp summary
BGP router identifier 11.11.11.11, local AS number 11
BGP table version is 78, main routing table version 78
7 network entries using 924 bytes of memory
9 path entries using 468 bytes of memory
8/5 BGP path/bestpath attribute entries using 1184 bytes of memory
7 BGP AS-PATH entries using 168 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 2) using 32 bytes of memory
BGP using 2776 total bytes of memory
BGP activity 7/0 prefixes, 53/44 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 1 186 189 78 0 0 00:53:33 7
192.168.1.2 4 3 161 199 78 0 0 00:51:48 2
The first command, show ip bgp 0.0.0.0 0.0.0.0, displays details about the default routes
in the BGP table. The output lists three lines per route, with the AS_Path on the first line.
Working through the highlighted portions of the output, in this case, the AS_Path is either
3 or 1, because the ISP routers each originated the route, and those neighboring ASNs are
ASN 1 and ASN 3. The output also lists the next-hop address of the route (192.168.1.2 and
1.1.1.1) and the neighbor’s BGP RID (I1-1’s is 1.1.1.1 and I3-1’s is 3.3.3.3). Finally, instead of
the > seen in the output of show ip bgp, this command simply lists the term “best” for the
best route.
The next command, show ip bgp 192.135.250.0, looks much like the first. In this case,
with no subnet mask listed in the command, IOS displays information for any prefix
192.135.250.0 regardless of prefix length. The output again lists three lines per route beginning
with the AS_Path values (as highlighted).
www.CareerCert.info
Chapter 13: External BGP 443
The final command listed earlier in Table 13-4, show ip bgp summary, lists the number of
prefixes received from each neighbor on the far right side. Also, you can see the amount
of memory used for the prefixes (listed as network entries) and for different PAs.
The rest of the commands from Table 13-4 focus on displaying information relative to
whether BGP filtering has yet occurred. The first, show ip bgp neighbors neighbor-ip
received-routes, lists routes received from the neighbor before inbound BGP filtering. The
second, show ip bgp neighbors neighbor-ip routes, lists routes received from that neighbor
that passed through any inbound filtering. These commands are particularly useful
when verifying the results of any configured BGP filters or route maps. The section “Displaying
the Results of BGP Filtering” in Chapter 14 discusses the information in these
commands and an extra configuration requirement to use the received-routes option.

No comments:

Post a Comment