BSCI: BGP Attributes II
Posted by Aragoen Celtdra on 18th December 2008
AS-Path Attribute
- Whenever a route update passes through an AS, the AS number is prepended to that update when it is advertised to the next EBGP neighbor.
- The AS-path attribute is the list of AS numbers that a route has traversed to reach a destination, with the number of the AS that originate the route at the end of the list.
- The AS-Path attribute avoids routing loops by the local AS simply rejecting any route object that contains its own AS in the AS_PATH attribute.
- The BGP system prefers the route object with the shortest AS_PATH attribute length.
- In the above figure, AS1 originates a network 10.0.0.0/8 and advertises it to AS2 and AS3. AS1 adds its own AS number to the AS_PATH.
- AS2 and AS3 learns of the route with an associated path vector of <AS1>.
- AS2 advertises the route to its neighbor AS 4. AS2 prepends its own AS number to the AS_PATH.
- AS3 advertises the route it learns from AS1 to AS5. AS3 prepends its own AS to the AS_PATH.
- AS4 learns of the route from AS2 with an associated path vector of <AS2, AS1>.
- AS 5 eventually learns two paths to 10.0.0.0/8.
- One with a path vector of <AS3, AS1>
- Another with path vector of <AS4, AS2, AS1>
- AS5 will select the shortest path to reach 10.0.0.0/8. This path is the one that goes though AS3 –> AS1.
- This path that AS5 chose will also be advertised to its adjacent AS peers.
- Loop prevention mechanism on BGP will not allow AS5 to advertise the same path to AS1 because AS1 is already in the path vector.
Next-Hop Attribute
- The next-hop attribute indicates the next-hop IP address to reach a destination.
- The next-hop IP address is not always the address of a neighboring router.
- For EBGP, the next-hop is the IP address of the neighbor that sent the update.
- For IBGP, it stipulates that the next hop advertised by EBGP should be carried into IBGP.
- It is not necessarily the connected IGP neighbor that is advertised as the BGP next hop address.
- Consider the diagram above, Router B learns the network 172.16.0.0 from Router A, with the next-hop IP address of 10.10.10.3. Likewise, A uses 10.10.10.1 as the next hop IP address to get to 172.20.0.0.
- Because the rule for IBGP states that the next hop advertised by EBGP should be carried into IBGP, Router B advertises to its IBGP peer Router C the network 172.16.0.0, with the next hop of 10.10.10.3 (not 172.20.10.1 as we’re accustomed to seeing in the IGP world).
- It is important that Router C knows how to reach the 10.10.10.0 subnet, otherwise packets destined for 172.16.0.0 could be dropped.
- Router C can learn about network 10.10.10.0 by IGP or static route.
- An IGP uses the IP address of a routing update (route source) as the next-hop address.
- BGP uses a separate field for each network to record the next-hop address.
- IBGP neighbors use recursive lookup to reach BGP next-hop address by using its IGP entries in the routing table.
- Router C learns about 172.16.0.0 from Router B (route source 172.20.10.1) with Router A (10.10.10.3) as the next hop.
- Router C, therefore, installs the route to 172.16.0.0/16 in the routing table with a next hop of 10.10.10.3
- With Router B using an IGP to announce network 10.10.10.0/24 to Router C, Router C also installs 10.10.10.0/24 in its routing table with a next hop of 172.20.10.1.
- When Router C sends a packet to a destination in the 172.16.0.0. network, it looks up the network in the routing table and finds a BGP route with a next hop of 10.10.10.3.
- Because it is a BGP entry, Router C completes a recursive lookup in the routing table for a path to network 10.10.10.3.
- There is an IGP route to network 10.10.10.0 in the routing table with a nesxt hop of 172.20.10.1.
- Router C then forwards the packet destined for the network 172.16.0.0 to 172.20.10.1.
Example 2: Next-Hop Attribute on Multiaccess Network

- In the above diagram, Routers B and C in AS 65000 are running an IGP.
- Router B can reach network 172.30.0.0 via 10.10.10.2.
- Router C can reach network 172.20.0.0 via 10.10.10.1.
- B and C are also running IBGP between each other.
- Router B is running EBGP with Router A.
- Router C is running EBGP with Router D.
- When B sends a BGP update to A about 172.30.0.0, it gives 10.10.10.2 (Router C) as the next hop, and not it’s own address.
- This feature is called a third-party next hop.
- A BGP speaker can advertise to an external peer an interface of any internal peer router in the next hop component, provided the external peer to which the route is being advertised shares a common subnet with the next hop address. – RFC 2858.
- It basically means that in a multi-access network, a BGP router can use the a next hop address that is not necessarily its own, by changing the next-hop attribute, in order to avoid inserting additional hops into the path.
- This feature is called a third-party next hop.
- In the scenario above, If Router A needs to send update to AS 64600, Router B tells Router A to install the AS 64600 networks with next hop address of 10.10.10.2 (Router C)
- To get to AS 64600, Router A must go through AS 65000.
- Router B advertises AS 64600 networks to Router A because they have neighbor relationship. But because Router B does not handle traffic to AS 64600, and Router C has neighbor relationship with Router D in AS 64600, Router B tells Router A to get to AS 64600 through Router C. This is of course dependent on Router A and C being on the same subnet.
Example 3: Next-hop Attribute on NBMA

- In the above figure, Routers A, B, and C are connected via Frame Relay.
- Router B has a Frame Relay map entry for Router C, therefore it can reach network 172.30.0.0, using 10.10.10.2 as the next hop address.
- Router B, with a an EBGP neighbor relationship with Router A, sends a BGP update to Router A about 172.30.0.0, using 10.10.10.2 as the next hop address.
- A potential problem can occur if there is no way for Routers A and C to communicate directly because of missing Frame Relay map entry to each other.
- One solution, of course, is to add a Frame Relay map entry between the two.
- Another option is a configuration feature called next-hop-self.
- This configuration is set on Router B by configuring itself to advertise its IP address as the next-hop attribute.
As mentioned earlier, the IP address of the next-hop is not always the address of the directly attached neighboring router. There are some rules that apply to determining the next-hop address:
- If the advertising router and receiving router are external peers (ie they are in different autonomous systems), the IP address of the advertising router’s interface is the next-hop address.
- If the advertising router and receiving routers are internal peers (in the same AS), and the destination is withing the same AS, the next-hop is the address of the router that advertised the route.
- If the advertising router and the receiving router are internal peers and the destination of the update is in a different AS, the next-hop is the IP address of the external peer from which the route was learned.
Origin Attribute
- A well-known mandatory attribute that specifies the origin of routing updates.
- It can be one of three values:
- IGP
- The NLRI was learned from a protocol internal to the originating AS. BGP routes are given an origin of IGP when a network command is used to advertise the route via IGP.
- An origin of IGP is given the highest preference of the ORIGIN values.
- An origin of IGP is indicated with an “i‘ in the BGP table.
- EGP
- This means that the route is learned from Exterior Gateway Protocol (EGP). This is not supported on the Internet because it only does classful routing and does not support CIDR.
- This is the next preferred to IGP.
- Indicated by an “e“ in the BGP table
- Incomplete
- This mens that the origin of the route is unknown or learned by other means.
- Usually a result of a route being redistributed into BGP, because there is no way to determine the original source of the the route.
- Lowest preferred ORIGIN value.
- Indicated by a “?“ in the BGP table.
- IGP
Resources:
- Border Gateway Protocol – Internetworking Technology Handbook – Cisco Systems
- An Introduction to BGP – the Protocol – The ISP Column – Geoff Huston
- BGP AS-Path – Cisco IOS Hints and Tricks
- RFC 2858 – Multiprotocol Extensions for BGP-4
This entry is not an authoritative guide. These are merely notes and rehash of the primary text materials and resources that I use. For a thorough guide of the BSCI course, consider purchasing Building Scalable Cisco Internetworks (BSCI) (Authorized Self-Study Guide) (3rd Edition) by Diane Teare and Catherine Paquet; Routing TCP/IP, Volume 1 (2nd Edition) (CCIE Professional Development) by Jeff Doyle and Jennifer Carroll; as well as following the links on the resources section of this entry.
Posted in BGP, BSCI Exam Prep, CCNP, Routing Protocols | No Comments » |


