Title: Routing Fundamentals
1Routing Fundamentals
- One of a router's primary jobs is to make
decisions about which path is the best path to a
given destination. A router learns paths, called
routes, from an administrator's configuration or
from other routers via routing protocols. Routers
keep a routing table in RAM. A routing table is a
list of the best available routes. Routers use
this table to make decisions about how to forward
a packet. You can issue the show ip route command
to view the TCP/IP routing table.
2Routing Fundamentals
- A routing table maps network prefixes to an
outbound interface. - A router drops any packet destined for a network
that is not listed in the routing table.
3Routing Fundamentals
- New routes can be added to the routing table via
one of two methods - Static routing - An administrator manually
defines routes to one or more destination
networks.
4Routing Fundamentals
- Dynamic routing - Routers follow rules defined by
a routing protocol to exchange routing
information and independently select the best
path. - What are some of the advantages and disadvantages
of static and dynamic routing?
5Static Routes
- Static routing is useful in very simple networks
that do not have multiple paths to any
destination network. Static routing reduces the
memory and processing burdens on a router. Even
on large internetworks, administrators often
configure static routes on access routers that
connect stub networks, or networks that have only
one way in and one way out.
6Static Routes
- To configure static routing on a Cisco router,
you must use the ip route command. This command
uses the following syntax - Router(config)ip route destination-prefix
destination-prefix-mask address
interface distance tag tag permanent
7Static Routes
- You can manually add an entry to a routing table
using one of two variations on the ip route
command - RTA(config)ip route 10.6.0.0 255.255.0.0 s1
- RTA(config)ip route 10.7.0.0 255.255.0.0
10.4.0.2
8Static Routes
- The first example maps a network prefix
(10.6.0.0/16) to a local physical interface (S1)
on the router the same way that a directly
connected network is mapped to an interface. - The second example maps the network prefix
(10.7.0.0/16) to the next-hop address (10.4.0.2).
9Static Routes
- When using a routing protocol such as RIP or
IGRP, static routes that show as directly
connected will automatically be advertised to
other routers as long as the appropriate network
command has been issued. - Static routes can be included in updates if they
are injected, or redistributed into the dynamic
routing protocol.
10Static Routes
- When an interface goes down, all static routes
mapped to that interface are removed from the IP
routing table. In addition, when the router can
no longer find a valid next hop for the address
specified in a static route, the static route is
likewise removed from the table. An alternative
method is to map a static IP address to a
loopback interface.
11Static Routes
- Note As a rule, you should always use the
next-hop address when defining a static route on
a multi-access network such as Ethernet. A router
interface on a multi-access network could have
several link partners, so you must use the
next-hop address to specify which neighbor should
receive traffic for a given network.
12Static Routes
- Static routes are also good to use when having
trouble with a routing protocol. - Static routing does not suit large, complex
networks that include redundant links, multiple
protocols, and meshed topologies. - Dynamic routing is the best choice for complex
networks.
13Dynamic Routes
- Dynamic routing of TCP/IP can be implemented
using one or more protocols. - Routing protocols designed to work inside an
autonomous system are categorized as interior
gateway protocols (IGPs), and protocols that work
between autonomous systems are classified as
exterior gateway protocols (EGPs). - What are some examples of IGP and EGP?
14Dynamic Routes
- You can further categorize these protocols as
either distance-vector routing protocols or
link-state routing protocols, depending on their
method of operation. - The Cisco IOS commands to enable dynamic routing
vary depending on the routing protocol used.
15Dynamic Routes
- Although Cisco's EIGRP offers comprehensive
support for both IPX and AppleTalk, it is
important to be familiar with the names of the
following proprietary routing protocols IPX RIP
(or Novell RIP), NetWare Link Services Protocol
(NLSP), and AppleTalk's Routing Table Maintenance
Protocol (RTMP).
16IP Routing Protocols and the Routing Table
- Routers use administrative distance and metrics
to evaluate, or measure, routes. When multiple
routes to the same network exist and the routes
are from the same routing protocol, the route
with the lowest metric is considered the best. - Each routing protocol calculates its metrics
differently. - What are some examples? RIP, IGRP, EIGRP?
17IP Routing Protocols and the Routing Table
- With default settings, EIGRP's metric for the
route to 192.168.1.0 is 3,219,456 and RIPs is 3!
If RTA receives a RIP update and an EIGRP update
for this same network, how can the router compare
what is, in effect, three apples against more
than 3 million oranges? That is where
administrative distance comes in.
18Administrative Distance
- When a router receives updates from different
routing protocols about the same network, it can
not use dissimilar metrics to evaluate a route.
It uses administrative distance to decide which
protocol to believe. The Cisco IOS assigns a
default administrative distance to every routing
protocol the lower the value, the more
trustworthy the routing protocol.
19Distance Vector
- Distance-vector routing protocols are based on
the Bellman-Ford algorithm (also known as a
distance-vector algorithm). - Routers configured to use a distance-vector
routing protocol typically send their complete
routing table at regular intervals to neighbor
routers.
20Distance Vector
- In fact, simple distance-vector protocols, such
as RIP and IGRP, broadcast (or multicast) their
routing table out all configured interfaces, by
default. Routers that use these protocols do not
actually identify their neighbors for direct
communication.
21Distance Vector
- A neighbor router receiving the broadcast update
examines it and compares the information to its
current routing table. Routes to new networks, or
routes to known networks with better metrics, are
inserted in the table. The neighbor then
broadcasts its routing table, which includes any
updated routes.
22Distance Vector
- Distance-vector routing protocols are concerned
with the distance and vector (direction) of
destination networks. - Before sending an update, each router adds its
own distance value to the route's metric. - Simple distance-vector routing protocols enjoy
two major benefits over link-state protocols.
They are relatively easy to configure, and they
generally use less memory and processing power.
23Distance Vector
- Simple distance-vector routing protocols do not
scale as well as their link-state counterparts.
RIPv1 and IGRP are classful routing protocols
(they do not send subnet information in updates),
so they can not support scalability features such
as Variable Length Subnet Masking (VLSM) or
supernetting.
24Distance Vector
- In general, simple distance-vector routing
protocols converge more slowly than link-state
protocols. They do not work as well in a complex
network. - RIP has a 15 hop limitation and IGRP is a Cisco
proprietary protocol and therefore it cannot
support a multi-vendor routing environment.
25Link State Routing
- Link-state routing protocols offer greater
scalability and faster convergence than
distance-vector protocols such as RIP and IGRP.
Unfortunately, these advantages come at a price.
Link-state protocols require more memory and
processing power from the router, and more
knowledge and expertise from the administrator
than do distance-vector protocols.
26Link State Routing
- Link-state protocols are based on the Dijkstra
algorithm, sometimes referred to as the Shortest
Path First (SPF) algorithm.
27Link State Routing
- Routers running a link-state protocol, such as
OSPF, are concerned with the states (for example,
up or down) of links (interfaces on other
routers) in the network. A link-state router
builds a complete database of all the link states
of every router in its area. In other words, a
link-state router gathers enough information to
create its own map of the network.
28Link State Routing
- Each router then individually runs the SPF
algorithm on its own map, or link-state database,
to identify the best paths to be installed in the
routing table. These paths to other networks form
a tree with the local router as its root.
29Link State Routing
- Link-state routers advertise the states of their
links to all other routers in the area so that
each router can build a complete link-state
database. These advertisements are called
link-state advertisements (LSAs). Unlike
distance-vector routers, link-state routers can
form special relationships with their neighbors
and other link-state routers, to ensure that the
LSA information is properly and efficiently
exchanged.
30Link State Routing
- After an initial flood of LSAs provides routers
with the information that they need to build a
link-state database, routing updates occur only
when a link-state changes, or, if no changes have
occurred, after a specific interval. If a link
state changes, a partial update is sent
immediately. The partial update contains only
link states that have changed, not a complete
routing table.
31Link State Routing
- Link-state protocols generally outperform
distance-vector protocols on any size network. So
why are not link-state protocols used exclusively
for routing? Link-state protocols have two major
disadvantages
32Link State Routing
- Link-state routing may overtax low-end hardware.
Link-state routers require more memory and
processing power than distance-vector routers,
which potentially makes link-state routing
cost-prohibitive for organizations with tight
budgets and legacy hardware.
33Link State Routing
- Link-state protocols require complex
administration. Configuring link-state routing
can be a daunting task, and many administrators
prefer to avoid its complexity and stick to
distance-vector routing. Even capable
administrators may opt for a straightforward
distance-vector protocol on simple networks. .
34Hybrid Routing
- Cisco's proprietary EIGRP is an advanced
distance-vector protocol that also employs the
best features of link-state routing. For the most
part, EIGRP configuration is similar to
configuring a simple distance-vector protocol
such as IGRP. EIGRP routers use partial updates,
special neighbor relationships, and topological
databases to provide optimal convergence. Rapid
convergence, event driven updates, loop free
routing, and multi-protocol support are EIGRPs
trademark.
35Default Routing aka Gateway of Last Resort
- Default routes are used when the router can not
match a destination network with a more specific
entry in the routing table thus, the gateway of
last resort.
36Default Routing aka Gateway of Last Resort
- In effect, the router uses the default route to
hand off to another router. The other router must
have either a route to that destination or its
own default route to a third router. If it is a
default route to a third router, that router must
have either the route to the destination or
another default route, and so on.
37Default Routing aka Gateway of Last Resort
- Before routers can dynamically exchange default
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 and ip default-network.
38Default Routing aka Gateway of Last Resort
- Creating an ip route to 0.0.0.0/0 is the simplest
way to configure a default route. This is done
using the following syntax Router(config) ip
route 0.0.0.0 0.0.0.0 next-hop-ip-address
exit-interface. - To the Cisco IOS, network 0.0.0.0 /0 has special
meaning as the gateway of last resort. All
destination addresses match this route because a
mask of all 0s requires none of the 32 bits in an
address to be an exact match.
39Default Routing aka Gateway of Last Resort
- Manually configuring 0.0.0.0/0 routes on every
router might suffice in a simple network. You may
want routers to dynamically exchange default
routes in more complex situations. The exchange
of default information works differently
depending on the routing protocol being used and
can create severe problems when improperly
configured.
40Default Routing aka Gateway of Last Resort
- In IOS release 12.1, RIP does not propagate a
static default route automatically. If you are
using RIP and IOS 12.1, you must manually
configure the RIP process to advertise the static
default by issuing the network 0.0.0.0 command.
41Default Routing aka Gateway of Last Resort
- Alternately, you can use either the
default-information originate command or the
redistribute static command to configure static
default route propagation. OSPF (regardless of
the IOS version) requires the default-information
originate command if you want to propagate static
default routes. The following example illustrates
this configuration for RIP (see the figure).
42Default Routing aka Gateway of Last Resort
- RTY(config) ip route 0.0.0.0 0.0.0.0
172.16.1.2RTY(config) router ripRTY(config-rout
er) default-information originate.
43Default Routing aka Gateway of Last Resort
- Using the default-information originate command,
an administrator can statically configure a
single RIP router with a 0.0.0.0/0 route, and
that default route will be propagated to other
routers. The default-information originate
command can also be used with OSPF to achieve the
same effect.
44Default Routing W/ IGRP
- IGRP does not recognize the network 0.0.0.0/0 and
will not include it in updates. To configure a
dynamic exchange of default information in an
IGRP network, you must use the ip default-network
command. - The ip default-network command can be used to
flag a route to any IP network, not just
0.0.0.0/0, as a candidate default route, using
the following command syntax
45Default Routing W/ IGRP
- Router(config)ip default-network
ip-network-address. - In complex topologies, several networks can be
flagged as candidate defaults. Routers can then
choose from among the available candidates to
pick the lowest-cost route.
46Floating Static Routes
- Floating static routes are static routes
configured with an administrative distance value
that is greater than that of the primary route
(or routes). Essentially, floating static routes
are fallback routes, or backup routes, that do
not appear in the routing table until another
route to the same destination fails.
47Floating Static Routes
- RTB(config)ip route 10.0.0.0 255.0.0.0 1.1.1.1
130 - This ip route command includes an administrative
distance of 130. Recall that static routes have a
default administrative distance of 1
48Floating Static Routes
- To create a static route that will float (that
is, wait for another route to fail before
entering the routing table) you must manually set
an administrative distance value. This value must
be greater than the primary route's
administrative distance value.
49Floating Static Routes
- In this example, the primary route is learned by
RIP and thus has an administrative distance of
120. By configuring the static route with an
administrative distance of 130, the static route
will be less desirable than the primary route.
50Convergence
- When all routers in a network agree on the
topology, they have converged. Rapid convergence
means rapid recovery from link failure or other
network changes. Routing protocols and network
designs are ultimately judged by how quickly they
converge.
51Multiple Routes to a Single Destination
- Routing protocols permit the router to store
multiple routes to each destination. - One advantage of multiple routes is that
equal-cost load balancing or unequal-cost load
balancing can be used. Another advantage is that
maintaining multiple routes to a single
destination reduces a network's vulnerability to
routing loops and dropped packets when a link
fails.
52Timed Updates Vs. Event Driven Updates
- Routing protocols that are exclusively
time-driven react poorly to topology changes. If
a router detects a change but has to wait 30
seconds before alerting neighbors, routing in
that network could break down. It could take
several minutes before such a network's routers
converge.
53Timed Updates Vs. Event Driven Updates
- Routing protocols that are exclusively
event-driven theoretically could go months
without sending updates. If there is no other
mechanism to ensure that routers regularly
communicate (such as a Hello protocol), routers
could base their routing decisions on dangerously
outdated information.
54Timed Updates Vs. Event Driven Updates
- For these reasons, most routing protocols use a
combination of time-driven and event-driven
updates. RIP is time-driven, but Cisco's
implementation of RIP sends triggered updates
whenever a change is detected. Likewise, topology
changes trigger immediate updates in IGRP
routers, regardless of the update timer. Without
triggered updates, RIP and IGRP would perform
miserably.
55Timed Updates Vs. Event Driven Updates
- Protocols that are primarily event-driven
typically use timers as well. For instance, OSPF
routers typically assign a MaxAge to routing
information. Once information has reached its
MaxAge, it can no longer be used in the routing
table, and a new update must be requested.
56Metrics
- A routing metric is a value that measures the
desirability. Some routing protocols use only one
factor to calculate a metric such as RIP. - Other protocols base their metric on two, three,
or even five different factors, such as hop
count, bandwidth, delay, load, and reliability.