Strategy Partner :
16-Routing Protocol Operation
Go to these sections for information you
are interested in:
l
Introduction
to IP Route and Routing Table
l
Routing
Protocol Overview
l
Displaying
and Maintaining a Routing Table
The term router
in this chapter refers to a router in a generic sense or an Ethernet switch
running a routing protocol.
Routers are used for route selection on the
Internet. As a router receives a packet, it selects an appropriate route
(through a network) according to the destination address of the packet and
forwards the packet to the next router. The last router on the route is
responsible for delivering the packet to the destination host.
I. Function
The key for a router to forward packets is
the routing table. Each router maintains a routing table. Each entry in this
table contains an IP address that represents a host/subnet and specifies which
physical port on the router should be used to forward the packets destined for
the host/subnet. And the router forwards those packets through this port to the
next router or directly to the destination host if the host is on a network
directly connected to the router.
Routes in a routing table can be divided
into three categories by origin:
l
Direct routes: Routes discovered by data link
protocols, also known as interface routes.
l
Static routes: Routes that are manually
configured.
l
Dynamic routes: Routes that are discovered
dynamically by routing protocols.
II. Routing entry
Each routing entry in a routing table contains:
l
Destination: It identifies the address of the
destination host or network of an IP packet.
l
Mask: Along with the destination address, it
identifies the address of the network segment where the destination host or
router resides. By performing a logical AND operation between destination
address and network mask, you can get the address of the network segment where the
destination host or router resides. For example, if the destination address is
129.102.8.10 and the mask is 255.255.0.0, the address of the network segment where
the destination host or router resides is 129.102.0.0. A mask consists of some consecutive
1s, represented either in dotted decimal notation or by the number of the consecutive
1s in the mask.
l
Interface: It indicates through which interface
IP packets should be forwarded to the destination.
l
Nexthop: It indicates the next router that IP
packets will pass through to reach the destination.
l
Preference: There may be multiple routes with
different next hops to the same destination. These routes may be discovered by
different routing protocols, or be manually configured static routes. The one
with the highest preference (the smallest numerical value) will be selected as
the current optimal route.
According to different destinations, routes
fall into the following categories:
l
Subnet route: The destination is a subnet.
l
Host route: The destination is a host.
In addition, according to whether the
network where the destination resides is directly connected to the router,
routes fall into the following categories:
l
Direct route: The router is directly connected
to the network where the destination resides.
l
Indirect route: The router is not directly
connected to the network where the destination resides.
In order to avoid an oversized routing
table, you can set a default route. All the packets for which the router fails
to find a matching entry in the routing table will be forwarded through this
default route.
Figure 1-1 shows a relatively
complicated internet environment, the number in each network cloud indicate the
network address. Router G is connected to three networks, and so it has three
IP addresses and three physical ports. Its routing table is shown in Figure 1-1.

|
Destination Network
|
Nexthop
|
Interface
|
|
11.0.0.0
|
14.0.0.1
|
3
|
|
12.0.0.0
|
14.0.0.1
|
3
|
|
13.0.0.0
|
16.0.0.1
|
2
|
|
14.0.0.0
|
14.0.0.3
|
3
|
|
15.0.0.0
|
17.0.0.2
|
1
|
|
16.0.0.0
|
16.0.0.2
|
2
|
|
17.0.0.0
|
17.0.0.1
|
1
|
Figure 1-1 Routing table
Static routing is easy to configure and requires
less system resources. It works well in small, stable networks with simple
topologies. It cannot adapt itself to any network topology change automatically
so that you must perform routing configuration again whenever the network
topology changes.
Dynamic routing is based on dynamic routing
protocols, which can detect network topology changes and recalculate the routes
accordingly. Therefore, dynamic routing is suitable for large networks. It is complicated
to configure, and it not only imposes higher requirements on the system than
static routing, but also occupies a certain amount of network resources.
Dynamic routing protocols can be classified
based on the following standards:
I. Operational scope
l
Interior Gateway Protocols (IGPs): Work within
an autonomous system, typically including RIP, OSPF, and IS-IS.
l
Exterior Gateway Protocols (EGPs): Work between
autonomous systems. The most popular one is BGP.
An autonomous
system refers to a group of routers that share the same routing policy and work
under the same administration.
II. Routing algorithm
l
Distance-vector protocols: RIP and BGP. BGP is
also considered a path-vector protocol.
l
Link-state protocols: OSPF and IS-IS.
The main differences between the above two types
of routing algorithms lie in the way routes are discovered and calculated.
III. Type of the destination
address
l
Unicast routing protocols: RIP, OSPF, BGP, and
IS-IS.
l
Multicast routing protocols: PIM-SM and PIM-DM.
This chapter focuses on unicast routing
protocols. For information on multicast routing protocols, refer to the part
discussing Multicast.
Different routing
protocols may find different routes (including static routes) to the same
destination. However, not all of those routes are optimal. In fact, at a
particular moment, only one protocol can uniquely determine the current optimal
routing to the destination. For the purpose of route selection, each routing
protocol (including static routes) is assigned a priority. The route found by the
routing protocol with the highest priority is preferred.
The following table lists some routing
protocols and the default priorities for routes found by them:
Table 1-1
Routing protocols and priorities of their default
route
|
Routing approach
|
Priority
|
|
DIRECT
|
0
|
|
OSPF
|
10
|
|
STATIC
|
60
|
|
RIP
|
100
|
|
OSPF ASE
|
150
|
|
OSPF NSSA
|
150
|
|
UNKNOWN
|
255
|
|
BGP
|
256
|
l
The smaller the priority value, the higher the
priority.
l
The priority for a direct route is always 0,
which you cannot change. Any other type of routes can have their priorities
manually configured.
l
Each static route can be configured with a different
priority.
I. Load sharing
A given routing protocol may find several
routes with the same metric to the same destination, and if this protocol has
the highest priority among all the active protocols, these routes will be considered
valid and are used to forward packets, thus achieving load sharing.
II. Route backup
You can configure multiple routes to the
same destination, expecting the one with the highest priority to be the primary
route and all the rest backup routes.
Route backup can help improve network
reliability. Automatic switching can happen between the primary route and a
backup route.
Under normal circumstances, packets are
forwarded through the primary route. When the primary route goes down, the route
with the highest priority among the backup routes is selected to forward
packets. When the primary route recovers, the route selection process is
performed again and the primary route is selected again to forward packets.
As different routing protocols use
different algorithms to calculate routes, they may discover different routes. In
a large network with multiple routing protocols, it is required for routing protocols
to share their routing information. Each routing protocol shares routing
information discovered by other routing protocols through a route redistribution
mechanism.
1.3 Displaying and Maintaining a Routing Table
|
To do…
|
Use the command…
|
Remarks
|
|
Display brief information about a routing
table
|
display ip routing-table [ | { begin | exclude | include } regular-expression
]
|
Available in any view
|
|
Display detailed information about a
routing table
|
display ip routing-table verbose
|
|
Display information about routes
permitted by a basic ACL
|
display ip routing-table acl acl-number [ verbose ]
|
|
Display information about routes
permitted by a prefix list
|
display
ip routing-table ip-prefix ip-prefix-name
[ verbose ]
|
|
Display routes to a specified destination
|
display
ip routing-table ip-address [ mask |
mask-length ] [ longer-match ] [ verbose ]
|
|
Display routes to specified destinations
|
display
ip routing-table ip-address1 { mask1 |
mask-length1 } ip-address2 { mask2 | mask-length2 } [ verbose
]
|
|
Display routes discovered by a routing
protocol
|
display ip routing-table protocol protocol [ inactive | verbose
]
|
|
Display the tree-structured routing table information
|
display ip routing-table radix
|
|
Display statistics about a routing table
|
display
ip routing-table statistics
|
|
Clear statistics about a routing table
|
reset ip routing-table statistics
protocol { all | protocol }
|
Available in user view
|
When configuring a static route, go to
these sections for information you are interested in:
l
Introduction to Static Route
l
Static Route Configuration
l
Displaying and Maintaining
Static Routes
l
Static Route Configuration
Example
l
Troubleshooting a Static
Route
The term router
in this chapter refers to a router in a generic sense or an Ethernet switch
running a routing protocol.
Static routes are special routes. They are
manually configured by the administrator. In a relatively simple network, you
only need to configure static routes to make routers work normally. Proper
configuration and usage of static routes can improve network performance and
ensure sufficient bandwidth for important applications.
When the network topology changes, static
routes may become unreachable because they cannot adapt themselves to the change
automatically, thus resulting in network interruption. In this case, the network
administrator needs to modify the configuration of static routes manually.
Static routes are divided into three types:
l
Reachable route: normal route. If a static route
to a destination is of this type, the IP packets destined for this destination
will be forwarded to the next hop. It is the most common type of static routes.
l
Unreachable route: route with the reject
attribute. If a static route to a destination has the reject attribute,
all the IP packets destined for this destination will be discarded, and the source
hosts will be informed of the unreachability of the destination.
l
Blackhole route: route with blackhole attribute.
If a static route destined for a destination has the blackhole attribute,
the outgoing interface of this route is the Null 0 interface regardless of the
next hop address, and all the IP packets addressed to this destination will be dropped
without notifying the source hosts.
The attributes reject and blackhole
are usually used to limit the range of the destinations this router can reach,
and help troubleshoot the network.
To avoid too large a
routing table, you can configure a default route.
When the destination address of a packet
fails to match any entry in the routing table,
l
If there is default route in the routing table,
the default route will be selected to forward the packet.
l
If there is no default route, the packet will be
discarded and an ICMP Destination Unreachable or Network Unreachable packet
will be returned to the source.
A default
route can be manually configured or generated by some dynamic routing protocols,
such as OSPF and RIP.
Before configuring a static route, perform
the following tasks:
l
Configuring the physical parameters of related
interfaces
l
Configuring IP addresses for related interfaces
Follow these steps to configure a static
route:
|
To do...
|
Use the command...
|
Remarks
|
|