BGP Route Processing

Figure 1 shows how BGP processes routes. BGP routes can be imported from other protocols or learned from peers. To reduce the routing size, you can configure route summarization after BGP selects routes. In addition, you can configure route-policies and apply them to route import, receipt, or advertisement to filter routes or modify route attributes.

Figure 1 BGP route processing

For details about route import, see Route Import; for details about BGP route selection rules, see BGP Route Selection; for details about route summarization, see Route Summarization; for details about advertising routes to BGP peers, see BGP Route Advertisement.

For details about import or export policies, see "Routing Policies" in NetEngine 8000 F Feature Description — IP Routing.

For details about BGP load balancing, see Load Balancing Among BGP Routes.

Route Import

BGP itself cannot discover routes. Therefore, it needs to import other protocol routes, such as IGP routes or static routes, to the BGP routing table. Imported routes can be transmitted within an AS or between ASs.

BGP can import routes by using either of the following commands:
  • The import-route command imports routes based on protocol types, such as RIP routes, OSPF routes, IS-IS routes, static routes, and direct routes.
  • The network command imports a route with the specified prefix and mask to the BGP routing table, which is more precise than using the import-route command.

BGP Route Selection

On the NetEngine 8000 F, when multiple routes to the same destination are available, BGP selects routes based on the following rules:
  1. Prefers routes in descending order of Valid, Not Found, and Invalid after BGP origin AS validation results are applied to route selection in a scenario where the device is connected to a Resource Public Key Infrastructure (RPKI) server.
  2. Prefers routes without bit errors.

    If the bestroute bit-error-detection command is run, BGP preferentially selects routes without bit error events.

  3. Prefers the route with the largest PrefVal value.

    PrefVal is Huawei-specific. It is valid only on the device where it is configured.

  4. Prefers the route with the largest Local_Pref value.

    If a route does not carry Local_Pref, the default value 100 takes effect. To change the value, run the default local-preference command.

  5. Prefers a locally originated route to a route learned from a peer.

    Locally originated routes include routes imported using the network or import-route command, as well as manually and automatically generated summary routes.
    1. Prefers a summary route over a non-summary route.
    2. Prefers a route obtained using the aggregate command over a route obtained using the summary automatic command.
    3. Prefers a route imported using the network command over a route imported using the import-route command.
  6. Prefers a route that carries the Accumulated Interior Gateway Protocol Metric (AIGP) attribute.

    • The priority of a route that carries the AIGP attribute is higher than the priority of a route that does not carry the AIGP attribute.
    • If two routes both carry the AIGP attribute, the route with a smaller AIGP attribute value plus IGP metric of the recursive next hop is preferred over the other route.
  7. Prefers the route with the shortest AS_Path.
    • The AS_CONFED_SEQUENCE and AS_CONFED_SET are not included in the AS_Path length.
    • During route selection, a device assumes that an AS_SET carries only one AS number regardless of the actual number of ASs it carries.
    • If the bestroute as-path-ignore command is run, BGP no longer compares the AS_Path attribute.

    After the load-balancing as-path-ignore command is run, the routes with different AS_Path values can load-balance traffic.

  8. Prefers the route with the Origin type as IGP, EGP, and Incomplete in descending order.

  9. Prefers the route with the smallest MED value.

    If the bestroute med-plus-igp command is run, BGP preferentially selects the route with the smallest sum of MED multiplied by a MED multiplier and IGP cost multiplied by an IGP cost multiplier.

    • BGP compares the MEDs of only routes from the same AS (excluding confederation sub-ASs). MEDs of two routes are compared only when the first AS number in the AS_Sequence (excluding AS_Confed_Sequence) of one route is the same as its counterpart in the other route.
    • If a route does not carry MED, BGP considers its MED as the default value (0) during route selection. If the bestroute med-none-as-maximum command is run, BGP considers its MED as the largest MED value (4294967295).
    • If the compare-different-as-med command is run, BGP compares MEDs of routes even when the routes are received from peers in different ASs. If the ASs use the same IGP and route selection mode, you can run this command. Otherwise, do not run this command because a loop may occur.
    • If the deterministic-med command is run, routes are no longer selected in the sequence in which they are received.
  10. Prefers local VPN routes, LocalCross routes, and RemoteCross routes in descending order.

    LocalCross routes indicate the routes that are leaked between local VPN instances or routes imported between public network and VPN instances.

    If the ERT of a VPNv4 route in the routing table of a VPN instance on a PE matches the IRT of another VPN instance on the PE, the VPNv4 route is added to the routing table of the second VPN instance. This route is called a LocalCross route. If the ERT of a VPNv4 route learned from a remote PE matches the IRT of a VPN instance on the local PE, the VPNv4 route is added to the routing table of that VPN instance. This route is called a RemoteCross route.

  11. Prefers EBGP routes to IBGP routes.

  12. Prefers the VPNv4, VPNv6, and EVPN routes learned from peers.

    If the peer high-priority command is run, the device preferentially selects the VPNv4, VPNv6, and EVPN routes learned from IPv4 or IPv6 peers.

  13. Prefers the routes that are learned from VPNv4 or VPNv6 peers and are then leaked to a VPN instance and that carry IPv4 or IPv6 next hop addresses.

    If the bestroute nexthop-priority ipv4 command is run, the device preferentially selects the routes that are learned from VPNv4 or VPNv6 peers and are then leaked to a VPN instance and that carry IPv4 next hop addresses.

    If the bestroute nexthop-priority ipv6 command is run, the device preferentially selects the routes that are learned from VPNv4 or VPNv6 peers and are then leaked to a VPN instance and that carry IPv6 next hop addresses.

  14. Prefers the route that recurses to an IGP route with the smallest cost.

    If the bestroute igp-metric-ignore command is run, BGP no longer compares the IGP cost.

  15. Prefers the route with the shortest Cluster_List.

    By default, Cluster_List takes precedence over Router ID during BGP route selection. To enable Router ID to take precedence over Cluster_List during BGP route selection, run the bestroute routerid-prior-clusterlist command.

  16. Prefers the route advertised by the router with the smallest router ID.

    After the bestroute router-id-ignore command is run, BGP does not compare router IDs during route selection.

    If each route carries an Originator_ID, the originator IDs rather than router IDs are compared during route selection. The route with the smallest Originator_ID is preferred.

  17. Prefers the route learned from the peer with the smallest IP address.

  18. If BGP Flow Specification routes are configured locally, the first configured BGP Flow Specification route is preferentially selected.

  19. Prefers the locally imported route in the RM routing table.

    If a direct route, static route, and IGP route are imported, BGP preferentially selects the direct route, static route, and IGP route in descending order.

  20. Prefers the Add-Path route with the smallest recv pathID.

  21. Prefers the RemoteCross route with the smallest RD.

  22. Prefers locally received routes over the routes imported between VPN and public network instances.

  23. Prefers the route that was learned the earliest.

For details about BGP route attributes, see BGP Attributes.

For details about the BGP route selection process, see Figure 2.

Figure 2 BGP route selection process

Route Summarization

On a large-scale network, the BGP routing table can be very large. Route summarization can reduce the size of the routing table.

Route summarization is the process of summarizing specific routes with the same IP prefix into a summary route. After route summarization, BGP advertises only the summary route rather than all specific routes to BGP peers.

BGP supports automatic and manual route summarization.
  • Automatic route summarization: takes effect on the routes imported by BGP. With automatic route summarization, the specific routes for the summarization are suppressed, and BGP summarizes routes based on the natural network segment and sends only the summary route to BGP peers. For example, 10.1.1.1/32 and 10.2.1.1/32 are summarized into 10.0.0.0/8, which is a Class A address.
  • Manual route summarization: takes effect on routes in the local BGP routing table. With manual route summarization, users can control the attributes of the summary route and determine whether to advertise the specific routes.

IPv4 supports both automatic and manual route summarization, whereas IPv6 supports only manual route summarization.

BGP Route Advertisement

BGP adopts the following policies to advertise routes:
  • When there are multiple valid routes, a BGP speaker advertises only the optimal route to its peers.
  • A BGP speaker advertises the routes learned from EBGP peers to all BGP peers, including EBGP peers and IBGP peers.
  • A BGP speaker does not advertise the routes learned from an IBGP peer to other IBGP peers.
  • Whether a BGP speaker advertises the routes obtained from an IBGP peer to its EBGP peers depends on the BGP-IGP synchronization state.
  • A BGP speaker advertises all BGP optimal routes to new peers after peer relationships are established.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >