Overview
Overview
Routing is a basic concept in data communication networks. Routing is an activity that transmits
information from a source address to a destination address through an interconnected network.
Routing occurs at the network layer, Layer 3, in the Open Systems Interconnection (OSI)
reference model. The devices that provide routing and forwarding functions are called routers.
When a router receives an IP packet, the router searches its routing table for the best matching
route based on the destination IP address of the packet and forwards the packet through the
outbound interface or next-hop IP address for the route. The routing table contains the routing
entries (routes) learned by the router in various ways. The router can obtain routing entries in
static or dynamic mode and maintain its own routing table.
Routing Protocols
In a small network, a routing table can be manually configured (in static mode). In a large and
complex network, changes may often occur, so it is not practical to manually create and maintain
a routing table. Therefore, it is hoped that routers can dynamically create and maintain their
routing tables through specific protocols, so that networks can adapt to changes and avoid faults.
These protocols are called routing protocols.
Route Iteration
Routes can be used to forward traffic only when they have directly connected next hops.
However, this condition may not be met when routes are generated. The system then needs to
search for directly connected next hops and corresponding outbound interfaces. This process is
called route iteration. In most cases, BGP routes, static routes, and user network routes (UNRs)
do not have directly connected next hops, and route iteration is required. The following examples
demonstrate how route iteration generates an FIB entry.
A next-hop IP address of a BGP route is often the IP address of an indirectly connected peer's
loopback interface, and therefore the BGP route needs to be iterated. The system searches the
IP routing table for a direct route (an IGP route in most cases) that is destined for the next-hop IP
address of the BGP route and then adds the next-hop IP address and outbound interface of the
IGP route to the IP routing table. This generates a FIB entry.
A next-hop IP address of a BGP VPN route is often the IP address of an indirectly connected
PE's loopback interface, and the BGP route needs to be iterated to a tunnel. The system
searches the tunnel list for a tunnel that is destined for this loopback IP address and then adds
the tunnel information to the routing table. This generates a FIB entry.
Routing Table
Each router maintains a local core routing table (namely, an IP routing table), and each routing
protocol maintains its own routing table.
Local core routing table
A router uses the local core routing table to store preferred routes. The router then sends
the preferred routes to the FIB table to guide packet forwarding. The router selects routes
according to the priorities of protocols and costs stored in the routing table.
A router that supports Layer 3 Virtual Private Network (L3VPN) maintains a local core
routing table for each VPN instance.
Protocol routing table
A protocol routing table stores routing information discovered by the protocol.
A routing protocol can import and advertise routes that are discovered by other routing
protocols. For example, if a router running the Open Shortest Path First (OSPF) protocol
needs to use OSPF to advertise direct routes, static routes, or Intermediate System-
Intermediate System (IS-IS) routes, the router must import the routes into the OSPF
routing table.
Automatic Restoration After the Number of Routes Exceeds the Upper Limit
A local core routing table stores routes of different routing protocols. If the number of routes in
the local core routing table reaches the upper limit, no more route can be added to the table. The
local core routing table has the following route limitations:
System route limit: specifies the maximum number of routes supported by the system.
System route prefix limit: specifies the range of prefixes for all the routes supported by
the system.
Multicast IGP route limit: specifies the maximum number of multicast IGP routes.
Multi-topology route limit: specifies the maximum number of multi-topology routes.
Private network route limit: specifies the maximum number of private network routes
supported by the system.
VPN route limit: specifies the maximum number of VPN routes supported by the system.
VPN route prefix limit: specifies the range of prefixes for all the VPN routes supported by
the system.
If a protocol fails to add routes to the local core routing table due to a specific route limitation, the
system records the failure with the protocol name and routing table ID.
After routes of protocols are deleted from the local core routing table, and the number of routes
falls below the upper limit, the system prompts all the protocols that failed to add routes to the
local core routing table to re-add the routes to the local core routing table. This process restores
most of the routes in the local core routing table. The size of released table space determines
whether all routes in the local core routing table can be restored.
The router performs the "AND" operation on the destination address [Link] and the masks 0,
16, and 24 to obtain the network segment addresses: [Link]/0, [Link]/16, and [Link]/24.
The three addresses match three entries in the FIB table. The router chooses the entry
[Link]/24 according to the longest match rule, and forwards the packet through
GigabitEthernet2/0/0.
Direct 0
OSPF 10
IS-IS 15
Static 60
RIP 100
IBGP 255
EBGP 255
Internal preferences of routing protocols cannot be manually configured. Table 1-2 lists the
internal preferences of routing protocols.
Table 1-2 Internal preferences of routing protocols
Direct 0
OSPF 10
IS-IS Level-1 15
Routing Protocol or Route Internal Preference
Type
IS-IS Level-2 18
Static 60
RIP 100
IBGP 200
EBGP 20
During route selection, a router first compares the external preferences of routes. When the
same external preference is set for different routing protocols, the router selects the optimal route
based on the internal preference. For example, assume that there are two routes to [Link]/24:
a static route and an OSPF route. Both routes have the same external preference: 5. In this
case, the router determines the optimal route based on the internal preference listed in Table 1-
2. An OSPF route has an internal preference of 10, and a static route has an internal preference
of 60. This indicates that the OSPF route has a higher preference than the static route, so the
router selects the OSPF route as the optimal route.
Route Metric
A route metric specifies the cost of a route to a specified destination address. The following
factors often affect the route metric:
Path length
Path length is the most common factor that affects the route metric. Link-state routing
protocols allow you to assign a link cost for each link to identify the path length of a link.
In this case, the path length is the sum of the link costs of all the links that packets pass
through. Distance-vector routing protocols use the hop count to identify the path length.
The hop count is the number of devices that packets pass through from the source to the
destination. For example, the hop count from a router to its directly connected network is
0, and the hop count from a router to a network that can be reached through just one
other router is 1. Other lengths can be deduced in the same manner.
Network bandwidth
Network bandwidth is the transmission capability of a link. For example, a 10-Gigabit link
has a higher transmission capability than a 1-Gigabit link. Although bandwidth defines
the maximum transmission rate of a link, routes over high-bandwidth links are not
necessarily better than routes over low-bandwidth links. For example, when a high-
bandwidth link is congested, forwarding packets over this link will require more time.
Load
The load is the degree to which a network resource is busy. You can calculate the load
by calculating the CPU usage and packets processed per second. Continually monitoring
the CPU usage and packets processed per second helps you learn more about network
usage.
Communication cost
The communication cost is the operating cost of a route over a link. The communication
cost is another important indicator, especially if you do not care about network
performance but are concerned about the operating expenditure.
Load Balancing
Routers support the multi-route mode, which allows you to configure multiple routes with the
same destination and preference. If the destinations and costs of multiple routes discovered by
the same routing protocol are the same, load balancing can be performed among the routes.
During load balancing, a router forwards packets based on the packets' 5-tuple (source IP
address, destination IP address, source port, destination port, and transport protocol). When the
5-tuple information is the same, the router always chooses the next-hop address that is the same
as the last one to send packets. When the 5-tuple information is different, the router forwards
packets over idle paths.
Figure 1-2 Networking diagram of load balancing
In the example shown in Figure 1-2, RouterA forwards the first packet P1 to [Link]/24 through
GE1/0/0 and needs to forward subsequent packets to [Link]/24 and [Link]/24 respectively.
The forwarding process is as follows:
If RouterA finds that 5-tuple information of P2 destined for [Link]/24 is the same as that
of P1 destined for [Link]/24, it forwards P2 and subsequent packets destined for
[Link]/24 through GE1/0/0.
If RouterA finds that 5-tuple information of P1 destined for [Link]/24 is different from
that of P1 destined for [Link]/24, it forwards P1 and subsequent packets destined for
[Link]/24 through GE2/0/0.
Route Backup
Route backup can improve network reliability. You can configure multiple routes to the same
destination as required. The route with the highest preference functions as the primary route, and
other routes with lower preferences function as backup routes.
A router generally uses the primary route to forward data. When the primary link fails, the primary
route becomes inactive. The router selects a backup route with the highest preference to forward
data. In this manner, data is switched from the primary route to a backup route. When the
primary link recovers, the router selects the primary route to forward data again because the
primary route has the highest preference. Data is then switched back from the backup route to
the primary route.
IP FRR
Definition
When a router detects a fault at the physical or data link layer, IP fast reroute (FRR) enables the
router to report the fault to the upper-layer routing system, and to immediately use a backup link
to forward packets. IP FRR is a method that implements fast route backup.
Purpose
On traditional IP networks, when a fault occurs at the lower layer of the forwarding link, the
physical interface on the router becomes Down. After the router detects the fault, it informs the
upper-layer routing system to recalculate routes and then update routing information. Usually, it
takes the routing system several seconds to re-select an available route.
Second-level convergence is intolerable to services that are sensitive to delay and packet loss
because it may lead to service interruption. For example, Voice over Internet Protocol (VoIP)
services are only tolerant of millisecond-level interruption.
IP FRR resolves this by ensuring that the forwarding system rapidly detects a link fault and then
uses a backup route to restore services as soon as possible.
Route Convergence
Definition
Route convergence is the action of recalculating routes to replace existing routes in the case of
network topology changes. The integration of multiple network services urgently requires
differentiated services. Routes for key services, such as Voice over IP (VoIP), video conferences,
and multicast services, need to be converged rapidly, while routes for common services can be
converged relatively slowly. In this case, the system needs to converge routes based on their
convergence priorities to improve network reliability.
Priority-based convergence is a mechanism that allows the system to converge routes based on
the convergence priority. You can set different convergence priorities for routes: critical, high,
medium, and low (in descending order of priority). The system then converges routes according
to the assigned scheduling weight to guide service forwarding.
Principles
Routing protocols first compute and deliver routes of high convergence priority to the system.
You can reconfigure the scheduling weight values as required. Table 1-3 lists the default
convergence priorities of public routes.
Table 1-3 Default convergence priorities of public routes
Direct high
Static medium
RIP low
BGP low
For private routes, only the convergence priorities of 32-bit OSPF and IS-IS host routes are
identified as medium, and the convergence priorities of the other routes are identified as low.
Default Routes
Default routes are special routes used only when packets to be forwarded do not match any
routing entry in a routing table. If the destination address of a packet does not match any entry in
the routing table, the packet is sent through a default route. If no default route exists and the
destination address of the packet does not match any entry in the routing table, the packet is
discarded. An Internet Control Message Protocol (ICMP) packet is then sent, informing the
originating host that the destination host or network is unreachable.
In a routing table, a default route is the route to network [Link] (with the mask [Link]). You can
run the display ip routing-table command to check whether a default route is configured.
Generally, administrators can manually configure default static routes. Default routes can also be
generated through dynamic routing protocols such as OSPF and IS-IS.
Route Importing
Different routing protocols using different algorithms may discover different routes. If multiple
routing protocols run on a large network, the routing protocols need to re-advertise the routes
they discover.
Each routing protocol can import routes discovered by other routing protocols, direct routes, and
static routes.
Autonomous System
An Autonomous System (AS) is a set of IP networks and routers under one administration entity
and with common routing policies.
Each AS supports multiple IGPs. All the networks in an AS are assigned the same AS number
and managed by the same administration group. Two types of AS numbers are available: a 2-
byte AS number (with a number range from 1 to 65535) and a 4-byte AS number (with a number
range from 1 to 4294967295). Available AS numbers can become exhausted thereby 2-byte AS
numbers need to be extended to 4-byte AS numbers. A 4-byte AS number is shown in the X.Y
format, where X ranges from 1 to 65535 and Y ranges from 0 to 65535.
Based on the network where they are used, AS numbers are classified into two types. Table 1-
4 lists the two types of AS numbers and their ranges.
Table 1-4 AS number types and ranges
Take a Class B IP address as an example. If the high-order 5 bits of the host ID are used for
subnetting, the subnet ID ranges from 00000 to 11111, allowing up to 32 (25) subnets to be
formed. After the subnetting, the subnet mask changes accordingly. For example, if the subnet
ID is 11111, the subnet mask is [Link]. The network address is the result of an AND
operation on the IP address and the corresponding mask.
Borrowing bits from the host ID field to create a subnet ID field results in a compromise whereby
the number of supported hosts is reduced. For example, a Class B IP address supports 65,534
(216 − 2) hosts. If a 5-bit subnet ID field is used, a maximum of 32 subnets can be formed. Each
subnet has an 11-bit host ID field, supporting a maximum of 2046 (211 - 2) hosts. Therefore, the
total number of supported hosts is 65,472 (32 x 2046), which is 62 fewer than without a 5-bit
subnet ID field.
The all-0 host number indicates that the IP address is the address of the network and is used for
network routing. The all-1 host number indicates that the IP address is a broadcast address and
is used for broadcasting to all hosts on the network.
Routing Policies
Definition
Routing policies filter routes and modify route attributes (including reachability) to change the
path through which network traffic passes.
Purpose
You can configure routing policies based on networking requirements for the device to filter the
routes to be advertised, received, or imported and change route attributes. Routing policies serve
the following purposes:
Control route reception and advertisement.
Only valid and required routes are accepted or advertised, which reduces the size of the
routing table and improves network security.
Control route import.
A routing protocol can be configured to import desired routes discovered by other
protocols to expand its routing table.
Set attributes of the routes matching filtering conditions.
Attributes of the routes that match the specified routing policy can be modified as
required.
Policy-based Routing
Definition
Policy-based routing (PBR) is a mechanism for selecting routes based on user-defined policies.
Purpose
Traditionally, devices search their IP routing tables for routes based on packets' destination
addresses and then forward the packets. However, more and more users require packet routing
based on user-defined policies. Network administrators can customize policies for PBR based on
attributes such as the destination address, source address, packet size, and link quality to
change the forwarding path of packets.
PBR Fundamentals
PBR applies only to IP packets to be forwarded. It does not apply to locally generated packets
(such as local ping packets).
PBR-based tracert is not supported. If a device has PBR configured but does not have a route
corresponding to the destination IP address of a received tracert packet, the device discards the
tracert packet.
PBR is implemented through redirection configuration in a traffic behavior and takes effect only
on incoming packets. By default, a device forwards packets to the next hop of the matching route
in the routing table. If PBR is configured, the device forwards packets to the next hop specified in
the PBR configuration. You can configure a device to preferentially select the next hop or
outbound interface of a specific route in the routing table to forward packets matching the defined
policy. If the specific route becomes invalid, the device uses the next hop or outbound interface
specified in the PBR configuration to forward the packets. If the next hop or outbound interface of
the specific route and that specified in the PBR configuration both become invalid but a default
route exists in the routing table, the device uses the default route to forward the packets.
If the device is configured to forward packets based on the next hop specified in the PBR
configuration but no ARP entry corresponding to the next hop exists, ARP entry learning is
triggered. If the ARP entry learning fails, the device forwards the packets based on the next hop
of the matching route in the routing table. If an ARP entry corresponding to the next hop specified
in the PBR configuration exists or the ARP entry learning succeeds, the device forwards the
packets based on this specified next hop.
References
For details about how to configure and use routing protocols, see the following documents:
S12700 V200R013C00 Configuration Guide - IP Unicast Routing
CloudEngine 12800, 12800E V200R005C10 Configuration Guide - IP Unicast Routing
HUAWEI USG6000, USG9500, NGFW Module V500R005C00 Product Documentation - IP
Routing
AR100, AR120, AR150, AR160, AR200, AR1200, AR2200, AR3200, AR3600 V200R010 Product
Documentation CLI-based Configuration - IP Unicast Routing Configuration Guide
NE20E-S V8R10C10SPC500 Product Documentation Configuration - IP Routing
NE40E V8R10C10SPC500 Product Documentation Configuration - IP Routing