Sunday, October 28, 2012

BGP Route Aggregation



In this lab, I want to summarize the routes being advised by R5, in BGP it's called route aggregation. I found the summary route the same by writing down all the routes in binary and finding the common bits to make the network address and turning those to all ones to get the subnet mask.

0001 0000    00000001    00000001    00000001    00000001
0001 0001    00000001    00000001    00000001    00000001
0001 0010    00000001    00000001    00000001    00000001
0001 0100    00000001    00000001    00000001    00000001

common bits
0001 0 = 16.0.0.0

Turn common bits to all ones
11111 = 252.0.0.0

16.0.0.0 252.0.0.0 is the aggregate address and mask

I want to reduce the size of R1's BGP table because everything has a cost in CPU cycles. I will create the aggregation on R2.


R1#show ip bgp
BGP table version is 5, local router ID is 1.1.1.1
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
*> 16.0.0.0         10.10.10.5               0             0 500 i
*> 17.0.0.0         10.10.10.5               0             0 500 i
*> 18.0.0.0         10.10.10.5               0             0 500 i
*> 19.0.0.0         10.10.10.5               0             0 500 i




R1#show ip bgp sum
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 5, main routing table version 5
4 network entries using 480 bytes of memory
4 path entries using 208 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
1 BGP AS-PATH entries using 24 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
BGP using 960 total bytes of memory
BGP activity 4/0 prefixes, 4/0 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.10.10.5      4   500       5       4        5    0    0 00:00:39        4


R5#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R5(config)#router bgp 500
R5(config-router)#aggregate-address 16.0.0.0 252.0.0.0

BGP by default aggregate addresses along with the more specific routes, when I look at the BGP routes, I'm now learning 5 routes, each single route with the additional of the summary route.



R1#show ip bgp sum
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 6, main routing table version 6
5 network entries using 600 bytes of memory
5 path entries using 260 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 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
BGP using 1256 total bytes of memory
BGP activity 5/0 prefixes, 5/0 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.10.10.5      4   500       8       6        6    0    0 00:02:12        5

Summary is in bold below

R1#show ip bgp
BGP table version is 6, local router ID is 1.1.1.1
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
*> 16.0.0.0         10.10.10.5               0             0 500 i
*> 16.0.0.0/6       10.10.10.5               0             0 500 i
*> 17.0.0.0         10.10.10.5               0             0 500 i
*> 18.0.0.0         10.10.10.5               0             0 500 i
*> 19.0.0.0         10.10.10.5               0             0 500 i

I will take off the default and enable the option for summary only.
R5(config)#router bgp 500
R5(config-router)#no aggregate-address 16.0.0.0 252.0.0.0
R5(config-router)#aggregate-address 16.0.0.0 252.0.0.0 summary-only

I now have only an aggregate address being advised to R1.

R1#show ip bgp
BGP table version is 12, local router ID is 1.1.1.1
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
*> 16.0.0.0/6       10.10.10.5               0             0 500 i

I notice the atomic-aggregate attribute in the BGP summary.
R1#show ip bgp 16.0.0.0
BGP routing table entry for 16.0.0.0/6, version 8
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  500, (aggregated by 500 19.1.1.1)
    10.10.10.5 from 10.10.10.5 (19.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, external, atomic-aggregate, best



No comments:

Post a Comment