Distance Vector Routing 719
A triggered update is an update that is sent without waiting for the update timer to
expire. The router immediately sends another routing update on its other interfaces,
rather than waiting for the routing update timer to expire. This action causes the updated
information about the status of the route to be forwarded and starts the hold-down
timers more rapidly on the neighboring routers. This wave of updates is transmitted
throughout the network. Figure 16-8 demonstrates this principle.
Figure 16-8 Triggered Updates
Router C issues a triggered update, announcing that network 10.4.0.0 is unreachable.
Upon receipt of this information, Router B announces that network 10.4.0.0 is down
through interface S0/1. In turn, Router A sends out an update through interface Fa0/0.
Preventing Routing Loops with Hold-Down Timers
A count to infinity problem can be avoided by using hold-down timers. The correct
sequence for this procedure is as follows:
1.
When a router receives an update from a neighbor indicating that a previously
accessible network is now inaccessible, the router marks the route as inaccessible
and starts a hold-down timer. If an update is received from the same neighbor
before the hold-down timer expires indicating that the network is again accessible,
the router marks the network as accessible and removes the hold-down timer.
2.
If an update arrives from a different neighboring router with a better metric than
that originally recorded for the network, the router marks the network as acces-
sible and removes the hold-down timer.
3.
If at any time before the hold-down timer expires, an update is received from a
different neighboring router with a poorer metric, the update is ignored. Ignoring
updates under these conditions allows more time for the knowledge of a disrup-
tive change to travel through the entire network, as Figure 16-9 shows.
A B C
10.2.0.0
S0/0
S0/1
S0/0
S0/1
Fa0/0
Fa0/0
10.3.0.0 10.4.0.010.1.0.0
Network 10.4.0.0 is unreachable.
chpt_16.fm Page 719 Tuesday, May 27, 2003 2:16 PM
720 Chapter 16: Distance Vector Routing Protocols
Figure 16-9 Hold-Down Timers
Preventing Routing Updates Through an Interface
Route filtering works by regulating the routes that are entered into or advertised out of
a route table. The effects are different on link-state routing protocols than they are on
distance vector protocols. A router running a distance vector protocol advertises routes
based on the information in its route table. As a result, a route filter influences which
routes the router advertises to its neighbors.
Conversely, routers running link-state protocols determine routes based on informa-
tion in the link-state database, rather than the route entries advertised by neighboring
routers. Route filters have no effect on link-state advertisements or the link-state data-
base. For this reason, the information presented here applies only to distance vector IP
routing protocols such as RIP and IGRP.
Using the passive-interface command can prevent routers from sending routing updates
through a router interface. Keeping routing update messages from being sent through
a router interface prevents other systems on that network from learning about routes
dynamically. As illustrated in Figure 16-10, Router E uses the passive-interface com-
mand to keep routing updates from being sent:
RouterE(config-router)#
passive-interface Fa0/0
Figure 16-10 Defining a Passive Interface
C
D
B
A
E
?, X
Update After
Hold-Down Time
Network 1 Down,
Back Up for a Time, and
Back Down Once Again
Update After
Hold-Down Time
Update After
Hold-Down Time
Update After
Hold-Down Time
Network 1 Down
1
chpt_16.fm Page 720 Tuesday, May 27, 2003 2:16 PM
Examining the Routing Table 721
For RIP and IGRP, the passive-interface command stops the router from sending updates
to a particular neighbor, but the router continues to accept and utilize routing updates from
that neighbor. Keeping routing update messages from being sent through a router inter-
face prevents other systems on the interface from learning about routes dynamically.
Examining the Routing Table
A router might learn about routes to destination networks using a dynamic routing
protocol. It might learn about routes when a network administrator configures static
routes. The router very likely uses a combination of dynamic and static routing to dis-
cover routing information. Whatever the method used for route discovery, when a
router determines that a route is the best path to a destination, it installs the route in
its routing table. This section describes methods for examining and interpreting the
contents of the routing table and covers the following topics:
■ The show ip route command
■
Determining the gateway of last resort
■
Determining the route source and destination address
■ Determining route administrative distance
■
Determining route metric
■
Determining route next hop
■ Determining last route updates
■
Observing multiple paths to destination
The show ip route Command
One of a router’s primary functions is to determine the best path to a given destination.
A router learns paths, also called routes, from an administrator’s configuration or from
other routers via routing protocols. They store this routing information in “routing
tables” using onboard random-access memory (RAM). A routing table contains a list
of the best available routes that routers use to make packet forwarding decisions.
The show ip route command displays the contents of the IP routing table. This table
contains entries for all known networks and subnetworks, as well as a code that indi-
cates how that information was learned. The additional keywords that can be used
with the show ip route command are as follows:
■ connected—Used to show the IP routing table on the router
■ network—Gives detailed routing information about the specified network
■ rip—Used to show the IP routing table information related to RIP on the router
chpt_16.fm Page 721 Tuesday, May 27, 2003 2:16 PM
722 Chapter 16: Distance Vector Routing Protocols
■ igrp—Used to show the IP routing table information related to IGRP on the
router
■ static—Used to show the static IP routing table information on the router
A routing table maps network prefixes to an outbound interface. When RTA receives a
packet destined for 192.168.4.46, it looks for the prefix 192.168.4.0/24 in its table. RTA
then forwards the packet out an interface (Ethernet0) based on the routing table entry.
If RTA receives a packet destined for 10.3.21.5, it sends that packet out Serial 0/0.
Additionally, RTA drops any packet destined for a network that is not listed in the
routing table. To forward to other destinations the routing table for RTA has to
include more routes. These new routes can be added via one of two methods:
■ Static routing—An administrator manually defines routes to one or more
destination networks.
■ Dynamic routing—Routers follow rules defined by a routing protocol to
exchange routing information and independently select the best path.
Administratively defined routes are said to be static because they do not change until a
network administrator manually programs the changes. Routes learned from other
routers are dynamic because they can change automatically as neighboring routers
update each other with new information. Each method has fundamental advantages
and disadvantages.
Determining the Gateway of Last Resort
It is not feasible, or even desirable, for a router to maintain routes to every possible
destination. Instead, routers keep a default route, or a gateway of last resort. Default
routes are used when the router is unable to match a destination network with a more
specific entry in the routing table. The router uses the default route to hand off to
another router, the gateway of last resort, in an effort to forward the packet.
A key scalability feature is that default routes keep routing tables as small as possible.
They make it possible for routers to forward packets destined to any Internet host
without having to maintain a table entry for every Internet network. The default route,
in many cases, points to the ISP’s network. Default routes can be statically entered by
an administrator or dynamically learned via a routing protocol.
Default routing begins with the administrator. Before routers can dynamically exchange
information, an administrator must configure at least one router with a default route.
An administrator can use two very different commands to statically configure default
routes:
ip route 0.0.0.0 0.0.0.0
ip default-network.
chpt_16.fm Page 722 Tuesday, May 27, 2003 2:16 PM
Examining the Routing Table 723
The ip default-network command establishes a default route in networks using
dynamic routing protocols.
The global command ip default-network 195.16.11.0 defines the Class C network
195.16.11.0 as the destination path for packets that have no routing table entries. For
every network configured with ip default-network, if a router has a route to the net-
work, that route is flagged as a candidate for the default route.
Creating an ip route to 0.0.0.0/0 is another way to configure a default route:
Router(config)# ip route 0.0.0.0 0.0.0.0 [
next-hop-ip-address
|
exit-interface
]
After configuring a default route or default network, the command show ip route
shows the following:
Gateway of last resort is 172.16.1.2 to network 0.0.0.0
If router RTY does not have the network in the routing table, it sends the packet to
172.16.1.2.
Determining Route Source to Route Destination
For traffic going through a network cloud, path determination occurs at the network
layer. The path determination function enables a router to evaluate the available paths
to a destination and to establish the preferred handling of a packet. Routing services
use network topology information when evaluating network paths. This information
can be configured by the network administrator or collected through dynamic pro-
cesses running in the network.
The network layer provides best-effort, end-to-end packet delivery across intercon-
nected networks. The network layer uses the IP routing table to send packets from the
source network to the destination network. After the router determines which path to
use, it takes the packet from one interface and forwards it to another interface or port
that reflects the best path to the packet’s destination.
Determining Layer 2 and Layer 3 Addresses from the Source to
the Destination
While network layer (Layer 3) addresses, also known as MAC addresses, are used to
get packets from source to destination, it is important to understand that a different
type of address is used to get packets from one router to the next. For a packet to get
from the source to the destination, both Layer 2 and Layer 3 addresses are used.
The Layer 3 address is used to route the packet from the source network to the desti-
nation network. The source and destination IP addresses remain the same. The MAC
address (Layer 2) changes at each hop or router. A data link layer address is necessary
chpt_16.fm Page 723 Tuesday, May 27, 2003 2:16 PM
724 Chapter 16: Distance Vector Routing Protocols
because the source host must have a way of addressing the next-hop router to which
the packets are being forwarded. Also, when the packet is delivered to the intended
host on a LAN, the router sends it directly to the host’s MAC address.
Determining Route Administrative Distance
One of the intriguing aspects of Cisco routers, especially for those new to routing, is
how the router chooses which route is the best among those presented by routing pro-
tocols, manual configuration, and various other means.
As each routing process receives updates and other information, it chooses the best
path to any given destination and attempts to add this path to the routing table.
The router decides whether or not to add the routes presented by the routing processes
based on the administrative distance of the route in question. If a path has the lowest
administrative distance to a particular destination, it is added in the routing table; if
not, then the route is rejected. Table 16-1 lists the default values for protocols sup-
ported by Cisco IOS Software.
Table 16-1 Default Administrative Distances
Route Type Administrative Distance
Connected 0
Static 1
EIGRP summary route 5
external Border Gateway Protocol (eBGP) 20
EIGRP (internal) 90
IGRP 100
OSPF 110
IS-IS 115
RIP 120
EIGRP (external) 170
internal Border Gateway Protocol iBGP 200
chpt_16.fm Page 724 Tuesday, May 27, 2003 2:16 PM
Examining the Routing Table 725
Determining Route Metric
Routing protocols use metrics to determine the best route to a destination. The metric
is a value that measures the desirability of a route. Some routing protocols use only
one factor to calculate a metric; for example, RIP-1 uses hop count as the only factor
to determine the metric of a route. Other protocols base their metric on hop count,
bandwidth, delay, load, reliability, ticks delay, maximum transmission unit (MTU),
and cost. Table 16-2 lists and describes each metric.
Table 16-2 Route Metrics
Metric Description
Hop count The number of routers that must be traversed
to reach a destination. The path with the
lowest hop count is preferred.
Bandwidth The link speed. The path with the greatest
bandwidth is preferred.
Delay The amount of time it takes for a packet to
travel a link. The path with the least delay is
preferred.
Load The amount of activity on a link. On Cisco
routers, the value can typically range any-
where between 1 and 255, where 1 repre-
sents a link with the less load and 255 a link
with the most load. Paths with the smallest
load are preferred.
Reliability The error rate on a link. On Cisco routers,
the value can typically range anywhere
between 1 and 255, with 255 representing
a link with the highest reliability. Paths with
the greatest reliability are preferred.
Ticks delay Used by IPX RIP and represents the number
of 1/18-second intervals required to forward
a packet across a link. Paths with the lowest
ticks delay are preferred.
Maximum transmission unit (MTU) The largest packet size (in bytes) allowed on
a link. Paths with the highest commonly
shared MTU are preferred.
Cost An administratively defined metric. Least-cost
paths are preferred.
chpt_16.fm Page 725 Tuesday, May 27, 2003 2:16 PM
726 Chapter 16: Distance Vector Routing Protocols
Each routing algorithm interprets what is best in its own way. The algorithm generates
a number, called the metric value, for each path through the network. Typically, the
smaller the metric number, the better the path.
Factors such as bandwidth and delay are static, in that they remain the same for each
interface until the router is reconfigured or the network is redesigned. Factors such as
load and reliability are dynamic, meaning that they are calculated for each interface in
real time by the router.
The more factors that make up a metric, the greater the flexibility to tailor network
operations to meet specific needs. By default IGRP uses two static factors to calculate
a metric value: bandwidth and delay. These two factors can be configured manually,
allowing precise control over what routes a router chooses. IGRP can also be config-
ured to include load and reliability, two dynamic factors in the metric calculation. By
using dynamic factors, IGRP routers can make decisions based on current conditions.
Thus, if a link becomes heavily loaded or unreliable, IGRP increases the metric of
routes using that link. Alternate routes might present a lower metric than the down-
graded route and are used instead.
IGRP calculates the metric by adding the weighted values of different characteristics of
the link to the network in question. These values (bandwidth, bandwidth divided by
load, and delay) are weighted with the constants K1, K2, and K3.
Metric = K1 × Bandwidth + (K2 × Bandwidth)/256 - load) + K3 × Delay
The default constant values are K1 = K3 = 1 and K2 = K4 = K5 = 0, so
Metric = Bandwidth + Delay
Determining Route Next Hop
Routing algorithms fill routing tables with a variety of information. Destination/next
hop associations tell a router that a particular destination can be reached optimally by
sending the packet to a particular router representing the “next hop” on the way to the
final destination.
When a router receives an incoming packet, it checks the destination address and
attempts to associate this address with a next hop.
Determining Last Route Updates
A network administrator can use the following commands to find the last route
update:
■ show ip route—Used to display the IP routing table on the router.
chpt_16.fm Page 726 Tuesday, May 27, 2003 2:16 PM
Examining the Routing Table 727
■ show ip route network—Provides detailed routing information about the speci-
fied network.
■ show ip protocols—Used to display IP routing protocol information.
■ show ip rip database—Displays the contents of the RIP private database when
triggered extensions to RIP are enabled.
The default update time for RIP is 30 seconds and for IGRP is 90 seconds.
Example 16-1 shows the output for the command show ip route.
Rt1 has received a RIP update for the network 200.200.200.0 from 192.168.10.2. RIP
updates every 30 seconds, and the shaded area is the amount of time since the last
update.
Example 16-2 shows the output for the command show ip route 200.200.200.0.
Example 16-1 show ip route Command Output
rt1# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
R 200.200.200.0/24 [120/1] via 192.168.10.2, 00:00:14, Serial0/0
C 192.168.10.0/24 is directly connected, Serial0/0
C 192.168.0.0/24 is directly connected, Loopback0
Example 16-2 show ip route 200.200.200.0 Command Output
rt1# show ip route 200.200.200.0
Routing entry for 200.200.200.0/24
Known via "rip", distance 120, metric 1
Redistributing via rip
Last update from 192.168.10.2 on Serial0/0, 00:00:11 ago
continues
00:00:14
chpt_16.fm Page 727 Tuesday, May 27, 2003 2:16 PM
728 Chapter 16: Distance Vector Routing Protocols
Example 16-3 shows the output for the command show ip protocols.
Example 16-4 shows the output for the command show ip rip database.
Routing Descriptor Blocks:
* 192.168.10.2, from 192.168.10.2, 00:00:11 ago, via Serial0/0
Route metric is 1, traffic share count is 1
Rt1 has received a RIP update for the network 200.200.200.0 from 192.168.10.2.
RIP updates every 30 seconds and the last update was 11 seconds ago.
Example 16-3 show ip protocols Command Output
rt1# show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 9 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is
Incoming update filter list for all interfaces is
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
Serial0/0 1 1 2
Loopback0 1 1 2
Routing for Networks:
192.168.0.0
192.168.10.0
Routing Information Sources:
Gateway Distance Last Update
192.168.10.2 120 00:00:03
Distance: (default is 120)
Example 16-4 show ip rip database Command Output
rt1# show ip rip database
192.168.0.0/24 auto-summary
192.168.0.0/24 directly connected, Loopback0
192.168.10.0/24 auto-summary
192.168.10.0/24 directly connected, Serial0/0
Example 16-2 show ip route 200.200.200.0 Command Output (Continued)
next due in 9 seconds
chpt_16.fm Page 728 Tuesday, May 27, 2003 2:16 PM