Border Gateway Protocol Attributes

May 9, 2007 at 10:53 pm | Posted in BGP, Routing | Leave a comment

http://www.cramsession.com/articles/files/border-gateway-protocol-a-982003-1304.asp

Whether you are planning on taking the Building Scalable Cisco Networks (BSCN) or the Building Scalable Cisco Internetworks (BSCI) exam on the path to the CCNP certification, you are going to have to know BGP. For some reason, I have always had a hard time remembering the BGP attributes. This article is dedicated to the better understanding of BGP attributes.

A BGP attribute, or path attribute, is a metric used to describe the characteristics of a BGP path. Attributes are contained in update messages passed between BGP peers to advertise routes. There are four categories of BGP attributes. These are:

1) Well-known Mandatory
2) Well-known Discretionary
3) Optional Transitive
4) Optional Non-transitive

Optional transitive attributes may also be marked as partial.

Well-known attributes are attributes that all BGP implementations must recognize and are propagated to all BGP neighbors. Mandatory well-known attributes must appear in the route description. Discretionary attributes do not have to appear in the route description (they are not mandatory).

Optional attributes may not be supported by all BGP implementations. The transitive bit determines if an optional attribute is passed to BGP neighbors. If an optional attribute is transitive and not supported by a neighbor, it is passed and marked as partial. If it is non-transitive, a neighbor that does not implement the attribute deletes it.

The attributes that are commonly used in the Cisco Implementation of BGP are as follows:

WELL-KNOWN, MANDATORY

AS-path: A list of the Autonomous Systems (AS) numbers that a route passes through to reach the destination. As the update passes through an AS the AS number is inserted at the beginning of the list. The AS-path attribute has a reverse-order list of AS passed through to get to the destination.

Next-hop: The next-hop address that is used to reach the destination.

Origin: Indicates how BGP learned a particular route. There are three possible types — IGP (route is internal to the AS), EGP (learned via EBGP), or Incomplete (origin unknown or learned in a different way).

WELL-KNOWN, DISCRETIONARY

Local Preference: Defines the preferred exit point from the local AS for a specific route.

Atomic Aggregate: Set if a router advertises an aggregate causes path attribute information to be lost.

OPTIONAL, TRANSITIVE

Aggregator: Specifies the router ID and AS of the router that originated an aggregate prefix. Used in conjunction with the atomic aggregate attribute.

Community: Used to group routes that share common properties so that policies can be applied at the group level.

OPTIONAL, NON-TRANSITIVE

Multi-exit-discriminator (MED): Indicates the preferred path into an AS to external neighbors when multiple paths exist.

A list of path attributes is contained in BGP update messages. The attribute is variable length and consists of three fields: Attribute type consisting of a 1-byte attribute flags field and a 1-byte attribute code field, Attribute length field that is 1 or 2 bytes, and a variable length attribute value field. The attribute type codes used by Cisco are: 1-origin, 2-AS-path, 3-Next-hop, 4-MED, 5-Local preference, 6-Atomic aggregate, 7-aggregator, 8-community, 9-originator-ID, and 10-cluster list.

This article discussed the BGP attributes with the intent of preparing you for those confusing questions on the BSCN or BSCI exams. Hopefully, there is no more confusion on the various attributes that are used in the Cisco implementation of BGP.

BGP Path Selection

May 9, 2007 at 2:12 pm | Posted in BGP, Routing | Leave a comment

http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/bgp.htm 

BGP could possibly receive multiple advertisements for the same route from multiple sources. BGP selects only one path as the best path. When the path is selected, BGP puts the selected path in the IP routing table and propagates the path to its neighbors. BGP uses the following criteria, in the order presented, to select a path for a destination:

If the path specifies a next hop that is inaccessible, drop the update.

Prefer the path with the largest weight.

If the weights are the same, prefer the path with the largest local preference.

If the local preferences are the same, prefer the path that was originated by BGP running on this router.

If no route was originated, prefer the route that has the shortest AS_path.

If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP is lower than EGP, and EGP is lower than incomplete).

If the origin codes are the same, prefer the path with the lowest MED attribute.

If the paths have the same MED, prefer the external path over the internal path.

If the paths are still the same, prefer the path through the closest IGP neighbor.

Prefer the path with the lowest IP address, as specified by the BGP router ID.

IPv6 BGP routing

April 25, 2007 at 1:48 pm | Posted in BGP, IPv6, Routing | 2 Comments

CE1#

ipv6 unicast-routing
!
!
interface Serial0
 no ip address
 ipv6 address 200A:0:0:10::2/124
 clockrate 4000000
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 200A:0:0:10::1 remote-as 100
 no auto-summary
 !
 address-family ipv6
 neighbor 200A:0:0:10::1 activate
 exit-address-family
!
PE1#
!
!
ipv6 unicast-routing
!
!
interface FastEthernet0/0
 no ip address
 speed 10
 full-duplex
 ipv6 address 200A:0:0:2::1/64
!
interface Serial0/0
 description IGP link
 no ip address
 ipv6 address 200A:0:0:1::1/124
 no fair-queue
!
interface Serial0/1
 description link to CE1
 no ip address
 ipv6 address 200A:0:0:10::1/124

!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 200A:0:0:2::2 remote-as 300
 neighbor 200A:0:0:10::2 remote-as 100
 no auto-summary
 !
 address-family ipv6
 neighbor 200A:0:0:2::2 activate
 neighbor 200A:0:0:10::2 activate
 network 200A:0:0:1::/124
 exit-address-family
!
P1#
!
ipv6 unicast-routing
!
!
interface FastEthernet0/0
 description P1 to PE1 (e-BGP)
 no ip address
 speed 10
 full-duplex
 ipv6 address 200A:0:0:2::2/64
!
!
router bgp 300
 no synchronization
 bgp log-neighbor-changes
 neighbor 200A:0:0:2::1 remote-as 100
 no auto-summary
 !
 address-family ipv6
 neighbor 200A:0:0:2::1 activate
 exit-address-family

PE1#sh bgp ipv6 summary
BGP router identifier 165.87.1.1, local AS number 100
BGP table version is 2, main routing table version 2
1 network entries and 1 paths using 201 bytes of memory
1 BGP path attribute entries using 60 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 activity 1/0 prefixes, 1/0 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
200A:0:0:2::2   4   300       5       6        2    0    0 00:01:15        0
200A:0:0:10::2  4   100       5       6        2    0    0 00:01:38        0
P1#sh bgp ipv6 summ
BGP router identifier 165.87.1.2, local AS number 300
BGP table version is 5, main routing table version 5
1 network entries and 1 paths using 201 bytes of memory
1 BGP path attribute entries using 60 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 activity 2/1 prefixes, 2/1 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
200A:0:0:2::1   4   100      41      39        5    0    0 00:05:53        1
CE1#sh ip bgp summ
BGP router identifier 32.34.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
200A:0:0:10::1  4   100       9       8        0    0    0 00:04:12 (NoNeg)

CE1#sh ipv6 route
IPv6 Routing Table – 5 entries
Codes: C – Connected, L – Local, S – Static, R – RIP, B – BGP
       U – Per-user Static route
       I1 – ISIS L1, I2 – ISIS L2, IA – ISIS interarea, IS – ISIS summary
       O – OSPF intra, OI – OSPF inter, OE1 – OSPF ext 1, OE2 – OSPF ext 2
       ON1 – OSPF NSSA ext 1, ON2 – OSPF NSSA ext 2
B   200A:0:0:1::/124 [200/0]
     via 200A:0:0:10::1
C   200A:0:0:10::/124 [0/0]
     via ::, Serial0
L   200A:0:0:10::2/128 [0/0]
     via ::, Serial0
L   FE80::/10 [0/0]
     via ::, Null0
L   FF00::/8 [0/0]
     via ::, Null0

CE1#sh bgp ipv6 unicast summary
BGP router identifier 32.34.1.1, local AS number 100
BGP table version is 4, main routing table version 4
1 network entries using 149 bytes of memory
1 path entries using 72 bytes of memory
2/1 BGP path/bestpath attribute entries using 232 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 453 total bytes of memory
BGP activity 2/1 prefixes, 2/1 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
200A:0:0:10::1  4   100      19      17        4    0    0 00:02:22        1
% NOTE: This command is deprecated. Please use ‘show bgp ipv6 unicast’

CE1#sh bgp ipv6 unicast
BGP table version is 4, local router ID is 32.34.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
*>i200A:0:0:1::/124 200A:0:0:10::1           0    100      0 i
CE1#sh bgp ipv6 unicast neighbors
BGP neighbor is 200A:0:0:10::1,  remote AS 100, internal link
  BGP version 4, remote router ID 165.87.1.1
  BGP state = Established, up for 00:03:32
  Last read 00:00:32, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised
    Address family IPv6 Unicast: advertised and received
  Message statistics:
    InQ depth is 0
    OutQ depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                0          1
    Keepalives:             6          6
    Route Refresh:          0          0
    Total:                  7          8
  Default minimum time between advertisement runs is 5 seconds

 For address family: IPv4 Unicast
  BGP table version 1, neighbor version 0/0
  Output queue sizes : 0 self, 0 replicated
  Index 1, Offset 0, Mask 0x2
  1 update-group member
                                 Sent       Rcvd
  Prefix activity:               —-       —-
    Prefixes Current:               0          0
    Prefixes Total:                 0          0
    Implicit Withdraw:              0          0
    Explicit Withdraw:              0          0
    Used as bestpath:             n/a          0
    Used as multipath:            n/a          0

                                   Outbound    Inbound
  Local Policy Denied Prefixes:    ——–    ——-
    Total:                                0          0
  Number of NLRIs in the update sent: max 0, min 0

 For address family: IPv6 Unicast
  BGP table version 2, neighbor version 2/0
  Output queue sizes : 0 self, 0 replicated
  Index 1, Offset 0, Mask 0x2
  1 update-group member
                                 Sent       Rcvd
  Prefix activity:               —-       —-
    Prefixes Current:               0          1 (Consumes 72 bytes)
    Prefixes Total:                 0          1
    Implicit Withdraw:              0          0
    Explicit Withdraw:              0          0
    Used as bestpath:             n/a          1
    Used as multipath:            n/a          0

                                   Outbound    Inbound
  Local Policy Denied Prefixes:    ——–    ——-
    Bestpath from this peer:              1        n/a
    Total:                                1          0
  Number of NLRIs in the update sent: max 0, min 0

  Connections established 1; dropped 0
  Last reset never
Connection state is ESTAB, I/O status: 1, unread input bytes: 0       
Connection is ECN Disabled
Local host: 200A:0:0:10::2, Local port: 179
Foreign host: 200A:0:0:10::1, Foreign port: 11011

Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)

Event Timers (current time is 0x5537760):
Timer          Starts    Wakeups            Next
Retrans             6          0             0x0
TimeWait            0          0             0x0
AckHold             6          2             0x0
SendWnd             0          0             0x0
KeepAlive           0          0             0x0
GiveUp              0          0             0x0
PmtuAger            0          0             0x0
DeadWait            0          0             0x0

iss: 3514389540  snduna: 3514389708  sndnxt: 3514389708     sndwnd:  16217
irs:  559465704  rcvnxt:  559465949  rcvwnd:      16140  delrcvwnd:    244

SRTT: 165 ms, RTTO: 1172 ms, RTV: 1007 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 300 ms, ACK hold: 200 ms
Flags: passive open, nagle, gen tcbs
IP Precedence value : 6

Datagrams (max data segment is 1440 bytes):
Rcvd: 11 (out of order: 0), with data: 6, total data bytes: 244
Sent: 8 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 8, total data bytes: 495
 

Blog at WordPress.com.
Entries and comments feeds.