Tài liệu Routing and Switching Alogrithms - Pdf 90

1
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
6
Routing and
Switching Alogrithms
Terms you’ll need to understand:
✓ Distance vector protocols
✓ Routing Information Protocol (RIP)
✓ Interior Gateway Routing Protocol (IGRP)
✓ Enhanced Interior Gateway Routing Protocol (EIGRP)
✓ Link-state protocols
✓ Intermediate System to Intermediate System (ISIS)
✓ Open Shortest Path First (OSPF)
✓ Hello packets
✓ Border Gateway Protocol (BGP)
✓ Interior Border Gateway Protocol (IBGP)
✓ Exterior Border Gateway Protocol (EBGP)
✓ Summarization
✓ Multicast
Techniques you’ll need to master:
✓ Describing the mechanics of RIP, IGRP, EIGRP, ISIS,
OSPF, and BGP
✓ Setting up IP routing protocols in a simple design
scenario
✓ Identifying the IP routing table for each routing protocol
2
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Chapter 6
This chapter presents the commands you need to know when configuring the
various IP routing protocols on Cisco routers. Frequently, the terminology pre-
sents the most challenging aspect of understanding routing with Cisco IOS.

focal-point topics to help you fully prepare for the CCIE exam.
3
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Routing and Switching Algorithms
Summary of Available IP
Routing Protocols
Cisco IOS supports a number of IP routing protocols. Listing 6.1 shows the
routing protocols supported by Cisco routers. According to the CCIE exam objec-
tives, you’re only required to understand RIP, IGRP, EIGRP, ISIS, OSPF, and
BGP.
Listing 6.1 The router ? command.
R2(config)#router ?
bgp Border Gateway Protocol (BGP)
egp Exterior Gateway Protocol (EGP)
eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
igrp Interior Gateway Routing Protocol (IGRP)
isis ISO ISIS
iso-igrp IGRP for OSI networks
mobile Mobile routes
odr On-Demand Stub Routes
ospf Open Shortest Path First (OSPF)
rip Routing Information Protocol (RIP)
static Static routes
RIP, IGRP, EIGRP, OSPF, and BGP are called dynamic protocols because they
employ techniques that “automatically” discover and learn IP routing informa-
tion from other routers. Dynamic protocols use dynamic routing, a routing method
in which routers learn about IP networks without static configuration.
In the upcoming sections, we’ll cover the distance vector protocols—RIP, RIP II,
and IGRP. Next, we’ll look at a hybrid distance vector and link-state protocol—
EIGRP. Then, we’ll cover the link-state protocols—ISIS and OSPF. Finally, we’ll

multicast updates. While RIP II provides advancements over RIP I, it still con-
tains some of the deficiencies found in RIP I. For example, RIP II continues to
send full routing updates every 30 seconds and limits hop counts to 15 hops.
Cisco routers support both RIP I and RIP II. By default a Cisco router runs RIP
version I. Therefore, by default, the router will listen to RIP II updates but will
only forward RIP I updates unless configured otherwise.
Note: In order to configure RIP version II, you will have to be in the “router rip”
configuration mode.
To further clarify the operation of RIP I and RIP, let’s look at a sample RIP
configuration on a small network consisting of four Cisco routers.
Configurating RIP I and II
RIP is easy to configure, you start RIP with the IOS command router rip and
then apply the networks you want to be advertised. The IOS command to enable
the local network within RIP is:
network <classful networks to be advertised>
For illustrative purposes, let’s configure the network shown in Figure 6.1 for IP
RIP version I. Then, we can modify the configuration to enable RIP II.
5
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Routing and Switching Algorithms
In order to get our RIP network operating, a few steps will need to occur so let’s
briefly discuss them. First, we will need to start the RIP routing process on each
router and then apply the networks that are advertised as shown previously. The
RIP configuration on all three routers is identical because we are using the classful
Class A address of 10.0.0.0.
Listing 6.2 provides the configuration for router R1 shown in Figure 6.1. Router R1’s
RIP configuration is identical to the configuration of routers R2 through R4.
Listing 6.2 IP RIP configuration.
hostname R1
....

Router rip
network 10.0.0.0
IGRP example
Router igrp1
network 10.0.0.0
EIGRP example
Router eigrp1
network 10.0.0.0
Configuration of all
routers is the same
E0
Figure 6.1 RIP network scenario.
6
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Chapter 6
As you can see in Listing 6.2, the network uses the Class A network of 10.0.0.0.
Hence, we only need one line to identify the directly connected networks. To
view the IP routing table, you type the IOS command show ip route. Listing 6.3
shows the R1 router’s routing table.
Listing 6.3 The show ip route command.
R1#sh ip route
.....
10.0.0.0/8 is variably subnetted, 16 subnets, 2 masks
R 10.1.9.0/24 [120/4] via 10.1.4.1, 00:00:22, Serial3
R 10.1.8.0/30 [120/1] via 10.1.4.1, 00:00:22, Serial3
[120/1] via 10.1.2.2, 00:00:14, Serial2
R 10.1.8.0/24 [120/4] via 10.1.2.2, 00:00:14, Serial2
R 10.1.3.0/24 [120/5] via 10.1.4.1, 00:00:22, Serial3
R 10.1.3.0/24 [120/1] via 10.1.2.2, 00:00:14, Serial2
C 10.1.2.0/24 is directly connected, Serial2

➤ via 10.1.4.1—The IP address of the interface that the router learned the route
from
➤ 00:00:22—How long ago was the route learned
➤ Serial3 —What interface the network has been discovered from.
As you can see in Listing 6.3, the network 10.1.5.0/24 is reachable via routers R2
and R3 with the same hop count (1) so RIP will load balance to this network
because of the multiple paths. Listing 6.3 also shows a default route. The default
route is used if there is an IP packet to an unknown destination. In Listing 6.3,
the default route will be sent to the next hop address 10.1.4.1 or router R4. Let’s
assume you have been supplied a default router from the source address
131.108.1.100. To create a default route in RIP, you use the following command:
ip route 0.0.0.0 0.0.0.0 131.108.1.100
Note: The combination of a source address of 0.0.0.0 and mask of 0.0.0.0 indicates a
special route known as a default route.
The preceding command injects a default route into any neighboring RIP rout-
ers. To view the characteristics of how RIP is operating on a Cisco router, you can
use the show ip protocol command, as illustrated in Listing 6.4.
Listing 6.4 The show ip protocol command.
R1#show ip protocol
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 21 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Key-chain
Ethernet0 1 1 2
Serial0 1 1 2
Serial1 1 1 2

R1#sh ip route
Gateway of last resort is 10.1.4.1 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 16 subnets, 2 masks
R 10.1.9.0/30 [120/4] via 10.1.4.1, 00:00:22, Serial3
R 10.1.9.0/24 [120/1] via 10.1.4.1, 00:00:22, Serial3
R 10.1.8.0/30 [120/1] via 10.1.4.1, 00:00:22, Serial3
[120/1] via 10.1.2.2, 00:00:14, Serial2
R 10.1.8.0/24 [120/4] via 10.1.2.2, 00:00:14, Serial2
R 10.1.3.0/30 [120/5] via 10.1.4.1, 00:00:22, Serial3
R 10.1.3.0/24 [120/1] via 10.1.2.2, 00:00:14, Serial2
C 10.1.2.0/30 is directly connected, Serial2
C 10.1.1.0/24 is directly connected, Ethernet0
R 10.1.7.0/24 [120/2] via 10.1.2.2, 00:00:15, Serial2
C 10.1.7.0/30 is directly connected, Serial1
R 10.1.6.0/30 [120/4] via 10.1.4.1, 00:00:22, Serial3
R 10.1.6.0/24 [120/1] via 10.1.7.2, 00:00:13, Serial1
R 10.1.5.0/30 [120/1] via 10.1.7.2, 00:00:15, Serial1
[120/1] via 10.1.2.2, 00:00:16, Serial2
R 10.1.5.0/24 [120/4] via 10.1.2.2, 00:00:16, Serial2
C 10.1.4.0/30 is directly connected, Serial3
R* 0.0.0.0/0 [120/1] via 10.1.4.1, 00:00:23, Serial3
9
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Routing and Switching Algorithms
Notice that the serial networks display with the new 30-bit notation, and the
Class C networks display. RIP I would not be able to cope with IP networks with
varying masks.
Now, take a look at Listing 6.7, which shows the output you receive when the
show ip protocol command is issued after RIP II is in use.
Listing 6.7 The show ip protocol command after enabling RIP II.

debug ip rip Displays the RIP routing transactions
neighbor <ip address> Establishes a link to a remote router via unicast
network <network number> Runs RIP on the associated interface
(continued)
10
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Chapter 6
Note: RIP is relatively easy to configure and troubleshoot when compared to other
protocols, such as OSPF. Therefore, RIP was popular in the early days of IP
networking.
Let’s now discuss another distance vector routing protocol—Interior Gateway
Routing Protocol (IGRP).
Interior Gateway Routing Protocol
(IGRP)
Cisco Systems developed a proprietary distance vector routing protocol, called the
Interior Gateway Routing Protocol (IGRP), in the 1980s in response to the major
limitations of RIP. RIP’s major limitation, of course, is its hop count limit of 15
hops. Cisco developed IGRP with a maximum hop count of 255 and an update
interval of 90 seconds while retaining most of the other characteristics of RIP.
The major disadvantage of IGRP is that it only operates on Cisco routers. In
contrast, IP RIP is an international standard and operates on any compliant host
device. IGRP, which only works with Cisco routers, increases the network diam-
eter by allowing a greater hop count limit of 255 hops. The default hop count is
100 hops.
IGRP uses a concept called autonomous systems (AS). An AS is a domain under
the same administration. The AS number will be unique in each domain, and the
numbers are controlled by IANA (www.iana.org). IGRP AS’s numbers are not

Table 6.1 Summary of RIP commands
(continued)

default, only the bandwidth and the delay is used to measure how long a packet
will take to leave an interface. The bandwidth is calculated in kilobits, and the
delay is calculated in microseconds. The formula to calculate the IGRP metric in
its simple form is:
IGRP
metric
= 10
7
/Bandwidth + Delay/10
For example, assuming a delay of 20,000 msec on a 1,544K line, the IGRP metric
would be calculated as:
IGRP
metric
= 10
7
/1544 + 20000/10 = 6476+2000=8476
The full IGRP metric can be based on reliability and load (default metrics). If
these metrics are used, then the formula becomes:
IGRP
metric
= K1 * bandwidth + (K2 * bandwidth)/(256-load) + K3*Delay
In the preceding formula, the values K1 through K5 are constants. If the defaults
are not modified by the administrator, then K1=K3=1 and K2=K4=K5=0.
If K5 is not 0 or it’s given an appropriate value as directed by a qualified Cisco
engineer, then you also have the formula IGRP
metric
= Metric * [K5/(reliability +
K4)]. In effect, the metric is simply multiplied by the constant K5/K4. These
values should only be changed under the guidance of a qualified engineer at Cisco
systems. This metric was designed to ensure that networks are selected based on

composite metric is the same. In the entry for 10.1.6.0/24, you can see that there
are two alternate paths via Serial2 and Serial 0, because the metric is the same
(160350).
To display the characteristics of IGRP, issue the show ip protocols IOS com-
mand, as shown in Listing 6.9.
Listing 6.9 The show ip protocols command after enabling IGRP.
R1#sh ip protocols
Routing Protocol is "igrp 1"
Sending updates every 90 seconds, next due in 18 seconds
Invalid after 270 seconds, hold down 280, flushed after 630
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
13
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Routing and Switching Algorithms
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
IGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
IGRP maximum hopcount 100
IGRP maximum metric variance 1
Redistributing: igrp 1
Routing for Networks:
10.0.0.0
Routing Information Sources:
Gateway Distance Last Update
10.1.2.2 100 00:00:18
10.1.7.2 100 00:00:53
10.1.4.1 100 00:00:57
Distance: (default is 100)
You can determine from the output in Listing 6.9 that the AS is 1, the update

tocols and link-state protocols (link-state protocols are addressed later in this
chapter). Therefore, EIGRP is commonly referred to as a hybrid routing protocol.
EIGRP uses distance vector properties to determine the best path to a network
and uses link-state properties when changes occur or when detecting new neigh-
bors. EIGRP uses the Diffusing Update Algorithm (DUAL), which provides for
fast convergence, VLSM, and partial updates. EIGRP supports other desktop
protocols, such as IPX and AppleTalk, which are discussed in Chapter 7.
The main characteristics of EIGRP include the following:
➤ Uses the same composite metric as IGRP, but the metric is multiplied by 256.
➤ Sends network changes, but does not send periodic updates.
➤ Load shares up to six paths. (The default is four paths.)
➤ Serves as a hybrid protocol.
➤ Performs automatic redistribution between IGRP and EIGRP when using
the same AS.
➤ Requires less CPU resources compared to IGRP. By default, EIGRP allows
up to 50 percent of the bandwidth.
➤ Carries subnet information in updates, which means support for VLSM.
➤ Supports authentication (in IOS release versions 11.3+).
Table 6.2 Summary of IGRP commands
(continued)
.
Command Description
passive-interface <interface> Stops IGRP updates from being sent out only
router igrp <AS> Runs IGRP with an autonomous number required
timers basic <update> Modifies IGRP timers
<invalid><holdown> <flush>
variance <value> Specifies load balancing over unequal cost paths
default-metric bandwidth delay Specifies the default metrics when redistributing
reliability loading mtu
debug ip igrp events Provides routing messages that are sent

10.0.0.0/24 is subnetted, 9 subnets
D 10.1.9.0 [90/40537600] via 10.1.4.1, 00:00:55, Serial3
D 10.1.8.0 [90/41024000] via 10.1.4.1, 00:00:52, Serial3
[90/41024000] via 10.1.2.2, 00:00:52, Serial2
D 10.1.3.0 [90/40537600] via 10.1.2.2, 00:00:52, Serial2
C 10.1.2.0 is directly connected, Serial2
C 10.1.1.0 is directly connected, Ethernet0
C 10.1.7.0 is directly connected, Serial1
D 10.1.6.0 [90/40537600] via 10.1.7.2, 00:00:52, Serial1
D 10.1.5.0 [90/41024000] via 10.1.7.2, 00:00:55, Serial1
[90/41024000] via 10.1.2.2, 00:00:55, Serial2
C 10.1.4.0 is directly connected, Serial3
16
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Chapter 6
Notice in Listing 6.10 that the networks are reachable via D (EIGRP) and the
administrative distance is 90. The metric is 256 times what IGRP will calculate.
When IGRP was running, the cost calculated by router R1 to the network 10.1.6.0
was 158350. With EIGRP started, the metric is 40537600 or 256*158350.
To display the characteristics of EIGRP, issue the show ip protocol IOS command.
Listing 6.11 provides the output of this command when issued on router R1.
Listing 6.11 The show ip protocols command after enabling EIGRP.
R1#sh ip protocols
Routing Protocol is "eigrp 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100

(sec) (ms)
2 10.1.2.2 Se2 13 00:09:21 36 2280 0 8
1 10.1.7.2 Se1 13 00:09:31 40 2280 0 6
0 10.1.4.1 Se3 10 00:09:52 639 3834 0 10
By default, EIGRP automatically summarizes IP classes. This means that if you
are using a Class A address to cross a network boundary then EIGRP will install
this network with a Class A mask of 255.0.0.0. You can disable automatic sum-
marization by using the no auto-summary IOS command. You can also manu-
ally summarize a network as a classless route by applying the ip summary-address
eigrp <AS> <network> <mask> interface command. Table 6.3 provides a sum-
mary of common EIGRP IOS commands.
Now, let’s move on to a more advanced type of routing protocol, namely link-
state protocols. We will begin by discussing Intermediate System to Intermediate
System (ISIS) protocol and then we’ll take a look at Open Shortest Path First
(OSPF).
Table 6.3 Summary of EIGRP commands.
Command Description
auto-summary Enables auto summarization. This is the default
action.
Maximum-paths Sets the maximum paths. The default is 4.
metric maximum-hops <hops> Specifies the maximum hops EIGRP will use. The
default is 100, and the range is from 1 through 255.
ip summary-address eigrp Enables summarization.
autonomous-system-number
address mask
network <network number> Runs EIGRP on the associated interface.
passive-interface <interface> Stops EIGRP updates and hello packets from being
sent out.
router eigrp <AS> Runs EIGRP with autonomous number required.
Show ip eigrp neighbors Displays neighbors in the same AS.

intermediate system is identified as an ES-IS connection. Communication be-
tween IS end systems is referred to as an ISIS connection. Figure 6.2 also defines
areas in the ISIS environment that reduce the routing table’s size and memory
requirements—namely, router R1 in area 1 and R2 in area 2. Routers that have
ES-IS and ISIS connections will maintain a different database for each connec-
tion. Further, routers in the same area will maintain a Level 1 (L1) database,
while routers in different areas will need to maintain Level 1 and Level 2 (L1/
L2) databases. These are the link-state database used by ISIS.
Configuration of ISIS
To enable ISIS on a Cisco router, you must perform the following configura-
tion tasks:
➤ Enable ISIS with the router isis command.
19
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Routing and Switching Algorithms
➤ Configure ISIS interface parameters.
➤ Configure area parameters.
➤ Configure any miscellaneous parameters.
The three methods (referred to as network entities) used to define an ISIS area
and their field formats are:
➤ Simple—Area System ID SEL
➤ OSI—Domain Area System ID SEL
➤ GOSIP—AFI ICD DFI AAI Reserved RDI Area System ID SEL
The meaning of each network entity field is defined as follows:
➤ AFI—Authority and format identifier (47, for Cisco routers)
➤ ICD—International code designator
➤ DFI—Domain-specific part
➤ AAI—Administrative authority identifier
➤ RDI—Routing domain identifier (an autonomous system number)
➤ SEL—Selector byte used to ensure uniqueness in the address (NSAP is Net-

clns routing
interface Ethernet0
ip address 10.1.1.1 255.255.255.0
ip router isis
!
interface Serial1
ip address 10.1.7.1 255.255.255.0
ip router isis
bandwidth 64
clockrate 64000
!
interface Serial2
ip address 10.1.2.1 255.255.255.0
ip router isis
interface Serial3
ip address 10.1.4.2 255.255.255.0
ip router isis
router isis
net 47.0000.0c8e.774b.00
Listing 6.14 ISIS configuration on R2.
Hostname R2
clns routing
!
interface Ethernet0
ip address 10.1.3.1 255.255.255.0
ip router isis
bridge-group 1
!
interface Serial0
ip address 10.1.5.1 255.255.255.0

ip router isis
!
interface Serial1
ip address 10.1.5.2 255.255.255.0
ip router isis
!
router isis
net 47.aa00.0400.0120.00
Listing 6.16 ISIS configuration on R4.
Hostname R4
clns routing
!
interface Ethernet0
ip address 10.1.9.1 255.255.255.0
ip router isis
!
interface Serial0
ip address 10.1.8.1 255.255.255.0
ip router isis
22
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Chapter 6
!
interface Serial1
ip address 10.1.7.1 255.255.255.0
bandwidth 64
!
interface Serial2
ip address 10.1.4.1 255.255.255.0
ip router isis

Incoming update filter list for all interfaces is not set
Redistributing: isis
23
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Routing and Switching Algorithms
Address Summarization:
None
Routing for Networks:
Ethernet0
Serial1
Serial2
Serial3
Routing Information Sources:
Gateway Distance Last Update
10.1.2.2 115 00:05:16
10.1.7.2 115 00:05:17
10.1.4.1 115 00:05:17
Distance: (default is 115)
Notice in Listing 6.18 that updates are not sent unless a change occurs, like any
link-state protocol. To configure a default route, you use the default-information
originate command; otherwise, the default router will not be advertised. Listing
6.19 outlines the configuration on router R4 required to advertise a default route.
Listing 6.19 Default route configuration on router R4.
hostname R4
router isis
net 47.0000.0c75.d97e.00
default-information originate
ip route 0.0.0.0 0.0.0.0 null0
!Injects a Default route
The routing table for router R1, shown in Listing 6.20, shows that a default route

➤ Uses a metric based on a cost value. The formula used is 10
8
/Bandwidth in
BPS.
➤ Supports equal cost load balancing up to six paths.
➤ Uses hello packets to discover and maintain links to other routers, which
reduces bandwidth requirements.
➤ Supports authentication.
Table 6.4 Summary of ISIS commands.
Command Description
router isis Enables ISIS.
net entity Configures the network for the router.
ip router isis Enables ISIS on a local interface.
isis metric Sets the metric used by ISIS for Level 1 or 2 interfaces.
isis hello-interval Sets the hello interval in seconds.
isis password Sets the password used in authentication.
default-information originate Advertises a default route.
summary-address Summarizes networks.
show isis database Displays the ISIS link-state database.
show isis spf-log Displays the number of times the SPF algorithm has
been run due to network changes.
25
○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○
Routing and Switching Algorithms
➤ Provides fast convergence.
➤ Provides network summarization.
➤ Supports dial-on-demand links.
Before you look at an example of enabling OSPF, you should review some of the
key concepts and terminology used in OSPF networks.
OSPF Key Concepts and Terminology

(current)
OSPF
version 2
updated in
RFC 2328
1989
1991
1992
1994
1995
1997
1998
Figure 6.3 The evolution of OSPF.


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status