Network Routing Basics Understanding IP Routing in Cisco Systems PDF
Network Routing Basics Understanding IP Routing in Cisco Systems PDF
James Macfarlane
01_772739 ffirs.qxp 3/3/06 9:19 PM Page ii
01_772739 ffirs.qxp 3/3/06 9:19 PM Page i
James Macfarlane
01_772739 ffirs.qxp 3/3/06 9:19 PM Page iv
To Julia
01_772739 ffirs.qxp 3/3/06 9:19 PM Page vi
Technical Editor
vi
01_772739 ffirs.qxp 3/3/06 9:19 PM Page vii
Credits
vii
01_772739 ffirs.qxp 3/3/06 9:19 PM Page viii
02_772739 ftoc.qxp 3/3/06 9:19 PM Page ix
Contents at a Glance
Acknowledgments xvii
Introduction xix
Chapter 1 Networking Overview 1
Chapter 2 Routing Basics 69
Chapter 3 Static Routing 89
Chapter 4 Dynamic Routing 103
Chapter 5 RIP 137
Chapter 6 IGRP 167
Chapter 7 EIGRP 185
Chapter 8 OSPF 221
Chapter 9 External Routing Protocols in Brief 343
Chapter 10 Redistribution and Default Routing 361
Appendix A Where Do You Go From Here? 379
Appendix B Recommended Reading 381
Appendix C RFCs Related to Routing 383
Appendix D Web References 387
Appendix E Administrative Distance Table 389
Appendix F Quick-and-Dirty Subnetting—No Calculator 391
Appendix G Subnetting Helper Sheet 393
Index 395
ix
02_772739 ftoc.qxp 3/3/06 9:19 PM Page x
02_772739 ftoc.qxp 3/3/06 9:19 PM Page xi
Contents
Acknowledgments xvii
Introduction xix
Chapter 1 Networking Overview 1
Overview 1
OSI Network Model 2
The Conundrum of Explaining the OSI Model 2
Mother of All OSI Model Explanations? 3
Anatomy of a Data Communication Session 3
The Way Things Used to Be 5
Explanation of OSI Layers 6
Another Mail Analogy 12
Encapsulation 13
TCP/IP Model 15
Networking Equipment 15
Packet Forwarding 16
Repeaters—Layer 1, Physical 16
Hubs—Layer 1, Physical 16
Bridges—Layer 2, Data-Link 17
Switches—Layer 2, Data-Link 18
Routers—Layer 3, Network 19
Layer 3 Switches 23
CSU/DSUs (TSU) 23
TCP/IP Review 24
IP Addressing 24
Ports and Sockets 56
Important Protocols Related to Routing 59
Notes 67
xi
02_772739 ftoc.qxp 3/3/06 9:19 PM Page xii
xii Contents
Contents xiii
xiv Contents
Contents xv
xvi Contents
Acknowledgments
Thanks to each person at Wiley, both the people I worked with personally, and
the many people I did not have the pleasure of meeting, for the care and effort
taken to publish this book.
xvii
03_772739 flast.qxp 3/3/06 9:20 PM Page xviii
03_772739 flast.qxp 3/3/06 9:20 PM Page xix
Introduction
A few years ago, I was preparing to teach my first introductory course on net-
work routing. While seeking courseware material for the class, I examined a
number of books on the subject but never found one I felt completely comfort-
able with. In the end, I chose some standardized courseware, and ended up
handing out a series of “white papers” I had authored, in order to augment the
books used in the course. Those white papers ultimately evolved into this book.
Routing is not rocket science, but it’s a bit of a challenge to explain it in a
manner that students don’t find confusing. The basic idea of forwarding pack-
ets from one network to another is really not all that difficult a concept, but
in the maturing, Internet-driven, multi-vendor, multi-protocol, classlessly
addressed world of routing we live in today, there are a number of twists and
turns when it comes to getting all those millions of packets to their destination.
In considering an addition to the various routing primers available to the
reader, I saw a need for an up-to-date introduction to the subject that leaves the
reader—after making the investment in studying the material—with the reward
of having the confidence that they actually understand modern routing enough
to go out there and put their knowledge to work. When poorly explained, rout-
ing can be a weighty, cumbersome topic. When properly understood, routing is,
well . . . fun. It’s a really enjoyable field to work in when you have a handle on
how this aspect of networking works. There is an art to routing as well as a sci-
ence. In other words, there’s more than one way to get a packet from point A to
point B. As a network engineer with a specialty in routing, you can excel in your
field and gain peer recognition by playing a game called “let’s figure out the most
efficient way to route packets on this network.” We’re here to help you play the game
well.
A primary goal in the creation of this book is to provide clear and complete
information about how modern routing works. A strong emphasis has been
xix
03_772739 flast.qxp 3/3/06 9:20 PM Page xx
xx Introduction
Introduction xxi
CHAPTER
1
Networking Overview
Overview
The purpose of this chapter is to provide a refresher of basic networking top-
ics related to routing. The following topics are covered:
OSI network model 2
TCP/IP network model 15
Networking equipment 15
Packet forwarding 16
IP addressing 24
Ports and sockets 56
Importatnt Protocols related to routing 59
Based TCP/IP utilities windows 64
1
04_772739 ch01.qxp 3/3/06 9:20 PM Page 2
2 Chapter 1
Layer Name
7 Application
6 Presentation
5 Session
4 Transport
3 Network
2 Data Link
1 Physical
Figure 1-1 Basic OSI network model.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 3
Networking Overview 3
This chapter discusses the OSI model first because it lays a foundation for
how to fit routing into the broader aspects of general networking. As you read
this section, keep the following in mind: The OSI model is not some “extra
thing you have to learn about networking.” Rather, think of it as a tool to facil-
itate understanding the concepts of networking. Understanding networking
translates to understanding routing. Be advised that any unfamiliar network-
ing terms used in this section are probably explained in subsequent sections
(it’s that chicken-or-egg thing).
Sending Side
The side originating the session has a checklist of several items that must be
accomplished:
■■ Data from the user’s application (on computer A) must be passed to the
network.
■■ The data may need to be converted (ASCII to EBCDIC for example).
■■ The data may need to be encrypted and/or compressed.
■■ If reliable communications are desired, a communication channel with
the destination computer (computer B) must be established to track
each packet. In that case, a mechanism is needed to tag each packet and
follow up on the delivery attempt.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 4
4 Chapter 1
■■ The data must be broken up into smaller chunks that can be handled by
the network (you don’t send a 10MB file in a single packet).
■■ The logical and physical addresses (IP address and MAC address
respectfully) must be determined for the destination computer.
■■ The source and destination addresses must be added to the data packets.
■■ Error-detection information must be added to the packets.
■■ The best route to the destination host must be determined.
■■ The packets then need to be formatted into the particular frame type
unique to the network architecture of computer A (Ethernet, Token
Ring, and so on).
■■ The packets must be converted into electrical signals and placed on the
cable.
■■ Access to the network cable must be managed.
■■ The packets may need to be repackaged along the way into a differing
frame type if computer B resides on a network with a different LAN
architecture.
Receiving Side
As the data stream is received, computer B has several responsibilities:
■■ Computer B must have a way of knowing which packets are intended
for it.
■■ Computer B must have a way of knowing which application should
receive the packets.
■■ Access to the network cable must be managed to retrieve the packets.
■■ The packets must be converted from electrical signals to bits.
■■ The packets must be checked for corruption.
■■ The packets must be checked for correct order delivery and for missing
packets. Packets received out of order must be reordered.
■■ If reliable delivery was utilized, an acknowledgement message must be
sent for packets received intact. A retransmit message must be sent for
missing packets.
■■ The packet data needs to be rearranged into a format the receiving
application can understand.
■■ The data may need to be decrypted and/or decompressed.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 5
Networking Overview 5
6 Chapter 1
know the friend’s address and the location of the nearest mailbox. The post-
man who picks up the letter needs to know only two things: where the mail-
box is and the substation to drop the letter off. By the same token, the
employees at the substation need to know only two things: where the mailman
drops off the mail and which truck to load the letter on in order to get it to
Hawaii. The substation employees don’t care who wrote the letter, its contents,
what mailbox it was picked up from, or even the return address for that
matter.
It’s the same with the OSI model. For example, the networking layer needs
to know only how to receive data segments from the transport layer, process
the segments into packets, and pass them to the data-link layer. The network
layer doesn’t even care if the packets reach their destination—the transport
layer is in charge of that. The network layer certainly cares nothing about the
data itself—the layers above it worry about that.
With the uniform set of rules provided by a networking model in place, a
network-interface card manufacturer can produce a product that works with
any application or OS. This is because the NIC designer only needs to be concerned
about communicating with adjacent layers. Additionally, standardized APIs at the
boundary of each layer provide a common set of rules that facilitate intralayer
communications. As a result, product development time is greatly reduced.
WHAT IS AN API?
Networking Overview 7
Applications
7 Application Network entry point for data received HTTP, HTTPS, SSL,
from applications SMTP, POP3, FTP, SMB,
6 Presentation Application based conversion, NCP, ASCII, EBCDIC,
translation, encryption and compression MPEG, MP3, .JPEG,
of data TIFF, RPC, SQL, SMB,
5 Session Establish a communication session with
another host
4 Transport Breaks data into segments, flow control, TCP, UDP, NetBEUI,
insure packet delivery when requested SPX, NWLINK
3 Network Address packets (logical address), route IP, IPSec, ARP, RARP,
Lower Layers
Network
8 Chapter 1
Bear in mind that the upper layers are the starting point to initiate commu-
nications on the sending computer, but they are the end point for the receiving
computer. The communication process starts at layer 7 of the sending com-
puter and works its way down the OSI model to layer 1. The data is then trans-
mitted to the receiving computer, which receives the frame at layer 1 and
processes it up to layer 7 where it is then made available to the receiving
application.
N OT E The OSI model is protocol neutral, but due to the pervasiveness of the
TCP/IP protocol suite, TCP/IP will be used in the examples. All the TCP/IP
protocols, such as TCP and UDP, are discussed in a subsequent section.
Networking Overview 9
method of IBM mainframes2. Data formats such as MPEG and MP3 are associ-
ated with the presentation layer. Application-based encryption is another exam-
ple of the presentation layer. On the sending side, data would be encrypted at this
layer, and then decrypted by the corresponding layer on the receiving computer.
10 Chapter 1
Networking Overview 11
MAC (Media Access Control) addresses are the unique identifying numbers
burned into every network interface card (NIC) or directly into a computer if it
does not have a separate NIC card. MAC addresses are known as physical
addresses because they are permanently associated with the NIC. In the OSI
reference model, the MAC address is also referred to as the data-link address
because the data-link layer makes use of the physical address for
communicating with another host. Communications ultimately take place
between two hosts via their MAC/data-link addresses.
A MAC address is a 48-bit number expressed as six pairs of hexadecimal
numbers, for example 00-20-40-70-F4-84. The first three pairs of numbers refer
to the manufacturer of the NIC, while the remaining three pairs are uniquely
assigned to each NIC produced. The combined numbers create a universally
unique physical address that identifies a specific node on a network.
The data-link layer is only responsible for delivery and error detection on
the local network. If the frame must be routed to a different network, the router
will strip off the current frame and apply a new one based on the network pro-
tocol the packet is being forwarded to on the next hop.
Finally, the framed data is converted to a bit stream and passed to layer 1.
One question folks have when studying the OSI model regards the need for
two sets of addresses: a network address (also known as a network ID or net-
work number) at layer 3 and a data-link address at layer 2. Isn’t one address
enough to uniquely identify a network node? In a perfect world, a single
address might be enough, but as we know all to well, it’s not a perfect world.
The OSI model reflects an open, flexible environment in having the ability to
assign logical (changeable and hierarchical) addresses as well as physical
(fixed and permanent) addresses. An analogy would be say, a Denny’s restau-
rant at 123 Goodfood Place. If Denny’s moved down the street, it would be
located at a new address. The existing building, in the meantime, might
become say, a Carrows (the logical address changes), but maintains the current
street address (the physical address remains the same).
Dual addressing simply provides the flexibility to allow an organization to
deploy any network numbering scheme it wishes (IPv4, IPv6, IPX, and so on),
while maintaining a standardized, globally unique physical addressing scheme.
12 Chapter 1
The data-link layer is actually divided into two sub-layers: The Logical Link
(LLC) layer and the Media Access Control (MAC) layer.
The LLC layer is thought of as the upper sub-layer and is defined by the IEEE
802.2 standard. The LLC is a “header within a header.” It frames the data
received from layer 3 by applying the MAC address and a checksum header to
the packet. The LLC layer can establish either a connection or connectionless
session (reliable or unreliable) with the next node in the path. Frame
synchronization, flow control, and error correction are all handled by this sub-
layer. An 802.2 frame allows for identification of the transport protocol in use.
The MAC layer is the lower sub-layer and is associated with the various
networking standards such as 802.3 (CMSA/CD or Ethernet) and 802.5 (Token
Ring). The MAC layer handles communication with the network adapter and
arbitrates shared access to the media.
Networking Overview 13
Encapsulation
Encapsulation is the term used to describe adding information to packets as
they are passed down the OSI model layers. If you look closely, you will notice
that there’s one distinct difference between what happens in the upper layers
of the OSI model juxtaposed to what happens at the lower layers. In the upper
layers, nothing is added to the data. The data itself is being acted on. It is con-
verted or encrypted or whatever, but it’s still the raw data (mostly).
In the lower layers however, information is being appended to the raw data.
IP addresses, MAC addresses, tracking information, error correction code, and
so on are all being added. The process by which all this network data is added
to the application data is called encapsulation. Encapsulation adds headers of
information to the raw data segments. As Figure 1-3 shows, most of these
headers are appended to the beginning of the data.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 14
14 Chapter 1
Sending Receiving
DATA 7 Application 7 DATA
DATA 6 Presentation 6 DATA
DATA 5 Session 5 DATA
TCP TCP
Hdr DATA 4 Transport 4 DATA Hdr
IP TCP TCP IP
Hdr Hdr DATA 3 Network 3 DATA Hdr Hdr
MAC LLC IP TCP DATA FCB DATA FCB TCP IP LLC MAC
Hd Hdr Hdr Hdr Hdr 2 Data-Link 2 Hdr Hdr Hdr Hdr Hd
10 10 10 10 10 10 10 10 10 10 10 10 1 Physical 1 10 10 10 10 10 10 10 10 10 10 10 10
Figure 1-3 Encapsulation adds critical networking information to each packet of data.
In the upper three layers of the sending side (7, 6, and 5), the data is passed
down the OSI stack, usually without the addition of any headers. At the trans-
port layer, the data is segmented and a header is appended to each segment.
The header includes data such as source and destination port numbers.
The transport layer then passes the modified DPU to the network layer. The
network layer treats the incoming segments—optional TCP/UDP header and
all—as “data.” This layer cares nothing about what’s in the payload of each
segment and does not distinguish between network data and application data.
The segments are repackaged based on the LAN network type, an IP header is
appended that includes information such as source and destination IP
addresses and quality of service settings, and the segment is now treated as a
packet.
The data-link layer receives the packet and again treats the whole packet as
data. A MAC header is then appended to the packet, and, depending on the
configured frame type, an 802.2, LLC header, and/or SNAP header are added
as well. The DPU at this layer is referred to as a frame.
The physical layer receives the frames, converts each frame to a bit stream,
and modulates the bits as electrical signals onto the medium. As before, the
entire frame—headers and data—is treated as one unit.
On the receiving side, the process is reversed. Each header will be examined
by the appropriate layer. The physical layer converts the electrical signals to a
bit stream, recreates the frames and passes each frame to the data-link layer.
The data-link layer strips off and discards the frame headers, and passes what
is now a packet to the network layer, which interprets the information in the IP
header. The network layer then passes the packet to the transport layer, which
interprets the TCP/UDP header. Based on the destination IP address from the
network layer and the destination port number from the TCP/UDP header,
the segment is passed to the upper layers and to the appropriate application or
service.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 15
Networking Overview 15
As shown in Figure 1-3, each layer of the OSI model communicates only
with its corresponding layer on the other host. Only matching layers can inter-
pret the headers created by their counterparts on the opposing host.
Presentation
Session
Physical
Which model should you care about? The OSI model, with all its imperfec-
tions, is imbedded in the lexicon as the reference model most used for describ-
ing networking. However, the TCP/IP model best reflects the actual protocols
used in today’s networks, as the model specifies strictly the TCP/IP protocol
suite.
Networking Equipment
This section focuses on some of the popular networking hardware in use
today. The concentration is mostly on packet forwarding equipment, with spe-
cial attention paid to routers. The following hardware will be covered:
■■ Repeaters
■■ Hubs
■■ Bridges
04_772739 ch01.qxp 3/3/06 9:20 PM Page 16
16 Chapter 1
■■ Switches
■■ Routers
■■ Layer 3 switches
■■ CSU/DSUs
Packet Forwarding
Before delving into packet forwarding hardware, be sure you understand
what packet forwarding actually is, and how the process differs on varying
types of forwarding hardware. The term “forwarding” is a generic term for
transferring a packet from point A to point B. It is a “method independent”
term, meaning it is used whether the packet is routed to a different network or
switched to another port on the same network. Forwarding just refers to moving
the packet along its way.
In describing forwarding, this text will usually refer to the unit of data being
forwarded as a packet. Although the term frame and datagram are best suited to
DPUs as they pass through routers (the DPU enters as a layer 2 frame and
moves through the router as a layer 3 datagram, its layer 2 header having been
stripped off), the term packet is a nice elastic one that has broader meaning in
common use and can apply to forwarding at both layers 2 and 3.
Repeaters—Layer 1, Physical
Repeaters are the most basic form of forwarding devices. They are associated
with the physical layer because they have no means of examining the contents
of frames. Repeaters don’t see the contents of headers; they simply amplify
electrical signals. A repeater receives a frame, regenerates an exact copy of the
frame, and forwards it along its way. The repeater does not scrutinize the bit
pattern in any way and makes no decision about how or where to forward
packets. A repeater therefore is only used for intranetwork communications.
Repeaters are primarily used to extend the maximum length of a cable run.
They typically have two ports: an input port and an output port. Although
repeaters still have their uses, it is rare to see one used specifically for net-
working, partially because the advent of fiber optic cabling has extended the
maximum length of cable runs. One place repeaters have seen a renaissance is
as USB extenders.
Hubs—Layer 1, Physical
Hubs (also known as concentrators) are easy to define. They are simply multi-
port repeaters. Whereas a repeater will have two ports (one in, one out), a
hub has 24 or more ports. The concept is exactly the same though. A signal
04_772739 ch01.qxp 3/3/06 9:20 PM Page 17
Networking Overview 17
delivered to any port on a hub is regenerated and forwarded out all ports.
Again, no examination of the frame is performed and no forwarding decisions
are made. Every port gets a copy of the frame because the hubs are too dumb
to know which port the destination node is attached to. Because hubs cannot
read network addresses within a frame, they are restricted to forwarding
frames within a single logical network only. Hubs do not route traffic.
Hubs have traditionally been employed on smaller Ethernet LANs to pro-
vide connections to network nodes. They are cheap and simple to deploy.
However, because the Ethernet frames sent from one node is forwarded to all
nodes, bandwidth is compromised. Ethernet is a baseband medium, meaning
only one signal at a time can be placed on the network. If a second signal is
placed on the wire, a collision occurs and communications must be reat-
tempted. Hubs and repeaters therefore form what is known as a collision
domain. All traffic on an intranetwork connected solely by hubs (or repeaters)
exists within a single collision domain.
As Ethernet networks grew in size over the years, the single collision domain
architecture became an issue because each additional node attached to the net-
work increased the chances of a collision. Collisions happened so often on larger
networks (over 50–100 nodes for example) that performance was significantly
degraded. Since Ethernet looked like it was going to become a ubiquitous LAN
technology, a solution was needed to somehow partition collision domains.
The next three networking devices to be discussed—bridges, switches, and
routers—address the issue by forming multiple collision domains.
Bridges—Layer 2, Data-Link
A bridge is a different animal than a repeater or a hub because it has the abil-
ity to examine frames. This ability is limited though in that a bridge can only
“see” into the layer 2 header (the source and destination MAC addresses and
checksum).
18 Chapter 1
The ability to read MAC addresses gives a bridge the ability to make intelli-
gent decisions about forwarding packets. A bridge will build a table in mem-
ory that records the MAC address of every node connected to either port. Over
a period of time, the bridge learns which nodes are connected to which of its
two ports.
How can this help network congestion? A two-port bridge can be inserted
between two LAN segments, thus splitting a single collision domain into two
collision domains. The two segments can be literally any size and contain any
number of hubs. Once the bridge learns the MAC addresses of all nodes and
which port they are connected to, it will forward packets only to the port the
destination node is connected to. In other words, if node 1 is connected to net-
work segment A, the bridge will never forward traffic destined for node 1 onto
segment B. That’s not where it lives.
However, bridges, like hubs, are restricted to forwarding frames within the
logical network because they can’t discern network addresses. The capability
of bridges is further enumerated in the following section on switches, which
are simply multi-port bridges.
Switches—Layer 2, Data-Link
Switches are quite similar to bridges. Because of a trend away from general
purpose CPUs to custom ASICs, and for marketing reasons, the bridge evolved
into the switch. Switches assist packet forwarding by creating a collision domain
on each switched port. As with bridges, switches track the source MAC address
of all packets and maps each address to the specific port it is sourced from. A
table is built containing this map, which allows the switch to forward traffic
only to the port attached to the destination node (assuming only one node is
connected to the port). If node 1 attached to port 1 sends a message to node 2
attached to port 2, that traffic is contained to port 1 and port 2. A node is
attached to port 3 could carry on a simultaneous conversation with a node
attached to port 4 without the chance of a collision. This is analogous to avoid-
ing a traffic jam by being allocated you own personal traffic lane.
Rather than attach a single workstation to a switched port, one or more hubs
could be attached to the port, although performance, as well as security, will
tend to degrade.
When switches were first introduced, they were substantially more expen-
sive than hubs, so a trade-off was made between cost and bandwidth manage-
ment, and both hubs and switches were deployed on LANs.
However, as the cost of switches has come down, more and more LANs are
built solely on switching technology. Moreover, the delay incurred by a switch
examining each packet’s MAC address has been mitigated by modern
switches employing what is referred to as wire speed technology, which is
04_772739 ch01.qxp 3/3/06 9:20 PM Page 19
Networking Overview 19
firmware-based code whose operation does not impinge on the speed of the
underlining media.
Switches are now marketed to the home networking market, typically in the
form of four-port switch/Internet/router combo boxes. This is a bit silly of
course, since the amount of collisions on a four-node network hardly results in
a perceivable difference in performance to the end user, but sizzle tends to sell
over steak. However, one computer per switched port tends to enhance secu-
rity, as it makes eavesdropping quite difficult.
Due to marketing, pricing, performance, and security, switches have
evolved into the most popular network component for forwarding packets
within a logical network.
Routers—Layer 3, Network
The previously described networking equipment is limited in that hubs and
switches can only forward packets within a single network. If packets must be
forwarded to another network, a router is required. A router’s primary func-
tion is to forward packets between networks (Chapter 2 goes into detail on
this). Routers deal in network addresses and are therefore associated with the
network layer (layer 3) of the OSI model. An artifact of router behavior is that
they isolate broadcast domains as well as collision domains. Repeaters, hubs,
bridges, and switches all forward broadcasts to all ports (even switched ports).
Routers usually do not forward broadcast packets.4
20 Chapter 1
Dedicated Routers
A dedicated router is just that—a computer with one basic function: the for-
warding of packets. A dedicated router has all the attributes cited previously:
a processor; an operating system; two or more interfaces; a route table; and
some type of memory to store the OS, route tables and core configuration of
the router. Most router product lines are distinguished by how the aforemen-
tioned criteria are incorporated into specific router model.
Processor
Processor type and clock speed vary according to the volume of packets
required to flow through the router in a given period and how much filtering
is performed on those packets. The heavier the workload, the more processing
power is required.
Operating System
At the core of a router is its operating system. Each brand of router runs an OS
proprietary to the vendor. For example, a Cisco router employs the venerable
Cisco IOS (Internetwork Operating System). The Cisco IOS has gone through
a number of versions over the years as features have been added to keep up
with changing network technologies. Although there are various flavors of the
IOS for different router series (2500, 2600, and so on) it is essentially the same
core code. When you have learned how to configure one Cisco router, you
have a handle on configuring any Cisco router. It’s all about knowing the IOS.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 21
Networking Overview 21
Memory
Routers employ various types of memory for different functions. Table 1-2
illustrates the common memory types.
ROM, Flash, and NVRAM are all non-volatile forms of memory. If the router
goes down or is powered off, the stored information is retained. RAM memory
is volatile, but is much faster than non-volatile memory. Information from non-
volatile memory is copied to RAM on boot-up to allow faster operation.
Router Interfaces
If routers can’t connect to networks, they don’t have much value. The number,
type, and capabilities of a router’s interfaces vary according to a particular
product line and model number. However, just about every router you pick up
has two traditional categories of routing interfaces: a LAN interface and a
WAN interface.
A WAN interface makes possible the connection to a WAN link, such as a
modem or a digital line (a T1 or a 56K line for example). The WAN interface on
a Cisco router is usually a DB60 female serial port. A DTE/DCE cable5 is used
to connect the WAN interface to a CSU/DSU. DTE stands for Data Terminal
Equipment (the router) and DCE stands for Data Circuit-terminating Equip-
ment (the CSU/DSU, Figure 1-4).
A LAN interface connects the router to one or more local networks. The
interface takes the physical form of either an RJ-45 jack (100base-T) or a DB-15
female connector. The DB-15 connector was designed to connect to the now-
obsolete 10Base-2 networks (coax). Even so, the Cisco 2500 series routers still
come equipped with such an interface. If a 2500 series router is to be interfaced
to an Ethernet network employing unshielded twisted pair (UTP) wiring, a
transceiver that converts the DB-15 to an RJ-45 jack is attached to the interface.
By the way, the RJ-45 jacks in Figure 1-4 are not LAN connections. Rather, they
are used to connect a terminal to the router and program it. The common
application to program the router is TELNET.EXE.
22 Chapter 1
On/Off
Switch
AUX
AUI AUI Serial0 Serial1 Console 2
Multi-Purpose Routers
Today’s routers have evolved and although you can certainly still purchase a
dedicated router, you now have the option of buying a router that has
absorbed the functions of other networking devices. One common router
hybrid is the layer 3 switch (defined in the next section).
Networking Overview 23
Some routers are also capable of handling security functions. The Cisco IOS
for example, has native packet filtering capabilities across the product line.
Certain routers are also capable of terminating one end of a VPN solution. Still
other models have built-in hubs or even built-in switched ports.
Layer 3 Switches
A layer 3 switch is a hybrid device that combines the functions of a switch and
a router into one box. With a layer 3 switch, both OSI layer 2 and layer 3 head-
ers can be examined, so a packet can be forwarded either across the local net-
work or to another network. A layer 3 switch with VLAN (virtual LAN)
capability allows for a potent one-box solution for most packet-forwarding
needs.
CSU/DSUs (TSU)
A Channel Service Unit/Data Service Unit (CSU/DSU, also referred to as a
TSU or Terminal Service Unit) is a piece of equipment that sits between the
router and a WAN connection such as a T1 line. Although a T1 line is a digital
line, the signaling methods used by the phone company are different from dig-
ital LAN signaling. The CSU/DSU conditions the signal from the router so
that it can be transmitted across the public link. A CSU/DSU on the receiving
side converts the signal back to a LAN signal and transmits it to the receiving
router6. The CSU/DSU, in turn, will typically have an RJ-45 jack that the telco
(telephone company) drop plugs into. Table 1-3 summarizes key networking
characteristics of the equipment discussed in this section.
Repeater X
Hub X
Bridge X X
Switch X X
Router X X X
Layer 3 switch X X X X
04_772739 ch01.qxp 3/3/06 9:20 PM Page 24
24 Chapter 1
TCP/IP Review
What follows is a quick review of TCP/IP networking concepts related to rout-
ing. It is by no means a complete primer on IP, but rather is intended to refresh
your recollection of IP networking and perhaps fill in some blanks. Having said
that, a fairly thorough treatment of classless networking (subnetting, variable-
length subnet masks, supernetting, and CIDR) will be covered, since it is so critical
to modern routing. The following topics will be addressed:
■■ Classful IP addressing
■■ Classless IP addressing
■■ Subnetting, variable-length subnet masks (VLSMs), supernetting, and
Classless Inter-Domain Routing (CIDR)
■■ Public and private addressing
■■ IPv6
■■ Ports and sockets
■■ IP protocols related to routing
■■ TCP/IP utilities related to routing
IP Addressing
An IP address is the number assigned to a host that uniquely identifies the host
on both the local network and all IP networks. IP addresses relate to the net-
working layer (layer 3) of the OSI model. The networking layer handles network
addressing and routing of packets, a topic that goes to the heart of this book.
DEFINING A HOST
Networking Overview 25
256*256*256*256 = 4,294,967,296
26 Chapter 1
Binary numbers are actually easy to understand because each bit represents
only two possibilities: 0 or 1. Therefore, each additional bit doubles the num-
ber of possibilities:
1 bit = 2 possibilities 0, 1
2 bits = 4 possibilities 00, 01, 10, 11
3 bits = 8 possibilities 000, 001, 010, 011, 100, 101, 110, 111
4 bits = 16 possibilities 0000, 0001, 0010, 0011, . . . 1111
5 bits = 32 possibilities 00000, 00001, 00010, 00011, . . . 11111
6 bits = 64 possibilities 000000, 000001, 000010, 000011, . . . 111111
7 bits = 128 possibilities 0000000, 0000001, 00000010, . . . 1111111
8 bits = 256 possibilities 00000000, 00000001, 00000010, . . . 11111111
Classful Addressing
The original, and now obsolete, system for denoting the network and host
address represented by an IP address was the classful system. You will see
04_772739 ch01.qxp 3/3/06 9:20 PM Page 27
Networking Overview 27
shortly why the system is no longer used. The classful system mandates three
different types (classes) of IP addresses, whereby entire octets are tasked with
representing either the network or the host portion of the address. Table 1-4
illustrates classful IP addressing.
Network Numbering
In a classful addressing system, a class A network reserves the first octet for
network numbering while leaving the remaining three octets for host number-
ing. A class B address reserves the first two octets for network numbering and
the remaining two octets for host numbering. A class C address reserves the
first three octets for network numbers and only one octet for host numbering.
How does this all work out? Have a look at Table 1-5.
In the classful system, certain bits in the first octet are “frozen”—they form
a set pattern and are never altered. A class A address is defined by the first bit
being frozen at 0. Because the network portion of a class A network number is
confined to the first octet, this leaves 7 bits that can be manipulated to create
network IDs. 27 equates to 128 potential class A networks. This isn’t very many
networks, but with three remaining octets tasked to host numbers, each net-
work has a huge number of potential host addresses.
Class B networks have the first 2 bits of the first octet frozen at 10. Because
the first two octets of a class B address form the range of network IDs, 14 bits
are available. 214 equates to 16,384 potential class B networks.
Class C networks have the first 3 bits of the first octet frozen at 110. Because
the first three octets of a class C address form the range of network IDs, 21 bits
are available. 221 equates to 2,097,152 potential class C networks.
In point of fact, not every potential network address translates into a valid,
usable network address. Certain addresses are considered reserved for other
uses, as shown in Table 1-6.
A Network.host.host.host 10.10.10.0
B Network.Network.host.host 128.50.0.0
C Network.Network.Network.host 190.0.0.0
04_772739 ch01.qxp 3/3/06 9:20 PM Page 28
28 Chapter 1
# OF
FIRST OCTET FIRST OCTET RANGE OF POTENTIAL
CLASS IN BINARY IN DECIMAL ADDRESSES NETWORKS
As a general rule, all network bits set to either 0 or 1 (not including frozen
bits) create invalid network addresses and explain why most of the addresses
shown in Table 1-6 are reserved. Table 1-7 shows the actual number of usable
networks.
Host Numbering
The number of hosts per network varies according to the network class. Class
A networks leave three full octets for the range of host IDs for each network.
That’s well over 16 million hosts per network!
Class B and C networks leave two octets and one octet, respectively, for host
addresses. Table 1-8 illustrates the number of hosts per network for each net-
work class.
NETWORK ID COMMENT
224.0.0.0 and above Multicast and experimental. Not used for host addressing.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 29
Networking Overview 29
As with network addresses, not all potential host addresses are valid. The rule
is that host addresses of all binary 0s or binary 1s cannot be assigned to a host. A
host address of all binary 0s represents the network number itself (the 1.0.0.0),
and a host address of all binary 1s represents the broadcast address for the net-
work. So that’s two reserved host addresses per network. Table 1-8 accounts for
that rule with the formula 2n – 2 where n = number of host bits.
Enumerating an IP Address
Table 1-9 illustrates the range of host addresses and the broadcast address for
each of the three network classes.
Table 1-8 Usable Range of Valid Host Addresses for Any Given Network Address
# OF HOSTS
HOST ADDRESS HOST ADDRESS RANGE PER
CLASS RANGE (IN DECIMAL) (IN BINARY) NETWORK
30 Chapter 1
BEGINNING ENDING
EXAMPLE HOST HOST BROADCAST
CLASS NETWORK ADDRESS ADDRESS ADDRESS
Public Addressing
In order to insure that every host’s IP address is unique, a central assigning
authority allocates all addresses that will be used on the Internet. These
addresses are known as public IP addresses (depicted later in Table 1-10).
Networking Overview 31
WHAT’S AN RFC?
An RFC, Request for Comments, is the method used to define standards for the
Internet. An RFC starts life as a public document in draft form that is circulated
in the Internet community. Each RFC has an assigned number. Once accepted as
a standard, the RFC retains the same number and is still called a Request for
Comments—just one of those little oddities, like doctors “practicing” medicine.
Private Addressing
RFC 1918 allocates a range of the IP address space for use by private networks.
These IP addresses can never be used on the Internet. This action was taken in
the mid-1990s to conserve the rapidly depleting number of globally unique IP
addresses.
Because network packets with private addresses are never routed from one
domain to another, any number of companies can use the same private
addresses. Private IP addresses are free of charge and they can be reused on
any number of private networks. Not so with the venerable public range of
addresses, which have become rare and expensive.
The implementation of privately addressed networks is what caused the
proliferation of proxy servers, NAT boxes, and gateways. These devices sub-
stitute a public address for a private address when access to the Internet is
required. A small pool of public addresses can server the needs of dozens or
even hundreds of privately addressed hosts (see Table 1-10).
The table indicates which range of addresses can be used for private net-
works. For example, the entire Class A network 10.0.0.0 is available. A Class A
network allows for over 16 million hosts (10.0.0.1 – 10.255.255.254). Is that
enough addresses for your network? Or, you could subnet the address and cre-
ate a multitudes of networks.
If you were to instead choose Class B addressing you could select the
172.16.0.0 network, for example, which allows for over 65,000 hosts (172.16.0.1 –
172.16.255.254). Or you could use 172.17.0.0, or 172.18.0.0, or any network num-
ber up to 172.31.0.0. Any of those network numbers allows for 65,000+ hosts. Or
again, you could subnet and create additional private network numbers.
If you have a smaller network and fewer hosts, you could get by with a
private Class C network. For example, the 192.168.0.0 allows for 254 hosts
(192.168.0.1 – 192.168.0.254). Most consumer Internet “routers,” which incorpo-
rate a NAT device for Internet access, default to a class C network (usually
192.168.0.0, 192.168.1.0, or 192.168.2.0).
04_772739 ch01.qxp 3/3/06 9:20 PM Page 32
32 Chapter 1
If you have a routed network, should you employ several private class C
addresses or a subnetted private class B address? When making such a deci-
sion, recall that one goal in network design is to keep route table entries as
small as possible. Another goal is organization of all those addresses. A hierar-
chical networking scheme with summarized network addresses is the key.
This means a private class A or B address may be the preferred choice. Or bet-
ter yet, make sure you fully understand classless addressing, classless routing,
and route summarization before deciding on an addressing scheme for a
network. These topics are fully explored throughout this book.
Classless Addressing
With classless addressing, the traditional dividing line between the network
and host portion of the address is blurred. While classful addressing draws the
dividing line only at octet borders, classless addressing draws the network/
host line at any bit boundary. This allows for a highly flexible addressing
scheme that does not unnecessarily waste IP addresses.
Before getting into the methods of how classless addressing is employed, it
is important that you understand how the IP stack running on a host deter-
mines the network portion of an IP address. This is critical in deciding whether a
packet needs to be routed to another network.
Networking Overview 33
A 00000000 = 0
B 10000000 = 128
C 11000000 = 192
Subnet Mask
The contemporary method for determining the network address is the subnet
mask. A subnet mask does just what it implies: it masks (blocks) out the host
portion of the address, thereby revealing just the network number. How that
works will be demonstrated shortly. Why is it called a “subnet” mask and not
a “network” mask? Actually, sometimes it is called a network mask. It’s also
referred to as the net mask, the subnet address, or simply the mask.
The subnet mask, like an IP address, is a 32-bit number expressed in dotted
decimal format. For classful networks, it takes the form shown in Table 1-12.
34 Chapter 1
A 255.0.0.0
B 255.255.0.0
C 255.255.255.0
Networking Overview 35
The ANDing process is performed on the IP address and the subnet mask to
extract the network number. To understand how this occurs, you need to con-
vert the IP address and subnet mask to binary format. The IP stack performs a
comparison of the IP address and the subnet mask, bit by bit, from left to right.
The ANDing process is performed on each “bit pair” and a decision is made as
to whether the bit is part of the network number or not.
In the following example, the IP address 190.1.1.1 with a mask of the
255.255.255.0 has the ANDing process performed to extract the network
address:
Address 190 .1 .1 .1
Binary 10111110 00000001 00000001 00000001
________ ________ ________ ________
Subnet mask 255 .255 .255 .0
Binary 11111111 11111111 11111111 00000000
======================================
ANDing process 10111110 00000001 00000001 00000000
Network ID 190 .1 .1 .0
N OT E For some people it’s easier to look at it this way: “If the subnet mask
bit is set to 1, it passes the corresponding address bit through. If the subnet
mask bit is 0, it passes a 0 regardless.” The end-result is the same regardless of
how you look at it.
4. The process continues until all bits in all octets have been compared.
When the resulting number is converted back to decimal, the true net-
work number of the source IP address is revealed.
When making routing decisions, IP performs the ANDing process on both
the source and destination addresses, and then compares the results. If both
04_772739 ch01.qxp 3/3/06 9:20 PM Page 36
36 Chapter 1
extracted network numbers are the same, the packet is delivered locally. If the
results differ, the packet is assumed to be destined for another network, and is
routed accordingly. ANDing is the key element of routing decisions in today’s
classless networking environment and the term will be referred to throughout
this guide. Be sure you understand the concept.
Prefix Notation
Prefix notation or prefix addressing is simply an alternate method of expressing
a network’s mask. Prefixes express the address masks in less space. In prefix
notation, a single number preceded by a “/” is used instead of a 32-bit number.
As you may deduce from Table 1-13, prefix notation simply reflects the num-
ber of bits turned on in the mask. Notice the default mask in the table
expressed in binary form. The first three octets of 255 each represent all binary
bits turned on; 24 bits turned on—thus the prefix of /24.
By the same token, a class A mask would be represented as /8 in prefix nota-
tion (the 255.0.0.0) and a class B mask would be /16 (the 255.255.0.0). A very
simple system. Some operating systems such as Windows XP allow you to
enter the network mask as a prefix number in lieu of a subnet mask. Public
WAN carriers also commonly use prefix notation. If you are assigned a net-
work number by your ISP, the mask will usually be notated in prefix format.
Table 1-13 Three Methods for Displaying the Same Class C Subnet Mask
Networking Overview 37
Subnetting in Brief
Subnetting is the act of taking a single IP network ID and subdividing it to cre-
ate two or more network IDs. Subnetting is accomplished by relocating the net-
work/host dividing line to the right from its originally assigned position—into
the area of the portion of the address representing the host IDs. As the line
moves to the right, bit-by-bit, additional network IDs are created as host IDs
are sacrificed. That’s the trade-off. The further the line is moved to the right, the
more networks (subnets) are created and the fewer the number of hosts per
network. The “borrowing” of host bits is accomplished by altering the original
mask of the network ID. A custom mask is how the ANDing process discerns
the subnets created by the bit borrowing process. The subnetting process works
the same regardless of whether the original address is classful or classless.
VLSMs in Brief
In standard subnetting, the same subnet mask used to derive the additional sub-
nets is applied to all hosts residing on all the subnets. With variable-length sub-
net masks (VLSMs), the subnet mask can be altered (varied) again for one or
more of the subnets. In effect, this is sub-subnetting. The reason for this appar-
ent insanity is the same as it always is when you’re submerged in the world of
classless addressing—namely, to provide the utmost in addressing utilization. A
standard subnetted class C address may yield say, two subnets with 62 hosts per
subnet. But what if one network requires 62 hosts and another network requires
say, only two host IDs? In that case, one of the two subnets could itself be sub-
netted further, creating additional networks with fewer hosts per subnet. One of
the two subnets remains the same and keeps the same custom mask, while the
other subnet is further subdivided into additional networks with a smaller num-
ber of hosts per network and thus a differing mask. That’s VLSM in a nutshell.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 38
38 Chapter 1
Supernetting in Brief
Supernetting is simply the reverse of standard subnetting. Instead of moving the
network/host dividing line to the right—creating additional networks with fewer
hosts per network—the line is moved to the left—creating fewer networks with a
greater number of hosts per network. This technique is applied to contiguous
blocks of network IDs to create a single network number with the combined
total of all host IDs that were originally spread out among several addresses.
CIDR in Brief
Classless Inter-Domain Routing (CIDR) is simply the concept of subnetting/
supernetting and even VLSM techniques applied at the address assignment
level, where ISPs and large organizations receive an allotment of addresses.
The assigning authority no longer wastes entire classful addresses by handing
out say, a class B address with 16,000+ host IDs. Instead, what was a class A, B,
or C address is now treated as simply a 32-bit number whose network/host
dividing line can be drawn at any point. With CIDR, every public network ID
is treated the same, regardless of its previous class distinction. A CIDR address
“block” is now assigned with the network/host dividing line determined by
the requirements of the organization receiving the address. The organization
receives the exact number of addresses it needs—no more, no less.
A pleasant side effect of allocating addresses in this manner allows the min-
imization of the number of route table entries on Internet routers. Blocks of
CIDR assigned addresses can be summarized into a single route table entry,
regardless of the number of networks actually assigned. The concept of route
summarization goes hand-in-hand with classless addressing techniques. Net-
work summarization is given extensive coverage in Chapter 4 on page 119.
Subnetting in Detail
The basic purpose of subnetting is to derive additional networks from a single
network address. Subnetting is accomplished by altering the current subnet
mask (prefix number) for the network. The current mask may be a classful A, B,
or C mask, or it may be whatever mask was assigned when the address was allo-
cated. Additional networks are created by borrowing bits from the host portion
of the IP address to create additional network IDs. When a network address is
subnetted into multiple networks, the term subnet is often used to refer to the
additional network addresses created. The result of subnetting is that you gain
additional network addresses—at the expense of fewer hosts per network.
Why Subnet?
There are many answers to this question. If the originally assigned network ID
is a public address, subnetting may be employed to efficiently allocate this rare
and valuable resource. A customer requiring several public network addresses
may be able to obtain (for a price) a single address and then subnet it into the
04_772739 ch01.qxp 3/3/06 9:20 PM Page 39
Networking Overview 39
N OT E Bear in mind that with the popularity of NAT, there is less of a need to
subnet public addresses at the organizational level. Just a single or a few public
addresses can represent many privately addressed hosts. ISPs, however, routinely
subnet their CIDR assigned public addresses to satisfy the demands of their
customers.
How to Subnet
You must take the following items into consideration when subnetting:
■■ Determine the total number of subnets needed. This includes planning
for future networks.
■■ Determine the total number of hosts that each subnet must support
now and in the future.
■■ Define a custom subnet mask that will support the required number of
hosts for that subnet.
■■ Derive the subnet IDs.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 40
40 Chapter 1
Borrowing Bits
Creating additional network IDs involves moving the network/host dividing
line to the right—into the host portion of the address. In effect, you are remov-
ing bits from the host portion of the address and reassigning them for subnet
duty. The more bits you borrow, the more subnet IDs you create. The new sub-
net IDs are formed strictly from the combinations of the borrowed bits.
Figure 1-8 shows how 2 bits are borrowed from the host ID. The subnet
mask is altered to create the subnets. Let’s see how many networks we can cre-
ate from 2 bits.
The first row shows the original dividing line of the address. In the second
row, 2 bits have been borrowed from the fourth octet, moving them into a new
field called the Subnet ID. In the third row, the borrowed bits have been
turned on (set to 1). This is how IP knows the dividing line has been moved to
the right. IP (specifically, the ANDing process) always identifies ON bits in the
mask (1’s) as network addresses and OFF bits in the mask (0’s) as host addresses.
Note the Subnet ID field. It’s made up solely of the borrowed bits. This
“field” is simply there to illustrate the place where the subnet IDs are derived
from. IP just sees the address as one long 32-bit binary address.
Networking Overview 41
42 Chapter 1
As you can see, the mechanics of creating a custom subnet mask is relatively
easy. Just remember that you always borrow from the first octet representing
the host portion of the address. For a class C address, that is the fourth octet.
For a class B address, you would start borrowing from the third octet, and con-
tinue borrowing into the fourth octet if required. For class A addresses, start
borrowing from the second octet.
N OT E You can also do the math with the calculator by setting it to binary
mode, and then start with 00, add 1, and continuously add 1 to the result (just
remember that the calculator won’t display leading zeros).
00 01 10 11
00 01 10 11
Networking Overview 43
For example if you borrowed 3 bits, the formula would be (23 - 2 or 2*2*2 - 2),
which is 4. Borrowing 3 bits yields six valid subnets.
Step 3: Determine the host IDs and broadcast ID for each subnet
Next, the host IDs belonging to each network are determined. Originally, this
class C network number was capable of supporting 254 hosts (190.100.50.1 –
190.100.50.254). However, many host addresses are rendered invalid once
04_772739 ch01.qxp 3/3/06 9:20 PM Page 44
44 Chapter 1
In this case, the formula plays out like this: 26 -2 or 2*2*2*2*2*2 - 2 = 62. The
reason that 2 is subtracted from the total is because, like a subnet address, a
host address of all binary 0s or all binary 1s is reserved. All host bits set to 0
represent the subnet ID itself. All bits set to 1 represent the broadcast address
for that particular subnet.
It’s quite easy to calculate the host addresses for each subnet. Begin by cal-
culating the first valid host ID for the first network ID. The first host ID is just
one number higher than the network number (see Figure 1-11).
Notice that the last host ID has all six host bits turned on except one. If you
study the figure for a moment one thing should start to jump out at you. Cal-
culating host IDs is easy. The first ID is just the subnet number plus one, and
the last host ID is just two shy of the next subnet, the .128. The broadcast ID is
just one short of the next subnet ID. It always works out that way. Now calcu-
late the host IDs for the .128 subnet (see Figure 1-12).
Figure 1-13 summarizes the subnetted network.
192.100.50.64 network
th
Host ID 4 octet in binary Convert to decimal Complete host address
Subnet ID Host ID
1st host ID 01 000001 .65 192.100.50.65
2nd host ID 01 000010 .66 192.100.50.66
3rd host ID 01 000011 .67 192.100.50.67
4th host ID 01 000100 .68 192.100.50.68
And so on . . .
61st host ID 01 111101 .125 192.100.50.125
62nd host ID 01 111110 .126 192.100.50.126
Broadcast ID 01 111111 .127 192.100.50.127
Figure 1-11 Determining the host IDs for the .64 subnet.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 45
Networking Overview 45
192.100.50.128 network
Host ID 4th octet in binary Convert to decimal Complete host address
Subnet ID Host ID
1st host ID 01 000001 .129 192.100.50.129
2nd host ID 01 000010 .130 192.100.50.130
3rd host ID 01 000011 .131 192.100.50.131
4th host ID 01 000100 .132 192.100.50.132
And so on . . .
61st host ID 01 111101 .189 192.100.50.189
62nd host ID 01 111110 .190 192.100.50.190
Broadcast ID 01 111111 .191 192.100.50.191
Figure 1-12 Determining the host IDs for the .128 subnet.
Subnetting Summed Up
Here is a summary of the basic steps of subnetting:
■■ Determine the total number of subnets needed. This includes planning
for future networks.
■■ Determine the total number of hosts that each subnet must support
now and in the future.
■■ Define a custom subnet mask that will support the required number of
subnets and hosts per subnet.
■■ Derive the subnet IDs.
■■ Derive the host IDs for each subnet.
■■ Derive the broadcast address for each subnet.
Subnet 1 Subnet 2
Original network address: 192.100.50.0 Original network address: 192.100.50.0
Custom subnet mask: 255.255.255.192 Custom subnet mask: 255.255.255.192
Subnet address 1: 192.100.50.64 Subnet Address 2: 192.100.50.128
Beginning host address: 192.100.100.65 Beginning host address: 192.100.100.129
Ending host address: 192.100.100.126 Ending host address: 192.100.100.190
Total valid hosts: 62 Total valid hosts: 62
Broadcast address: 192.100.100.127 Broadcast address: 192.100.100.191
The host IDs .1-.63 and .193-.254 are gone. They are rendered invalid because they are now
owned by reserved network IDs.
Figure 1-13 The results of subnetting the 190.100.50.0 with a 255.255.255.192 mask.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 46
46 Chapter 1
______________________________________________________
Target address 190 .100 .50 .129
Binary 11000000 01100100 00110010 10000001
________ ________ ________ ________
Subnet mask 255 .255 .255 .192
Binary 11111111 11111111 11111111 11000000
======================================
ANDing process 11000000 01100100 00110010 10000000
Network ID 190 .100 .50 .128
Which subnet will IP determine the destination host is on? The destination
host belongs to a different network, so the packets must be routed. Remember
that the ANDing process masks out the host portion of the address, leaving
just the network portion. Before subnetting ANDing would have determined
that the target host was on the same network. After subnetting ANDing shows
the target address as being part of a different network.
Networking Overview 47
all networks require a similar number of hosts for each subnet. This is where
VLSMs come in. By varying the subnet mask of one of the subnets a second
time (by moving the network/host dividing line further to the right), addi-
tional subnets are created, albeit with a smaller number of hosts per network.
VLSMs allow for extremely granular control over the number of hosts per sub-
net. Just bear in mind that for each additional subnet created by a VLSM, a
router is required to forward packets to and from the subnet.
As with standard subnetting, the more bits you borrow when varying a sub-
net mask, the more subnet IDs you create and the fewer hosts per subnet. To
illustrate this concept, a class B address will be used as an example. Let’s say
an ISP has been assigned the class B address 170.1.0.0 /16.8 The conventional
(classful) dividing line between network/host is between the second and third
octets (255.255.0.0). It is unlikely the ISP probably has just one customer with a
network requiring 65,536 hosts. Rather, the ISP probably has multiple cus-
tomers with networks requiring far fewer hosts. Therefore, the address will be
subnetted.
It is quite common to see class B addresses subnetted with a class C subnet
mask (255.255.255.0 or /24). An entire octet is borrowed for subnet IDs, leav-
ing an entire octet for host addresses (see Figure 1-14). This alteration renders
254 subnets, with 254 hosts per subnet (28 – 2 or 2*2*2*2*2*2*2*2 – 2 = 254).
Alas, the Internet service provider is not satisfied. The ISP has a large num-
ber of point-to-point fractional T1 links connecting to its customer base. These
links require only two host addresses per network. There is no way the ISP is
going to waste 254 valuable host IDs on each point-to-point network. Variable
length subnet masks to the rescue. The ISP can burn just one of its 254 subnets,
subdividing it again, thus creating a bunch of sub-subnets. To employ this
strategy, the selected subnet will have its mask altered once again to achieve
the required result.
48 Chapter 1
Figure 1-15 shows how the subnets of the 170.1.253.0/30 are created.
Note that once a subnet has been further subnetted, all subnets (or sub-
sub-nets, if you will) are valid. The rule of no subnets with all 0s or 1s was
already obeyed when the original subnets were created. All subnets of a sub-
net are usable addresses. However, the host addresses of sub-subnets still
must obey the rule (no all-binary 0s or 1s in host ID).
The fully enumerated subnet is displayed in Figure 1-16.
To see the big picture, examine the entire assigned address range of the
revised allocation for the 170.1.0.0 shown in Figure 1-17.
There is no end to how many times the network can be subdivided. Any
other subnet ID could be subdivided just as the 170.1.253.0 just was. Any pre-
fix number higher than /24 could be used depending on how many host IDs
per subnet are required. Once sub-subnetted, the subnets could be variably
subnetted yet again, as long as bits remain to be borrowed.
Networking Overview 49
170.1.253.0 /30
Subnet ID Subnet Mask in Subnet Mask in Host ID Range
Octet Format Prefix Notation
170.1.253.0 255.255.255.252 /30 170.1.253.1 - 170.1.253.2 (.3 is broadcast ID for subnet)
170.1.253.4 255.255.255.252 /30 170.1.253.5 - 170.1.253.6 (.7 is broadcast ID for subnet)
170.1.253.8 255.255.255.252 /30 170.1.253.9 - 170.1.253.10 (.11 is broadcast ID for subnet)
170.1.253.12 255.255.255.252 /30 170.1.253.13 - 170.1.253.14 (.15 is broadcast ID for subnet)
170.1.253.16 255.255.255.252 /30 170.1.253.17 - 170.1.253.18 (.19 is broadcast ID for subnet)
170.1.253.20 255.255.255.252 /30 170.1.253.21 - 170.1.253.22 (.23 is broadcast ID for subnet)
etc . . .
170.1.253.244 255.255.255.252 /30 170.1.253.245 - 170.1.253.246 (.247 is broadcast ID for subnet)
170.1.253.248 255.255.255.252 /30 170.1.253.249 - 170.1.253.250 (.251 is broadcast ID for subnet)
170.1.253.252 255.255.255.252 /30 170.1.253.253 - 170.1.253.254 (.255 is broadcast ID for subnet)
50 Chapter 1
Supernetting in Detail
Supernetting is the reverse of subnetting. With supernetting, rather than
dividing one network address into multiple subnets, you instead combine mul-
tiple network addresses into one large network. Why would you want to do
that? Take the example of a company needing a single network that can accom-
modate 1,000 public host addresses. Before the concept of supernetting (and
later CIDR), the company had the limited choice of either acquiring a class B
network address and wasting more than 65,000 host addresses, or being
assigned four class C addresses and creating four networks connected by
routers. With supernetting, those four class C addresses could be combined
into a single network ID by moving the network/host dividing line to the left
rather than to the right.
Before CIDR addressing was introduced, supernetting obviously had value.
CIDR notation negates the need for supernetting public addresses however,
because the old class limitations no longer apply. The assigning authority sim-
ply allocates an address (even what was once a class C address) with the pre-
fix set to accommodate the number of networks and hosts required by an
organization.
CIDR in Detail
Although it is the final classless addressing technique explored here, CIDR
(Classless Inter-Domain Routing) is where classless addressing actually starts
in today’s world. It’s only mentioned at the end of the discussion because
CIDR embodies the previously mentioned classless addressing methods—
with the only exception being that these methods are carried out at the level
where Internet addresses are assigned rather than at the organization level.
Here’s how it works.
The Internet agency responsible for assigning network addresses is called
the NIC (Internet Network Information Center) or InterNIC. Traditionally, the
InterNIC worked through its subsidy, IANA (Internet Assigned Numbers
Authority) to administer the addresses. As the Internet has grown larger and
larger, private regional entities have taken on the responsibility of assigning
addresses. In America, the local agency allocating network addresses is ARIN
(American Registry for Internet Numbers). To avoid confusion, this book just
uses the generic term “assigning authority” when referring to the agency that
assigns network addresses.
CIDR supports the concept of classless networking between networks, or
more accurately between routing domains—thus the moniker Inter-Domain
Routing. A domain is defined as a network or networks under a single admin-
istrative control. For example, CIDR allows organization A and organization B
to be assigned classless IP addresses and successfully route packets between
the two organizations (domains).
04_772739 ch01.qxp 3/3/06 9:20 PM Page 51
Networking Overview 51
52 Chapter 1
received its allocation from the assigning authority. We will start at the top of
this food chain to see how a CIDR address is efficiently allocated from day one.
Mammoth received an allocation of over 65,000 addresses from the assign-
ing authority. The allocation took the form of 44.0.0.0/16. Before CIDR,
this address would have been designated a class A address of over 16 million
addresses, and possibly assigned to a single organization where most of the
address space would have remained unused. With CIDR notation, the assign-
ing authority allocates just the range of this address space that the customer
requires; about 65K addresses.
As you can see from examining Table 1-14, the 44.0.0.0 is used far more effi-
ciently under CIDR. The address, as allocated in the table, satisfies the needs of
256 customers needing a 65K allotment of addresses.
The fun doesn’t stop there however. Table 1-15 further illustrates that it is
not necessary to apply the same prefix to each portion of the 44.0.0.0.
N OT E The fourth column of the tables in this section on CIDR enumerates the
total address space for the given address range rather than the total number of
networks and hosts per network. When dealing with CIDR addresses, or any
scope of addresses that are subject to varying prefixes, its easier to just refer to
the total addressable space, because any subnet within the range is subject to
further sub-division.
ADDRESS TOTAL
ASSIGNMENT CUSTOMER RANGE ADDRESSES
And so on . . .
Networking Overview 53
ADDRESS TOTAL
ASSIGNMENT CUSTOMER RANGE ADDRESSES
And so on . . .
Etc.
ADDRESS TOTAL
ASSIGNMENT CUSTOMER RANGE ADDRESSES
And so on . . .
Etc.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 54
54 Chapter 1
Last address all assigned bits on – except low order bit OFF)
11111111.11111111.000001 | 11.11111110
Decimal 44 .0 .7 .254
The examination of the process in binary form has revealed that the prefix of
/22 derives a subnet with the range of the 44.0.4.1 – the 44.0.7.254. The
remaining portion of the address is available for allocation elsewhere.
MiddleMan must now allocate an address to the local ISP. MinniMe has
requested 200 addresses, so the closest match will be an address space of 8 bits;
in other words, a /24 prefix. Table 1-17 elucidates the allocation to MinniMe,
along with a few other customers.
ADDRESS TOTAL
ASSIGNMENT CUSTOMER RANGE ADDRESSES
Etc.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 55
Networking Overview 55
Whoops. If MiddleMan keeps this up, it will soon exhaust its allocation. No
problem. MiddleMan can lease additional CIDR blocks from Mammoth if the
need arises.
To complete the CIDR example, MinniMe will create a number of small sub-
nets for its subscribers. Table 1-18 reflects a possible allocation.
To sum up, the above examples should demonstrate CIDRs ability to effi-
ciently allocate IP addresses. Furthermore, CIDRs ability to also reduce the
size of route tables due to the natural network summarization that takes place
with CIDR-assigned address will be reinforced many times throughout this
book, especially in Chapter 4.
ADDRESS TOTAL
ASSIGNMENT CUSTOMER RANGE ADDRESSES
And so on . . .
* Once the address range rolls over to the .5, it is out of range of the allocated CIDR address. Someone else
owns the range from there.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 56
56 Chapter 1
Ports
Ports are values set in a header field of TCP and UDP packets. A port number
indicates which application is to be used to process a packet. The receiving
computer examines the value of the port field and passes the packet to the
application waiting for traffic on that port number.
Port numbers are analogous to apartment numbers. The street address (IP
address) of an apartment complex takes you to the correct building, but the
apartment number (port) is required to identify the correct location within the
building. Take a request for a web page. An incoming packet requesting a web
04_772739 ch01.qxp 3/3/06 9:20 PM Page 57
Networking Overview 57
page from xyz.com will contain not only the IP address of the web server; it
will also contain the port number it expects the web server software to be listening on.
How does the packet know which port number to use? That has all been set up
in advance. Web servers listen on TCP port 80. Port 80 is one of many so-called
“well known” ports. Therefore, if the packet wants to get a web page, it had
better request the page on port 80.
When a web server is started up, it immediately begins listening on port 80.
When it detects a packet with the port number set to 80, the web server
responds by extracting the packet’s payload and processing the data. Likewise
with an FTP server. An FTP server listens on port 20. It will try to process any
packets set to port number 20 (see Table 1-19).
(continued)
04_772739 ch01.qxp 3/3/06 9:20 PM Page 58
58 Chapter 1
Ports are numbered from 0–65,535. Port numbers that everyone agrees on
are referred to as “well-known.” The ports 0–1023 are reserved as well-known
ports. They are used by server-based applications. Both the UDP (unreliable)
and the TCP (reliable) protocols each have their own range of port numbers
numbered 0–65,535.
Sockets
Sockets are easy to understand. A socket is simply the combination of an IP
address and a port number. Sockets help identify a specific host, along with the
port a particular application is listening on. For example, if the web server for
xyz.com is 191.1.1.25, the socket for web traffic on that machine is 191.1.1.25:80
(IP 191.1.1.25 and port 80). Any traffic bound for the web server at xyz.com
would have the destination socket 191.1.1.25:80 imbedded in each packet.
Both a source socket and a destination socket are embedded in every packet.
The destination socket specifies exactly where the packet is bound for, and the
source socket specifies exactly where the packet came from. The source socket
is necessary because the server has to direct response packets back to the appli-
cation on the host that made the request.
You might be wondering which port number the source host uses when
requesting a web page. Many people would guess port 80. That’s actually not
correct. Port 80 is reserved only for computers running web server software,
not web browser software. After all, you don’t want a host receiving traffic on
port 80 if it is not running the software required to process HTTP requests. In
fact, clients making requests use any of a series of sequential port numbers
between 1024 and 4096. The first port a computer uses upon boot-up is 1024.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 59
Networking Overview 59
The next packet stream will use 1025, then 1026, and so on, up to 4096. Then it
rolls over to 1024 again.
N OT E The range of ports used for client requests, server responses, and other
functions is not as meticulously followed by everyone in the TCP/IP community
as it could be. Like many things, there are always exceptions to the rule, and
there is some overlap in the use of port numbers. However the well-known port
numbers are pretty universal. Appendix D provides the URL of a site that lists
the assignment for all port numbers.
UDP Protocol
The UDP protocol is a connectionless protocol. It really does nothing more
than store the source and destination port numbers and make a best effort (so-
called “unreliable”) delivery attempt. There is no mechanism to insure the
packet is delivered. Any requirement for assured delivery and/or error cor-
rection when UDP is used must be handled by the application (application
layer 7) and the network technology (data-link layer 2).
So-called unreliable delivery begs the question; Why would you ever send
data with a protocol that doesn’t follow up on the delivery attempt? A good
example of when the UDP protocol is used is for time-sensitive applications
such as video or audio transmissions. There is no point in retransmitting a lost
packet in real time data streams. Another example is the Trivial File Transfer
04_772739 ch01.qxp 3/3/06 9:20 PM Page 60
60 Chapter 1
Protocol (TFTP), which uses UDP. A TFTP program is often used in lieu of a
traditional FTP application (which uses TCP) for transferring files when
assured delivery is not required. Cisco uses the TFTP protocol to upload the
IOS and configuration file to a router. This process often happens over a local
network, which is usually a reliable medium. The TFTP application uses
checksums for error detection and correction. TCP could be used, but there is
far more overhead involved and file transfers would be slower.
UDP is also the protocol used for broadcast packets. Broadcasts are sent to
all hosts on a subnet and are usually responded to by one host (if that). It
would be pointless to try to assure delivery of all broadcast packets. It’s like
walking into a bar and shouting out “Is Harry here?” You don’t expect every
patron to announce that they are not Harry.
TCP Protocol
The TCP protocol on the other hand goes to great lengths to insure packet
delivery. This is the protocol of choice when packets absolutely, positively have
to get there. TCP handles error detection, error correction, packet re-ordering,
and flow control.
TCP initially sends a SYN9 (synchronize) packet to the destination host. This
is a prerequisite to sending the actual data. A reply from the destination host
verifies it is reachable and includes information about how to set up the con-
nection.
The SYN packet is responded to with an ACK (acknowledgement) packet.
The first SYN and ACK packet contain information the two hosts will use for
numbering packets. Each packet in a TCP communication is numbered for
tracking purposes. The hosts agree on which number to start with for num-
bering packets. This number is known as the sequence number.
Once the ACK packet is received, the sending host sends one additional
packet indicating it has received the reply and has synched to a specific
sequence number. This process is analogous to making a phone call where the
caller says, “Can you hear me?” and the receiver says, “Yeah. Can you hear me?”
and the caller replies, “Yep. I can hear you. Let’s talk.” This entire setup process
is called the 3-way handshake and is used to initiate every TCP session.
At this point, TCP starts sending data packets. For each packet sent, TCP notes
the sequence number and starts a timer. If an ACK for that sequence number is
not received before the timer expires, the packet stream will be re-sent.
Flow control is achieved by throttling the number of packets sent. If packets
are sent faster than the receiving host can process them, they may be dropped
and would have to be re-sent. This slows the communication process. Therefore,
only a given number of packets are transmitted before they must be acknowl-
edged. This is known as a sliding window. A sliding window is simply a buffer
in memory used to store a given number of outbound packets. Once a burst of
packets is transmitted, no others are sent until each packet in the burst is
acknowledged. Then the window “slides” to the next set of packets waiting in
04_772739 ch01.qxp 3/3/06 9:20 PM Page 61
Networking Overview 61
memory and another burst is transmitted. The receiving host can signal the
sending host to increase or decrease the size of the sliding window as the session
proceeds. The initial size of the sliding window is determined during the 3-way
handshake.10
IP Protocol—Layer 3, Network
The IP (Internet Protocol) is responsible for logical packet addressing and for-
warding datagrams. IP header has fields containing the source and destination
IP addresses. IP will determine the “next-hop” of a datagram and forward it to
that address. IP is a connectionless protocol. No session is established before
exchanging data. IP datagrams are forwarded and forgotten. If reliable commu-
nications are required, the layer 4 TCP protocol must be invoked by the send-
ing application. In that case, each IP packet will be encapsulated in a TCP
header. There’s that OSI model at work!
IP Fragmentation
On the sending side, the IP performs fragmentation of outbound datagrams to
accommodate the packet size restriction of the underlying layer 2 data-link
protocol. On the receiving side, the IP reassembles the datagrams.
IP Error Detection
A TTL (Time to Live) field in the IP header contains a starting value that is
decreased at each router the datagram passes through. This causes the data-
gram to expire after a given number of router hops, preventing errant packets
from bouncing around a network in perpetuity. See section 3.1 of RFC 1122 for
a nice terse explanation of the IP’s job.
62 Chapter 1
Networking Overview 63
mask. DHCP can optionally supply many other IP parameters such as default
gateway, DNS addresses, WINS servers, and other items. DHCP is quite help-
ful in a routing environment because it reduces the chances of misconfiguring
critical client information relating to the proper routing of packets (routing
begins at the workstation). DHCP also helps conserve precious host addresses
because addresses are usually leased to the host temporarily. If a host does not
renew its lease periodically, it is presumed to be offline, and the address is
reclaimed to be reused elsewhere. DHCP relies on DHCP servers responding
to requests from hosts for address assignments. Such DHCP servers are con-
figured with a range of addresses available for allocation to the requesting
hosts. A DHCP server is also configured with, and supplies the supporting
configuration information (subnet mask, default gateway, and so on).
When you’re configuring DHCP in a routed environment, it is important to
understand that DHCP uses broadcast packets for a portion of its communica-
tions, because routers do not pass broadcasts by default. When a host first
attempts to contact a DHCP server, it does not know where the server is, so it
broadcasts a special packet with request data that a DHCP server will under-
stand and respond to. After a server responds, further communications are
unicast. However, a host will also use broadcast packets if it’s unable to renew
its lease through its current DHCP server. In that case, broadcast packets are
again used to locate another DHCP server.
Unless a DCHP server is placed on every subnet containing hosts that
require DHCP services, the routers must be configured to pass the DHCP
broadcast packets to a subnet containing a DHCP server. To enable this capa-
bility, Cisco routers are configured with the ip helper-address11 global
configuration command. This command enables pass-through of several types
of broadcast messages (BOOTP, DNS, NetBIOS servers, and so on) and must
be entered with the proper options for the needs of the system.
Notice the reference to BOOTP. BOOTP is the original protocol for auto-
assignment of host addresses that DHCP is based on. DHCP is far more flexi-
ble than BOOTP and replaced it in principal. However, BOOTP is still the
protocol referred to by Cisco routers. That is not a problem, because at the
layer 3 routing level, the information the routers care about is the same
between BOOTP and DHCP. Both protocols use UDP ports 67 and 68 for
DHCP related traffic. The client listens on port 67 and the server listens on port
68. Routers enabled to pass BOOTP broadcasts listen on the same ports to rec-
ognize and direct the packets.
64 Chapter 1
PING.EXE
PING.EXE has the following characteristics:
■■ You use it to check communication link to another host.
■■ It uses the ICMP protocol.
■■ Just type ping at a command prompt to get help for command line
options.
Here are the common command line options:
TRACERT.EXE
TRACERT.EXE has the following characteristics:
■■ You use it to trace which routers a packet travels across to its destination.
■■ It is an extremely helpful utility for determining where the communica-
tion break-down occurs.
■■ It uses ICMP protocol.
■■ Just type tracert to get help for command line options.
Here are the common command line options:
Networking Overview 65
ROUTE.EXE
ROUTE.EXE has the following characteristics:
■■ It displays and optionally alters the route table of a host (not a router).
■■ Just type route to get help for command line options.
Here are the common command line options:
TELNET.EXE
TELNET.EXE has the following characteristics:
■■ You use it to establish a remote control session with another host.
■■ It is commonly used to configure routers.
■■ Type telnet to run Telnet from the RUN command.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 66
66 Chapter 1
NSLOOKUP.EXE
NSLOOKUP.EXE has the following characteristics:
■■ It is a utility for managing and checking configuration of DNS servers.
■■ It tends to be one of the more cantankerous utilities.
■■ It can be used in command line mode or interactive mode.
This utility is typically used to see resource records on DNS servers. Follow
these steps:
1. Start NSLOOKUP. Ignore any messages that might be displayed.
2. Type >ls followed by the domain name you want information on (for
example, type ls widgets.com).
HOSTNAME.EXE
HOSTNAME.EXE has the following characteristics:
■■ It returns the host name of a computer.
■■ No command line options are available.
NETSTAT.EXE
NETSTAT.EXE has the following characteristics:
■■ It displays the connection status and protocol status.
■■ It displays the port number used for a TCP/IP connection.
■■ Just type netstat /? to get help for command line options
ARP.EXE
ARP.EXE has the following characteristics:
■■ It displays and manages local ARP cache.
■■ Just type arp to get help for command line options.
Here are the common, testable command line options:
Networking Overview 67
Notes
1. The notation that ISO stands for the International Organization for
Standardization is not a typo. Rather, it’s an artifact of language transla-
tion. ISO is based in Switzerland.
2. Computer systems vary in how they represent text and data as a binary
code. The letter “A” is represented as 11000001 in ASCII, whereas the
same letter in EBCDIC would be represented as 10000001.
3. In common practice, the term “packet” is often used to refer to the DPU
of any layer.
4. Routers can be configured to forward broadcast packets in special cir-
cumstances, such as for DHCP traffic (see page 62).
5. A DTE/DCE cable is often referred to as a v.35 cable because the two
interfaces it connects follow the v.35 standard for high-speed serial
communications.
6. CSU/DSUs are seen less often, as the telcos are delivering more and
more services with Ethernet interfaces.
7. Cisco routers allow an all-zero network address with the ip subnet-zero
global configuration command. This can cause compatibility issues
with some networking equipment however, and should be employed
with care.
8. It would be unusual for all but the largest ISPs to be assigned an
address with so many hosts in today’s CIDR base world. See the follow-
ing section on CIDR.
9. The SYN packet has gained notoriety because it is used to launch
Denial of Service (DoS) attacks. In a DoS attack, the sending host floods
the target with SYN packets. The target’s TCP buffer fills up and it
becomes too overwhelmed to respond to inquiries, even valid ones.
10. There are additional timers that fine tune how TCP works, but this is
beyond the scope of this review. See Appendix B for recommended
reading.
11. The ip helper-address command and its counterpart, the ip forward-
protocol command, are beyond the scope of this text. Refer to a Cisco
command reference.
04_772739 ch01.qxp 3/3/06 9:20 PM Page 68
05_772739 ch02.qxp 3/3/06 9:21 PM Page 69
CHAPTER
2
Routing Basics
Overview
The purpose of this chapter is to provide foundational information about what
routing is and the basics of how it works. Specifics of routing, such as static
routing, dynamic routing, and routing protocols are provided in subsequent
chapters. The following topics are covered in this chapter:
What is routing 70
Routing begins at home 71
Anatomy of a routed packet 76
Anatomy of a routed table 81
Populating route tables 83
Static and dynamic routing 83
Routing metrics 84
Administrative distance 84
69
05_772739 ch02.qxp 3/3/06 9:21 PM Page 70
70 Chapter 2
KEY TERMS
Routing metric
Cost
Administrative distance
Default gateway
Default route
Gateway of Last Resort
Virtual address
ARP
MAC address
Source routing or source path routing
Static routing
Dynamic routing
Routing protocols
NAT
What Is Routing?
Simply put, routing is the act of forwarding network packets from a source
network to a destination network. This is a straightforward concept in princi-
ple. In practice, you must take into account a variety of considerations to
insure the successful delivery of packets:
■■ When should you route?
■■ What is the best route?
■■ How is the best route determined?
■■ What if the network topology changes?
■■ What if there is a network fault?
■■ What if the destination does not exist?
Routing occurs when a packet must be forwarded off its originating network
(determined by the ANDing process covered in Chapter 1). Any packet with a des-
tination network number that differs from the local network number is, by definition,
destined for another network and must therefore be forwarded to the target network. A
router is the designated networking device for forwarding packets between net-
works. Only a router has the internetwork information and the logic required to
make the correct decision about how best to forward the packet.
05_772739 ch02.qxp 3/3/06 9:21 PM Page 71
Routing Basics 71
Row 1 defines where to send packets for which there is no specific route. This
is known as the default gateway, default route, or Gateway of Last Resort.
The first column in row 1 is the network address. This column lists networks,
as opposed to host addresses (the only exception is the IP address of the local
host itself in row 4). Column 1 will always list every possible network the host
is aware of. The entry the 0.0.0.0 is a wild card representing any network not in
the list, and the IP stack uses the information in this row to determine how to
forward packets whose destination network is not listed in the table. Most
packets bound for another network are sent to the default gateway—a router
will have a more robust route table, and so is better equipped to make the best
decision about how to reach the destination network.
Network Address = 192.100.100.0
05_772739 ch02.qxp
C:>route print
Active Routes:
(1) (2) (3) (4) (5)
9:21 PM
2 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 (local loopback – tests local TCP/IP stack)
Page 72
3 192.100.100.0 255.255.255.0 192.100.100.191 192.100.100.191 1 (Local subnet address. Identifies route to local network)
4 192.100.100.191 255.255.255.255 127.0.0.1 127.0.0.1 1 (Network card address. Identifies route to local address)
6 224.0.0.0 224.0.0.0 192.100.100.191 192.100.100.191 1 (Multicast broadcast address. 224 is a class D address)
(1) Network Destination: The IP address of a host, subnet, network, or Default Gateway.
(2) Netmask: (Subnet mask). Determines what portion of the IP address is the network ID.
(3) Gateway Address The address of a router. Where packets will be forwarded. This will be the Default Gateway address, the local computer’s
IP address, or a generic loopback address (assuming no static routes have been entered).
(4) Interface: How the packets will leave the local host. This will contain the local host’s IP address or the generic loopback address.
(5) Metric The “cost” of the route to the destination network address, usually in terms of time to the destination
Routing Basics 73
Column 2 defines the network mask, if any, for the network number in col-
umn 1. A network mask performs a function similar to a subnet mask. The mask
is used to isolate the network portion of the address. Note that it is a 32-bit num-
ber broken into four octets, just like a network ID. An entry of 255 allows the cor-
responding octet in the network ID to be passed through. An entry of 0 blocks
the corresponding octet. In the case of a default gateway entry, the mask will
usually be the 0.0.0.0. A mask of the 0.0.0.0 effectively means no network num-
ber, equating to “any network.” This is kind of a weird example. The 0.0.0.0 is a
pretty funky mask. More easily understood examples will be shown later.
Column 3 specifies the IP address of the gateway (router). This is the address
that the packets are forwarded to.
Column 4 specifies which local interface to forward packets to in order to
reach the gateway. In the case of a host with only one network interface card
(NIC), this entry is inconsequential. But if the host has two or more NICs
installed, this column provides an opportunity to specify which interface the
packet should be sent to.
Column 5 indicates the metric. A metric is one way to assign a “cost” to a
route. This is not a dollar cost, but rather an indicator of how expensive a route
is in terms of time to delivery. For example, let’s say that a network has been
configured with two separate paths (routes) to a destination network. This is
often done for fault tolerance. However, one path may have a T1 connection
while the other has a far slower 56K connection. Naturally, you want most of
the traffic to go through the path with the T1 link. That is where the metric
comes in. The lower the metric number, the lower the cost of the route. Therefore, if
you assign a metric of 1 to the T1 path and a metric of 2 to the 56K path, the
host will choose the T1 path over the 56K path (unless the TI is down, in which
case it will fall back to the 56K path).
Row 2 is the loopback address, which is used for testing purposes. The RFCs
that specified the assignment of IP addresses reserved the entire the 127.0.0.0
network for testing (too bad). The typical IP address used for loopback testing
is the 127.0.0.1. Try pinging the 127.0.0.1 from your command prompt. The
results should be similar to the output shown in Figure 2-2.
PING TIP
One way to save time with the ping command in Windows is to add the switch
–n 1, which will cause the target to be pinged only once, instead of the default
4 times.
Example: ping –n 1 192.168.1.1
05_772739 ch02.qxp 3/3/06 9:21 PM Page 74
74 Chapter 2
C:>ping 127.0.0.1
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 0ms,
Maximum = 0ms, Average = 0ms
Pinging the loopback address is a quick way to test the integrity of the local
IP stack. A reply indicates that the stack on the local machine is functioning.
Given what you learned about how to interpret row 1, what do the five
columns represent for the loopback test?
■■ Column 1 represents the loopback network.
■■ Column 2 is the network mask. A mask of the 255.0.0.0 passes the first
octet and blocks the remaining octets, exposing a network address 127.
■■ In column 3, a gateway address of the 127.0.0.1 is in actuality a virtual
address that maps to the IP address of the workstation. The IP stack
will send test packets to this make-believe address.
■■ Column 4 indicates to send test packets out the 127.0.0.1, which again is
a fictitious gateway address pointing to the local host’s IP address.
■■ The metric in column 5 has little meaning for a loopback, but it shows
up with the default value of 1.
This entry defines the local network or subnet. The term subnet does not imply
that the network has been subnetted. In this context, it just reflects an individual
network—the one that the host is a part of, as shown in column 1. Column 2
reflects whatever subnet mask was entered into the IP configuration of the host,
in this case a standard class C network. The Gateway and Interface columns
both match the IP address assigned to the host’s NIC. This simply identifies the
route to this host.
05_772739 ch02.qxp 3/3/06 9:21 PM Page 75
Routing Basics 75
To specify the host’s actual IP address in the route table, the address is listed in
the Network Destination column. A netmask of 255.255.255.255 is necessary to
pass all four octets intact and reveal the true host address. The loopback
addresses for Gateway Address and Interface are just placeholders that refer to
the local IP address.
A route table needs to reflect how broadcasts are handled. A way to broadcast
on the subnet is required, plus a way to broadcast to all hosts, everywhere
(scary thought). Also, multicasting is handled here (broadcast to only a subset
of hosts).
Row 5 defines how to broadcast on the local subnet. Rather than identifying a
single host, it identifies all hosts on that subnet. A netmask of the 255.255.255.255
is required to pass the entire address. The host’s IP address is used for both the
Gateway Address and the Interface.
Row 7 is similar to row 5, so it is explained next. It defines how to broadcast
to everybody. Whereas 0.0.0.0 took on the meaning of “any network not in the
list,” 255.255.255.255 takes on the meaning “all hosts on all networks.” As with
the local subnet broadcast entry, a netmask of the 255.255.255.255 allows all
bits to be passed through.
Row 6 sets up a multicast entry. The 224 network is reserved specifically for
multicasting. Multicasting is used to broadcast to a specific subgroup of hosts.
An example of its use would be delivering a pay-per-view seminar across
the web. Some routing protocols use multicasting to communicate between
routers.
Remember that up until now, no action was required on the administrator’s
part to populate the workstation’s route table except to have specified an IP
address, subnet mask, and default gateway address in the IP configuration of
the host. The Windows IP stack did the rest. Meaning, you normally don’t have
to sweat these basic entries. But again, it’s helpful to have an understanding of a
workstation’s route table when it comes time to troubleshoot. In a real life trou-
bleshooting scenario where routing is broken, walking up to a workstation and
running the route print command gives a quick rundown of the host’s IP
05_772739 ch02.qxp 3/3/06 9:21 PM Page 76
76 Chapter 2
address, subnet mask, and default gateway, as well as a list of any specific routes
that have been configured. Put this command in your troubleshooting arsenal
and use it with the ping.exe and tracert.exe commands covered in Chapter 1.
See Chapter 3 for an example of when a workstation’s route table might be man-
ually altered.
Routing Basics 77
3. TCP takes responsibility for insuring the data generated by SMB is sent
to the destination intact. The protocol numbers and tracks each packet
and signs off on the deal only when ACKs (acknowledgements) of each
packet are received from the destination host. TCP, however, has no
knowledge of how to initially locate the destination host, so it calls the
TCP/IP protocol known as IP (network layer 3).
4. IP adds logical addressing information for both source and destination
hosts. The source IP address is known and is added to the IP header of the
packet right away. The only thing known about the destination host how-
ever is its NetBIOS name (the friendly name of the host). A broadcast
packet is sent asking the computer called COMPUTER_B to respond with
its IP address. The packet is sent to IP address the 160.1.255.255, the broad-
cast address for the 160.1.0.0 network. All hosts on the subnet will exam-
ine the packet sent to the 160.1.255.255, but only the host named
COMPUTER_B will respond with its IP address. The newly learned desti-
nation IP address is now added to the IP header of the packet.
5. Now that both the source and destination IP addresses are known, the
ANDing process can be used to determine whether or not the destina-
tion host is on the same network as the sending host. The subnet mask
defined for the source host is applied to both the 160.1.0.1 and the
160.1.0.2 addresses, yielding network numbers the 160.1.0.0 for the
source host and 160.1.0.0 for the destination host. A comparison of the
two numbers reveals the source and destination host are on the same
network. Routing of the packet will not be required.
6. Layer 3 is not done with its work however. Communications do not take
place until the MAC address of both hosts is known. MAC addresses are
the realm of the data-link protocol (Token Ring, Ethernet, and so on),
and since it’s the data-link protocol that actually sends the packet, it
needs to know the MAC address of the target host. If the target’s MAC
address is not in the sending host’s ARP cache, the ARP protocol is
called. ARP sends a broadcast packet to ask for the MAC address of the
160.1.0.2, which replies with its physical (MAC) address. The MAC
addresses are passed to the data-link protocol for the local network
(layer 2).
VARIATIONS ON A THEME
There are in fact many ways the destination IP address might be learned in
step 4. In a Microsoft WINS environment, the address would be retrieved from
the WINS database instead of by broadcast. In a pure WIN2K environment sans
NetBIOS, the IP address would be looked up via Dynamic DNS. Or, in some
cases, the IP address of the destination would already be cached in memory.
05_772739 ch02.qxp 3/3/06 9:21 PM Page 78
78 Chapter 2
7. Armed with the destination’s MAC address, the data-link protocol (let’s
assume Ethernet), vis-à-vis the NIC driver, interfaces with the NIC,
which generates the electrical impulses on the network medium, which
will be heard by the destination host.
8. The two hosts have now communicated. The initial packet stream will
be the 3-way handshake that establishes the session. Then the packets
generated by SMB perform the housekeeping required to prepare for
the file transfer. Finally, the file transfer will commence.
Routing Basics 79
TROUBLESHOOTING TIP
One common place to check when network communications break down is the
default gateway setting on the sending host. If the specified address is
incorrect or missing default routing cannot take place.
It is also common to see problems with the default gateway setting at the
destination host. If a destination host has a misconfigured default gateway,
packets will reach the host, but replies will not return. This would cause a ping
from the source host to the destination host to fail. In this case, the TRACERT.EXE
command would show how far the packet got before it encountered trouble.
Workstations tend to rely more on default gateways than routers (known as
the Gateway of Last Resort on Cisco routers), but default routing is certainly
used on routers, and a router will drop a packet if the destination network is
not in the route table and no default gateway has been configured. Moral of
the story: Check your default gateways along any portion of the path under
your control when troubleshooting failed communications.
05_772739 ch02.qxp 3/3/06 9:21 PM Page 80
80 Chapter 2
What goes out must come back. How do packets find a return path to the
source host? Even in the example of a file transfer, where most packets flow
from the source to the destination, packets flow in both directions if for no
other reason than to return TCP acknowledgement packets, confirming to the
sending host that the packets arrived intact.
In fact, the term “return path” is a misnomer because there is normally no
return path per se—no “trail of breadcrumbs” to follow. What was the
“destination host” becomes the “source host” and vice versa, and the whole
process starts over. The same path determination mechanisms (route tables,
default gateways, etc.) are used to forward packets to the initiating host, so
packets might very well take a different path on their return trip.
The table reveals which router the packet must be forwarded to and
which interface the packet must exit this router from in order to reach
the next identified router. Therefore, the layer 1 and 2 headers are built
for the exit interface’s data-link type and the packet stream is for-
warded through that interface, after an access list check.
2. Now the process simply repeats itself. When the second router receives
the packet everything the first router did is repeated. The layer 2 header
05_772739 ch02.qxp 3/3/06 9:21 PM Page 81
Routing Basics 81
is stripped off, access lists applied to the inbound interface are checked,
and a lookup of the route table is performed. If the destination address of
the packet matches to a directly connected network, the packet is for-
warded out the corresponding interface. Otherwise, the packet is for-
warded to the next hop (router) in the path. (By the way, if at any time a
router’s route table reveals no path to the destination network, a variety
of things may occur, depending on how the router is configured. That
contingency will be covered shortly.)
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
82 Chapter 2
Table 2-1 Simplified View of the Same Route Table. “AD” is short for Administrative
Distance
Routing Basics 83
path. Route tables help packets along their way, one hop at a time. When the
packets arrive at the next hop, the process of path determination starts all over
again. This may seem like a less-than-efficient process, but it works out well
because it provides for great flexibility. There is often more than one path to a
destination, and network links and routers can go down. It is impossible for all
routers in a system to all have up-to-the-minute information at the same
instant. Therefore, a system of recalculating routes after each hop insures more
reliable network communications. The obvious conclusion is that every router
in an internetwork must have a very good idea about which next hop router
will get the packet to its destination most efficiently. This is where dynamic
routing comes in (discussed in Chapter 4).
84 Chapter 2
PROTOCOL PURPOSE
RIP ver 1 (Routing Information Protocol Legacy protocol suited for small
version 1) networks
IGRP (Interior Gateway Routing Protocol) Legacy Cisco specific protocol to replace
RIP
Routing Metrics
The term metric was first introduced when the route table of a local host was
explained earlier. Metrics define the cost of a route in terms of how long it takes
to deliver packets through a particular path. Metrics have special significance
for routing protocols. Each routing protocol has its own formula for assigning
a metric value to a learned route based on factors such as hop count, band-
width, reliability of link, and so on. If a routing protocol learns of more than
one path to a particular network, it will install the route with the lowest metric
into the route table. Depending on the routing protocol, duplicate routes may
be kept as backup routes if the primary route fails, or the routing protocol may
install multiple routes into the route table and forward packets through all
paths to increase throughput.3
Administrative Distance
Administrative distance builds on the concept of a metric, but it works as a more
global means of route selection and comes into play when multiple sources are
providing more than one path to a given network. For example, more than one
routing protocol can run on a single router. Each routing protocol may learn of
the same network, and each protocol will apply its native metrics to determine
05_772739 ch02.qxp 3/3/06 9:21 PM Page 85
Routing Basics 85
which path is most efficient to reach the network. But in the end, two different
protocols each present a candidate path to the same network for inclusion into
the route table. Which route should be installed? An arbitrator is needed to
choose between the two candidates. This is where administrative distance
comes in. An administrative distance value is assigned to every method for
identifying network routes—albeit a directly connected network, a statically
entered route, or a route discovered by a routing protocol.
One way to state the differences between metrics and administrative dis-
tance is to state that metrics ask the question “Which routes that I know of are
the best?” whereas administrative distance asks the question “What source do
I believe more?”
As with metrics, the lower the administrative distance value, the better the
route. The route with the lowest administrative distance is always installed
into the route table. Bear in mind that both metrics and administrative distance
can be manipulated by a network engineer (that’s you).
The default administrative distances are as follows:
Directly connected interface = 0
Static route = 1
EIGRP (summary routes) = 5
BGP (external) = 20
EIGRP (internal) = 90
IGRP = 100
OSPF = 110
RIP = 120
EIGRP (external) = 170
Internal BGP = 200
Unknown = 255
Note that directly connected routes have the lowest administrative distance,
and therefore the highest selection priority. Obviously, if a network is directly
connected to a router, there is no need to forward the packet to a different
router first. Thus, a directly connected route will always take precedence over
any other method of learning about the network. The administrative distance
values assigned to the various routing protocols have evolved as routing pro-
tocols have evolved. For example, RIP is an older protocol with less robust
metrics than OSPF, thus OSPF earns a lower administrative distance value4. A
router will trust an OSPF learned route over a RIP learned route (assuming
both protocols are running on the router). The entries in the above list will
make more sense as you complete the subsequent chapters.
05_772739 ch02.qxp 3/3/06 9:21 PM Page 86
86 Chapter 2
Summary
This chapter provided you with insight into why and how packets get routed.
Specifically, it covered the following:
■■ Routing is the process of forwarding packets from one network to
another. The ANDing process running on the source host determines if
the IP address of a destination packet needs to be routed to another
network.
■■ A variety of devices forward packets from point A to point B (hubs,
routers, switches, and firewalls), but only routers have the ability to
locate and forward packets to another network.
■■ One seeming exception to the requirement that routers forward packets
between networks is Network Address Translation (NAT). Although
NAT forwards packets off the network, it is not true routing because
NAT does not incorporate route tables or make decisions about how
and where to route packets. Proxy servers and gateways are another
exception for the same reason.
■■ Routing devices must determine valid, economical paths to all destina-
tion networks and respond to changing network conditions.
■■ Route determination begins at the workstation. A workstation’s route
table usually indicates only the path of a default route, a place where
outbound packets with no listed path are sent. However, static routes
specifying the path to specific networks can be inserted into a worksta-
tion’s route table.
■■ Routers determine the path to a network through the use of routing
tables which list known networks. Route tables are populated in one of
three ways: directly connected networks are added to the table auto-
matically, routes learned through one or more routing protocols are
added automatically, or routes can be manually added as static routes.
■■ Route tables do not contain the full path that packets will take to reach
their destination. Rather, a routing table simply specifies the next router
to forward the packet to, pushing the packet closer to its destination.
Each router receiving a packet will in turn determine the best path and
forward the packet to the next router.
■■ Routing metrics and administrative distance are the two mechanisms
that determine route selection when multiple paths to a destination net-
work exist. Metrics are used to determine the best route learned from a
specific source, and are heavily used with dynamic routing protocols.
Each routing protocol will choose the best path from among multiple
05_772739 ch02.qxp 3/3/06 9:21 PM Page 87
Routing Basics 87
possible paths by picking the route with the lowest metric (cost).
Administrative distance is used to choose the best route if the same net-
work is learned from more than one source— the same network may be
known through a direct connection, a static entry, or from one or more
routing protocols running on the same router.
■■ Default routes are used to forward packets when no match is found for
a packet’s destination address in the route table.
It is now time to delve into the specifics of static and dynamic routing—the two
principal ways network routes are installed into route tables. Chapter 3 is a short
but important chapter on how to configure static routes, and how to know when
static routes are required. Chapter 4, in covering routing protocols, not only acts
as a springboard for the subsequent chapters on the specific routing protocols,
but it covers a broad array of critical routing concepts as well.
05_772739 ch02.qxp 3/3/06 9:21 PM Page 88
88 Chapter 2
Notes
1. If more than one path is found, the route with the lowest metric is cho-
sen and the path is considered to be determined. In either case, packets
are then forwarded to the router specified by the entry.
2. Routing protocols can be designed to contain the complete path to the
destination within the network packet (rather then just the source and
destination addresses). In this case, all routing decisions are made at the
router sourcing the packet. This is known as source routing. Most rout-
ing protocols do not incorporate source routing because allowing rout-
ing decisions to be made at each router along the path, on-the-fly,
provides far more flexibility. Source routing, when it’s used, tends to be
implemented at the data-link layer. It is also worth noting that some
protocols, like OSPF, in certain cases keeps the full path to a destination
stored in a special table. However, the route table for OSPF still func-
tions on a hop-by-hop basis.
3. Chapter 4 discusses routing metrics further.
4. The Cisco IOS makes use of the “distance” command to alter the
default administrative distance. Default routing metrics can be also
altered when entering a static route or when configuring a routing
protocol. Specifics are given in the relevant chapters covering routing
protocols.
06_772739 ch03.qxp 3/3/06 9:21 PM Page 89
CHAPTER
3
Static Routing
Overview
This chapter explains the various aspects of static routing. Static routing is
often used in lieu of, or in conjunction with, dynamic routing protocols. The
following topics are covered:
What is static routing? 90
When to use static routes 90
Configuring static routes on a router 91
Static default routes 95
Static routes on a workstation 98
Floating static routes 100
Propagating static routes 100
89
06_772739 ch03.qxp 3/3/06 9:21 PM Page 90
90 Chapter 3
KEY TERMS
Static route
ip route command
Static default route
Floating static routes
Route Add command
ODR: On Demand Routing
Static Routing 91
E0 E0 E0
S0 S1
S0 S0
A
200.1.1.17/28 B
200.1.1.33/28 C
200.1.1.18/28 200.1.1.34/28
92 Chapter 3
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 3-2 Results of the show ip route command on router A—no static routes yet.
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 3-3 Results of the show ip route command on router B—no static routes yet.
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 3-4 Results of the show ip route command on router C—no static routes yet.
06_772739 ch03.qxp 3/3/06 9:21 PM Page 93
Static Routing 93
routerA#config-term
routerA(config)#ip route 192.168.2.0 255.255.255.0 200.1.1.18 (1)
routerA(config)#ip route 192.168.3.0 255.255.255.0 200.1.1.18 (2)
routerB#config-term
routerB(config)#ip route 192.168.1.0 255.255.255.0 200.1.1.17 (3)
routerB(config)#ip route 192.168.3.0 255.255.255.0 200.1.1.34 (4)
routerC#config-term
routerC(config)#ip route 192.168.1.0 255.255.255.0 200.1.1.33 (5)
routerC(config)#ip route 192.168.2.0 255.255.255.0 200.1.1.33 (6)
94 Chapter 3
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Packets can now find their way to any destination on the example network.
Pretty straightforward, right? Just keep in mind that we are not necessarily
saying this is the only way to configure such a network. Rather, it is one way.
There are other ways the same objective could have been met. One method is
to go ahead and implement a dynamic routing protocol, which is covered in
the next chapter. Another method is outlined next.
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Static Routing 95
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
routerA#config-term
routerA(config)#ip route 0.0.0.0 0.0.0.0 200.1.1.18 (1)
routerB#config-term
06_772739 ch03.qxp 3/3/06 9:21 PM Page 96
96 Chapter 3
routerC#config-term
routerC(config)#ip route 0.0.0.0 0.0.0.0 200.1.1.33 (4)
(1) Set a static default route that points to the next hop router.
(2) Create a static route, same as before.
(3) Create a static route, same as before.
(4) Set a static default route that points to the next hop router.
The route tables in Figures 3-8, 3-9, and 3-10 now reflect that a Gateway of
Last Resort exists.
To take as an example a packet sent from the 192.168.1.0 to the 192.168.3.0,
router A will forward the packet to its default gateway (the 200.1.1.18) when it
can’t find a match for the destination network in its route table. Router B will
find a match and the packet will successfully reach its destination. Note that
router A and B use the 0.0.0.0 network to represent the default route.
One advantage to this configuration is that if a fourth router is added down-
stream of either of the routers configured with a default gateway, fewer routers
will need to have their configurations changed. The routers would simply for-
ward packets with destination addresses not matching an entry in the route
table to the Gateway of Last Resort. Naturally, attention must be paid in con-
figuring static default routes that packets forwarded to the default gateway
will eventually reach their destination. Many more examples of default rout-
ing will be presented throughout the book, but the real lesson here is that there
is often more than one way to configure a routing scheme and one method
might work better than another. This gives you an opportunity to stand out in
your field by thinking through a better solution.
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Static Routing 97
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
N OT E The static default route technique will not work on router B because
router B has two interfaces connecting to other networks. Packets from router B
bound for the 192.168.1.0 must exit through the S0 interface, whereas packets
bound for the 192.168.3.0 must be forwarded through interface S1. In this case,
the specific routes must be added to the route tables.
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
98 Chapter 3
Router
192.168.1.0/24 A 192.168.2.0/24
.1 .254 .254 .1
Static Routing 99
The
Internet
Router
B
.254
192.168.3.0
Router
192.168.1.0/24 A 192.168.2.0/24
.1 .254 .254 .1
You should be able to see both the advantages and disadvantages to setting a
workstation’s default gateway to point to the Internet. While modifying the
workstation’s route table certainly optimizes routing, the downside is that each
internal network must be listed in the route table of each workstation on
192.168.1.0. Some administrators might balk at this idea, but it all depends on
your network and how fast it’s growing. With workstation imaging being so
prevalent, some would consider the modification of the default route table as
simply another of many configuration settings.
06_772739 ch03.qxp 3/3/06 9:21 PM Page 100
100 Chapter 3
Summary
This chapter covered the following:
■■ Static routes are routes manually added to a routing table.
■■ Static routes may be suitable for smaller networks without redundant
network links.
■■ Static routes are often employed in conjunction with dynamic routing
protocols and as default gateways to solve specific network configura-
tion issues.
■■ Static routes are configured with the ip route command on Cisco
routers.
■■ Static routes have an administrative distance value of 1, which means
by default, a static route will always be chosen over a route learned
from any routing protocol. Only directly connected routes have a higher
precedence.
■■ Floating static routes have had their administrative distance altered to a
higher value so that they are only installed in the route table if another
route to the same network is lost.
■■ Cisco provides the ODR (On Demand Routing) facility as an alternative
to using static routing.
■■ Static routes, and static default routes can be propagated throughout
the system by way of routing protocols. (See Chapter 10 for details.)
06_772739 ch03.qxp 3/3/06 9:21 PM Page 102
102 Chapter 3
Notes
1. Cisco introduced a facility in later versions of its IOS called On Demand
Routing (ODR). ODR reduces the need for static routing, providing a
“best-of-both-worlds” solution between static and dynamic routing in
very specific cases. ODR is not covered in this book.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 103
CHAPTER
4
Dynamic Routing
Overview
This chapter explains the heady topic of dynamic routing. It is a prelude to the
subsequent chapters that cover specific dynamic routing protocols. A number
of examples are given that illustrate important routing concepts such as class-
less routing, route summarization, longest match principal, and so on. The fol-
lowing topics are covered:
The need for an automated routing solution 104
What is a routing protocol? 105
Considerations for designing routing protocols 106
Metrics of routing protocols 107
Categorizing dynamic routing protocols 108
Route summarization 119
103
07_772739 ch04.qxp 3/3/06 9:22 PM Page 104
104 Chapter 4
KEY TERMS
106 Chapter 4
108 Chapter 4
Is there a difference between the term metric and the term cost? If there is,
it’s minor, as whatever distinction existed between the terms has blurred over
the years. Think of “metric” as a generic reference to the concept of a routing
protocol choosing one route over another, whereas “cost” is often embodied as
a specific value (like “1” or “1784”), and composed of whatever metric criteria
the protocol uses: hop count, bandwidth, delay, and so on.
But there are no hard and fast rules for how the terms interrelate. For
example, the popular Dijkstra algorithm uses a metric defined as cost, with
“cost” not being specified. OSPF, which uses the Dijkstra algorithm, often
defines cost as the bandwidth of the network link. Bandwidth is explained in
many texts as one of the criteria composing a metric! Go figure.
Not all routing protocols implement each of the aforementioned factors. One
reason for the plethora of routing protocols that have been developed, has to
with the difference in the metrics each protocol employs. Over the years metrics
have improved. Newer routing protocols incorporate these improvements.
Most routing protocols are interior protocols. The only exterior routing pro-
tocol in common use is BGP (Border Gateway Protocol). BGP is used exten-
sively in the Internet, tying together thousands of autonomous systems.
Synonymous terms for interior versus exterior protocols are intradomain ver-
sus interdomain and intranetwork versus internetwork. You will also see the
acronyms IGP (Interior Gateway Protocol) and EGP (Exterior Gateway Proto-
col). These acronyms refer to interior and exterior routing protocols as a group.
Table 4-1 lists the common routing protocols classified by interior versus
exterior.
PROTOCOL INTERIOR/EXTERIOR
110 Chapter 4
Psst. Hey neighbor, I know Psst. Hey neighbor, I know Wow! I known about the,
about the 192.168.1.0 and about the 192.168.10.0, the 192.168.100.0, 200.2.2.2,
the 200.1.1.0. 200.1.1.0, the 200.2.2.0, and 200.1.1.0, 192.168.10.0,
the 192.168.1.0. and the 192.168.1.0.
Vectors
In a distance vector environment, each router keeps a vector for each destina-
tion network. A vector is simply a direction, taking the form of the next hop
router the packet will be forwarded to on the way to its destination. The router
stores the IP address of the router that reported the lowest cost path. This
router is called the next hop because it is the next location packets will be for-
warded to on the way to the destination network.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 111
N OT E Even though IGRP does not employ hop count in its metric, the term
“next hop router” applies even to routing protocols that don’t employ hop
count in ther metric.
Once again, distance is derived from the metric of a route; how far it is to the
destination network; while vector is simply the direction a packet is forwarded
as it leaves the router; which interface the packet leaves from. Thus we have
the distance vector protocol.
112 Chapter 4
E0 E0 E0 E0
S0 S1 S1
S0 S0 S0
A T1 B T1 C T1 D
S1 S1
56K
S0 S1
E 56K
Subnet 4 Subnet 5
Figure 4-2 Network diagram showing two paths from network 1 to network 4—hop count
used as metric.4
Table 4-2 shows router A’s route table after the distance vector protocol has
run (simplified).
As networks started growing in size, the designers of distance vector routing
protocols realized the limitations of using hop count for determining path
length. IGRP, a proprietary Cisco routing protocol introduced after RIP, use
bandwidth (and other factors) to determine the distance to a network. Refer
again to Figure 4-2, but this time running a distance vector routing protocol that
incorporates bandwidth in determining distance.
After all routers have broadcast their route tables, but before the distance
vector protocol has run, router A will know the following (simplified):
I am directly connected to network 1 via Ethernet interface 0.
I am directly connected to subnet 1 via serial interface 0.
I am directly connected to subnet 4 via serial interface 1.
Network 2 is reachable through a 1,544 Kbps link via serial interface 0.
Network 2 is reachable through two 56K links and two 1,544 Kbps links
via serial interface 1.
Network 3 is reachable through two 1,544 Kbps links via serial interface 0.
Network 3 is reachable through two 56K links and one 1,544 Kbps link
via serial interface 1.
Network 4 is reachable through three 1,544 Kbps links via serial
interface 0.
Network 4 is reachable through two 56K links via serial interface 1.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 113
Network 2 S0 1
Network 3 S0 2
Network 4 S1 2
When the distance vector algorithm for IGRP is run, the links to the net-
works will be taken into account and the three-router hop across the T1 links
to network 4 will win over the two-router hop across the slower 56K links.
Table 4-3 shows router A’s route table after the distance vector protocol has
run—bandwidth is used for path determination.
Network 2 S0 1
Network 3 S0 2
Network 4 S0 3
07_772739 ch04.qxp 3/3/06 9:22 PM Page 114
114 Chapter 4
For all the aforementioned reasons, distance vector routing protocols are
suitable only for smaller networks.
116 Chapter 4
Router A knows a lot! So does every router in the system. Each router liter-
ally has a map of the network topology. They see what you see in the diagram.
Each router not only knows how many total routers are in the area, they know
which network is connected to which router and the speed of each network
link. From this information, the Dijkstra algorithm is run and the route table is
built.
As you can see, the key difference with link-state protocols over distance
vector protocols is that link-state protocols don’t need to be told the distance to
a network by another router. Link-state routers make that calculation for them-
selves because they have enough information to do so.
118 Chapter 4
Route Summarization
In this all-important section of the book, we are taking a broad approach to
route summarization. Rather than try and break this topic out and explain
summarization in a compartmentalized fashion, it is being treated in-context
with the peripheral networking issues surrounding summarization. The fol-
lowing topics are covered in this section:
■■ Route summarization with interior routing protocols
■■ Several examples of networking with classless routing protocols
■■ Reinforcement of classless addressing concepts: subnetting, VLSMs,
and CIDR
■■ Discontiguous networks and the special handling they require
■■ Longest-match algorithm—how routers actually match a network to a
route table entry
■■ Using summarization in a hierarchical addressing scheme
120 Chapter 4
PROTOCOL SUMMARIZATION
PROTOCOL SUMMARIZATION
Can be disabled.
Network Example 1
Classfully addressed network
No summarization
Allocated IP addresses: 150.1.0.0/16, 150.2.0.0/16, 150.3.0.0/16
Figure 4-4 portrays a simple, routed network employing pre-CIDR network
addresses. Router A connects the departmental networks. Router B is a border
(edge) router connecting to the Internet. Router A has sent its route table to
router B. Note that the prefix was advertised with the route. Packets from the
Internet destined for any of the three networks will be directed to router A.
Table 4-9 shows a simplified view of router B’s route table.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 122
122 Chapter 4
The
Internet
150.1.0.0/16
150.1.1.1 (incoming packet)
S0
S0
150.2.0.0/16 A 200.1.1.5/30 200.1.1.6/30 B
150.3.0.0/16
Figure 4-4 Network model for summarization example 1.
N OT E Normally only the prefix of the address is stored in the route table. The
diagram shows the entire 32 bits of the address with the network portion in
bold for illustrative purposes only.
Although explicit matches are often made on a destination address, this is not
always the case. Sometimes two or more entries in the table may match the
address and in that case the table entry with the greatest number of matching
prefix bits is selected—thus the term longest match. The ambiguity of multiple
route table matches to an address is usually due to the use of variable length
subnet masks. Upcoming example 3 demonstrates the longest match principal
at work in a VLSM networking model.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 124
124 Chapter 4
Now that the match is made, router B forwards the packet out the interface
specified for the 150.1.0.0 network (S0). Router A then delivers the packet to its
directly connected interface for the destination address, using the same look-
up method.
Network Example 2
Classlessly addressed network
Summarization occurs automatically with certain protocols
Allocated IP address 150.1.0.0/21
Figure 4-6 is the same network from the previous example, except that the
organization has been assigned a CIDR address with a /21 prefix. The assign-
ing authority controls the first 21 bits of this address, but the organization can
manipulate the remaining 11 bits to tailor whatever number of subnets and
hosts per subnet it requires. The address as supplied creates a single network
address, 150.1.0.0 /21, with 2,046 hosts (211 – 2). Since the organization actually
requires several subnets capable of supporting up to 200 hosts per subnet,
the prefix is altered to /24. This modification creates the addressing scheme
reflected in Table 4-10.
The organization then implements three of the derived subnets on router B’s
connected networks by configuring the router with the three addresses using
the /24 prefix. The specifics of how this is done for each routing protocol will
be given in the chapter that covers the protocol.
The
Internet
150.1.1.0/24
150.1.1.1 (incoming packet)
S0
S0
150.1.2.0/24 A 200.1.1.5/30 200.1.1.6/30 B
150.1.3.0/24
Figure 4-6 Network model for summarization example 2.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 125
126 Chapter 4
Router A has advertised a single route representing its three connected net-
works. It has summarized the three /24 networks to the classful border of /16.
This is the default behavior of RIPv2 and EIGRP. These two routing protocols
automatically summarize routes in certain cases. This behavior is known as
auto-summarization. OSPF on the other hand, does not auto-summarize. Any
summarization performed by OSPF must be manually configured. Let’s
assume for the purpose of this example that OSPF has been configured to sum-
marize router A’s subnets in the same manner.
The problem however, is that the summarized address listed in router B’s
route table covers the entire range of subnets of the 150.1.0.0 /16, but not all of
those subnets are configured on router A. In fact, the organization does not even
own this entire address range. These routes have been over-summarized by
router A. Setting aside the fact that router A is listing subnets it does not have
routes to, the next example illustrates how deploying additional subnets of the
150.1.0.0 /21 on another router will break routing within the organization.
Network Example 3
Classless addressing
Summarization occurs automatically with certain protocols
Routing fails due to discontiguous network
Allocated IP address 150.1.0.0/21
In Figure 4-8 additional subnets of the 150.1.0.0 /21 have been deployed with
the same /24 prefix used on router A. How will these routes be advertised to
router B? Table 4-12 shows that router B is having trouble.
The
Internet
150.1.1.0/24
150.1.1.1 (incoming packet)
S0
S0
150.1.2.0/24 A 200.1.1.5/30 200.1.1.6/30 B
200.1.1.9/30 S1
150.1.3.0/24
200.1.1.10/30 S0
150.1.4.0/24 C 150.1.5.0/24
Figure 4-8 Network model for summarization example 3.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 128
128 Chapter 4
Table 4-12 Router A’s Attempt to Handle Two Routers Advertising the Same Address
Discontiguous Networks
What has been created here is a discontiguous network. A discontiguous net-
work is defined as a major network (a classful network address), being sepa-
rated by another major network. In the example, the major network 150.1.0.0 is
being separated by major network 200.1.1.0. If router B is fooled into thinking
that both paths are valid for all subnets of the 150.1.0.0, it will accept the routes
and try to load balance between the two paths. Naturally some number of
packets will find their destination network and some will not. The symptom of
the problem will be an intermittent routing problem and would be difficult to
troubleshoot.11
130 Chapter 4
RIPV2 CONFUSION?
RIPv2, EIGRP, and OSPF all support summarization at the bit boundary. There
are texts on routing that dispute this assertion in regards to RIPv2. But in fact,
only Cisco’s implementation of RIPv2 supports bit level summarization, and
only in IOS ver 12.1 or better.
The three networks connected to router A are shown here in binary (also
shown is 150.1.0.0 /24, because it falls within the same bit pattern range as the
other three subnets). The common bits are shown in bold. There are 22 high-
order bits in common among the addresses, thus the prefix /22 (255.255.252.0)
is the desired mask. It’s that simple. The following is an example of entering
the command for EIGRP (RIPv2 uses the same commands, but OSPF uses a
different command and syntax):
Now only the previously specified range of adresses will be advertised! The
routes will now be summarized from router A as 150.1.1.0 /22. Note that the
commands are entered at the interface level. Only routes advertised through the
specified interface are affected by the summary command.
Now for router C. The drill is the same. The number of bits common to all
subnets of the 150.1.x.x is used as the prefix number for the mask in the ip
summary-address command:
10010110.00000001.00000100.00000000 (150.1.4.0)
10010110.00000001.00000101.00000000 (150.1.5.0)
10010110.00000001.00000110.00000000 (150.1.6.0)
10010110.00000001.00000111.00000000 (150.1.7.0)
Note that the address at the beginning of the range is the one specified in the
statement. The routes will now be summarized from router B as 150.1.4.0 /21.
One notable difference for router C is that the range enclosed by the mask
encompasses more than just the two subnets connected to the router. The
remaining two subnets are also part of the summarized address because they
are within the same unique 3-bit pattern as the other subnets, even though
they are not currently in use. This demonstrates that the granularity of control
07_772739 ch04.qxp 3/3/06 9:22 PM Page 131
over which networks are summarized extends down to the bit boundary, but
no further. If either the 150.1.6.0 or the 150.1.7.0 network is ever used it must be
implemented at router C, or downstream of router C. Table 4-13 shows the
results on router B.
Note that the route table is now populated in such a manner as to be able to
forward packets bound for subnets of the 150.1.0.0 correctly. But don’t just take
our word for it. Let’s prove that this particular brand of madness works by
again tracing the path of an incoming packet.
In this case however the diagram for showing the incoming packet making
a match to a route table entry has been altered. A more sophisticated diagram
is required to reveal a subtle change in how a match is made when bit-level
summarization is in use, as follows:
132 Chapter 4
The correct route is chosen, and the packet is correctly forwarded out of the
serial 2 interface to router C.
Network Example 4
Classlessly addressed network with VLSMs
No summarization occurs by default due to contiguous network
Allocated IP address 150.1.0.0/24
Figure 4-10 illustrates a network model that employs VLSMs on router A. In
this model, the network also happens to be contiguous, because no major net-
work boundaries are crossed when routers advertise their route. Therefore,
RIPv2 and EIGRP won’t try to auto-summarize routes. Table 4-14 shows router
B’s route table before manual summarization is configured.
The
Internet
150.1.1.0/24
150.1.1.1 (incoming packet)
S0
S0
150.1.2.0/25 A 200.1.6.5/30 200.1.6.6/30 B
S1 200.1.6.9/30 S1
150.1.2.128/25
200.1.6.10/30 S0
150.1.4.0/24 C 150.1.5.0/24
Figure 4-10 Network model for summarization example 4.
07_772739 ch04.qxp 3/3/06 9:22 PM Page 133
As you can see, even with variable subnetting there are 22 high-order bits in
common, so the same /22 mask will be used in the summarization command
as was used in the previous example. Table 4-15 shows router B’s route table
after manually summarizing router A’s networks.
134 Chapter 4
Router C’s subnets cannot be summarized and this fact has nothing to do
with VLSMs. Why? Note that the point-to-point links are employing a subnet ID
within the range of subnets that would be summarized at router C, which as
demonstrated in the previous example is 150.1.4.0 – 150.1.7.0. Because a subnet
within this range is configured on another router, the range is discontiguous and
cannot be summarized. Moral of the story: Plan your network addressing well.
Summary
As you can see, summarization is a powerful tool for managing routing
updates. It must be used with caution though as you need to be aware of when
summarization takes place and the range of subnets that are summarized. This
chapter covered the following:
■■ Dynamic routing protocols are used to automatically populate and
maintain route tables with the best paths to networks.
■■ A variety of routing protocols have been developed over the years. As
networks have grown in size, routing protocols have evolved to keep
up with the demands placed on them.
■■ Routing metrics help a routing protocol choose the best route when
multiple paths to the same network exist.
■■ Routing protocols are categorized by several criteria:
■■ Interior versus exterior: Used within an autonomous system or
between autonomous systems, respectfully.
■■ Distance vector versus link-state: Distance vector protocols com-
municate only with neighboring routers (routing by rumor),
whereas link-state protocols build topology maps by talking to all
routers in the area.
■■ Singlepath versus multipath: Multipath protocols can keep more
than one path to a network in the route table and optionally load
balance among the routes.
■■ Broadcast versus multicast: Some routing protocols are capable of
sending route updates using unicasts and multicasts rather than
broadcasts.
■■ Flat versus hierarchical: Some routing protocols are capable of
being configured in a hierarchical architecture to minimize routing
updates.
■■ Classful versus classless: Classful protocols have limited support
for classless addressing and no support for VLSMs or discontiguous
07_772739 ch04.qxp 3/3/06 9:22 PM Page 135
136 Chapter 4
Notes
1. IS-IS was developed around the time OSPF was, but for several reasons
never gained wide acceptance. Therefore, it will not be covered in
this book.
2. Chapter 10 describes a facility known as redistribution, which allows
the routes learned by one routing protocol to be shared with other rout-
ing protocols.
3. Chapter 5 describes routing-loops in detail.
4. The terms network and subnet are being used simply to make it easy to
distinguish the networks that contain hosts from the WAN links con-
necting the routers.
5. OSPF sends infrequent, periodic updates as a backup mechanism to
insure that all route tables are synchronized.
6. Cisco’s implementation of RIP is multipath in that it incorporates load
balancing on multiple paths, but only if each path has the exact same
metric value (known as equal cost multipath routing).
7. Some vendor implementations allow for multipath routing.
8. Although EIGRP is not hierarchical in the strictest sense, routing
updates can be confined to specific sections of the network in a variety
of ways. See the treatment of EIGRP in Chapter 7.
9. RIPv2 only summarizes at the bit boundary with Cisco IOS 12.1 or
higher.
10. In fact, the address may be summarized even further for the majority of
the Internet, especially if the entire 150.1.0.0 was allocated to a single
ISP. This concept was explained in the CIDR section of Chapter 1.
11. In point of fact, the two erroneous entries may or may not show up in the
route table, depending on the protocol in use and how it is configured.
12. Another way to deal with the scenario would be to institute static
routes to the individual subnets. You could manually configure static
routes on the routers that would point to the discontiguous networks.
But that is defeating the purpose of dynamic routing, isn’t it?
13. The “1” in the command line refers to an autonomous system number
identifying which EIGRP process will be affected by the command and
has nothing to do with the summary-address command.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 137
CHAPTER
5
RIP
Overview
RIP stands for Routing Information Protocol. It is the oldest interior routing
protocol still in common use and it is widely supported. Version 2 supports
classlessly addressed networks. It is not suitable for large networks. Table 5-1
shows the basic characteristics of RIP.
137
08_772739 ch05.qxp 3/3/06 9:23 PM Page 138
138 Chapter 5
RIP 139
RIP Background
RIP was the first interior routing protocol to achieve widespread use. It is a dis-
tance vector protocol suitable for smaller systems without multiple redundant
paths to networks. While some would say RIP is more of a rotting protocol than
a routing protocol, it still sees use. Like so many other computer technologies,
RIP was created at Xerox PARC (Palo Alto Research Center) in the late 1970s.
Although you may have no immediate need to understand distance vector
protocols, you should read this chapter because routing loops are covered in
the greatest detail here. It’s also good to be familiar with RIP because other
routing protocols are often compared to RIP when their various features are
explained.
RIP is based on the Bellman-Ford algorithm, which it uses to compute the
metric for a route. The algorithm uses hop count as the metric for stating the
cost to a network. Hop count is simply a value that states how many routers
(hops) a packet must pass through to arrive at the destination network. RIP
cannot take into account variables such as bandwidth, load, reliability, and
other factors that can dramatically influence the time required to deliver pack-
ets. Given a choice of two possible paths, a distance vector protocol such as
RIP will always choose the path with the lowest hop count, even though a path
with more hops may be preferable due to say, higher speed network links.1
RIP communicates via UDP port 520. RIP has an administrative distance
of 120.
RIP Versions
There are two versions of RIP. Version 1 (RIPv1) is a classful routing protocol
and therefore has only limited support for classless addressing. Classful rout-
ing protocols are not considered viable for today’s CIDR-based world, so cov-
erage of RIPv1 is limited here. There are very few networking environments
that cannot upgrade from a classful routing protocol, and where they are
employed it is likely a privately addressed, classfully addressed system
behind a NAT box or gateway of some type.
Version 2 of RIP (RIPv2), released in 1993 under RFC 2453, added several
enhancements, the most important of which was support for classless address-
ing through inclusion of the subnet mask in routing advertisements. RIPv2
therefore fully supports CIDR addresses, subnetting, VLSMs, and—with ver-
sion 12.1 or higher of the Cisco IOS—even discontiguous networks, thanks to
the inclusion of bit-level summarization.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 140
140 Chapter 5
RIPv2 Improvements
■■ Auto-summarization is on by default, but summarization can either be
disabled entirely, or manually configured to summarize subnets at any
bit boundary.
■■ Multicasts are used rather than broadcasts to communicate with neigh-
boring routers. RIPv2 routers listen on multicast address 224.0.0.9 for
RIPv2 updates. This reduces the processing on network hosts that don’t
care about RIP traffic (unicasts and multicasts are not processed by
other hosts once it is discovered that the MAC address does not match).
■■ RIPv2 supports simple password authentication to verify the genuine-
ness of incoming update packets.
■■ A field was added to the RIP header that allows a value to be associated
with a route known as a route tag. Route tags are used with route redis-
tribution, which is covered in Chapter 10.
■■ The next hop field was added in RIPv2 to allow better integration with
OSPF networks by potentially reducing the number of hops to an OSPF
network. This field potentially avoids routing loops because the
receiver can see if its own address is listed as the next hop.
Advertising Routes
When a router running RIP is first booted, it builds a route table that contains
only the directly connected networks and any statically added routes. Once
initialized, the router then broadcasts its entire route table to its immediate
neighboring routers. In RIP, a neighboring router is any router with an inter-
face sharing a common link with another router. In other words, a router one
hop away. By default, the IP implementation of RIP advertises the route table
to its neighbors every 30 seconds. A small time variance, sometimes termed
“jitter,” is introduced so that not all updates are triggered at the exact same
instant.
By default, RIP will advertise the entire route table out each interface
enabled for RIP. Individual interfaces can be configured to not propagate the
route table, yet still advertise the associated network out other interfaces. This
prevents advertising routing updates unnecessarily out interfaces with no
neighboring router (stub networks that only contain workstations).
08_772739 ch05.qxp 3/3/06 9:23 PM Page 141
RIP 141
Learning Routes
RIP-enabled routers learn about networks from other RIP-enabled routers via
the advertisements just described. When a router running RIP learns of a qual-
ifying route to a network from a neighboring router it adds the route to its own
route table after first bumping the hop count by one. The router then adver-
tises the new route, along with the existing routes it is aware of, to its other
neighbors2 at a predetermined time interval. For example, let’s say a router
learns about a network x that is two hops away. That router will in effect say to
its neighboring routers; “You can get to network x by going through me. Net-
work x is three hops away.”
RIP routing updates cascade throughout the autonomous system. After
being initialized, every router in the system ultimately learns the path to every
network advertised by RIP. When a change to a network link occurs the
affected router updates its neighbors, who in turn update their neighbors, and
so on. The time it takes for all routers to learn about all routes is referred to as
convergence. When all route tables have the same information they are con-
sidered converged or normalized.
Even after the route tables have converged, RIP routers continue to broad-
cast their entire route table every 30 seconds, even if no changes take place.
This makes for a chatty protocol. The overall design of RIP (and IGRP) requires
a fair amount of bandwidth for router-to-router communications.
142 Chapter 5
In Figure 5-1, RIP has learned about three routes from its neighbors. Note
that the routes all have an administrative distance value of 120, the default
value for the RIP protocol. Two of the routes are one hop away and one route
is two hops away. The only route timer displayed with the show ip route com-
mand is the invalid timer, which indicates how long since the last update was
received for the route. RIP maintains more timers than just the update timer
though. (All the timers will be covered shortly.)
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 5-1 Route table indicates RIP routes with an “R” preceding the entry.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 143
RIP 143
E0 E0 E0
S1 S1
S0 S0
A
200.1.1.5/30 B
200.1.1.9/30 C
200.1.1.6/30 200.1.1.10/30
Route table for router A (simplified) Route table for router C (simplified)
network mask next hop int a/m Network mask next hop int a/m
192.168.10.0 /24 (direct) E0 0/0 192.168.30.0 /24 (direct) E0 0/0
200.1.1.4 /30 (direct) S1 0/0 200.1.1.8 /30 (direct) S0 0/0
Figure 5-2 Route tables upon boot (no RIP traffic yet).
E0 E0 E0
S1 S1
S0 S0
A
200.1.1.5/30 B
200.1.1.9/30 C
200.1.1.6/30 200.1.1.10/30
Route table for router A (simplified) Route table for router C (simplified)
network mask next hop int a/m Network mask next hop int a/m
192.168.10.0 /24 (direct) E0 0/0 192.168.30.0 /24 (direct) E0 0/0
200.1.1.4 /30 (direct) S1 0/0 200.1.1.8 /30 (direct) S0 0/0
Figure 5-3 Route tables after router A advertises its networks to router B.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 144
144 Chapter 5
E0 E0 E0
S1 S1
S0 S0
A
200.1.1.5/30 B
200.1.1.9/30 C
200.1.1.6/30 200.1.1.10/30
Route table for router A (simplified) Route table for router C (simplified)
network mask next hop int a/m Network mask next hop int a/m
192.168.10.0 /24 (direct) E0 0/0 192.168.30.0 /24 (direct) E0 0/0
200.1.1.4 /30 (direct) S1 0/0 200.1.1.8 /30 (direct) S0 0/0
192.168.20.0 /24 200.1.1.6 S1 120/1 192.168.10.0 /24 200.1.1.9 S0 120/2
192.168.30.0 /24 200.1.1.6 S1 120/2 192.168.20.0 /24 200.1.1.9 S0 120/1
200.1.1.8 /30 200.1.1.9 S1 120/1 200.1.1.4 /30 200.1.1.9 S0 120/1
Figure 5-4 Route tables after all routers have advertised their route tables.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 145
RIP 145
Update Timer
The update timer dictates the interval of outbound routing updates (adver-
tisements). This is when the entire route table is broadcast out of all interfaces
enabled for RIP (the broadcast address is 255.255.255.255). The default setting
for the update timer is 30 seconds on Cisco routers.
146 Chapter 5
to spread the news about the dead route. When the flush timer expires the
route is removed from the route table. The flush timer is always set higher than
the invalid timer to allow time for the invalid route to be advertised to the
neighbors. The default setting for the invalid timer is 180 seconds (six update
periods). The default setting for the flush timer is 240 seconds (60 seconds
longer than the invalid timer).
As you can see, even with route poisoning, it takes quite a while to time out
a route. The settings on the timers could be lowered, but that would increase
the amount of network bandwidth used. So what’s a routing protocol to do?
RIP is kind of between a rock and a hard spot here, so other means have been
developed to speed convergence and prevent routing loops when a change
occurs. These techniques will be covered after first explaining how routing
loops get started.
RIP 147
E0 E0 E0
S1
S1 S0 S0
A B
200.1.1.9/30 C
200.1.1.5/30 200.1.1.6/30 200.1.1.10/30
Route table for router A (simplified) Route table for router C (simplified)
network mask next hop int a/m Network mask next hop int a/m
192.168.10.0 /24 (direct) E0 0/0 192.168.30.0 /24 (direct) E0 0/0
200.1.1.4 /30 (direct) S1 0/0 200.1.1.8 /30 (direct) S0 0/0
192.168.20 /24 200.1.1.6 S1 120/1 192.168.10.0 /24 200.1.1.9 S0 120/2
192.168.30 /24 200.1.1.6 S1 120/2 192.168.20.0 /24 200.1.1.9 S0 120/1
200.1.1.8 /30 200.1.1.9 S1 120/1 200.1.1.4 /30 200.1.1.9 S0 120/1
Figure 5-5 Trouble in River City. The WAN link joining routers A and B went down 10
seconds ago.
Additionally, the RIP-learned routes that depended on the downed link are
no longer good, so they are marked invalid immediately without even waiting
for the invalid timer to expire. The routes are not removed from the table
though. Those entries will be advertised along with the rest of the route table
with an unreachable metric of 16 until the flush timer expires.
Meanwhile, router C has no clue what’s going on. The RIP learned entries
on router C are timing out normally because router C has no knowledge of the
downed link at this point. Let’s review the timers:
■■ RIP routers expect to receive routing updates periodically. The default
period is 30 seconds.
■■ A router will wait for six update periods (180 seconds) to get an adver-
tisement from a neighbor about each route in its table and then mark
the route as invalid. This is controlled by the invalid timer. If the invalid
timer expires, the routes will be advertised as unreachable until the
flush timer expires.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 148
148 Chapter 5
■■ The flush timer always runs longer than the invalid timer to give the
router time to advertise the invalid routes before they are removed from
the router’s route tables. The flush timer is set to 240 seconds, so the flush
timer expires 60 seconds after the invalid timer. Once the flush timer
expires the invalid routes are removed and never advertised again. This
action has a cascading effect. An invalid and flush timer is running on all
routers for each route listed in their tables. As the invalid and flush
timers expire, routes are removed from each route table and no longer
advertised. Ultimately, every router removes the route and stops adver-
tising the route, and the route tables are considered converged.
So, except for the downed link, everything is OK, right? The invalid and
flush timers keep the routers “honest,” and after a while router C will dump the
dead routes. Right? Wrong. Without additional rules to handle this outage, RIP
will get into deep trouble very quickly by creating a routing loop. The problem
is with router C which still has an entry in its route table listing routes to the
200.1.1.4 and 192.168.10.0 through router B, which of course are now invalid.
Router B has marked the routes invalid but before router B can notify its neigh-
bors in its regular 30 second update, router C sends a periodic update to router
B, telling it about the routes that B thought were dead. Router B, thinking it has
a new path to the missing networks, accepts the updates from router C and incre-
ments the metrics for each network by one. This is reflected in Figure 5-6.
Here’s what’s different about router B’s route table now:
■■ Router B now lists a RIP learned route to the 200.1.1.4 via serial 1 with a
metric of 2.
■■ Router B now lists a RIP learned route to the 192.168.10.0 via serial 1
with a metric of 3.
Here is where things go from bad to worse as a routing loop is inadvertently
created. Router B has replaced the invalid routes to the 192.168.10.0 and
200.1.1.4 with routes to the same networks via router C. Router B erroneously
thinks the way to these networks is through router C, and router C still thinks
the way to the networks is through router B! Without the safeguards in place
(which will be discussed in a moment), RIP is too dumb to see what it has
done. Every time router B receives a packet bound for the 192.168.10.0 it will
forward it to router C. Every time router C receives a packet bound for the
192.168.10.0 it will forward it to router B! The two routers will do nothing
except ping-pong the packets back and forth to each other. That’s a basic rout-
ing loop.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 149
RIP 149
E0 E0 E0
S1 S0 S1
S0
A B
200.1.1.9/30 C
200.1.1.5/30 200.1.1.6/30 200.1.1.10/30
Route table for router A (simplified) Route table for router C (simplified)
network mask next hop int a/m Network mask next hop int a/m
192.168.10.0 /24 (direct) E0 0/0 192.168.30.0 /24 (direct) E0 0/0
192.168.20 /24 200.1.1.6 S1 120/1 200.1.1.8 /30 (direct) S0 0/0
192.168.30 /24 200.1.1.6 S1 120/2 192.168.10.0 /24 200.1.1.9 S0 120/2
200.1.1.8 /30 200.1.1.9 S1 120/1 192.168.20.0 /24 200.1.1.9 S0 120/1
200.1.1.4 /30 200.1.1.9 S0 120/1
Figure 5-6 The route tables 30 seconds after the WAN link has gone down (no routing
loop safeguards in place).
150 Chapter 5
Don’t conclude that the scenario being described here is the only way routing
loops are created. They can happen for a number of reasons even with routing
protocols relatively immune from loops, like EIGRP and OSPF, if they are not
configured correctly. For example, two trouble spots for routing loops are
misconfigured redistribution and incorrectly architected OSPF areas. These
issues are discussed in the relevant chapters.
Installing only the routes with the lowest metric not only speeds routing,
but since the fewest number of routers are used in the path, there are simply
fewer things to go wrong. Routing metrics are a critical function of any routing
protocol and will be covered in detail later in the chapter. The concepts of tim-
ing out directly connected routes as soon as the keep-alives detect a dead link
and poisoning the route were covered earlier in the scenario. Let’s turn our
attention to the remaining items on the list.
Hold-Down Timer
One mechanism that helps stabilize route tables and avoid looped routes is the
hold-down timer. The rule for the hold-down timer says this: “Once an entry
in a route table is updated (added, changed, or deleted), ignore any updates
about the route until the hold-down timer expires.” The default value of the
hold-down timer for RIP is 180 seconds.
The hold-down timer acts as a buffer when network conditions are chang-
ing rapidly. Suppose, for example, the link previously shown in Figure 5-5 was
down because of a loose connection. As the connection engages and disen-
gages, the line goes up and down. If it were not for the hold-down timer, a
large amount of network traffic would be created as RIP propagates broad-
casts saying first that the link is up, then down, then up, and so on. This activ-
ity is known as route flapping. The hold-down timer will “freeze” the route in
its current status in the route table even though RIP advertisements may say
the status is otherwise. When the timer expires, the router will start paying
attention to updates once again.
The hold-down timer would help in the example under study. It would have
probably prevented router B from accepting the faulty routes from router C.
Once router B’s path to the routes had been altered, the hold-down timer
would have prevented router B from accepting the update from router C. That
would have given router B time enough to notify router C about the bad routes
in its routine 30 second updates.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 151
RIP 151
Split Horizon
While the hold-down timer is helpful, it is by no means a foolproof mechanism
for preventing routing loops. Take the advertisement of the 192.168.10.0 for
example. Router B originally learned about the the 192.168.10.0 network from
router A. Router C learned about the same network from router B. The loop
was created because router C kept sending its entire route table to router B,
including a claim that router C new how to reach the 192.168.10.0. The inclu-
sion of this network was unnecessary and in fact wrong, because router C had
no other path to the 192.168.10.0.
Advertising a route back to the router that told you about the route in the
first place is a mistake. What’s really needed is a rule that says: Never advertise
a route back through the link you learned the route from. With this rule, a router
would never include a route in an update to a neighbor that had already
advertised the route. On the other hand, the router would definitely include
the route in advertisements to any other neighbors. Well, they made just such
a rule. It’s called split horizon. Split horizon is a simple loop-prevention tech-
nique that would have prevented the routing loop shown in Figure 5-6 from
ever occurring. With the split horizon rule in place, router C would not have
tried to tell router B about 200.1.1.4 or 192.168.10.0, because router B told it
about those routes in the first place.
With split horizon in place router C still thinks it has a path to the
192.168.10.0, but at least it has not tried to convince router B of the same.
Triggered Updates
As things stand right now in the example (previously shown in Figure 5-6),
router B will be notifying router C of the invalid routes in the next route
update by setting the metric to 16, also known as route poisoning. Route poi-
soning occurs until the flush timer expires.
There are times when split horizon may backfire and prevent propagation of
routes on the network. In certain configurations, it is actually necessary for a
router to advertise a route back out of the same interface it learned the route
on. This happens often with frame-relay networks where multiple logical
networks attach to one physical router interface (using sub-interfaces). If the
router does not advertise a route learned from one logical network back out
the same interface to the other logical networks, the route tables of one or
more routers will not be fully populated.
See the command reference later in this chapter for information about how
to manually enable and disable split horizon.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 152
152 Chapter 5
Poison Reverse
The drive toward rapid convergence does not stop with hold-down timers,
route poisoning, split horizon, and triggered updates however. Another rule
has been developed called poison reverse. The poison reverse rule says that
any router that knows of a poisoned route learned through one interface and
learns about the same route through another interface, will immediately
advertise the route back out of that interface with a metric of 16, thus inform-
ing its neighboring router that the route is dead. In effect, this is a temporary
suspension of the split horizon rule that helps speed convergence.
By the way, the poison reverse rule is so closely tied with the split horizon
rule, the rules are often stated together as “split horizon with poison reverse.”
Hop Count
A last-ditch mechanism for preventing routing loops in RIP is to limit the num-
ber of times a packet can traverse routers. RIP has a hop count limit of 15,
meaning a packet can be forwarded through only 15 routers before it is dis-
carded. Each RIP router receiving a packet increasing the hop count by 1. The
fifteenth router receiving the packet will discard it unless it is addressed to a
directly connected network.
While RIP has its own method of limiting the life of a routing packet, there is
also a routing protocol-independent means of detecting that a packet has been
on a network for too long. It is the TTL (Time to Live) field in the IP header. The
TTL field is set to a positive value by the sender, then each router along the way
decrements the TTL field by 1. If the value of the TTL field reaches 0, the packet
is discarded and the host sends an ICMP message back to the originating host.
The TTL is originally set anywhere from 32 to 256, depending on the type of
host initiating communications.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 153
RIP 153
Load Balancing
Although there are no provisions for load balancing in the RFC for RIP, Cisco’s
implementation of IP RIP allows for automatic load balancing across equal cost
paths (each route to the same network must have the same metric). By default,
RIP will keep up to four equal cost paths in the route table and forward traffic
through each of them. Two to six equal cost paths may be manually configured.
Default Routing
Default routing is covered in detail in Chapter 10 along with configuration
commands. Notations pertaining specifically to RIP are included here.
RIP supports both commands for creating default routes: the ip route com-
mand and the ip default-network command. As a general rule, use the ip
route command to set a default route on the current router that is not to be
propagated to other routers, and use the ip default-network command to set
a default route on the current router that is also propagated as a candidate
default route to all other RIP routers in the system.
The ip route command creates a static default route that uses a wildcard for-
mat of 0.0.0.0 in the statement. When you’re using the command specify the IP
address of the next hop router interface rather than the local interface name
(like “e0”) in the statement, or the route may be propagated anyway.
The ip default-network command will always propagate a candidate
default route, as well as install a default route on the current router. Unlike
some other protocols, the network specified in the statement need not be listed
on a router to accept the default route, because RIP propagates the default
route as network 0.0.0.0.
Use the examples provided in Chapter 10 to configure default routing for RIP.
Redistribution
RIP is capable of including static and externally learned routes in its updates—
in other words, redistribution. Chapter 10 provides general information on
redistribution. Examples of configuring RIP for redistribution are covered in
the following command reference for RIP.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 154
154 Chapter 5
Command Reference—RIP
Figure 5-7 provides a network model for the configuration of RIP. The exam-
ples will cover configuring RIP on a Cisco router.
Initial Configuration
An initial configuration of the routers will be performed and the route tables
will be shown before the RIP routing protocol is configured.
routerA#configure terminal
routerA(config)#interface fastethernet 0 (1)
routerA(config-if)#ip address 192.168.10.1 255.255.255.0 (2)
routerA(config-if)#exit (3)
routerA(config)#interface serial 1 (4)
routerA(config-if)#ip address 200.1.1.5 255.255.255.252 (5)
routerA(config-if)#exit
routerA(config)#
routerB#configure terminal
routerB(config)#interface fastethernet 0
routerB(config-if)#ip address 192.168.21.0 255.255.255.0
routerB(config-if)#exit
routerB(config)#interface serial 0
routerB(config-if)#ip address 200.1.1.6 255.255.255.252
routerB(config-if)#exit
routerB(config)#interface serial 1
routerB(config-if)#ip address 200.1.1.9 255.255.255.252 (6)
routerB(config-if)#exit
routerB(config)#
routerC#configure terminal
routerC(config)#interface fastethernet 0
routerC(config-if)#ip address 192.168.31.0 255.255.255.0
routerC(config-if)#exit
E0 E0 E0
S1 S1
S0 S0
A
200.1.1.5/30 B
200.1.1.9/30 C
200.1.1.6/30 200.1.1.10/30
Figure 5-7 Example network for commands.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 155
RIP 155
routerC(config)#interface serial 0
routerC(config-if)#ip address 200.1.1.10 255.255.255.252
routerC(config-if)#exit
routerC(config)#
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
156 Chapter 5
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Configure RIP
The configuration of RIP is fairly straightforward. The router rip command
enables RIP on the router—once enabled, it is mostly a matter of specifying
which networks to advertise, via the network x.x.x.x command, as follows:
routerB#config-term
routerB(config)#router rip
routerB(config-router)#network 192.168.20.0
routerB(config-router)#network 200.1.1.4
routerB(config-router)#network 200.1.1.8
routerB(config-router)#passive-interface fastethernet 0
routerB(config-router)#exit
routerB(config)#
routerC#config-term
routerC(config)#router rip
routerC(config-router)#network 192.168.30.0
routerC(config-router)#network 200.1.1.8
routerC(config-router)#passive-interface fastethernet 0
routerC(config-router)#exit
routerC(config)#
08_772739 ch05.qxp 3/3/06 9:23 PM Page 157
RIP 157
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
158 Chapter 5
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
RIP 159
routerX(config)#router rip
routerX(config-router)#version x (1)
where:
(1) x = 1 or 2
In the rare case where more granular control is required, the RIP version can
be set at the interface level. Since routers configured for version 2 of RIP ignore
RIP version 1 updates, a specific interface could be set to accept version 1
advertisements if say, one router was still using RIPv1. Here’s how:
routerX(config)#int e0
If need be, the interface level RIP commands could be used to advertise
and/or receive both versions of RIP updates, like this:
routerX(config)#int e1
routerX(config)#show ip protocols
160 Chapter 5
where:
(1) x = number of seconds
For example:
routerX(config)#router rip
where:
(2) doubles the length of time between routing updates from 30 to
60 seconds and maintains all other timers at default.
RouterX(config)#router rip
RouterX(config-router)#Maximum-paths x (1)
where:
(1) x = (1-6)
routerX(config)#show ip interface s 0
Scan the output for the statement “Split horizon is enabled” or “Split hori-
zon is disabled.” Split horizon can be forcibly enabled or disabled on an inter-
face level with the following command:
routerX(config-if)#{no} ip split-horizon
08_772739 ch05.qxp 3/3/06 9:23 PM Page 161
RIP 161
Configuring Summarization
Auto-summarization is on by default for both RIPv1 and RIPv2 when adver-
tising a route across a major network boundary. This behavior cannot be
altered for RIPv1. Auto-summarization can be disabled for RIPv, and can
optionally be configured to summarize at any bit boundary. (Summarization
was covered in Chapter 4.) Here is an example of the command syntax for RIP:
routerX(config)#interface s0
where:
(1) disables auto-summarization on specified interface only.
(2) summarizes advertised subnets of the 192.168.1.0 on this interface to a
class C boundary.
routerX(config)#router rip
routerX(config-router)#ip classless
Redistribution
The general principals of redistribution are covered in Chapter 10. Listed here
is a sample configuration of redistributing IRGP routes into RIP (redistribution
is OFF by default in RIP):
routerX(config)#router rip
routerX(config-router)#default-metric 10
The key to including external routes in RIP is to get the metric right. RIP can
only deal with a metric in the range of 1–15. The metrics of other routing pro-
tocols have significantly larger values. Values larger than 15 are treated as
unreachable networks in RIP.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 162
162 Chapter 5
The redistribute igrp 100 tag 1 statement causes IGRP update packets to be
injected into the RIP process. An assumption is made that IGRP is running on
the same router. RIP will include any IGRP-learned networks with its regular
updates. All IGRP routes will be tagged with the number 1. This allows other
routers to identify the IGRP injected routes if need be. The default-metric 10
statement applies a metric of 10 to all injected routes. This is mandatory
because IGRP metrics make no sense to RIP. The number “10” in this case is
arbitrary. The IGRP-learned networks are not necessarily 10 hops away, but
that does not prevent the delivery of packets. To mitigate the possibility of a
routing loop, use a metric value greater than the metric of any IGRP routes that
RIP is also aware of. In other words, if both IGRP and RIP are aware of a route
to 172.1.0.0, then RIP will become aware of the route again when the IGRP
routes are redistributed into RIP. The external route should be set to a metric
less than the current metric RIP has for the route it learned from another RIP
router. This will force RIP to choose the routes it learned directly over the
external IGRP routes.
routerX(config)#router rip
routerX(config-router)#redistribute igrp 100 tag 1 metric 10
These statements have the same effect as the previous example, except that
they apply only to IGRP-injected routes, whereas the default-metric statement
in the previous example applies to any protocol being redistributed into RIP.
This provides for more granular control over the redistribution process.
routerX(config)#router rip
routerX(config-router)#redistribute static
Be advised that static default routes are configured slightly different (see
Chapters 3 and 10).
RIP 163
A distribution list allows you to control which external routes the native
routing process learns about. An access list must be created that specifies
which networks will be permitted or denied. In this example, the access-list
statement denies any subnets of the 192.100.100.0. Until the access list is
applied somewhere, the distribution list is meaningless. The router igrp 100
statement accesses the IGRP routing process. Then the access list is applied to
outgoing routing updates in the form of an outbound distribution list with the
statement distribute-list 1 out. IGRP will now be prevented from advertising
this network from this router. Finally, the redistribute igrp 100 statement
injects IGRP updates into RIP (minus network 190.100.100.0).
Be advised that this example prevents IGRP from advertising the
190.100.100.0 network to anybody, not just RIP. However, this does not prevent
other IGRP processes on other routers to propagate the network throughout
the IGRP system.
routerA#Show ip protocols
164 Chapter 5
where:
(1) shows all Routes.
(2) shows more detail for a single route.
Troubleshooting Commands
If you get into trouble, these commands can help get you out.
Activating Debugging
Use the following command to activate debugging:
routerA#debug ip rip
routerA#show debug
Stopping Debugging
Use the following command to stop debugging:
routerA#undebug all
08_772739 ch05.qxp 3/3/06 9:23 PM Page 165
RIP 165
Notes
1. This characteristic was illustrated in Chapter 4, in the section on dis-
tance vector routing protocols, page 109.
2. The term “neighbor” has various meanings, depending on the specific
routing protocol. EIGRP and OSPF require an initial exchange between
routers to establish a neighbor relationship and share route tables. RIP,
however, rather blindly broadcasts updates without prior knowledge of
who may be out there. Every RIP router sharing a network link on an
interface enabled for RIP is automatically considered a neighbor.
3. The command reference later in this chapter lists the configuration com-
mands and actual router output for this model.
4. RIP cannot forward packets more than 15 hops away, therefore adver-
tising a route with a metric of 16 is telling other routers the route cannot
be used.
5. Routers can also detect the loss of a carrier on some types of WAN
links, which is an even faster indication that the link has gone down.
08_772739 ch05.qxp 3/3/06 9:23 PM Page 166
09_772739 ch06.qxp 3/3/06 9:23 PM Page 167
CHAPTER
6
IGRP
Overview
IGRP stands for Interior Gateway Routing Protocol. It is one of the early
replacements for RIP that eliminated the hop count limitation and used more
robust metrics. It provides the same limited support for classlessly addressed
networks as RIP. It is a Cisco-proprietary protocol. In its time, IGRP provided
a good solution, but now it should be replaced by the classless protocols
EIGRP or OSPF. Table 6-1 shows the basic characteristics of IGRP.
167
09_772739 ch06.qxp 3/3/06 9:23 PM Page 168
168 Chapter 6
IGRP 169
IGRP Background
IGRP is a proprietary classful routing protocol developed by Cisco to replace
RIPv1. It was released in 1986. IGRP runs only on Cisco routers. IGRP
attempted to overcome RIPv’s limitations such as using hop count for the met-
ric and transmitting the route table every 30 seconds. IGRP is considered a dis-
tance vector protocol for use within autonomous systems (as is RIP).
Rather than hop count, IGRP uses the bandwidth of the link and delay of the
link to calculate the metric. Additionally, an administrator can add load of the
link and reliability of the link to the metric (these terms were defined in Chap-
ter 4 on page 107).
IGRP can even be optionally configured for hop count and MTU (Maximum
Transmission Unit), but these factors are not incorporated into the metric. Hop
count is used only to set a limit on counting to infinity problems. The hop count
can be manually configured for up to 255 hops—the default is 100 hops. The
MTU is a setting identifying the maximum MTU that can be handled by any
networking device in the system. It is desirable to set an MTU no larger than
the smallest MTU of any link on the network. This prevents routing update
packets from being fragmented and thus improves throughput.
IGRP has more in common with RIPv1 than any other routing protocol. It is
therefore recommend that you read Chapter 5 even if you have no intention of
working with that protocol. Chapter 5 goes into detail about how distance vec-
tor protocols propagate routes and how routing loops are handled. Table 6-2
illustrates the difference between IGRP and RIP.
170 Chapter 6
IGRP Timers
IGRP has timers similar to RIP that control route propagation and limit rout-
ing loops. However, as Table 6-3 illustrates, the values for these timers are
quite different for IGRP.
Update timer 30 90
Invalid timer 180 270
As you can see, IGRP is not nearly as chatty as RIP. Saving network band-
width is a good thing. But what keeps IGRP from slipping in the convergence
department? IGRP implements flash updates. When a router learns of a
change to a route (link down, new route, different metric for an existing route,
and so on), it immediately sends an update to its neighbors. Flash updates are
similar to RIP’s triggered updates. In earlier releases of the Cisco IOS, IGRP’s
flash updates were triggered by a wider variety of events than RIP, but RIP
convergence has been improved in later releases of the IOS.
09_772739 ch06.qxp 3/3/06 9:23 PM Page 171
IGRP 171
Split Horizon
As with RIP, IGRP usually does not advertise a route back through the same
interface the route learned. However, the same cautions regarding Frame
Relay apply here, namely that split horizon may need to be disabled on Frame
Relay sub-interfaces.
Poison Reverse
This feature works the same as with RIP.
IGRP Metrics
IGRP calculates a metric for a route differently than RIP. Stated in its simplest
form, with default values, the formula for the algorithm is shown in Figure 6-1
This formula reduces to a single value based on the assignments for band-
width and delay shown in Table 6-4.
Token Ring
(16 Mbps) 16,000 630
T1 1544 20,000
The values from the table are manipulated to render the actual metric. Let’s
take the example of a route passing through two WAN links: one link is FDDI
and one link is T1. The algorithm first divides 10,000,000 by the slowest link
in the path, then adds the result to the sum of the delay values for each link,
and divides by 10. The slowest link in this example is the T1 link, so the for-
mula looks as the one shown in Figure 6-2.
Bandwidth + Delay
Figure 6-1 Basic formula for metric calculation in IGRP.
09_772739 ch06.qxp 3/3/06 9:23 PM Page 172
172 Chapter 6
The metric yielded is 84871. This number can be compared to IGRP metrics
derived from other routes to the same destination. The path with the lowest
number will be chosen by IGRP as the best route. Note that delay values
include outbound interfaces only.
Bandwidth and delay metrics can be modified from their default values if
required. These factors can be adjusted on Cisco routers with the metric
weight command. The metric formula is adjusted to accommodate these
optional weighting factors as reflected in Figure 6-3.
The variables k1 and k3 are set to 1 by default, so they normally have no
effect (1 x a number = that number). But if the settings are altered, they affect
the metric as shown in the figure.
If desired, the factors load and reliability can be added to weigh the metric,
but most deployments do not do so. When used, the formula is now fully
expressed in Figure 6-4.
The additional variables k2, k4, and k5 have been added. They all have a
default value of 0, so unless they are altered, they have no impact on the
formula.
Note that the IGRP algorithm is not as adept at automatically picking the
best route as it would seem from all the factors that contribute to the compos-
ite metric. All metric factors except reliability and load are static values, and
reliability and load metrics are not active by default. Furthermore, you must
have a very good handle on your network traffic before going here and futzing
with these settings. Cisco recommends leaving the values at their default,
which means you are dealing with a protocol that, in the end, uses the formula
as first expressed (Bandwidth + Delay).
IGRP 173
Autonomous Numbers
Unlike RIP, IGRP (and EIGRP) can run multiple instances of its routing process
on a single router. An instance of IGRP is identified by an autonomous system
number associated with the routing protocol when it is enabled. Multiple
instances of IGRP are isolated from each other. Each instance sends and
receives separate updates and builds separate route tables. You could, for
example, run two instances of IGRP on one router if there are two autonomous
systems under separate administrative control that need to share routing
information.
174 Chapter 6
S0 S1
S0 S0
A B D
FDDI FDDI
S1
T1
T1
S0 S1
C
Router A has a 100 Mbps path to router D through the FDDI link. Router A
also has a 1.544 Mbps path to router D through the T1 link. The metric for the
path to router D via the FDDI link is 120 and via the T1 link is 10477. By divid-
ing the larger metric by the smaller metric, the multiple between the two val-
ues can be determined as 87.3 (10477/120). So the metric 10477 is 87.3 times
larger then the metric 120. That number will be needed in a moment.
Until the variance command is issued, router A will use router B to get to
router D exclusively, since the metrics of the two paths are dissimilar. In order
to activate the other path, the metric of the path through router C must be a
lower effective metric then through router B. This is where the variance command
comes in. A variance must be entered that is greater than the multiple between
the larger and smaller metric. A variance of 88 will do the trick. After configur-
ing the variance, the two paths will now be active. The faster link will carry 88
percent more packets than the slower link. (See the previous discussion about
flow-based splitting. See the command reference for the exact commands.)
Default Routing
Default routing is covered in Chapter 10. Differences pertaining specifically to
IGRP are noted here.
09_772739 ch06.qxp 3/3/06 9:23 PM Page 175
IGRP 175
IGRP does not support the ip route command (ip route 0.0.0.0 0.0.0.0 x.x.x.x)
for configuring default routing because the protocol does not understand the
0.0.0.0 network. Instead, the ip default-network command must be used.
Unlike RIP, all routers must list the network specified in the ip default-
network statement, or the default route will not be accepted.
Redistribution
IGRP is capable of including static and externally learned routes in its updates
(redistribution). The general principals of redistribution are covered in Chap-
ter 10. Redistribution is OFF by default in IGRP, with one exception: IGRP and
EIGRP, which have similar metrics, automatically distribute routes to each
other when both routing protocols are running on the same router and both
protocols are using the same autonomous system number. The one dissimilar-
ity between the protocols, the metric multiplier of 256, is automatically
adjusted when routes are redistributed. It is clear that EIGRP, IGRP’s succes-
sor, was engineered to make an easy upgrade from IGRP.
Command Reference—IGRP
Figure 6-6 provides a network model for the configuration of IGRP. The exam-
ples will cover configuring IGRP on a Cisco router.
E0 E0 E0
S1 (56K) S1 (T1)
S0 S0
A
200.1.1.5/30 B
200.1.1.9/30 C
200.1.1.6/30 200.1.1.10/30
Figure 6-6 Example network for commands.
09_772739 ch06.qxp 3/3/06 9:23 PM Page 176
176 Chapter 6
Initial Configuration
An initial configuration of the routers will be performed, and the route tables
will be shown before the IGRP routing protocol is configured.
routerA#configure terminal
routerA(config)#interface fastethernet 0 (1)
routerA(config-if)#ip address 192.168.10.0 255.255.255.0 (2)
routerA(config-if)#exit (3)
routerA(config)#interface serial 1 (4)
routerA(config-if)#ip address 200.1.1.5 255.255.255.252 (5)
routerA(config-if)#bandwidth 56 (6)
routerA(config-if)#exit
routerA(config)#
routerB#configure terminal
routerB(config)#interface fastethernet 0
routerB(config-if)#ip address 192.168.20.0 255.255.255.0
routerB(config-if)#exit
routerB(config)#interface serial 0
routerB(config-if)#ip address 200.1.1.6 255.255.255.252 (7)
routerB(config-if)#bandwidth 56
routerB(config-if)#exit
routerB(config)#interface serial 1
routerB(config-if)#ip address 200.1.1.9 255.255.255.252 (8)
routerB(config-if)#bandwidth 1544
routerB(config-if)#exit
routerB(config)#
routerC#configure terminal
routerC(config)#interface fastethernet 0
routerC(config-if)#ip address 192.168.30.0 255.255.255.0
routerC(config-if)#exit
routerC(config)#interface serial 0
routerC(config-if)#ip address 200.1.1.10 255.255.255.252
routerC(config-if)#bandwidth 1544
routerC(config-if)#exit
routerC(config)#
IGRP 177
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
178 Chapter 6
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Configuring IGRP
routerB#config-term
routerB(config)#router igrp 100
routerB(config-router)#network 192.168.20.0
routerB(config-router)#network 200.1.1.4
routerB(config-router)#network 200.1.1.8
routerB(config-router)#passive-interface fastethernet 0
routerB(config-router)#exit
routerB(config)#
routerC#config-term
routerC(config)#router igrp 100
routerC(config-router)#network 192.168.30.0
routerC(config-router)#network 200.1.1.8
routerC(config-router)#passive-interface fastethernet 0
routerC(config-router)#exit
routerC(config)#
09_772739 ch06.qxp 3/3/06 9:23 PM Page 179
IGRP 179
routeA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
180 Chapter 6
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
IGRP 181
routerX(config)#router igrp
routerX(config-router)#timers basic update invalid holddown flush x (1)
where:
(1) x = number of seconds
For example:
routerX(config)#router igrp
routerX(config-router)#timers basic 180 270 280 630 (2)
where:
(2) doubles the length of time between routing updates from 90 to 180
seconds and maintains all other timers at default.
routerX#config term
routerX(config)#router igrp
routerX(config-router)#maximum-paths x (1)
where:
(1) x = (1-6)
182 Chapter 6
routerX#config term
routerX(config)#router igrp 100
routerX(config-router)#variance 88
routerX(config-router)#exit
where:
(1) shows default K values being assigned.
routerX(config)#int s0
routerX(config-if)#show ip interface s0
Scan the output for the statement “Split horizon is enabled” or “Split hori-
zon is disabled.” Split horizon can be forcibly enabled or disabled on an inter-
face level with the following command:
routerX(config-if)#{no} ip split-horizon
Showing Configuration
The following command shows all routing protocols, IGRP timers, filters,
redistribution, and summarization status:
routerA#Show ip protocols
09_772739 ch06.qxp 3/3/06 9:23 PM Page 183
IGRP 183
Troubleshooting Commands
If you get into trouble, these commands can help get you out.
routerX#show debug
routerX#undebug all
09_772739 ch06.qxp 3/3/06 9:23 PM Page 184
184 Chapter 6
Notes
CHAPTER
7
EIGRP
Overview
EIGRP stands for Enhanced Interior Gateway Routing Protocol. It is a contem-
porary, widely implemented routing protocol with full support for classlessly
addressed networks. Table 7-1 shows the basic characteristics of EIGRP.
185
10_772739 ch07.qxp 3/3/06 9:24 PM Page 186
186 Chapter 7
EIGRP 187
EIGRP Background
EIGRP was released in the early 1990s by Cisco Systems, subsequent to releas-
ing IGRP. EIGRP was developed to address problems inherent to distance
vector routing protocols such as RIP and IGRP. Like IGRP, EIGRP is propri-
etary to Cisco and is only available on Cisco routers. EIGRP has similarities to
IGRP only in that it uses a very similar metric. Cisco calls EIGRP an advanced
distance vector routing protocol because EIGRP is actually a hybrid of distance
vector and link-state technologies—incorporating features of each design.
EIGRP is a classless routing protocol and therefore fully supports CIDR nota-
tion, subnetting, VLSMs, and even discontiguous networks. EIGRP and OSPF
are the two widely accepted interior IP routing protocols for large networks.
EIGRP Terminology
There are a number of terms associated with the operation of EIGRP and its
routing engine, DUAL. One potential roadblock to understanding the protocol
is that its associated terminology is not always intuitive. For example, the cur-
rently installed route in the route table is known as the successor. Another
example is when a path to a network is no longer functioning, the route
becomes active. There are good reasons for the use of these terms, but they tend
to be counterintuitive until fully understood. The core terms will be intro-
duced now so that you will have some familiarity with them when you
encounter them later.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 188
188 Chapter 7
Neighbor
The term neighbor has a more specific meaning with EIGRP than with RIP and
IGRP. Any router sharing a network link with another router is potentially a
neighbor. But to actually qualify as a neighbor, routers sharing a network link
must meet certain criteria and establish a neighbor relationship before
exchanging routing information.
Packet Types
There are five types of packets used in EIGRP1:
■■ Hello packets: Exchanged between routers and used to discover and
maintain neighbors.
■■ Update packets: This is the main packet type used to exchange routing
information. The data stored in the topology table (defined shortly) is
what is passed in an update packet. Update packets are sent initially
when a neighbor relationship is established and then periodically when
there is a change in the status of a link that affects routing.
■■ Query packets: Initiated by a router to its neighbors when it loses a
route. The query packet asks if the neighbor knows of a path to the lost
route.
■■ Reply packets: Used to respond to a query.
■■ ACK packet: A Hello packet with no data; used to acknowledge pack-
ets sent with the Reliable Transport Protocol (RTP).
Hold-Time
This is the time interval to wait for receiving Hello packets from an established
neighbor. Hello packets must be periodically exchanged between neighboring
routers. If a router stops receiving either Hello packets or any other type of
EIGRP packets the hold-time timer expires and the neighbor relationship ter-
minates. The router must then find new routes to networks that were previ-
ously reachable through the non-responsive neighbor.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 189
EIGRP 189
Neighbor Table
This is a separate table used to maintain the list of known neighbors.
Topology Table
This is a separate table that lists all qualified routes. (Qualified routes are
known as feasible successors.)
Route Table
Also known as a forwarding table, this is a separate table that lists the actual
routes used to forward packets. The route table is built from the topology
table.
190 Chapter 7
Successor
The route with the lowest metric to a destination network (lowest feasible dis-
tance) is known as a successor and is installed in the route table. (There can be
more than one successor route if multipathing is enabled.)
EIGRP 191
EIGRP Architecture
EIGRP has a clever design for speeding convergence, eliminating routing-
loops, and minimizing the use of network bandwidth and router resources.
Although an EIGRP router does not transmit a router’s links and its state (as
OSPF does), it makes the best of the information it does learn from its neigh-
bors. EIGRP keeps all information about qualified routes—routes that meet
what is known as a feasibility condition—in a topology table. A feasibility
condition is a means test (issued by DUAL) to insure a route is loop-free. Only
routes meeting the feasibility condition are accepted. Once the topology table
is populated, DUAL selects routes from the topology table for installation into
the route table, based upon the metric values of the routes.
Routing updates are sent only when a router detects a change for a network
it is aware of. When a route fails, a replacement route can often be found locally
in the router’s topology table. EIGRP inter-router communications are kept to
a minimum this way. When a replacement route cannot be located locally, the
router proactively interrogates its neighbors to see if they are aware of a
replacement route.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 192
192 Chapter 7
Small Hello packets are exchanged between routers to establish and main-
tain neighbor relationships. Failure to receive Hello packets in a timely man-
ner gives routers early notification when another router (or link to a router)
has failed, so that action can be taken to find alternative paths around the fail-
ure. On a stable network, Hello packets are the only traffic generated by EIGRP.
The proprietary Reliable Transport Protocol (RTP) also speeds convergence
by creating time frames for responses to updates and queries. RTP allows for
assured updates (each routing update is acknowledged), which mitigates the
need to transmit the entire route table periodically.
Finally, the fact that EIGRP supports multiple routed protocols potentially
makes it a single routing protocol solution (EIGRP can ride on IP, IPX, and
Appletalk/RTMP packets, thus providing routes to IP networks, NetWare net-
works, and Appletalk networks).
Now let’s take a look at what makes all this wonderfulness possible.
EIGRP 193
194 Chapter 7
use reliable communication is more a function of the network type than of the
nature of the communication. RTP, therefore, may be utilized for any packet
type (Hello packets, update packets, and so on). An ACK packet (which is sim-
ply an empty Hello packet except for a sequence number) is used to acknowl-
edge an RTP packet.
Two timers in addition to the hold-time timer are used with EIGRP. A smooth
round trip time (SRRT) timer is used to establish the average amount of time for
RTP packets to be acknowledged. That information is used by the retransmis-
sion timeout (RTO) timer to inform the router when an RTP packet has not been
acknowledged in a reasonable time frame.
EIGRP Tables
At the core of EIGRP are the tables maintained by the protocol on each router.
EIGRP maintains three separate tables that facilitate the learning, use, and
maintenance of routes to networks.
Neighbor Table
The neighbor table is the first table built when an EIGRP router is powered up.
The neighbor table lists all known neighbors the router is aware of.
Hello packets are used to establish and maintain neighbors. When a router
first receives a Hello packet it responds with an update packet listing its
directly connected networks. The neighbor receiving the route update recipro-
cates with its directly connected routes.
The following information is tracked in the neighbor table:
■■ The IP address of the neighbor
■■ The interface the neighbor was learned through
■■ The hold-time for the neighbor—a timer that tracks the reception of
Hello packets
■■ The uptime for the neighbor—how long the neighbor relationship has
existed
■■ The number of Hello packets in the queue, which can be used to spot
network congestion
■■ If the RTP has been used to transmit a Hello packet:
■■ Smooth Round Trip timer (SRRT)
■■ Retransmission (RTO)
■■ A queue indicating the number of reliably sent packets waiting
a reply
■■ The sequence number of the last acknowledged packet
10_772739 ch07.qxp 3/3/06 9:24 PM Page 195
EIGRP 195
Topology Table
The topology table contains all qualified routes to networks; routes that have
met the so-called feasibility condition. Initially the topology table contains
only the router’s directly connected networks. As routing updates arrive from
established neighbors, routes that meet the feasibility condition are added to
the topology table. In essence, when routers send update packets to their
neighbors they are exchanging the contents of their topology tables.
The topology table is an example of how EIGRP differs from other distance
vector routing protocols. RIP, for example, selects the best route it hears of (the
lowest metric) and discards information about other routes to the same desti-
nation. If RIP loses the path to the route it selected as the best, it must first time
out the route, and then wait for a routing update from a neighbor, in hopes of
finding a new path to the network. EIGRP dramatically improves convergence
by keeping track of every known route that meets the feasibility condition.
When a fault occurs, EIGRP can often converge instantly if a backup route is
located in its topology table.
The topology table keeps track of the following information for each route:
■■ The minimum bandwidth of all links to the destination network
■■ Total delay (the sum of all delays on all outgoing router interfaces along
the path to the destination network)
■■ Path reliability (a dynamically assigned value of the overall reliability
of the path—not used in metric by default)
■■ Path loading (a dynamically assigned value of the current load on the
path—not used in metric by default)
■■ The minimum MTU (The routers will not use an MTU larger than the
minimum specified size. This prevents fragmentation of update packets
and further speeds convergence.)
196 Chapter 7
Route Table
The route table, as with any other routing protocol, contains the actual routes
used to forward traffic. (See command reference at the end of the chapter for
the forms of the show ip route command that shows EIGRP specific data.)
Remember that we are still discussing EIGRP architecture. A later example
will show the actual population of these tables, and the actual router output
for each table will be explained at that time.
EIGRP Metrics
EIGRP metrics are almost the same as the metrics for IGRP, which in its sim-
plest form, is minimum bandwidth + the sum of delays (see Table 7-2). The
only difference in EIGRP is that the metric is scaled up by multiplying it by
256. This is done simply to add granularity to the metric. However, unlike
IGRP, a route’s metrics are first applied to qualify it for inclusion into the topol-
ogy table (example to follow). Later, the metrics are applied again when the
route is considered for installation into routing table.
EIGRP has a topology table. Pure link-state routing protocols such as OSPF have
topology tables. Are they both the same? A comparison of EIGRP’s and OSPF’s
topology tables, described in this chapter and the next, will reveal that the
answer to this question is a resounding “No.”
OSPF builds its topology table through each router reporting its directly
connected networks. The topology table in OSPF is a composite listing of all
those routers and their attached links. This gives OSPF an actual map of the
network topology (which is how OSPF avoids the bad routing information that
leads to routing-loops).
The topology table in EIGRP is quite different. It is not a map. It is mostly a
listing of distances and vectors, and metrics of qualified routes that are
available to be installed into the route table if the installed route fails. So even
though it’s called a “topology table,” don’t assume that EIGRP routers end up
with a topology map of the network in the way that link-state protocols like
OSPF do.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 197
EIGRP 197
Table 7-2 Assignments for Bandwidth and Delay Values (Same as IGRP)
BANDWIDTH DELAY
LINK TYPE (IN KBPS) (IN MICRO-SECONDS)
T1 1544 20,000
Take the example of a route passing through two WAN links; one link is
FDDI and one link is T1. The algorithm first divides 10,000,000 by the slowest
link in the path, then adds the result to the sum of the delay values for each
link, and divides by 10 (to convert microseconds to milliseconds). The result is
then multiplied by 256. The slowest link in this example is the T1 link, so the
formula looks like what is portrayed in Figure 7-1.
As with IGRP, other metrics such as load and reliability can be added
by manipulating the K values. The procedures are shown in Chapter 6 on
page 172, however Cisco recommends that the default metric be used.
198 Chapter 7
Once a successor for a route has initially been chosen, additional routes to
the same network must qualify for inclusion into both the topology table and
the route table, by passing a feasibility condition test issued by DUAL, to be
sure the route is not looped. We’re fully into algorithm country now and the
DUAL evaluates newly learned routes with the following basic equation:
reported distance < feasible distance
If the advertised route’s reported distance is less than the feasible distance of the
successor, the route has met a feasibility condition. It qualifies! The route is guar-
anteed to be loop-free. The route will either be kept in the topology table as a
feasible successor—meaning it is a backup route if the successor fails, or if the
route’s feasible distance is less than the feasible distance of the successor route,
it will replace the successor.5
OK. What exactly does that mean? How does the fact that the reported dis-
tance being less than the feasible distance guarantee the route is not looped?
Quite simply, any advertised route that has a larger reported metric value than
the metric of the route currently in use, might possibly include the current
router in the path; otherwise known as a routing-loop. On the other hand, if the
metric from the reporting neighbor to the destination network is less then the
metric from the current router to the destination network, the current router
could not possibly be included in the advertised route—the route is guaran-
teed not to be looped.
If a router does not already have an entry for a route to a particular network, it
can’t have been advertising the route. If the router has not been advertising the
route, there is little chance that it will learn of a route to the network that leads
back through itself.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 199
EIGRP 199
200 Chapter 7
■■ Q is the number of packets sent with RTP that are waiting acknowl-
edgement. A growing Q value indicates trouble on the network.
■■ SEQ NUM indicates the sequence number of the last received Update,
Query, or Reply packet. The RTP tracks the numbers to insure proper
sequencing of received packets.
Now the topology table will be examined. The topology table in Figure 7-4
shows three networks. Note that each entry is prefaced with a P, indicating the
route is in a passive state, meaning the router believes it has at least one stable
route to the network.
Network 1
192.168.1.0/24
E0 E0 E1 E0 E1
A 200.1.1.5/30 200.1.1.6/30 B 200.1.1.9/30 200.1.1.10/30 C
Figure 7-2 Network model for initial population of topology and route tables.
Figure 7-3 Output from router A when executing the show ip eigrp
neighbors command.
Figure 7-4 Output from router A when executing the show ip eigrp topology command.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 201
EIGRP 201
For each entry, the destination network is first listed, followed by the num-
ber of successor routes (the number of routes installed in the route table), fol-
lowed by the feasible distance (the metric from router A to the destination
network).
The second and any additional lines of the entry display all feasible succes-
sors for the route. These are routes that have met the feasibility condition
(reported distance < the feasible distance of the current successor). Each entry indi-
cates that either the route is directly connected or the next hop interface is dis-
played. If the route is not directly connected, the feasible distance and reported
distance are shown respectively in (). Finally, the local interface that packets
will exit from on their way to the destination network is displayed.
Let’s review the math for the metrics shown in Table 7-5. From router A’s
perspective, the reported distance for each route is shown is Figure 7-5.
Finally, let’s examine the route table (Figure 7-6).
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
202 Chapter 7
Again, the two learned routes were installed without question because there
were no pre-existing routes to those networks. The next example demonstrates
what will happen when a second route to 192.168.1.0 is discovered.
Network 1
192.168.1.0/24
E0 E0 E1 E0 E1
A 200.1.1.5/30 200.1.1.6/30 B 200.1.1.9/30 200.1.1.10/30 C
S0 E2
Fast Ethernet Fast Ethernet Fast Ethernet
100,000/100 100,000/100 100,000/100
200.1.1.13/30
200.1.1.18/30
S0 E0
200.1.1.14/30 D 200.1.1.17/30
T1 Ethernet
1,544/20,000 10,000/1000
EIGRP 203
Figure 7-9 The topology table is unchanged despite the new path to the 192.168.1.0
via router D.
204 Chapter 7
Network 1
192.168.1.0/24
E0 E0 E1 E0 E1
A 200.1.1.5/30 200.1.1.6/30 B 200.1.1.9/30 200.1.1.10/30 C
S0 E2
Fast Ethernet Fast Ethernet
100,000/100 Fast Ethernet
100,000/100 100,000/100
200.1.1.13/30 200.1.1.18/30
S0 E0
200.1.1.14/30 D 200.1.1.17/30
T1 Ethernet
1,544/20,000 10,000/1,000
After about 15 seconds, router B’s hold-time timer expires waiting for Hello
packets from router C. Among several actions that router B will take, it will
poison the route to the 192.168.1.0 by sending an update packet to router A
with the hop count set to infinity.7
Upon receiving the update regarding the failed route, router A will immedi-
ately remove the route to the 192.168.1.0 from the route table. Router A then
uses a local computation to examine its topology table for a feasible successor.
Finding no feasible successors to promote to successor, DUAL changes the
state of the route from passive (“I can handle this myself”) to active (“I need
help finding a path to the network”). A route becomes active when a router
has exhausted the possibility of locating a replacement route locally and must turn to
its neighbors.
In active mode, DUAL commences a diffusing computation whereby it will
query its neighbors for a path to the lost network (the idea of having other
routers spend CPU time helping to find a replacement route is where the
diffuse comes from in Diffusing Update ALgorithm). Up until now, only
Hello packets and update packets have been sent between neighbors. Now a
query packet is sent to neighbors asking if they have a route to the 192.168.1.0.
Query packets are always sent with the RTP protocol because replies to the
query are required, and therefore time-sensitive.
Router D receives the query from router A. Router D has one successor to
the 192.168.1.0. It has no feasible successors, because the path to the 192.168.1.0
through router A and B did not meet the feasibility condition. Router D replies
to the query with the information about the successor route, including its
reported distance of 284,160.
Router A receives the update, and because there is no current successor to
compare to, it immediately installs the route in the topology table and route
table. Router A now has a successor route to the 192.168.1.0.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 205
EIGRP 205
206 Chapter 7
The default setting for the SIA timer is 3 minutes. This can be altered with
the timers active-time command (see the command reference at the end of this
chapter).
REPORTED FEASIBLE
PATH DISTANCE DISTANCE
Creation of a Routing-Loop
Let’s say router B sends update packets to its neighbors advertising a route to
the 192.168.1.0 through router C. Router A and router D learn about the route.
Focus on router D. Router D now wants to tell its neighbors about the route.
Router D will advertise the route to router A, but router A will likely already
know about the route from router B and reject the offering from router D
because the reported distance from router D of 286,720 is not less than router
A’s current feasible distance of 33,280 to the same network through B.9
10_772739 ch07.qxp 3/3/06 9:24 PM Page 207
EIGRP 207
Network 1
192.168.1.0/24
E0 E0 E1 E0 E1
A 200.1.1.5/30 200.1.1.6/30 B 200.1.1.9/30 200.1.1.10/30 C
S0 200.1.1.18/30 E2
Fast Ethernet Fast Ethernet Fast Ethernet
100,000/100 100,000/100 100,000/100
200.1.1.13/30
200.1.1.17/30 E0
S0
200.1.1.14/30 D
T1 Ethernet
1,544/20,000 10,000/1,000
Would router D try to advertise the route back to B? Normally no, thanks to
the split-horizon rule, but there are some scenarios where it would, which is
one reason DUAL is around. DUAL does not assume split-horizon is always
active.
One possible issue related to split-horizon is that it may have been disabled.
Split-horizon can either be manually disabled, or in the case of certain point-
to-point or multi-point configurations with sub-interfaces configured, split-
horizon would be off by default. In such cases, router D would go ahead and
advertise the network back to router B. DUAL would show its stuff here by
rejecting the route—the reported distance of 286,720 would not be less than
router B’s feasible distance of 30,720 to the same network. In this case, the sus-
picion raised by a higher reported metric would be justified.
Another factor that could cause router D to advertise the 192.168.1.0 to
router B is if a network problem had prevented router D from learning about
the 192.168.1.0 from router B in the first place. Remember that EIGRP does not
periodically advertise all networks in routing updates. Only changes to routes
are advertised. If a network problem had prevented router D from receiving
the update packet regarding the 192.168.1.0 from router B, it would likely
advertise the route to router B after it learned it from A, thus potentially creat-
ing a routing-loop. Again, DUAL would put a stop to such nonsense. A looped
route will always have a larger reported distance than the receiving router’s current
feasible distance to the network, because the route includes a path through the router
receiving the advertisement. This is how DUAL achieves 100 percent loop-free
routes.
Load Balancing
EIGRP handles both equal and unequal cost load balancing in the same man-
ner as IGRP. The command reference at the end of this chapter has a brief
example. Refer to Chapter 6, page 173, for details.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 208
208 Chapter 7
Default Routing
Default routing is covered in Chapter 10. Differences pertaining specifically to
IGRP are noted here.
EIGRP supports both forms of configuring default routing via the ip route
and ip default-network commands.
Redistribution
EIGRP is capable of including static and externally learned routes in its
updates, via redistribution. The general principals of redistribution are cov-
ered in Chapter 10. Redistribution is OFF by default in EIGRP with one excep-
tion. EIGRP and IGRP, which have similar metrics, automatically distribute
routes to each other when both routing protocols are running on the same
router—and both protocols are using the same autonomous system number.
The one dissimilarity between the protocols, the metric multiplier of 256, is
automatically adjusted when routes are redistributed.
Route Summarization
EIGRP excels at route summarization by not only allowing the disabling of
auto-summarization and configuration of manual summarization, but sum-
marization can be performed at any bit boundary—the key to support for
discontiguous networks. The topic of summarization is covered in detail in
Chapter 4.
Command Reference—EIGRP
Figure 7-12 provides a network model for the configuration of EIGRP. The
examples will cover configuring EIGRP on a Cisco router.
E0 E0 E0
S1 (56K) S1 (T1)
S0 S0
A
200.1.1.5/30 B
200.1.1.9/30 C
200.1.1.6/30 200.1.1.10/30
Figure 7-12 Example network for commands.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 209
EIGRP 209
Initial Configuration
An initial configuration of the routers will be performed, and the route tables
will be shown before the EIGRP routing protocol is configured.
routerA#configure terminal
routerA(config)#interface fastethernet 0 (1)
routerA(config-if)#ip address 192.168.10.0 255.255.255.0 (2)
routerA(config-if)#exit (3)
routerA(config)#interface serial 1 (4)
routerA(config-if)#ip address 200.1.1.4 255.255.255.252 (5)
routerA(config-if)#bandwidth 56 (6)
routerA(config-if)#exit
routerA(config)#
routerB#configure terminal
routerB(config)#interface fastethernet 0
routerB(config-if)#ip address 192.168.20.0 255.255.255.0
routerB(config-if)#exit
routerB(config)#interface serial 0
routerB(config-if)#ip address 200.1.1.4 255.255.255.252 (7)
routerB(config-if)#bandwidth 56
routerB(config-if)#exit
routerB(config)#interface serial 1
routerB(config-if)#ip address 200.1.1.8 255.255.255.252 (8)
routerB(config-if)#bandwidth 1544
routerB(config-if)#exit
routerB(config)#
routerC#configure terminal
routerC(config)#interface fastethernet 0
routerC(config-if)#ip address 192.168.30.0 255.255.255.0
routerC(config-if)#exit
routerC(config)#interface serial 0
routerC(config-if)#ip address 200.1.1.8 255.255.255.252
routerC(config-if)#bandwidth 1544
routerC(config-if)#exit
routerC(config)#
210 Chapter 7
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
EIGRP 211
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Configuring EIGRP
routerB#config-term
routerB(config)#router eigrp 100
routerB(config-router)#network 192.168.20.0
routerB(config-router)#network 200.1.1.4
routerB(config-router)#network 200.1.1.8
routerB(config-router)#passive-interface fastethernet 0
routerB(config-router)#exit
routerB(config)#int s1
routerB(config-if)#bandwidth 56
routerB(config-if)#exit
routerB(config)#
routerC#config-term
routerC(config)#router iegrp 100
routerC(config-router)#network 192.168.30.0
routerC(config-router)#network 200.1.1.8
routerC(config-router)#passive-interface fastethernet 0
routerC(config-router)#exit
routerC(config)#
10_772739 ch07.qxp 3/3/06 9:24 PM Page 212
212 Chapter 7
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
EIGRP 213
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
routerC#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
214 Chapter 7
routerX#config term
routerX(config)#router eigrp
routerX(config-router)#maximum-paths x (1)
where:
(1) x = (1-6)
routerX#config term
routerX(config)#router iegrp 100
routerX(config-router)#variance 88
routerX(config-router)#exit
where:
(1) shows default K values being assigned.
10_772739 ch07.qxp 3/3/06 9:24 PM Page 215
EIGRP 215
routerX(config)#int s0
routerX(config-if)#show ip interface s0
Scan the output for the statement “Split horizon is enabled” or “Split hori-
zon is disabled.” Split horizon can be forcibly enabled or disabled on an inter-
face level with the following command:
routerX(config-if)#{no} ip split-horizon
Configuring Summarization
Auto-summarization is ON by default. Configuration commands for disabling
auto-summarization and/or configuring manual summarization are given in
Chapter 4, starting on page 130. As with IGRP, manual summarization is con-
figured at the interface level. The following example summarizes address
range 150.1.0.0–150.1.4.0 as 150.1.0.0:
routerX(config)#router eigrp
routerX(config-router)#ip classless
216 Chapter 7
where:
(1) disables sending routing updates through this interface.
routerX(config)#router eigrp
routerX(config-router)#ip Hello-interval eigrp x
The default Hello interval is 5 seconds for bandwidth links greater than T1.
Less than T1 default interval is 60 seconds. The hold-time timer must be
altered if the Hello interval is altered to maintain a 3:1 ratio of hold-time to
Hello interval.
routerX(config)#router eigrp
routerX(config-router)#ip hold-time eigrp x
routerX(config)#router eigrp
EIGRP 217
routerX(config)#router eigrp
routerX(config-router)#timers active-time x (1)
routerX#show ip protocols
218 Chapter 7
Troubleshooting Commands
If you get into trouble, these commands can help get you out.
where:
(1) The command debug eigrp packets is used to see options for filter-
ing out specific packet types.
where:
(1) restricts the debug command to EIGRP packets concerning the speci-
fied neighbor.
routerX#show debug
10_772739 ch07.qxp 3/3/06 9:24 PM Page 219
EIGRP 219
routerX#undebug all
10_772739 ch07.qxp 3/3/06 9:24 PM Page 220
220 Chapter 7
Notes
1. Technically there are six packet types. The sixth packet type relates to
Novell IPX, which is not covered here.
2. To be recognized as neighbors, routers sharing the same link must be
configured with the same autonomous system (AS) number, and their
configured timer settings must be identical.
3. Later versions of the IOS reset the hold-time timer upon receipt of any
type of EIGRP packet from a neighbor.
4. Routes not meeting the feasibility condition are actually installed into
the topology table, but they are hidden. This improves performance if
the route is later accepted.
5. Up to six routes to the same network can be installed into the route
table if their metric is equal. Additionally, EIGRP, like IGRP, supports
unequal-cost multipath routing through the use of the variance com-
mand. The variance command was explained on page 173.
6. The receipt of any EIGRP packet resets the hold-time timer in later IOS
versions.
7. Although hop count is not used in a route’s metric, there is a field for
hop count in the packet structure of update packets.
8. If the route is dropped, once the broken link is repaired, routers B and C
will “discover” the route and the route will again be propagated
throughout the network.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 221
CHAPTER
8
OSPF
Overview
OSPF (Open Shortest Path First) is the defacto open standard routing protocol
for large networks. Table 8-1 shows the basic characteristics of OSPF.
Metric Cost
221
11_772739 ch08.qxp 3/3/06 9:25 PM Page 222
222 Chapter 8
OSPF 223
OSPF Background
OSPF, like IGRP and EIGRP, was developed to overcome the shortfalls of RIP.
RIP’s relatively slow convergence, tendency to create routing loops, 15 hop
count limitation, and RIPv1’s lack of support for CIDR made it untenable for
larger networks. Most of the development of routing protocols designed to
replace RIP was done in the late ‘80s and early ‘90s. Although RIPv2 and IGRP
improved somewhat on RIPv1, large networks (over 50 routers for example)
needed a more scalable solution for propagating and maintaining routes.
While Cisco was developing its proprietary EIGRP protocol, an open stan-
dards committee (the IETF) developed OSPF. OSPF is mostly used on enter-
prise networks and some ISP backbones.1
Both EIGRP and OSPF are suitable for large networks but each protocol
approaches the problem of large-scale routing differently. EIGRP is a distance
vector protocol that uses some link-state methods and makes use of the Dif-
fusing Update Algorithm (DUAL) to learn and maintain routes, whereas OSPF
employs strictly link-state methods and uses the Shortest Path First (SPF) algo-
rithm to learn and maintain its routes. (Chapter 4 explains how distance vec-
tor and link-state routing protocols function.)
11_772739 ch08.qxp 3/3/06 9:25 PM Page 224
224 Chapter 8
Explaining OSPF
OSPF has a lot of terminology associated with it. Routing terminology is not
always intuitive, and the resulting “terminology fog” can often be a hindrance
rather than a facilitator to learning any technology. It would be a shame for this
to happen with OSPF, because although the protocol has a reputation for being
complex, it is in fact an efficient, elegant solution for populating route tables
with optimal paths to networks. Every feature built in to OSPF is there for a
good reason and the more you understand the why behind the architecture of
OSPF, the easier the protocol itself is to understand.
It’s easy to get into a chicken-or-egg thing when explaining OSPF, so after a
short introduction designed to give you an idea of how OSPF works and the
vision behind its architecture, OSPF terminology will be explained in brief.
From there, two passes will be made through the core material. In Part 1, the
building blocks of OSPF will be explained. You will learn about the different
network types the protocol runs on and the various elements of OSPF that
come into play in different network configurations. OSPF operation in both
single and multiple area configurations will be covered. In Part 2, all of the
building blocks will be tied together, providing specific examples of how to
implement OSPF in various network configurations. A command reference
with several example models follow. Although this approach gives rise to a
certain amount of redundancy, you want a little repetition with OSPF.
Introduction to OSPF
OSPF has evolved into the industry standard for larger networks requiring an
interior routing protocol, partially because it is built on open standards. OSPF
fully supports classless addressing and thus it supports subnetting, variable
subnetting (VLSMs), and CIDR. Unlike EIGRP, OSPF supports only one routed
protocol—IP. OSPF was designed from the beginning as an Internet rout-
ing protocol. OSPF has specific extensions for dealing with routes learned
from the pervasive routing protocol for handling interdomain routing on the
Internet: BGP.
Inherent to the design of OSPF is its ability to support a hierarchical routing
environment. An OSPF autonomous system can be divided into multiple areas
that share a controlled amount of routing information across their borders.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 225
OSPF 225
N OT E It should be underscored that the term hierarchy does not imply that
areas occur within areas, within areas, and so on. Rather, it is a hub and spoke
design; an approach that mitigates the possibility of routing loops.
Initial Startup
OSPF initializes by first building neighbor relationships with routers sharing a
common network link. This is the same as with EIGRP. But that is where the
analogy ends. Unlike EIGRP, OSPF shares routing information only with cer-
tain neighbors. The neighbor relationship with a router must be upgraded to a
status known as adjacent before the exchange of routing information actually
11_772739 ch08.qxp 3/3/06 9:25 PM Page 226
226 Chapter 8
OSPF 227
Running SPF
Once every router has a fully populated link-state database, the SPF algorithm
is run on each router to populate its route table. SPF first creates a shortest
path tree with the local router at the root of the tree. Performing this task on all
routers gives each router in the area a view of the network from its own per-
spective. Once the tree is built, a map of the area exists. The shortest path to
each network in the tree is calculated and the route table is populated. The
metric used by OSPF to determine the shortest path is cost, with cost being
unspecified by the RFC for OSPF. A popular implementation of OSPF is the
Cisco IOS, which defines cost as simply the bandwidth of the link. The speed
of a link is converted to a value ranging from 1 to 65535. The higher the band-
width, the lower the number. The exact formula will be shown when OSPF
metrics are covered on page 284. Figure 8-1 illustrates the network model used
for building the shortest path tree.
Figure 8-2 shows a simplified view of the link-state database on router A
before the SPF algorithm is run.
When the link-state database is complete, the SPF algorithm builds the
shortest path tree. Figure 8-3 shows router A’s tree.
(56K)
S0 S1
E (56K)
200.1.1.16/30 200.1.1.20/30
228 Chapter 8
Router A is directly connected to network 192.168.1.0. The mask is /24. The bandwidth is 100mbp/s
Router A is directly connected to network 200.1.1.4. The mask is /30. The bandwidth is 1.544mbp/s
Router A is directly connected to network 200.1.1.16. The mask is /30. The bandwidth is 56kbp/s
Router B is directly connected to network 192.168.2.0. The mask is /24. The bandwidth is 100mbp/s
Router B is directly connected to network 200.1.1.4. The mask is /30. The bandwidth is 1.544mbp/s
Router B is directly connected to network 200.1.1.8. The mask is /30. The bandwidth is 1.544mbp/s
Router C is directly connected to network 192.168.3.0. The mask is /24. The bandwidth is 100mbp/s
Router C is directly connected to network 200.1.1.8. The mask is /30. The bandwidth is 1.544mbp/s
Router C is directly connected to network 200.1.1.12. The mask is /30. The bandwidth is 1.544mbp/s
Router D is directly connected to network 192.168.4.0. The mask is /24. The bandwidth is 100mbp/s
Router D is directly connected to network 200.1.1.12. The mask is /30. The bandwidth is 1.544mbp/s
Router D is directly connected to network 200.1.1.20. The mask is /30. The bandwidth is 56kbp/s
Router E is directly connected to network 200.1.1.16. The mask is /30. The bandwidth is 56kbp/s
Router E is directly connected to network 200.1.1.20. The mask is /30. The bandwidth is 56kbp/s
Figure 8-2 Simplified view of the link-state database before SPF is run.
<root>
Router A
192.168.0.1 cost=1
200.1.1.4 cost=64
200.1.1.16 cost=1785
Router B Router E
192.168.0.2 cost=1 200.1.1.16 cost=1785
200.1.1.4 cost=64 200.1.1.20 cost=1785
200.1.1.8 cost=64
Router C Router D
192.168.0.3 cost=1 192.168.0.4 cost=1
200.1.1.8 cost=64 200.1.1.12 cost=64
200.1.1.12 cost=64 200.1.1.20 cost=1785
Router D Router C
192.168.0.4 cost=1 192.168.0.3 cost=1
200.1.1.12 cost=64 200.1.1.8 cost=64
200.1.1.20 cost=1785 200.1.1.12 cost=64
Router E Router B
200.1.1.16 cost=1785 192.168.0.2 cost=1
200.1.1.20 cost=1785 200.1.1.4 cost=64
200.1.1.8 cost=64
Figure 8-3 Simplified view of the shortest path tree created by the SPF algorithm.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 229
OSPF 229
The SPF tree gives you an idea of how the network is viewed by router A.
For example, router A can see that there are two paths to the 192.168.0.4/24
subnet attached to router D. One path is via router E and the other is via
routers B and C. The bandwidth of the links have been converted to a cost
value so SPF can easily determine which path is better. It is now a straightfor-
ward process of calculating the shortest path to each network and populating
the route table as shown in Figure 8-4.
In the case of the path to the 192.168.0.4, the route through routers B and C
was chosen as the shortest (quickest) path and installed into the route table.
The path through the T1 links is far quicker than the path through the 56K
links, even though a greater number of routers are traversed. A more complete
form of this process will be illustrated after additional fundamentals of OSPF
have been covered. Figure 8-5 summarizes the steps required to initialize
OSPF and commence routing.
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-4 Results of the show ip route command on router A after the route table is
populated from the SPF algorithm.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 230
230 Chapter 8
Establish neighbors
Commence routing
Maintaining Routes
Once every router achieves a complete link-state database, runs the SPF algo-
rithm, and populates the route table, OSPF generates minimal network traffic.
Hello packets are sent periodically between neighboring routers to keep the
neighbor relationship alive (usually every 10 seconds). Additionally, a router’s
link-state database is re-flooded every 30 minutes. Even though LSAs are sent
11_772739 ch08.qxp 3/3/06 9:25 PM Page 231
OSPF 231
reliably with OSPF’s proprietary mechanism for assured delivery, they are re-
sent periodically to be absolutely sure every router has a synchronized link-
state database. An accurate link-state database is critical to the proper
functioning of the SPF algorithm. If for some reason a router’s link-state data-
base becomes corrupt, this periodic flooding of LSAs insures that any issues
regarding the integrity of the database will be short-lived.
Network Failures
If a router or network link fails, the failure is detected through the loss of layer
2 data-link keep-alive packets. This will normally occur even before the loss of
Hello packets from an established neighbor is detected. In either case, the
router noticing the failure, after timing out the link and/or neighbor, will
notify adjacent neighbors that a change has occurred in the state of the link.
This information is propagated like any other update: an LSA is flooded
throughout the area. As each router receives the LSA, it updates its link-state
database, runs the SPF algorithm, and modifies the route table as needed. This
process happens fast, because the link is timed out quickly and the update
packet is small and confined within an area, giving OSPF the reputation for
quick convergence.
OSPF Areas
A fundamental design aspect of OSPF is that the autonomous system running
the protocol can be divided into multiple areas. What exactly does that mean?
Quite simply, this is one of OSPF’s many methods for controlling the traffic
generated by routing updates (LSAs).
The type of LSA discussed so far, the one used within an area, carries
enough detailed information about routers and their links to build the topol-
ogy map required by SPF. But this process takes up router resources and band-
width. As networks grow to incorporate multiple buildings, multiple cities, or
even multiple continents, the need for every router to have a detailed map of
the entire system is lessened. Why is that? Keep in mind that the SPF algorithm
only wants all that topology detail to choose the optimal path to a network. On
larger networks, not every router needs detailed information about every net-
work to choose the best path. This concept gave birth to the OSPF area. Areas
share routing information with each other, but only routes and their metrics—
not topology information. Figure 8-6 illustrates this principal.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 232
232 Chapter 8
OSPF area
Building A I am a border router. I am
sending small "summary" LSA's
about the networks in building A.
These LSAs are small because
they only include network routes
and their costs.
OSPF Area
Building B
Figure 8-6 This network model makes a case for not propagating detailed route
information between buildings.
OSPF 233
After all, there is no topology information to act on. Rather, the route is con-
sidered for inclusion into the route table based simply on its metric. Obviously,
this method saves on the processing power required to run the SPF algorithm.
The fewer the SPF calculations, the faster routing commences. Areas are a win-
win feature of OSPF, provided care is taken that optimal routing is not
impinged.
Finally, the bandwidth savings of summary LSAs sent between areas is fur-
ther leveraged when route summarization is introduced. Aggregating many
subnets into a single network ID means fewer summary LSAs are required to
describe the networks within an area. Summary LSAs and route summariza-
tion go hand-in-hand because with OSPF summarization only occurs at the
border of an area (as it should). In other words, summarization is more an inte-
gral part of OSPF than with other routing protocols. The same can be said of
default routing, which OSPF also tasks border routers to handle. Route sum-
marization and default routing are not an after thought with OSPF. They need
to be considered as part of the overall design of the implementation process. It
is said that in real estate, it’s all about location, location, location. In OSPF, it’s
all about planning, planning, planning. Understand the concept of areas and
you are well on your way to successfully implementing a well-architected
OSPF system.
OSPF Terminology
Like EIGRP, OSPF has an abundant amount of terminology. Therefore, a first
pass will be made through the terms surrounding OSPF in order to familiarize
you with them and gain some perspective. These terms will be further defined
as needed later. This section can also serve later as an OSPF glossary of terms.
234 Chapter 8
Hello Packets
This is one of five packet types unique to OSPF. Hello packets are sent out all
OSPF enabled interfaces of a router running the OSPF process. They are used
to identify neighboring routers with at least one interface on the same subnet.
Hello packets are multicast to multicast address 224.0.0.5 (known as All-
SPFRouters). Hello packets also act as keep-alives between neighboring
routers.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 235
OSPF 235
Neighbor
Routers sharing a common network link and exchanging Hello packets
become neighbors. Certain OSPF configuration parameters on each router
interface must match for two routers to become neighbors.
Adjacency
An adjacency is a status established between neighboring routers to enable
actual routing information to be exchanged (link-state databases are shared).
This additional relationship between routers helps minimize the amount of
traffic generated by routing updates.
DRother
DRother defines all routers sharing the segment that are not the DR or BDR.
This is terminology in keeping with describing all OSPF routers, regardless of
whether they are DRs or not (AllSPFRouters), and describing DRs just desig-
nated and BDRs (AllDRouters).
Hello Protocol
The Hello protocol uses Hello packets to establish neighbors and adjacencies,
and handles the election of the DR and BDR.
Router Priority
Router priority, which can be manually configured, dictates which routers are
eligible to become DR and BDR. The higher the router priority the more likely
a router will win an election to become DR or BDR.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 236
236 Chapter 8
Router ID
The router ID uniquely identifies each OSPF router. The highest IP address on
the router becomes the router ID. If a loopback address has been configured, it
becomes the router ID regardless of numerical precedence.
Router States
OSPF, like other routing protocols such as EIGRP and BGP, uses a finite state
machine.4 OSPF routers transition through various states as neighbor and adja-
cency relationships are formed with other routers.
Down State
This is one of three states used to form a neighbor relationship between two
routers. The down state is the initial state when the router is initialized. The
router is sending Hello packets but has not received a reply from any potential
neighbors.
Init State
The init state occurs when router X receives a Hello packet from router Y, but
the packet does not yet contain router X’s Router ID. This is also known as a 1-
way state.
2-Way State
This is the third and final state for establishing a neighbor relationship. It
occurs when router X receives a Hello packet from router Y, and the packet
contains router X’s router ID. At this point, a neighbor relationship has been
established. This is also the starting point for establishing adjacencies between
routers.
Attempt State
This state only applies to network types with manually configured neighbors
(for example, non-broadcast, multi-access networks). If a router loses contact
with an established neighbor (loss of Hello packets), it will enter the attempt
state. In the attempt state, periodic Hello packets are sent at the poll-interval
(defaults to 120 seconds) rather than the Hello-interval (defaults to 60 seconds
on NBMA networks). This reduced rate conserves bandwidth but still allows
the neighbor relationship to be re-established.
Exstart State
In this state, link-state databases are exchanged between pairs of adjacent
routers. The router with the highest interface address becomes the master and
will initiate the exchange (if a DR exists, it always becomes a master). The
other router becomes the slave.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 237
OSPF 237
Exchange State
The router designated master begins sending DataBase Description (DBD)
packets, which describe an LSA, to the slave. Upon completion, the slave reci-
procates to the master.
Loading State
This state is only entered when a router must request, or is waiting for, addi-
tional information from another router after the initial exchange of database
description packets.
Full State
When a router’s link-state database is fully synchronized, it is in the full state.
Upon reaching this state, the Shortest Path First (SPF) algorithm is run on the
link-state database (topology table), the route table is built, and the routing of
network packets commences.
Flooding
This term is used to describe the transmission of routing update packets
throughout an area. Routing updates are multicast and relayed by each adja-
cent router throughout the area so that all adjacent routers in the area receive
the update. Flooding is done reliably, with an acknowledgement received for
each LSA sent.
Areas
An area in OSPF is a logical grouping of routers that share the exact same link-
state database. Areas are one of several mechanisms for controlling the
resources consumed by routing updates. It is not necessary for all routers in an
autonomous system to receive detailed link-state information from all other
routers in the system, and areas provide a means to limit such traffic. OSPF
allows for several types of areas, depending on the network configuration.
Backbone Area
This is the only mandatory area in an OSPF network. The backbone area is
always designated area 0 (or 0.0.0.0.). There can be one, and only one area 0.
Normally, all other areas connect to area 0 and pass routing traffic bound for
other areas through area 0. As with all area types, link-state advertisements are
summarized before being advertised to other areas.
Standard Areas
A standard area is similar to the backbone area in terms of the amount of rout-
ing information circulated. Full routing information is shared between a stan-
dard area and area 0 (but not topology information). A standard area is often
11_772739 ch08.qxp 3/3/06 9:25 PM Page 238
238 Chapter 8
distinguished by the fact that it has multiple gateways (internal and/or exter-
nal) that connect to area 0 and possibly connects directly to other autonomous
systems.
Stub Areas
Stub areas generally have only one or a small number of gateways connecting
their networks to area 0. Stub areas usually have no direct connection to other
autonomous systems except through the backbone (area 0). Because of this,
certain types of routing information can be summarized at the border, and
bandwidth can be saved. Two stub area types are specified in the RFC for
OSPF, with a third type proprietary to Cisco routers.
Stub Area
Stub areas (also referred to as standard stub areas) receive only a subset of rout-
ing information from area 0. External routes (routes outside the OSPF system)
are not propagated into a stub area. Instead, a default route is injected. All traf-
fic bound for destinations outside the system use the default route that points
to a router bordering the stub area and area 0.
Partitioned Area
A partitioned area is not an area type. A partitioned area occurs when a failed
link causes one or more routers within an area to lose communication with one
or more routers within the same area.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 239
OSPF 239
Isolated Area
An isolated area occurs when one or more routers within an area are unable to
find a path to the backbone.
Virtual Links
Ideally, all OSPF areas should connect to area 0 directly. Virtual links allow an
area to instead connect to area 0 via another area. Virtual links can also be used
to repair a partitioned area until the links come back up.
Transit Area
This is not a specific area type, but rather a characteristic of the area when con-
figured to participate in a virtual link, in which case traffic just passes through
the area on the way to another area (as defined in the RFC specifying the oper-
ation of OSPF). In other contexts, the backbone area can be thought of as a tran-
sit area since in normal operation traffic passes from one area to another area
via area 0, without a virtual link.
Router Types
Router types go hand-in-hand with area types and are matched to the role they
play within the area.
Internal Router
An internal router has all interfaces contained within a single area and does
not connect to any other areas.
Backbone Router
This is a router that has at least one interface in area 0. A backbone router that
also has an interface in another area is also considered an ABR.
240 Chapter 8
Router LSA—Type 1
This packet type is generated by all routers. It describes the routers’ links and
their states. The router LSA is flooded to all adjacent neighbors within an area
on multicast address 224.0.0.5.
Network LSA—Type 2
This is generated only by DRs. This type of LSA describes the number of
routers attached to the subnet the DR serves and also contains the subnet mask
for the subnet.
OSPF 241
Segment
The term “segment” has a flexible definition in general networking. In discus-
sions of OSPF, a segment usually refers to a multi-access network identified by
a unique IP network number.
OSPF Timers
OSPF does not employ the timers associated with distance vector protocols,
but the protocol does use a number of timers related to neighbor maintenance,
link-state updates, and route flapping. Some of the more commonly referenced
timers are listed here. See the current OSPF RFC (2328) for a complete list.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 242
242 Chapter 8
Hello-Interval
This timer specifies how often a router sends a Hello packet. The default
period is 10 seconds on broadcast multi-access networks and 60 seconds on
non-broadcast, multi-access networks. The Hello interval value is included in
a router’s Hello packet. This timer must be set to the same value on routers that
want to become neighbors.
RouterDeadInterval
Hello packets include a value for a field called RouterDeadInterval, which
specifies how long a router should wait to receive a Hello packet from an
established neighbor. If continuous Hello packets are not received, the neigh-
bor relationship is terminated. The default value of RouterDeadInterval is 4
times the Hello interval. The value of RouterDeadInterval must be set the same for
two routers to become neighbors.
SPF Hold-Time
This specifies how long a router should wait after calculating the route table
before it will calculate the route table again. This prevents overloading router
resources due to route flapping (a route constantly going up and down). The
default value for the SPF hold-time is 10 seconds.
Poll-Interval
Applies only to non-broadcast network types. Specifies how often a router
should poll (send a Hello packet to) a neighbor that has transitioned from a
status of at least 2-way to a status of attempt. The default poll-interval is 120
seconds. This is used to reduce network traffic generated by Hello packets
while attempting to reestablish a lost neighbor relationship.
LSA Retransmit-Interval
LSAs sent in response to a link-state request are sent reliably. If an acknowl-
edgement for the packet is not received, the LSA is retransmitted. The LSA
retransmit-interval specifies how often the LSA is retransmitted. When LSAs
11_772739 ch08.qxp 3/3/06 9:25 PM Page 243
OSPF 243
are retransmitted, they are sent unicast to the host that has not acknowledged
the transmission.
Wait Timer
This timer applies only to network types that elect a DR and BDR. It specifies
how long a router should wait to see a DR and BDR listed in a neighbor’s
Hello packet before forcing an election of a DR or BDR. It defaults to the same
value as the RouterDeadInterval timer.
RxmtInterval
This is the amount of time a router waits before retransmitting a database
description packet. It relates to the synchronizing of link-state databases.
244 Chapter 8
OSPF 245
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type1, 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, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-7 The various types of OSPF path types are indicated in the output of a route
table.
246 Chapter 8
Second, OSPF cares whether the network type is multi-access or not. This
second consideration is strictly for running the OSPF protocol efficiently. On a
multi-access network, the possibility exists for many routers to have an inter-
face sharing a single network segment (subnet). In that case, rather than have
every router forward its link-state database to every other router on the seg-
ment, it’s mathematically more economical to elect a single router to receive all
LSAs from all attached routers, and then transmit the completed link-state
database back to all attached routers. The router chosen to act as the reception
point for the segment’s router LSAs is known as the Designated Router (DR).
The DR has a deputy known as the Backup Designated Router (BDR). The
BDR takes over if the DR fails. When a DR and BDR are elected, all routers on
the segment form an adjacency with the DR and the BDR and forward their
link-state databases to the DR and BDR. The DR then forwards the completed
link-state database back to each router on the segment. The greater the number
of routers sharing the segment, the more efficient this method is. Point-to-
point networks on the other hand, only have two routers on a segment, so a
DR is not required.
For the DR concept to work, the DR and BDR must have direct access to each
router on the segment. It is by design that the DR and BDR be able to transmit
link-state information directly. The routing data cannot be passed indirectly to
the target routers through another router. This is not a problem on broadcast
based multi-access media such as Ethernet or Token Ring. But care must be
taken when a designated router is elected in a non-broadcast, multi-access envi-
ronment (NBMA) like some Frame Relay or ATM implementations. Why? As
the examples that follow illustrate, a DR or BDR may or may not have direct
access to all routers on the subnet, due to the underlying WAN topology. If the
network is not configured in a manner that allows for a DR and BDR to
directly reach every router on the segment, it may be wiser to not use a DR/
BDR configuration and pay the price of incurring a bit more routing traffic.
Network Types
Four unique network types (data-link media) exist from OSPF’s point of view,
with additional variants for one of the types. In many cases, OSPF will auto-
matically detect the network type and configure itself accordingly. At other
times, the network type must be set manually with the ip ospf network
command.6
OSPF 247
192.168.0.4/24 192.168.0.5/24
Figure 8-8 A broadcast, multi-access network. A DR will handle synchronizing the link-
state databases.
Point-to-Point
In this case, there are only two devices on the subnet (see Figure 8-9). These
devices are typically a serial link with PPP or HDLC encapsulation and one
router on each end of the link. Broadcasts and multicasts are supported. No
DR will be elected.
Point-to-point networks are a common WAN type used for serial links and
will run over media such as a fractional T1 line. Such a network type will have
one router attached to each end of the line. OSPF will recognize this network
type as point-to-point, and because this network type supports broadcasts, a
neighbor relationship between the two routers will be automatically formed.
Since there are only two routers on this type of network, no DR or BDR will be
elected. Instead, the two routers will form a neighborhood relationship, imme-
diately upgrade it to adjacent, and multicast their link-state databases to each
other on multicast address 224.0.0.5 (AllSPFRouters). Multicasts are used in
lieu of unicasts to allow for the possibility of unnumbered links, where the
address of each router’s interface used for the point-to-point network may not
be known.
200.1.1.5/30 200.1.1.6/30
Figure 8-9 A point-to-point network. No DR is required.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 248
248 Chapter 8
200.1.1.9/29 200.1.1.10/29
Home Office SF
200.1.1.11/29 200.1.1.12/29
LA NY
Figure 8-10 Fully meshed Frame Relay network. Permanent virtual
circuits connect every router to every other router.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 249
OSPF 249
200.1.1.5/30
200.1.1.9/30
200.1.1.13/30 200.1.1.6/30
Home Office SF
(hub)
200.1.1.10/30 200.1.1.14/30
LA NY
Figure 8-11 Point-to-point sub-interfaces used in a partial mesh Frame
Relay network in a hub-spoke topology; burns one subnet ID for each link.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 250
250 Chapter 8
Demand Circuits
A demand circuit (also known as a dial-on-demand circuit) is unique in that the
link is only established when there is a need to send traffic. Quite often, the cus-
tomer pays a metered rate for the service. The more it is used, the more it costs.
ISDN is an example of this technology. The issue with demand circuits and rout-
ing protocols is that the routing protocol will “wake up” the line just to send
periodic routing updates. In the case of OSPF, periodic routing traffic occurs
with Hello packets (sent as a keep-alive feature to be sure the link is up) and with
summary LSAs (sent every 30 minutes even if no change has occurred).
200.1.1.9/29 200.1.1.10/29
Home Office SF
(hub)
200.1.1.11/29 200.1.1.12/29
LA NY
Figure 8-12 Point-to-multipoint sub-interfaces are the recommended
configuration for partial mesh Frame Relay networks.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 251
OSPF 251
OSPF Areas
The concept of OSPF areas was discussed in the introduction to this section.
The main reason to carve an OSPF autonomous system into areas is to manage
the amount of routing information carried on the network. Most routing infor-
mation is carried in link-state advertisements (LSAs). Routers advertise
detailed information about a network link within an LSA packet. It is the shar-
ing of these LSAs that allows every router to become aware of every network
link and build its own topology table. The type of LSA that performs this work
is known as a Router LSA. On larger networks, the kind of detail carried in a
Router LSA is simply not required by all routers. Bandwidth can be saved if
more distant routers receive only the amount of routing information required
to perform optimal routing. OSPF accommodates this need with a special type
of LSA that contains a subset of the data stored in a normal LSA. Areas can also
provide a layer of security because the internal area topology is not distributed
outside of the area The demarcation between groups of routers that circulate
router LSAs is the OSPF area border.
Knowing when to configure an OSPF system into multiple areas, and an
explanation of the special LSA types that circulate between areas, will be cov-
ered shortly. But first, the operation of OSPF in a single area will be covered.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 252
252 Chapter 8
200.1.1.5/30 200.1.1.6/30
OSPF 253
254 Chapter 8
Now let’s look under the hood at how this all happens.
Becoming Neighbors
Neighbor relationships must be established between all routers with an inter-
face that shares a common network link. Several parameters—stored in the
Hello packet—must be identical for two routers to become neighbors. The
parameters are as follows:
Network mask—net mask of the sending router
Area ID—area ID of the sending interface
Hello interval—how often Hello packets are transmitted
Dead interval—how long to wait for Hello packets before terminating neighbor
Authentication type and password—optional
Stub area flag—specifies the type of stub area, if applicable
Be advised that if you alter the Hello interval and/or dead intervals, you
must change the setting on all routers sharing the link, or neighbor relation-
ships will not be established. If neighbors are not being established, review the
list to be sure all parameters match. Naturally, not all items on the checklist
have been covered yet.
Becoming neighbors requires bidirectional communication between routers.
The routers transition through three distinct states to become neighbors:
1. Down state
The down state is the initial state when a router is first powered up
or when the OSPF process is reinitialized. In this state, the router
sends Hello packets out all OSPF-enabled interfaces on multicast
address 224.0.0.5 (AllSPFRouters). For clarity, let’s call this router
router A. In this state, the neighbor list field is empty.
2. Init state
Before router A can send a Hello packet to router B, router A receives
a Hello packet from router B (see Figure 8-14). Router A does not see
its own router ID listed in the neighbor list field of the packet
because router B has not received any Hello packets from router A,
but router A now knows there is another router out there and transi-
tions to the init state (also known as a 1-way state).
11_772739 ch08.qxp 3/3/06 9:25 PM Page 255
OSPF 255
A B
Hello
Figure 8-14 Router A enters init state upon reception of a Hello packet.
Now in the init state, router A adds router B’s router ID to the neigh-
bor list field for all subsequent outbound Hello packets, and sends a
populated Hello packet to router B, as shown in Figure 8-15.
3. 2-way state
In Figure 8-16, router A receives a Hello packet from router B with
router A’s router ID listed in the neighbor list field. Both routers are
now listed in the neighbor list field of the Hello packets. This indi-
cates that bidirectional communication has been established—the
neighbor relationship has been established.
A B
Hello
Figure 8-15 Router A populates a Hello packet with its router ID.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 256
256 Chapter 8
A B
Hello
Establishing an Adjacency
Routers that will become adjacent to one another continue communicating
after the neighbor relationship has been established. The routers transition
through the following four additional states to establish the adjacency,
whereby they share (synchronize) their link-state databases. In this example of
a point-to-point network, the two neighboring routers will immediately estab-
lish an adjacency.
1. Exstart state
In exstart state, the routers determine which one will share its link-
state database first. Link-state databases are exchanged via the afore-
mentioned database description packets (DDPs). With no DR
present, the router that goes first is strictly arbitrary and is deter-
mined by router ID. The router with the highest router ID becomes
the master, while the other router becomes the slave (also known as
primary and secondary). This is determined by each router sending
a single DDP to its adjacent neighbor. The packet contains no link-
state data, but simply includes the local router ID and a sequence
number.
The router with the higher Router ID becomes the master and sends
a populated DDP to the slave, using the same sequence number for
the first packet. The slave expects the first DDP to have the agreed
upon sequence number.
2. Exchange state
Now that the master and slave roles are agreed upon, and a begin-
ning sequence number is set, the master sends the first DDP, and the
slave responds with a populated DDP describing its link-state data-
base. The DDP sent by the slave uses the same sequence number as
the master. The exchange state has commenced.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 257
OSPF 257
Once the master receives the slave’s first populated DDP, the master
bumps the sequence number and sends the next DDP. Only one
DDP is outstanding at a time. Only the master can retransmit a DDP.
It waits a period of time set by the RxmtInterval timer before ever
retransmitting a DDP. The slave does not need a retransmit capabil-
ity, because the master receiving a DDP from the slave proves the
slave received the master’s DDP. If the master does not receive a
DDP from the slave within the timeout period, the master retrans-
mits the same DDP using the same sequence number. Only upon
receipt of a DDP from the slave is the next DDP sent by the master.
The process of exchanging DDPs continues until both routers have
exchanged the contents of their link-state databases.
The database description packets sent between routers contain a
subset of a single link-state entry, specifically, the LSA header, which
contains the link-state ID. The packet also contains general identifi-
cation information and other fields (see Tables 8-3 and 8-4).
The receiving router uses the link-state ID, the age, and the sequence
number to determine if it already has current information for this link.
If the receiving router does not already have a matching link-state ID,
or if the DDP contains a more recent version of an existing link-state
ID, then the router will generate a link-state Request requesting a
link-state Update (LSU). The request may be for one or more LSAs.
An LSU packet is the carrier for Link-State Advertisements, of which
there are 11 possible types. In the case of this database synchroniza-
tion, where an LSR has requested an LSU for details on one or more
links, a router LSA (Type 1) will be sent. Router LSAs contain the
core information of a link and are the primary means of synchroniz-
ing link-state databases within an area. (The pertinent fields of the
OSPF packets discussed in this section are listed at the end of this
section in Tables 8-2 through 8-8).
N OT E This is a good place to slow down and do a quick review, because LSAs
are where the rubber meets the road in OSPF. LSUs carry LSAs. LSAs carry link-
state information. Within an area, type 1 (router) LSAs are used to share link-
state database entries with adjacent neighboring routers. Type 1 LSAs are sent
in response to a link-state request, which was generated when the router
receiving a DDP determined that it had missing or outdated information for one
or more links. Type 1 (router) LSAs are also sent by each router every 30
minutes to insure the link-state databases remain synched.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 258
258 Chapter 8
3. Loading state
The loading state is not always required. It is entered only if there is
still business to do after all DDPs have been sent. There are two rea-
sons for this.
If any Link-State Requests were generated (due to receiving a DDP
that required a complete LSA), and the corresponding LSAs have
not been received by the time the DDPs have been sent, the routers
will enter the loading state.
Second, LSAs are sent reliably using the proprietary assured deliv-
ery mechanism built into OSPF. They are acknowledged with LSA
packets. Transmitted LSAs are queued in a Link-State Retransmis-
sion List. The LSA is retransmitted if the LSA retransmit-interval
timer expires. Unacknowledged LSAs will transition the router’s
state to loading. Only after any requested LSAs are acknowledged,
does the router transition out of this state.
4. Full state
The full state is entered when the adjacent routers’ link-state data-
bases are fully synchronized. LSAs have been received for all gener-
ated LSRs, and each LSA has been acknowledged. When the full
state is reached, the SPF algorithm is run and the route table is pop-
ulated. Routing can now commence.7
OSPF 259
If a router needs to invalidate an existing LSA, say because the link associated
to the LSA goes down, the router will generate a fresh LSA with the LsAGE field
set to MaxAge, which is 1 hour. The LSA will be flooded, and upon receipt, the
LSA will be purged from the link-state database of all routers in the area. Each
router will then run SPF and update their route tables as needed. This procedure
is referred to as premature aging in the RFC for OSPF.
260 Chapter 8
The DR and BDR do more work than other routers on the segment. Therefore,
you may want to control which routers take on the task of assimilating and
transmitting the link-state database. One may assume from the discussion so
far that simply setting the router priority of the two routers that are intended to
be the DR and BDR higher than the other routers on the segment would do the
job. That step will help, but be advised that if the routers that are elected DR
and BDR are not online when the election is held, they will not get elected
when they do come online. The first router with a priority of any value other
than 0 to come online becomes the DR. The only thing that can be done in this
case would be to force an election by temporarily taking the current DR and
BDR offline (the BDR must go offline because it will immediately be promoted
to DR when the DR goes down). Not an ideal solution, so naturally you want to
be sure these routers are online when the network is first brought up. Of
course, routers that should never be elected DR or BDR can have their priority
set to 0.
OSPF 261
The answer lies in the same reasoning that spawned the idea of the DR in the
first place—namely the mitigation of unnecessary routing traffic. SPF wants to
know how every router links to every other router in an area to accurately build
the area’s topology map. Normally a router will generate an LSA that identifies
the router on the other end of each link (excluding stub networks of course).
On a multi-access segment however, such reporting will cause a number of
redundant LSAs to be generated. Since the DR is fully aware of which routers
share the common link, it is in a position to report the router relationships
without the redundancy.
vice versa, and a change in the metric value of a link all require each router in
the area to be notified. The router sourcing the change of a link’s state will
flood the area with a type 1 (router) LSA that describes just the changed link.
Regardless of any changes to links, each LSA in a link-state database is
reflooded by the router the link is connected to (known as the originating
router) every 30 minutes. This insures the integrity of the database on each
router.
262 Chapter 8
DRouters
DR BDR
All DRouters
Figure 8-18 Router designations for synchronizing link-state databases
on a multi-access network.
DR BDR
Figure 8-19 Adjacencies formed on a multi-access network.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 263
OSPF 263
264 Chapter 8
the dead interval, which establishes how long a router will wait for a peri-
odic Hello packet before declaring a neighbor dead. The default values for
these timers is 10 seconds for Hello packets (30 seconds on NBMA media),
and 40 seconds for the dead interval (120 seconds on NBMA media).
■■ Router Priority: Determines the likelihood of a router being elected as
the DR or BDR. The default value is 1. The higher the value, the more
likely the router will be elected. A value of 0 removes the router from
contention as a DR or BDR.
■■ RouterDeadInterval: This timer determines how long to wait if the
stream of periodic Hello packets that maintain the neighbor relation-
ship is discontinued. The default is 4 times the Hello interval. If the
timer expires, the neighbor relationship is terminated.
■■ Designated Router: This field will be filled in when a DR has been
elected. It indicates the presence of a DR (no need for an election) and
allows the router to unicast packets to the DR. A value of 0.0.0.0 indi-
cates there is no DR. This forces an election.
■■ Backup Designated Router: Same as for Designated Router.
■■ Neighbor List: When a router receives a Hello packet from another
router, the receiving router will add its own router ID to the Hello pack-
ets it sources. When the corresponding router receives these Hello pack-
ets, it recognizes itself in the packets and commences the steps required
to establish a neighbor relationship. Once the neighbor relationship is
established, the interface address of the neighbor is added to the neigh-
bor field.
■■ Options: This field describes a router’s capabilities from the perspec-
tive of how it will behave in an OSPF routing domain. The Options
field is present in three different OSPF packet types, so it makes more
sense to describe it in a separate section (see page 300).
OSPF 265
Age The number of seconds since the LSA was created by the
originating router.
LSA TYPE 3
PACKET FIELD DESCRIPTION NOTE
Link-State Type Identifies which type of LSA is Repeated for each link
being requested (of 11 types). being requested.
Advertising Router The router that originated the LSA. Repeated for each link
being requested.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 266
266 Chapter 8
LSA TYPE 1
PACKET FIELD DESCRIPTION NOTE
OSPF 267
LSA TYPE 1
PACKET FIELD DESCRIPTION NOTE
Some LSA type 1 packet fields in Table 8-6 require further explanation:
■■ Age and Sequence Number: OSPF uses the Age field and the Sequence
Number field (along with the checksum field, which is not shown) to
determine if an LSA is newer then one a router may already have for
the same link. A newer LSA replaces an existing LSA.
■■ Link Type, Link ID, and Link Data: OSPF wants to know the type of
network being advertised in the LSA. This information is mainly used
by the SPF algorithm for building the route table. Link type 1 refers to a
pair of routers on a point-to-point link. Link type 2 refers to a multi-
access network with a DR. A type 3 link is simply a stub network—no
other routers share the link. Link type 4 refers to the special case of a
virtual link. The value of the Link ID and Link Data fields vary accord-
ing to the link type. For example if the link type is 1, OSPF wants iden-
tifying information about the neighboring router, as indicated in the
table. For the multi-access network specified by link type 2, OSPF
wants identifying information about the DR. For the stub networks
specified by link type 3, there is no router information required. Rather,
this is where the net mask for stub networks is collected. All this data
assists SPF in determining the shortest path to all networks.
LSA TYPE 2
PACKET FIELD DESCRIPTION NOTE
(continued)
11_772739 ch08.qxp 3/3/06 9:25 PM Page 268
268 Chapter 8
LSA TYPE 2
PACKET FIELD DESCRIPTION NOTE
Attached Router Router ID of a router on the multi- This field is repeated for
access network. each attached router.
LSA TYPE 5
PACKET FIELD DESCRIPTION
LSA Headers Includes only the headers of the LSAs being acknowledged.
N OT E The fields of the various OSPF packet types can appear a bit daunting
at first. For example, the Link-State ID is not only an IP address, it can refer to a
DR, the interface of a neighbor, a network address, or another entity, depending
on the link type. Exploring packet formats places you deep in the bowels of the
protocol. We will not endeavor here to explain each field of each packet type in
detail, but instead note that the data in these packets is primarily used to
identify the state of links, help in link-state database synchronization, and build
an area’s topology table.
OSPF 269
270 Chapter 8
other areas are advertised with far less information. This reduces packet size
and saves on bandwidth.
Something else to be aware of in multiple-area configurations is that when
routers learn of a route to a network residing in another area, they do not run the
SPF algorithm on the route. Such routes are simply evaluated for inclusion into
the route table based on their metrics. The reason for this is that routes learned
from other areas within the system don’t include all the topology information
that links learned within the area do. Only networks and their metrics are adver-
tised between areas.
But wait. What kind of heresy is this? If only networks are advertised
between areas, and not the routers they are connected to, how can the topol-
ogy map be built by SPF? Isn’t that the key to how OSPF works— knowing the
location of all routers in the system? Isn’t this what guarantees fast, efficient,
loop-free routing?
Indeed, managing network resources by excluding some networks from the
SPF algorithm appears at first to be a bit of a tradeoff. Advertising only routes
and their metrics is kind of like – dare we say – routing by rumor. It is, but the
designers of OSPF took all this into account. There are specific restrictions as to
how the hierarchy of areas can be configured. Having all non-zero areas con-
nect to area 0 helps prevent a router learning of a route that leads back through
itself, also known as a routing-loop.
Another factor that affects the need for multiple areas is route summarization.
In OSPF, route summarization takes place only at the border between areas. Sum-
marization leverages the concept of small packets passing between areas by caus-
ing fewer of those packets to be generated, thanks to a fewer number of networks
being advertised. Summarizing routes is another factor to consider when plan-
ning where to place areas boundaries. You may even want to employ multiple
areas on smaller networks in order to enjoy the benefits of route summarization.
The number of areas to implement may even be affected by political consid-
erations. A manager might have two squabbling network administrators and
choose to put the administrators in charge of their own respective “areas.” A
silly concept perhaps, but you know how silly real life can be sometimes. In
another vein, a paranoid (perhaps with good reason) manager might wish to
take advantage of the fact that packet authentication can be set at an area’s bor-
der, preventing unauthorized routes from being advertised into the area.
Because many IT professionals take a layered approach to security, this feature
might be worth considering.
Finally, whether you are growing a newer network or changing routing pro-
tocols on an existing system, it is important to benchmark your system. This
means making baseline measurements of system performance before, during,
and after OSPF is introduced. Bandwidth usage should be monitored as well
as key router metrics like memory and CPU usage. Proper benchmarking
helps provides core information for determining how many areas are ulti-
mately required.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 271
OSPF 271
Multiple Areas Mean Multiple Area Types, LSA Types, and Router Types
The network configuration within an area determines the amount and type of
routing information that needs to be shared with the area. Toward that end,
OSPF discerns among four different types of areas as described later.9 Area
types are simply another means of managing routing traffic. To handle the spe-
cific routing information required by different area types, additional types of
LSAs are brought to bear. The single-area configuration presented earlier
introduced two types of LSAs: type 1 (router) LSAs, which flood the network
links throughout the area; and type 2 (network) LSAs, which flood the area
with a listing of each router connected to a multi-access network. Those two
LSAs are used for intra-area routing. Four additional types of LSAs will be
introduced that are used for inter-area and external routing, which totals six
common LSA types in use out of 11 total types specified in the RFCs for OSPF.
When an OSPF autonomous system is broken into multiple areas, the routers
within each area take on varying roles. A router with all interfaces within a sin-
gle area handles routing differently than a router that straddles two areas (by
having an interface configured for each area). Therefore, OSPF discerns
between a total of four types of routers, based on their location within an area.
Area types, LSA types, and router types are integral components to multiple-area
routing. As stated in the introduction to this section, these building blocks will
be explained in sequence in this treatment, and then used in practical examples
in the subsequent section, “OSPF Operation, Part 2: Tying It All Together.”
Area Types
As mentioned previously, there are four RFC sanctioned area types that OSPF
uses to route traffic. They are as follows:
■■ Backbone area
■■ Standard area
■■ Stub Area (2)
Backbone Area
The backbone area—also referred to as area 0 or 0.0.0.0, since that must be its
numeric designation—is mandatory when more than one area exists.10 The
backbone area acts as a sort of hub which all inter-area network traffic passes
through. Each non-zero area connects to the backbone area.11 Traffic passing
from a network in area 1 to a network in area 2, for example, uses the backbone
area as a transit area. It is not necessary for area 1 and area 2 to be directly con-
nected, nor should it be.
N OT E Area IDs are 32-bit numbers and can be expressed as a single number
or in dotted decimal format like an IP address. Therefore, area “0” and area
“0.0.0.0” are equivalent.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 272
272 Chapter 8
Use of the backbone area creates a two-level hierarchy scheme, thus OSPF’s
designation as a hierarchical protocol. Here again you can see the need for a
well-planned implementation of OSPF. By designing all areas to connect
through a single area 0, an efficient, logical network design is achieved. It
should be noted that because of this design, the network engineer should be
aware that some or all routers in area 0 need to be configured to accommodate
the extra transit traffic it must handle.
Figure 8-20 shows one possible multi-area configuration. Notice that geo-
graphically dispersed networks are configured into separate areas. An
assumption is made here that much of the network traffic is contained within
a single building or surrounding buildings (departments are often grouped
together geographically). Inter-area traffic is therefore kept to a minimum. The
FDDI backbone is accessed primarily for Internet access and when access to
networks in other areas is required.
Figure 8-21 illustrates a slightly different configuration. Here the areas are
connected via a public carrier and are very geographically dispersed. However,
in spite of the distances involved, the autonomous system can still be archi-
tected to connect areas 1, 2, and 3 to the backbone area. Notice that area 0 can be
configured with networks that contain hosts. It is not relegated to serving only
transient traffic. Note also that in this model each area has its own connection
to the Internet. The significance of whether an area directly connects to external
networks will be accounted for as we explore the other area types.
Standard Area
A standard area (also known as a normal area) is characterized by the follow-
ing criteria:
■■ Advertises summaries of its network links to backbone area 0
■■ Accepts summaries of network links from area 0, which comprise links
within area 0, as well as summarized network links area 0 has learned
of from other areas
■■ Accepts redistributed (externally learned) routes
■■ Can optionally accept a default route representing redistributed routes
Figure 8-22 illustrates a standard area. Standard areas receive the most rout-
ing information of any non-zero area type. The main characteristic of a stan-
dard area is that it can receive individual routes to both inter-area and external
locations. Optionally, a standard area may receive a default route representing
external routes. All other area types receive less routing information, mainly
having to do with external routes.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 273
OSPF 273
The
Internet
Area 0
FDDI backbone
Area 1 Area 3
Buildings 1-4 Buildings 9-12
Area 2
Buildings 5-8
Figure 8-20 Multiple OSPF areas. This model has no hosts in area 0.
The
Internet
Area 0
Home Office – San Francisco
Area 1 Area 3
Los Angeles Tokyo
Area 2
Egypt
The The
Internet Internet
The
Internet
Figure 8-21 Multiple OSPF areas. Area 0 contains hosts in this example.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 274
274 Chapter 8
Area 1 Area 0
"Here is a summary
of the network
140.23.2.4
links in area 1."
Area 0 The
Internet
Area 1
Area 0 Area1
Standard areas are often used when the area has redundant connections to
area 0 and/or when the area’s routers connect to external networks without
going through the backbone. With multiple paths to choose from for inter-area
and/or external routing, having the maximum amount of routing information
may improve routing decisions. A standard area is also the only area type that
can be used as a transit area for a virtual link connecting a non-zero area to the
backbone.
Stub Area
Stub areas accept less routing information than standard areas. A group of
routers are normally configured into a stub area when there is only a single
connection to the backbone, therefore requiring less detailed routing informa-
tion (although there are exceptions as noted later). There are two flavors
of stub areas specified by the RFC for OSPF, with a third type incorporated by
certain routing vendors such as Cisco. These various stub area types are
characterized by the type of routing information they send and receive. They
are stub, totally stubby, and not-so-stubby.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 275
OSPF 275
Stub Area
A stub area (also known as a standard stub area) is the same as a standard
area except that it does not accept any information about external routes (see
Figure 8-23). Rather than learn about routes to external networks, a stub area
will simply accept a default route that will lead to a router that has more
detailed information about how to reach external networks. This is a logical
choice if the area has no internal routers connecting to external networks and
only has a single connection to area 0. Why populate the route tables with list-
ings of external networks if there is only one possible routing decision? A stub
area is characterized by the following criteria:
■■ Advertises summaries of its network links to backbone area 0
■■ Accepts summaries of network links from area 0, which comprise links
within area 0, as well as summarized network links area 0 has learned
of from other areas
■■ Accepts a default route leading to external networks
276 Chapter 8
can even be translated into the external LSAs used by other areas and adver-
tised to area 0. The NSSA is also a good solution for a branch office with its
own Internet connection. Don’t forget that a rule of thumb for area types is to
propagate the least amount of information into an area that still allows for opti-
mal routing. The NSSA area type is a viable option when an area only requires
the amount of routing information provided to a stub configuration—but hey,
it needs an ASBR too. An NSSA is characterized by the following criteria:
■■ Advertises summaries of its network links to backbone area 0
■■ Accepts summaries of network links from area 0, which comprise links
within area 0 as well as summarized network links area 0 has learned of
from other areas
■■ Accepts a default route from area 0 leading to external networks
■■ Learns of external networks from a router within the NSSA
■■ Optionally advertises external networks learned from within the area to
area 0
Area 1 Area 0
"Here is a summary
of the network
links in area 1."
Area 0
Area 1
Area 0 Area 1
OSPF 277
Area 1 Area 0
"Here is a summary
of the network
links in area 1."
Area 0
Area 1
Area 0 Area 1
Area 1 Area 0
Area 0
Area 1
Area 0 Area 1
278 Chapter 8
Router Types
There are four unique roles that routers play in multiple area OSPF configura-
tions, resulting in four router types recognized by the protocol:
■■ Internal router: Has all its interfaces within a single area. The exception
is area 0 which has a separate router type designation. Internal routers
maintain a single link-state database for one area.
■■ Area Border Router (ABRs): Play a very important role in multiple-
area systems. They straddle the two areas, bridging them with one
interface connected to one area and another interface connected to
another area. ABRs is where link-state database summarization occurs,
as well as route summarization. ABRs maintain a link-state database for
each connected area.
■■ Backbone router: A router with at least one interface in area 0. If all
interfaces of the router are in area 0, the router is still designated a back-
bone router, not an internal router, although in common use either term
may be used.
■■ Autonomous System Boundary Router (ASBR): A router with at least
one interface connecting to a network outside the OSPF autonomous
system. ASBRs are responsible for injecting (redistributing) external
routes into the OSPF domain. ASBRs may run both OSPF and the native
routing protocol of the external system, or in lieu of running another
protocol, they may simply be populated with static routes to external
destinations. Good design practice suggests that the ASBR be placed in
area 0, which all inter-area traffic normally flows through.
Notice in Figure 8-26 that some routers have multiple roles. This drives
home the point that router types are interface-based as opposed to router-based.
For example, the router connecting area 1 to area 0 is both an area border
router (ABR), since it bridges two areas, and a backbone router, since it has at
least one interface in area 0.
OSPF 279
Backbone Routers
Area 0
Area 1 Area 3
Area 2
Internal Routers
Figure 8-26 OSPF router types. One router can assume multiple roles.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 280
280 Chapter 8
LSA TYPE 3
PACKET FIELD DESCRIPTION
Metric Cost of the route from the ABR to the advertised network.
Be sure you understand the difference between summary LSAs and route
summarization. Summary LSAs are an OSPF mechanism for advertising an
area’s networks to another area, whereas route summarization is a more
broadly defined process of summarizing a number of contiguously addressed
network IDs as a single route. OSPF supports route summarization at the area
border, which results in a reduced number of summary LSAs being produced—
fewer networks to advertise means fewer type 3 LSAs.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 281
OSPF 281
After an area has advertised summary LSAs into area 0, they are flooded
throughout the backbone. The ABRs in area 0 then flood the LSAs into all other
areas, making everyone aware of the routes. Routers receiving these LSAs do
not run the SPF algorithm on the learned networks. As previously mentioned,
the routes are simply added to the route table (or not) based on their metric.
LSA TYPE 4
PACKET FIELD DESCRIPTION
Metric Cost of the route from the ABR of the area to the
advertised ASBR.
282 Chapter 8
LSA TYPE 5
PACKET FIELD DESCRIPTION
E-bit A bit that when set to 0 sets the type of metric to type 1,
external path. When set to 1, this sets the type of metric to
type 2, external path.
In a type 5 LSA packet, the link ID is the external route being advertised. As
you can see, the mask of the network is advertised as well. To advertise a
default route, both fields are set to 0.0.0.0.
The E-bit indicates whether the external path type is type 1 or type 2, which
affects how the metric for the route is calculated. Type 2 external paths (the
default) only use the metric calculated for the route by the ASBR that learned
it—in other words, the cost of the route from the ASBR to the external network.
That means all routers in the entire OSPF use the same metric for the route.
Type 2 paths are used when the metric to the external network is heavily
weighted over the internal cost to reach the ASBR.
Type 1 external paths, on the other hand, include the cost from the sourcing
router to the ASBR, plus the cost from the ASBR to the external network. This
means that the metric will vary for each router within the OSPF autonomous
system. The availability of the optional type 1 external path is for flexibility. In
certain configurations, the internal cost of the path to the external network will
have a bearing on routing decisions if there are multiple paths to the same
external network. In that case, the administrator has the option to include the
internal cost by configuring the path as external type 1.
OSPF 283
LSA, which circulates only in not-so-stubby areas, bringing its router’s news
of external networks available through the locally attached ASBR.
In the event it is desired to share the routes learned by the NSSA ASBR, the
type 7 LSAs can be converted to type 5 LSAs at the Area Border Router and
advertised into other areas. In fact, this is the default setting. However, this
behavior can be inhibited (see the command reference). Table 8-12 dissects the
type 7 LSA packet.
284 Chapter 8
Overview
For the sake of perspective, it’s worth noting that with distance vector routing
protocols, once a router has learned of a route to a network and derived that it
has the lowest metric, the route is installed into the route table. OSPF, however,
requires an additional step because it does not yet know the shortest path to
each network. Unlike distance vector routing protocols, which transmit dis-
tance information with the route update, OSPF has to come up with the “dis-
tance” to each network on its own. This of course is where the Shortest Path
First (SPF) algorithm comes in. SPF actually does its work in several phases. It
creates the all-important topology map (the shortest path tree), laying out in its
mind the location of each router in the area and the networks attached to it.
This process is performed in several iterations. For example, the location of the
area’s routers are mapped out and then the stub networks are added to the
tree.
When the tree is complete, the algorithm calculates the shortest, loop-free,
path to each network. To accomplish this, SPF calculates each route’s complete
metric.
At some point, inter-area routes and external routes are added to the tree so
that all known networks can be evaluated for inclusion into the route table. As
with any routing protocol, the path to each network with the lowest metric is
then installed. Redundant routes to the same network may be installed as well,
because OSPF is capable of equal cost multi-path routing.
OSPF Metrics
In OSPF, the metric is based on “cost,” which in the case of the popular Cisco
IOS, is simply the bandwidth of the link. Specifically, cost in the Cisco imple-
mentation of OSPF is derived by the formula shown in Figure 8-27.
108/BW
Figure 8-27 Formula for the OSPF metric when the bandwidth is used as the cost.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 285
OSPF 285
For example, the bandwidth of Fast Ethernet is 100,000,000 bits per second,
so the formula reduces as shown in Figure 8-28.
Table 8-13 shows the cost for some common network transmission speeds.
FDDI (100,000,000/bps) 1
Ethernet (10,000,000/bps) 10
T1 (1.544/Mbps) 64
There’s one “gotcha.” Note that the cost of gigabit Ethernet is .1. When
OSPF was first implemented, such speeds did not exist. The Cisco IOS, for
example, did not recognize a cost less than 1. Starting with Cisco IOS version
11.2, the auto-cost reference-bandwidth command was introduced, which
allows the formula constant to be altered from 100 to say, 1000, for example.
The constant is in million bits per second (bps), so 1000 alters the constant to
1gig/s (see the command reference).
100,000,000 / 100,000,000
1/1
cost = 1
Figure 8-28 Calculating the metric for a Fast Ethernet link.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 286
286 Chapter 8
OSPF 287
12.6.8.44/24
B
.4
Area 0
172.16.1.0/24
172.16.5.0/24
.1
.3 .2 .1
172.16.4.0/24 172.16.6.0/24
C D A .1 .2 E .1
.1 .1 .1
Area 1 172.16.2.0/24 172.16.7.0/24
.2
172.16.100.0/24 .1 .2 172.16.3.0/24
F
172.16.100.0/20
Figure 8-29 Example network for running SPF and building the route table.
Figure 8-30 shows the link-state database on router A before SPF has run
(simplified).
Notice the absence of the 172.16.100.0 and 12.6.8.44 networks in the list. The
SPF algorithm is initially run only on the link-state database. The inter-area
and external routes are included in the tree later as candidates for inclusion in
the routing table.
Running SPF
Now the SPF algorithm runs. When it completes all its iterations the resulting
shortest path tree is as shown in Figure 8-31.
288 Chapter 8
<root>
Router ID
172.16.5.1
(Router A)
172.16.1.0/24 cost=1
172.16.3.0/24 cost=1
172.16.4.0/24 cost=1
Router ID
172.16.100.1
(Router F) Router ID
172.16.3.0/24 cost=1 172.16.2.1
172.16.4.0/24 cost=1 (Router C)
172.16.100.0/24 cost=1 172.16.1.0/24 cost=1
172.16.100.0/20 cost=1 172.16.2.0/24 cost=1
Router ID
172.16.1/2
(Router D)
172.16.1.0/24 cost=1
Router ID
172.16.1.4
(Router B)
172.16.1.0/24 cost=1
12.6.8.44/24 cost=10
N OT E The inter-area and external networks are now shown, along with their
accompanying metrics. They will be included as each route is evaluated for
inclusion into the route table. Bear in mind that we are presenting a somewhat
simplified view of the SPF process. Detailed information on the SPF algorithm is
found in RFC 2328.
OSPF 289
Path Type
Recall that there are six path types reflected in the route table: Intra-area, Inter-
Area, E1 External, E2 External, N1 NSSA External, and N2 NSSA External.
The first two path types simply denote routes learned internally to the OSPF
system. The other four path types all denote externally learned routes. The E1
External/N1 NSSA External path type refers to a route whose metric is made
up of both the cost assigned to the external route at the ASBR that learned of
the route, plus the cost of forwarding the packet between an internal router and
the ASBR. The E2 External/N2 NSSA External path type refers to a route
whose metric is composed solely of the cost assigned at the ASBR.
N OT E The NSSA path types mimic the two external types, except the
designation refers to external routes learned specifically from NSSA areas. An
area will have either external routes or NSSA external routes to evaluate, but
never both, because NSSA external routes are only found in NSSA areas, and
NSSA areas never learn of other external routes directly. Any NSSA external
routes advertised into other areas are advertised as external path types,
because the type 7 (NSSA) LSA is converted to a type 5 (external) LSA.
Intra-area routes have precedence over any other way a route was learned.
Why route a packet out of the area to reach a destination network within the
area? Inter-area routes have the next highest priority. This is based on the
axiom, “Why trust a route learned from a foreign source over the same route
learned of within the OSPF system?”
Path types E1 External and E1 NSSA External have the next order of prece-
dence. These path types are given more weight than their E2 counterparts
because the metric includes the internal cost as well as the cost assigned at the
system border. In cases where an OSPF system has multiple ASBRs, the com-
posite metric may render more optimal routing.
Destination Type
OSPF also distinguishes between routes to networks and routes to other routers.
Link-state information about the location of ABRs and ASBRs is included in
the initial SPF calculation, but only routes to networks are considered at this
point.
290 Chapter 8
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP 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, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-32 Route table output after SPF runs and populates the table.
Let’s walk through the entries, to be sure it’s clear what’s there, and why it’s
there. The first three route table entries reflect router A’s three directly con-
nected networks, thus they are denoted with a C code. The next two entries
coded O for OSPF intra-area routes are two equal-cost paths to the 172.16.2.0/
24. OSPF will forward roughly equal portions of traffic bound for that network
through both links. Note that the metric for both routes is 2, because SPF
summed the cost of the links to the network at each outbound interface.
The .5, .6, and .7 intra-area networks are then listed, all with a metric of 2,
again reflecting the sum of two links, which were assigned a cost of 1 based on
the interface bandwidth.
The 172.16.100.0/20 network shows up in the route table with an intra-area
code because the route was learned from a border router with an interface into
area 1. The 172.16.100.0 network is of course a summary route, representing
the condensed subnet IDs in area 1. Not only does this configuration reduce
the number of entries in the route table, all subnets in area 1 were advertised
into area 0 with a single, small summary LSA. This is a sign of a wellarchi-
tected OSPF system. The metric of 2 is a sum of the metric advertised by the
ABR (router F) plus the cost of the link between router F and router A (the
default cost applied to an inter-area summary route is 1).
Finally, the route to the 12.6.8.44 is indicated with the E2 code, indicating
its metric is composed simply of the cost assigned to the route at the ASBR
11_772739 ch08.qxp 3/3/06 9:25 PM Page 291
OSPF 291
(router B). The metric would have been 11 rather than 10 if the path type had
been set to E1.
292 Chapter 8
Area 0
172.16.24.128/25
172.16.24.0/25 172.16.25.0/25
"Here is a type 3
(summary) LSA. I
am advertising the
172.16.24.0/21."
OSPF 293
Area 0
172.16.24.128/25
"Here is a type 3
(summary) LSA. I
am advertising the
Area 3 172.16.0.0/21,
172.16.8.0/21,
172.16.16.0/21
subnets.”
294 Chapter 8
Redistribution in OSPF
Redistribution is covered in Chapter 10. The reason for talking about redistri-
bution in the last chapter of the book is certainly not because the topic has the
least importance, but rather because it makes more sense to explore redistrib-
ution after the routing protocols themselves have been covered. What is cov-
ered in this short section are some caveats regarding redistribution as it applies
to OSPF. Naturally, this material will make more sense if you go through the
general treatment of redistribution first.
There are special considerations for redistribution with OSPF. As a reminder,
redistribution is the process of advertising networks into the autonomous sys-
tem that were not learned by the native routing protocol. These may be routes
learned through another routing protocol, static routes, and even directly con-
nected networks on interfaces not enabled for OSPF. OSPF routers, as with any
routing protocol, won’t automatically advertise networks that haven’t been
learned through the OSPF process. Such routes need to be brought into the fold,
so to speak. The act of doing that is called redistribution.
OSPF 295
296 Chapter 8
OSPF 297
Notice how closely default routing is tied to redistribution. In and of itself, the
act of configuring a default route on a single router is performed without any
routing protocol. However, if you want that default route to be made available
to other routers—you don’t want to run around and hand configure the default
route on every affected router—then a routing protocol is mandatory, and now
we’re talkin’ redistribution. Therefore, to fully understand default routing
means knowing a thing or two about redistribution. This point is underscored
in OSPF, which because of its area-based architecture, more closely integrates
redistribution and default routing than other interior routing protocols.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 298
298 Chapter 8
Partitioned Areas
When one or more routers within an area lose connectivity to any other router
in the area, that area is considered partitioned. The severity of a partitioned area
depends on whether it is the backbone area (area 0) or a non-zero area.
Partitioning of non-zero areas will not break routing as long as every router
can still reach an ABR. OSPF will automatically treat the partitioned area as
two separate areas. Routing packets between the two disjoined sections of the
area will continue by forwarding packets to the backbone and then back into
the other partitioned section of the area.
Partitioning of area 0 is more problematic. Because inter-area traffic passes
through area 0, a downed link can break routing, as shown in Figure 8-35.
The chances of an area becoming partitioned are mitigated through the use
of redundant links. As you can see, area 0 needs redundancy if the system is to
be reliable. One option if an area does become partitioned; it can be temporar-
ily repaired through the use of Virtual Links, which are discussed next.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 299
OSPF 299
Area 0
Area 1 Area 3
Area 2
Figure 8-35 A failed link in area 0 has cut area 3 off from area 2, area 1, and
part of the backbone.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 300
300 Chapter 8
Virtual Links
Virtual links allow a non-zero area to connect to the backbone via another area.
The problem just illustrated in Figure 8-35, where the backbone became parti-
tioned, could be solved if area 3 could connect to the backbone through area 2.
In this case, area 2 would be considered a transit area for the virtual link.
Conversely, a virtual link can help in the same example by making the back-
bone contiguous. The networks connected to router A are unreachable through
the backbone, but not through area 3. A virtual link could be configured from
the backbone through area 2 and area 3 to make the backbone contiguous
again.
Options Field
The options field describes a router’s capabilities. The field is present in three
OSPF packet types: Hello packets, database description packets, and all LSA
packets. The value of various bits set in the options field determines how a
router will behave in an OSPF routing domain. Some of the more important
options bits are described next.
OSPF 301
302 Chapter 8
configuration at a later date. If you find that routers and/or links are becom-
ing overwhelmed with route calculations and/or routing traffic, you can split
the area. Conversely, areas that turn out to have available overhead for LSA
type 1 and type 2 traffic can be reconfigured to join another area. A significant
factor lies in whether you are growing a relatively small network, or migrating
a larger, mature network away from another routing protocol. Either way,
benchmarking is indispensable for spotting issues as you implement OSPF.
You should know ahead of time what the load on network links, router inter-
faces, router memory, and related items currently is. Then take periodic read-
ings as you make changes. Be smart. Stay a step ahead of trouble.
When you have an idea of how many areas you need, you then want to
determine what kind of areas they will be. Here is where we will get into some
examples that will clarify the purpose and role of each area type.
Backbone Area
If you’re implementing a multiple area system, it’s a no-brainer that you will
have a backbone area, because you have to. But how big will it be? How many
routers will it encompass? Bearing in mind the considerations just mentioned
for the size of an area, think about three other factors:
■■ Consider how all other areas will connect to area 0.
■■ Consider that all inter-area traffic must pass through area 0.
■■ Consider placing all or most all ASBRs in area 0—a good central location.
All non-zero areas must connect to area 0. That’s the rule; even if the con-
nections are through a virtual link. So area 0 should include the routers that
will act as ABRs to straddle into each non-zero area.
Because best practice specifies that traffic passing from one non-zero area to
another non-zero area will transit through the backbone area, area 0 must have
routers with sufficient CPU and memory to handle both inter-area traffic as
well as transient intra-area traffic. Naturally you want to have supersized
and/or redundant network links in the backbone as well.
All else being equal, it may be smart to place your ASBRs in area 0, simply
because it provides a central location to be reached by the non-zero areas. Of
course, external traffic entering and exiting through area 0 must also be con-
sidered. Other locations for ASBRs are standard areas and not-so-stubby areas.
Figure 8-36 depicts a properly designed area configuration.
The backbone area, like all area types, floods type 1 (router) LSA and type 2
(network) LSA packets within the area. Type 4 (ASBR summary) LSAs, and
type 5 (external) LSAs also circulate in area 0, carrying information on external
routes, as well as propagating default routes. And of course, area 0 carries
transit inter-area traffic.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 303
OSPF 303
The EIGRP
Internet
Area 0
Area 1 Area 3
Area 2
Standard Area
Standard areas absorb the most routing information of any non-zero area type.
All three intra-area LSA types—type 3 (summary) LSAs, type 4 (ASBR sum-
mary) LSAs, and type 5 (external) LSAs—are accepted. Therefore, routers in
standard areas learn about all networks within the autonomous system, the
location of all ASBRs, and the external routes distributed by ASBRs—or simply
a default route representing the non-OSPF routes, depending on how the
ASBRs are configured.
A standard area is appropriate when there are multiple paths leading out of
the area, and granular routing data is required for both intra-area and external
routes in order to make optimal routing decisions. Furthermore, a standard
area can contain an ASBR for cases when it is best to have external routes
injected directly into a non-zero area, rather than have the external routes be
accessed through area 0. Figure 8-37 depicts a typical standard area.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 304
304 Chapter 8
Area 1 Area 0
Area 0
10.4.2.9
Area 1 B
170.14.2.4
Area 0 Area 1
Figure 8-37 Standard areas circulate the same routing information as the backbone area.
Let’s assume in the diagram that all links in area 0 have the same band-
width. Note that there are multiple paths from area 1 to both inter-area and
external networks.
In terms of inter-area routing from area 1 to area 0, the path to the 170.14.2.4
in area 0 has a differing metric through router B than through A. Depending on
the network configuration within area 1, some routers may have an optimal
path through router B, while others may reach the 170.14.2.4 quicker through
router A. It is therefore wise to have both ABRs advertise the 170.14.2.4 into
area 1. Standard areas allow type 3 (summary) LSAs, so each router in area 1
will have the detailed information they need about how best to reach the
170.14.2.4.
Likewise with external routes. There are two paths to the 10.4.2.9. To pro-
vide area 1 with access to the 10.4.2.9 through area 0, area 1 must receive an
advertisement for the network. It won’t due to simply have the ABRs inject a
default route that points to the ASBR connected to the 10.4.2.9, even if it is to
be used as a backup if the route to the 10.4.2.9 in area 1 goes down. Why? The
ASBR connected to the Internet needs to supply the default route in order to
give all networks access to the Internet. The default route propagated by the
ABRs connecting to area 1 must point to the Internet ASBR. The route to the
10.4.2.9 must be specifically advertised.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 305
OSPF 305
Because standard areas let type 4 (ASBR summary) and type 5 (external)
LSAs in, the routers in area 1 can learn about the additional ASBR in area 0 and
learn of a path to 10.4.2.9 through it. The route with the shortest path, based on
its accumulative metric, will be installed into the route table and optimal rout-
ing will ensue. In the event the installed route becomes invalid, the alternate
path to 10.4.2.9 will be installed.
Stub Area
Stub areas are more restrictive than standard areas because they don’t allow
type 4 (ASBR summary) or type 5 (external) LSAs. A stub area can’t contain an
ASBR because type 4 and type 5 LSAs are literally ignored by routers config-
ured to be a part of a stub area.15 Such routers accept only types 1, 2, and 3 LSAs.
In this case, the only way to propagate external networks into the stub area is
with a default route injected at the ABR. Because type 3 (summary) LSAs are
allowed into the area, the default route is contained in that LSA type. The
default route simply forwards packets to the ABR, which will either itself have
a default route pointing to external networks, or its route table will be popu-
lated with external routes, depending on how redistribution has been config-
ured at area 0’s ASBRs. Figure 8-38 depicts how LSAs circulate in a stub area.
Area 1 Area 0
Area 0
Area 1
Area 0 Area 1
Figure 8-38 Stub area routers block type 4 (ASBR summary) and type 5 (external) LSAs.
A default route is injected for external networks.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 306
306 Chapter 8
Stub areas were originally designed for routers with limited resources, par-
ticularly memory. If such routers can be located where a default route can rep-
resent the path to many networks—preferably optimal paths—stub areas
make sense. In fact, any area of the network where optimal routing can ensue
when external routes are represented by a default route, are worthy of consid-
eration as a stub area.
OSPF 307
to the ABR, which will vary from router to router. Every area 1 router will
receive two advertisements for a default route, one from each ABR. The candi-
date default route with the lowest metric will be chosen. Optimal routing will
take place.16
Not-So-Stubby Area
Not-so-stubby areas (NSSAs) are the newest area type, introduced to OSPF in
1994 via RFC 1587. It allows the normal rule of “no ASBR in a stub area” to be
broken.
Sometimes the network configuration of a group of routers reveals that opti-
mal routing can still occur if the area is configured as stub . . . but . . . you want
to have a router within the area connect to one or more external networks. That
of course is a no-no with stub and totally stubby areas—the routers will sim-
ply ignore the type 5 (external) LSAs generated by an attached ASBR. This sit-
uation comes up often with remote locations that have a local Internet
connection or connect to another autonomous system for example. You want
to benefit from the reduced routing traffic enjoyed by a stub area, but you need
an ASBR in the area.
Area 1 Area 0 Assume all links in area 0 are the same speed
Router A
Area 0
Area 0 Area 1
A
Routers A and B
Area 1
170.14.2.4
B Type 3 (summary) LSAs.
Type 3 (summary) LSA
supplying
a default route.
Area 1 Area 0
Router B
Figure 8-39 Stub areas can have more than one connection to the backbone area.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 308
308 Chapter 8
Enter the not-so-stubby area. Like a stub area, an NSSA area allows only
type 3 (summary) LSAs into the area, and represents external networks as a
default route injected by the ABR. However, unlike stub and totally stubby
areas, external routes from a locally connected ASBR can be propagated into the
area. In this case, the ASBR is configured as NSSA, and special type 7 (NSSA
External) LSAs are circulated just within the area.
The routers in the NSSA can either populate their route tables with paths to
specific external networks learned by the NSSA ASBR, or the NSSA ASBR can
simply inject a default route.17 Figure 8-40 illustrates an NSSA configuration.
Area 1 Area 0
Area 1 B
170.14.2.4
Area 0 Area 1
Figure 8-40 Having an ASBR located in a stub area is only possible with an NSSA type.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 309
OSPF 309
Command Reference
This command reference includes not only the specific router commands used
to configure OSPF, but narration explaining many of the commands is also
provided. A single area network model will be presented first with just the
minimum commands required to run OSPF. Then a multi-area model will be
configured, again with just the bare bones commands needed to get OSPF up
and running. From there, additional OSPF commands will be presented that
apply to both single and multi-area configurations.
A B C
E0 192.168.0.1/24 E0 192.168.0.2/24 E0 192.168.0.3/24
E0 192.168.0.4/24 E0 192.168.0.5/24
D E
E1 192.168.4.1/24 E1 192.168.5.1/24
192.168.4.0/24 192.168.5.0/24
Figure 8-41 Single area model—broadcast, multi-access network.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 310
310 Chapter 8
■■ The configuration is the same for routers B-E with obvious adjustments.
■■ There is no need to set interface speed because LAN interfaces auto-
detect correct link speed.
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-42 Router output of single area multi-access network before OSPF is configured.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 311
OSPF 311
routerB(config)#router ospf 3
routerB(config-router)#network 192.168.0.0 0.0.255.255 area 0
routerC(config)#router ospf 5
routerC(config-router)#network 0.0.0.0 255.255.255.255 area 0
routerD(config)#router ospf 5
routerD(config-router)#network 0.0.0.0 255.255.255.255 area 0
routerE(config)#router ospf 1
routerE(config-router)#network 0.0.0.0 255.255.255.255 area 0
312 Chapter 8
any value in the corresponding address, thus you will often see the moniker
“don’t care bits” used to describe 1 bits.19
Referring to Figure 8-41, router A had the OSPF process enabled on interface
E0 by constructing the first network command to force a specific match on the
accompanying address. Notice in the first network statement that the network
portion of the address has to have an exact match. In fact, the command syn-
tax is so specific the command had to be issued twice—once for each of the two
networks. For the first statement, only the address 192.168.0.x would match.
Indeed, when the address on interface E0 is compared to the statement, OSPF
is enabled on that interface, the interface is added to area 0, and the 192.168.0.0
network will be advertised. Likewise with the second statement in which the
192.168.1.0 is added to area 0 and advertised.
Because both networks are being added to the same area, it was not neces-
sary to construct such a narrow match that two statements were required. It is
simply used to illustrate how the command syntax works. With router B, a
shortcut was taken. Because the first two octets of the mask are set to 0, the first
two octets of an interface address must match. However, because the second
two octets of the mask are set to 255 (all “don’t care bits”), the second two
octets of the interface address will make a match, regardless of their value.
Thus in one statement, both the 192.168.0.0 and 192.168.1.0 are enabled for
OSPF on the corresponding interfaces. In this more encompassing version of
the network command, any 192.168.x.x subnet would be added to area 0.
With routers C, D, and E, the broadest possible form of the network com-
mand was executed. A mask of all “don’t care bits” means any interface
address will match the statement. Thus, any active interface with an IP address
will be made part of area 0 and the corresponding network will be advertised.
This is just fine and dandy, as long as there are no router interfaces that need
to participate in a different area. Because this is a single area configuration
model, all the routers are internal OSPF routers, and the statement can be used
without a problem.
OSPF 313
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-44 Using the show ip ospf neighbor statement to see who got elected DR
and BDR.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 314
314 Chapter 8
The
Internet
.10
65.16.16.8/30
E1 .9
A0-ASBR1
E0 .2
172.1.4.0/24 Area 0
E3 .1
E1 E2
A0-INT1
172.1.1.0/24 .1 .1 172.1.2.0/24
E0 .1
E0 E1 172.1.3.0/24
.2 ABR1 .2
172.2.3.0/24
Area 1
E0 .1
E1 E2
A1-INT1
172.2.1.0/24 .1 .1 172.2.2.0/24
E3 .1
172.2.4.0/24
E0 .2
A1-ASBR1
E1 .5
64.23.11.4/30
.6
The
Internet
OSPF 315
Given that there are two ASBRs providing Internet access, and one of the
ASBRs is in a non-zero area, a standard area is a wise configuration. An NSSA
area is the other option, but let’s assume that some of the networks in area 1 are
(metrically) closer to the ASBR in area 0. In this case, you want the detailed
external routing information that is delivered to a standard area.
A0-ASBR1#config term
A0-ASBR1(config)#interface fastethernet 0/0
A0-ASBR1(config-if)#ip address 172.1.4.2 255.255.255.0
A0-ASBR1(config-if)#exit
A0-ASBR1(config)#interface fastethernet 0/1
A0-ASBR1(config-if)#ip address 65.16.16.9 255.255.255.252 (1)
A0-ASBR1(config-if)#exit
A1-INT1#config t
A1-INT1(config)#interface fastethernet 0/0
A1-INT1(config-if)#ip address 172.2.3.1 255.255.255.0
A1-INT1(config-if)#exit
A1-INT1(config)#interface fastethernet 0/1
A1-INT1(config-if)#ip address 172.2.1.1 255.255.255.0
A1-INT1(config-if)#exit
A1-INT1(config)#interface fastethernet 0/2
A1-INT1(config-if)#exit
A1-INT1(config-if)#ip address 172.2.2.1 255.255.255.0
A1-INT1(config)#interface fastethernet 0/3
A1-INT1(config-if)#exit
A1-INT1(config-if)#ip address 172.2.4.1 255.255.255.0
A1-INT1(config-if)#exit
A1-ASBR1#configure terminal
A1-ASBR1(config)#interface fastethernet 0/0
A1-ASBR1(config-if)#ip address 172.2.4.2 255.255.255.0
11_772739 ch08.qxp 3/3/06 9:25 PM Page 316
316 Chapter 8
A1-ASBR1(config-if)#exit
A1-ASBR1(config)#interface fastethernet 0/1
A1-ASBR1(config-if)#ip address 64.23.11.5 255.255.255.252 (2)
A1-ASBR1(config-if)#exit
ABR1#configure terminal
ABR1(config)#interface fastethernet 0/0
ABR1(config-if)#ip address 172.2.3.2 255.255.255.0
ABR1(config-if)#exit
ABR1(config)#interface fastethernet 0/1
ABR1(config-if)#ip address 172.1.3.2 255.255.255.0
ABR1(config-if)#exit
Configuring OSPF
A0-INT1(config)#router ospf 1
A0-INT1(config-router)#network 172.1.0.0 0.0.255.255 area 0 (1)
A1-INT1(config)#router ospf 1
A1-INT1(config-router)#network 172.2.0.0 0.0.255.255 area 1
A1-ASBR1(config)#router ospf 1
A1-ASBR1(config-router)#network 172.2.4.2 0.0.0.0 area 1
A1-ASBR1(config-router)#default-information originate metric 10 metric-
type 1
A1-ASBR1(config-router)#exit
A1-ASBR1(config)#ip route 0.0.0.0 0.0.0.0 e1
ABR1(config)#router ospf 1
ABR1(config-router)#network 172.2.3.2 0.0.0.0 area 1
ABR1(config-router)#network 172.1.3.2 0.0.0.0 area 0
OSPF 317
Router A0-INT1
Placing this router in area 0 makes it a backbone router. This is an internal
router (all interfaces within the area), so a mask is applied to the network com-
mand that assigns all interfaces into area 0.
Router A1-INT1
This is also an internal router, so a mask is applied to the network command
that assigns all interfaces into area 1. Notice that nothing special was done to
make the area a standard area. This happens by default when an area is created
with a non-zero number.
Router ABR1
An ABR will always require at least two network statements because one inter-
face will join area 0 and the other interface will join a non-zero area, in this case
area 1. A very tight mask was applied to each network statement because there
is no need for the mask to encompass more than the single address used at
each interface. Notice that no special command was issued to make the router
an ABR. This happened automatically by virtue of configuring the router’s
interfaces into at least two different areas under the same OSPF process.
318 Chapter 8
Because this system has two ASBRs, it’s helpful to use the E1 path type so that
each OSPF router can determine the shortest path to the nearest Internet con-
nection (ASBR). Each router will receive two candidate default routes, one
from each ASBR. The default route with the lowest metric will be installed. In
case the route to the Internet goes down, each router will run SPF again and
install the remaining default route.
AO-ASBR1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-46 Router A0-ASBR1 after the SPF algorithm has run.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 319
OSPF 319
It’s pretty much the same drill for router A1-ASBR1 as shown in Figure 8-47.
Of course, the router installed a default route pointing to its closest Internet
connection, which is through its directly connected interface.
A1-ASBR1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-47 Router A1-ASBR1 after the SPF algorithm has run.
The two internal routers in each area, as depicted by Figures 8-48 and 8-49,
now list all networks within the autonomous system. Neither router is aware
of the 65.16.16.x networks. Instead, they have each received advertisements
indicating the availability of two candidate default routes. Each router has
installed the default route closest to it.
The ABR is of course aware of all routes that have been advertised into
either area 0 or area 1 as shown in Figure 8-50.
Notice that all subnets of both the 172.1.0.0 and 172.2.0.0 are fully enumer-
ated, not only at the ABR, but throughout the system. No aggregation of routes
occurs without additional configuration. The commands to perform route
summarization and other commonly used OSPF commands are described
after the following stub area configurations are presented.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 320
320 Chapter 8
A0-INT1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-48 Router A0-INT1 after the SPF algorithm has run.
A0-INT1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-49 Router A1-INT1 after the SPF algorithm has run.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 321
OSPF 321
ABR1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 8-50 Router ABR1 after the SPF algorithm has run.
322 Chapter 8
The
Internet
EIGRP
.10
.6
65.16.16.8/30 64.23.11.4/30
E1 .9 E1 .5
A0-ASBR1 A0-ASBR2
E0 .2 E0 .2
172.1.1.0/24 172.1.2.0/24
A0-INT3
172.1.3.0/24
Area 0
E0 E1
A0-INT1 A0-INT2
.2 ABR1 .2
172.2.3.0/24
Area 1
A1-INT1 ABR2
172.2.4.0/24 .2 .2 172.1.6.0/24
A0-ASBR1(config)#router ospf 1
A0-ASBR1(config-router)#network 172.1.1.2 0.0.0.0 area 0
A0-ASBR1(config-router)#default-information originate metric 10
A0-ASBR1(config-router)#exit
A0-ASBR1(config)#ip route 0.0.0.0 0.0.0.0 e1
11_772739 ch08.qxp 3/3/06 9:25 PM Page 323
OSPF 323
ABR1(config)#router ospf 1
ABR1(config-router)#network 172.1.3.2 0.0.0.0 area 0
ABR1(config-router)#network 172.2.3.2 0.0.0.0 area 1
ABR1(config-router)#area 1 stub
ABR2(config)#router ospf 1
ABR2(config-router)#network 172.1.6.2 0.0.0.0 area 0
ABR2(config-router)#network 172.2.4.2 0.0.0.0 area 1
ABR2(config-router)#area 1 stub
A1-INT1(config)#router ospf 1
A1-INT1(config-router)# network 172.2.0.0 0.0.255.255 area 1
A1-INT1(config-router)#area 1 stub
A0-ASBR2
This router has the EIGRP routing process enabled with autonomous system
number 100 for any interface configured with a subnet of the 65.0.0.0. That’s a
very wide address range, but there is only one interface on this router that falls
under it, so EIGRP gets enabled on E1, and the router starts learning whatever
EIGRP routes are being advertised across the link. Meanwhile, interface E0
gets enabled for OSPF, and the EIGRP learned routes are injected into OSPF
process 1 with the redistribute command. A metric of 10 is assigned to all
EIGRP learned routes, the path type is left at the default of E2, and all subnets
of any learned routes are advertised with the subnets keyword.
324 Chapter 8
N OTE The area 1 stub statement must be executed on all routers within area 1.
This action sets the E-bit in the options field of the Hello packet to 0, which
causes the router to not accept any type 5 (external) LSAs.
The
Internet
.10
65.16.16.8/30
E1 .9
A0-ASBR
E0 .2
172.1.4.0/24 Area 0
E3 .1
E1 E2
A0-INT1
172.1.1.1/24 .1 .1 172.1.2.1/24
E0 .1
E0 E1 172.1.3.0/24
.2 ABR1 .2
172.2.3.0/24
Area 1
E0 .1
E1 T1 E2
A1-INT1
172.2.1.0/24 172.2.2.0/24
E3 .1
172.2.4.0/24
OSPF 325
The following router commands will cover the OSPF configuration for just
the area 1 routers:
ABR1(config)#router ospf 1
ABR1(config-router)#network 172.1.3.2 0.0.0.0 area 0
ABR1(config-router)#network 172.2.3.2 0.0.0.0 area 1
ABR1(config-router)#area 1 stub no-summary
A1-INT1(config)#router ospf 1
A1-INT1(config-router)#network 172.2.2.0 0.0.255.255 area 1
A1-INT1(config-router)#area 1 stub
326 Chapter 8
■■ Configuration option A
■■ ABR advertises type 3 (summary) LSAs into the area.
■■ ABR injects a default route into the area.
■■ NSSA ASBR advertises specific external networks into the area.
■■ Configuration option B
■■ ABR injects a default route into the area (totally stubby, NSSA).
■■ NSSA ASBR advertises specific external networks into the area.
■■ Configuration option C
■■ ABR advertises type 3 (summary) LSAs into the area.
■■ ABR injects a default route into the area.
■■ NSSA ASBR injects a default route into the area.
■■ Configuration option D
■■ ABR injects a default route into the area (totally stubby, NSSA).
■■ NSSA ASBR also injects just a default route into the area.
In addition, any of these configurations may either allow or disallow the
propagation of external routes learned by the NSSA ASBR into the backbone.
This makes for a very flexible area type. The model shown in Figure 8-52 will
be configured according to configuration A. Then just the commands to con-
figure the other NSSA alternatives will be shown.
ABR1(config)#router ospf 1
ABR1(config-router)#network 172.1.3.2 0.0.0.0 area 0
ABR1(config-router)#network 172.2.3.2 0.0.0.0 area 1
ABR1(config-router)#area 1 nssa
A1-INT1(config)#router ospf 1
A1-INT1(config-router)#network 172.2.0.0 0.0.255.255 area 1
A1-INT1(config-router)#area 1 nssa
A1-ASBR(config)#router rip
A1-ASBR(config-router)#network 64.0.0.0
A1-ASBR(config-router)#exit
A1-ASBR(config)#router ospf 1
A1-ASBR(config-router)#network 172.2.4.2 0.0.0.0 area 1
A1-ASBR(config-router)#area 1 nssa
A1-ASBR(config-router)#redistribute rip metric 1 metric-type 2 subnets
11_772739 ch08.qxp 3/3/06 9:25 PM Page 327
OSPF 327
The
Internet
.10
65.16.16.8/30
E1 .9
A0-ASBR1
E0 .2
172.1.4.0/24 Area 0
E3 .1
E1 E2
A0-INT1
172.1.1.0/24 .1 .1 172.1.2.0/24
E0 .1
172.2.3.0/24 E0 E1 172.1.3.0/24
.2 ABR1 .2
172.2.3.0/24
Area 1
E0 .1
E1 E2
A1-INT1
172.2.1.0/24 .1 172.2.2.0/24
E3 .1
172.2.4.0/24
E0 .2
A1-ASBR1
E1 .5
64.23.11.4/30
.6
RIP
140.3.1.0/24
140.3.2.0/24
140.3.3.0/24
328 Chapter 8
Explanation (NSSA)
ABR1
Of note here is the nssa keyword used with the area command. All routers
with an interface in an NSSA area must use the area x nssa statement. In the
case of the ABR, along with enabling the ABR to receive type 7 (NSSA external)
LSAs, this statement also alerts the router to the fact that it must convert type
7 LSAs into type 5 (external) LSAs, and advertise them into area 0.
A1-INT1
The only thing unique here is the inclusion of the area x nssa statement, which
is required by all routers participating in the NSSA.
A1-ASBR
This router connects to the other autonomous system, so it must be configured
with the protocol running on the other system, which is RIP. The network
64.0.0.0 statement activates RIP only on interface E1. Then OSPF is activated
on E0 and configured as NSSA. However, no type 7 (NSSA External) LSAs will
be propagated until the RIP routes are redistributed into the OSPF routing
process, which the redistribute command takes care of.
The no-summary keyword makes the ABR behave just as when this keyword
is used to make a stub area totally stubby: the advertisement of type 3 (sum-
mary) LSAs into the NSSA area are suppressed, and only a default route is
injected into the area. The model shown in Figure 8-52, since it has only a sin-
gle ABR, would benefit from this feature. Only the ABR requires the no-sum-
mary keyword in the statement, and of course, the router must support the keyword.
OSPF 329
Make Both the NSSA ASBR and the ABR Inject a Default Route
(Configuration Option D)
Note that configuration D is simply a combination of configurations B and C
employed on the same NSSA. In this case, two candidate default routes will be
injected into the NSSA. Each router in the NSSA will of course install the
default route with the lowest advertised metric. This is an unusual configura-
tion, but if both ASBRs in the system connect to the same set of external net-
works, it might be a viable option. This is yet another example of how flexible
OSPF can be.
ABR1(config)#router ospf 1
ABR1(config-router)#network 172.1.3.2 0.0.0.0 area 0
ABR1(config-router)#network 172.2.3.2 0.0.0.0 area 1
ABR1(config-router)#area 1 nssa
ABR1(config-router)#summary-address 64.0.0.0 0.255.255.255 not-advertise
The summary-address command uses the same inverse mask that the OSPF
network command uses. Here, the entire 65.0.0.0 network and its subnets are
suppressed from being advertised into area 0.
Suppress Both Type 7 LSAs and a Default Route from Being Propagated
From the NSSA ASBR
This final twist in the NSSA configuration arsenal seems a bit strange at first.
Why would you want to suppress both type 7 LSAs and a default route at the
NSSA ASBR? This concept would be helpful if an NSSA ASBR was doing dou-
ble-duty as an ABR.
In Figure 8-54, the ASBR, rather than being a separate router attached to
some internal NSSA router, is simply an interface of the ABR. In this case, the
routers in the NSSA really only need the default route injected by the ABR by
virtue of the area being configured NSSA. The default route already being
11_772739 ch08.qxp 3/3/06 9:25 PM Page 330
330 Chapter 8
injected into area 1 by the ABR would accurately forward all externally bound
packets to the ABR, where they would either be sent to the ASBR interface or
to the area 0 interface depending on the destination address in the packet. In
that case, the ASBR need not propagate type 7 LSAs or a default route into the
NSSA. They just aren’t needed.
The
Internet
.10
65.16.16.8/30
E1 .9
A0-ASBR1
E0 .2
172.1.4.0/24 Area 0
E3 .1
E1 E2
A0-INT1
172.1.1.1/24 .1 .1 172.1.2.1/24
E0 .1
172.2.3.0/24 E0 E1 172.1.3.0/24
ABR-ASBR 1
.2 .2
172.2.3.0/24 E2 .5
Area 1 64.23.12.4/30
E0 .1
E1 T1 E2 .6
A1-INT1
EIGRP
172.2.1.0/24 .1 172.2.2.0/24
E3 .1
172.2.4.0/24
E0 .2
A1-ASBR1
E1 .5
64.23.11.4/30
.6
RIP
140.3.1.0/24
140.3.2.0/24
140.3.3.0/24
Figure 8-54 NSSA not requiring type 7 (NSSA External) LSAs from router ABR-ASBR1.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 331
OSPF 331
Because there is an ASBR hanging directly off area 1 (A1-ASBR1), the area
must be configured as NSSA if it is desirous to make it a stub area. Type 7 LSAs
are needed from A1-ASBR1, but not from ABR-ASBR1. The syntax of the area
nssa statement in the following example achieves the desired result:
ABR-ASBR1(config)#router rip
ABR-ASBR1(config-router)#network 64.0.0.0
ABR-ASBR1(config-router)#exit
ABR-ASBR1(config)#router ospf 1
ABR-ASBR1(config-router)#redistribute rip metric 1 metric-type 2 subnets
ABR-ASBR1(config-router)#network 172.1.3.2 0.0.0.0 area 0
ABR-ASBR1(config-router)#network 172.2.3.2 0.0.0.0 area 1
ABR-ASBR1(config-router)#area 1 nssa no redistribution
ABR-ASBR1 will still propagate type 5 (external) LSAs into area 0, but
thanks to the no redistribution keyword, the NSSA will not receive type 7
LSAs from this router. If it is desired to also suppress type 3 (summary) LSAs
from area 1, the previously discussed no summary keyword can be appended
to the statement, making it totally stubby (assuming the router vendor sup-
ports it), like this:
Now ABR-ASBR1 will advertise nothing into area 1 except a default route.
A1-ASBR1 will still advertise external routes into area 1, which will also be
advertised into area 0 through the ABR, which will convert type 7 to type 5
LSAs. These could be suppressed of course with the filtering command shown
earlier.
ABR1(config)#router ospf 1
ABR1(config-router)#area 1 range 172.2.0.0 255.255.0.0
11_772739 ch08.qxp 3/3/06 9:25 PM Page 332
332 Chapter 8
The 1 in the statement indicates the area whose routes should be summa-
rized. The address following the range keyword specifies the summary
address. The mask following the address is a conventional subnet mask that
identifies the network portion of the address. Here, all subnets of the 172.2.0.0
(172.2.1.0/24, 172.2.2.0/24, etc.) are summarized as a single address, 172.1.0.0,
as shown in Figure 8-55. It will take only a single type 3 (summary) LSA to
advertise area 1’s networks to area 0.
Conversely, area 0’s routes can also be summarized before they are adver-
tised to area 1, as follows:
ABR1(config)#router ospf 1
ABR1(config-router)#area 0 range 172.1.0.0 255.255.0.0
AO-INT1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
OSPF 333
A1-INT1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
A1-ASBR1(config)#router rip
A1-ASBR1(config-router)#network 64.0.0.0
A1-ASBR1(config-router)#exit
A1-ASBR1(config)#router ospf 1
A1-ASBR1(config-router)#network 172.2.4.2 0.0.0.0 area 1
A1-ASBR1(config-router)#area 1 nssa
A1-ASBR1(config-router)#summary-address 150.23.0.0 255.255.0.0
A1-ASBR1(config-router)#redistribute rip metric 1 metric-type 2 subnets
334 Chapter 8
AO-INT1#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
A1-ASBR1(config)#router rip
A1-ASBR1(config-router)#network 64.0.0.0
A1-ASBR1(config-router)#exit
A1-ASBR1(config)#router ospf 1
A1-ASBR1(config-router)#network 172.2.4.2 0.0.0.0 area 1
A1-ASBR1(config-router)#area 1 nssa
A1-ASBR1(config-router)#default-information originate metric 1 metric-
type 1
A1-ASBR1(config-router)#exit
A1-ASBR1(config)# ip route 0.0.0.0 0.0.0.0 64.23.11.5
OSPF 335
RouterA(config)#interface loopback 0
RouterA(config-if)#ip address 192.168.0.1 255.255.255.0
Interface Bandwidth
The default bandwidth for an interface varies according to media type. To alter
the default bandwidth:
routerA(config-if)#bandwidth xx (1)
where:
(1) x is specified in Kbps.
where:
(2) x is specified in Mbps.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 336
336 Chapter 8
Interface Cost
There is no predefined default cost assigned to an interface. To directly alter
this cost:
routerA(config-if)#ip ospf cost x (3)
where:
(3) x = 1-65535
where:
(4) x = area number; y = a value for cost
ABR1(config)#router rip
ABR1(config-router)#default-metric x (5)
ABR1(config-router)#redistribute ospf 100
where:
(5) x = a value for the metric
where:
(6) x = a value for the metric
OSPF 337
where:
(7) x = a value for the metric
ABR1(config)#router ospf 1
ABR1(config-router)#network 10.0.0.0
ABR1(config-router)#area 1 stub
ABR1(config-router)#area 1 default-cost x (8)
where:
(8) x = the cost for the area. The default value is 1
Traverse Time
The default estimated time for an LSA to traverse a link is 1 second. To change
this default:
338 Chapter 8
where:
(9) x = 0-255
Show Commands
OSPF Information
To show general information about an OSPF process:
where:
(10) x = process ID
OSPF Process
To show details about the OSPF process on a specific interface:
where:
(11) x = name of interface, like ethernet 0
11_772739 ch08.qxp 3/3/06 9:25 PM Page 339
OSPF 339
Link-State Database
To show the link-state database of a router:
Neighbor Infomation
To show the neighbor information:
LSAs Requested
To show a list of LSAs that have been requested:
340 Chapter 8
Notes
1. The interior routing protocol IS-IS is similar to OSPF and was devel-
oped around the same time. Although IS-IS is not widely used, it is in
use on some ISP backbones.
2. When multiple routers interface to a common subnet, LSAs on the sub-
net are instead forwarded to a single DR, which will then propagate the
LSAs to each router sharing the link.
3. OSPF maintains additional tables beyond the ones described here, but
the most commonly discussed tables are listed here.
4. The finite state machine was defined in Chapter 7 on page 190.
5. An interesting extension to OSPF to demonstrate its extensibility is a
newer class of LSAs termed “opaque” LSAs. See RFC 2370.
6. Due to the sometimes complex nature of configuring OSPF for NBMA,
the command reference does cover this advanced topic.
7. A detailed look at the SPF algorithm and the population of the route
table will occur in a subsequent section (page 198). The explanation will
make the most sense after a full treatment of area types, router types,
and LSA types.
8. If the downed DR or BDR comes back online, it is not restored to its
former role. Elections are only held if a DR or BDR is missing. For those
familiar with Windows NT Domain Controllers, the DR and BDR elec-
tion process works in a similar manner.
9. Cisco routers employ a fifth area type, which will also be discussed.
10. In fact, even a single area configuration requires the numeric designa-
tion of the area to be 0. An area can conceivably be linked to area 0 via
another area with a technique known as a Virtual Link. This contin-
gency will be covered later.
11. An area can conceivably be logically linked to area 0 via another area
with a technique known as a Virtual Link. This contingency will be cov-
ered later.
12. Just to be clear, if summarization was not enabled in area 0, any sum-
marized networks it learned of from other areas would remain summa-
rized, but networks within area 0 would not be summarized as they are
advertised to other areas.
13. Of course, even if the ASBR is configured with this option, stub areas
will receive only a default route. This is by design.
11_772739 ch08.qxp 3/3/06 9:25 PM Page 341
OSPF 341
CHAPTER
9
External Routing Protocols
in Brief
Overview
In this chapter, external routing protocols are explored. This class of protocols
is generally referred to as Exterior Gateway Protocols (EGPs). The chapter cov-
ers the following EGP topics:
Internal versus external routing protocols 344
Brief history of EGPs 345
BGP—King of external routing protocols 346
BGP Backgrounder 346
When to use BGP 347
How BGP works 349
BGP terminology 349
BGP path attributes 351
The autonomous system revisited 353
BGP peer sessions 355
BGP path determination (decision process) 355
Sample BGP system 357
The future of BGP 358
343
12_772739 ch09.qxp 3/3/06 9:26 PM Page 344
344 Chapter 9
Up until now, Interior Gateway Protocols have been studied; that is, the rout-
ing protocols that run inside an autonomous system. Ultimately however, the
many autonomous systems deployed throughout the world need to connect to
each other. There’s a familiar name for a worldwide network of autonomous
systems talking to each other; they call it the Internet. The current External
Gateway Protocol (EGP) used to tie the autonomous systems of the Internet
together is the Border Gateway Protocol (BGP).
Our coverage of external routing protocols will not be as in-depth as the
treatment of the internal routing protocols in previous chapters. Many network
engineers may go through their entire IT careers and not deal directly with BGP,
because with certain exceptions (as noted later), most organizations don’t run
BGP. They instead point default routes to their ISPs, which are running BGP.
The main purpose of this chapter is to contrast exterior routing protocols to
their interior counterparts and to give you a general familiarity with the default
EGP for Internet routing; BGP. If you require in-depth knowledge of BGP (for
industry certification, employment with an ISP, working for a large enterprise
that runs BGP, or just general curiosity), you will do well to purchase one of the
many books dedicated to BGP. Please don’t read this chapter and then apply for
a job with your friendly neighborhood ISP stating that you “know BGP.” The
fact is, you probably need to have more routing experience to configure BGP
than any other routing protocol. This is due to the complexity of BGP, the fact
that it is manually configured to a much greater degree than other routing pro-
tocols, and the impact on the Internet as a whole if BGP is misconfigured.
and other types of filtering that autonomous systems under the same admin-
istrative umbrella don’t have to deal with. An external routing protocol used
to manage Internet traffic must be designed so that it can be tuned to accom-
modate the implementation of such routing policies.
346 Chapter 9
ARPANET
G G G G G
Internet
Figure 9-1 The backbone-based ARPANET evolved into the AS-based Internet.
BGP Backgrounder
BGP is now the principal routing protocol used to connect autonomous sys-
tems across the Internet. The protocol has been updated several times since its
initial release in 1989 as an experimental protocol. The current version is BGP-
4, released as RFC 1771 in 1995.1 Among several changes in version 4 was full
support for CIDR. Table 9-1 shows the basic characteristics of BGP.
12_772739 ch09.qxp 3/3/06 9:26 PM Page 347
ISP 1 ISP 2
AS 123 AS 456
BGP BGP
BGP/OSPF
BGP/OSPF
BGP
Customer 1
AS 789
Figure 9-2 Some companies may use BGP if they connect to multiple ISPs.
12_772739 ch09.qxp 3/3/06 9:26 PM Page 348
348 Chapter 9
AS1
ISP 1
BGP
OSPF
Customer 1
Figure 9-3 BGP is not required simply for a fault tolerant connection to a single ISP.
12_772739 ch09.qxp 3/3/06 9:26 PM Page 349
BGP Terminology
BGP has some unique terminology associated with it. Some of the terms refer
to characteristics unique to BGP, while other terms are simply new names for
a feature present in other routing protocols.
350 Chapter 9
If you were to compare routing protocols to cars, then you might say that RIPv2
is like an old, well maintained VW bus; it will get you from point A to point B,
but it doesn’t keep up well on the big Interstates. OSPF is like a Honda Civic;
very well engineered and quite economical. On the other hand, BGP is kind
of like a formula race car; you can tune every aspect of such a vehicle from
carburetion, to gearing, to suspension setup. BGP has the right stuff for fine-
tuning inter-autonomous system routing.
Path Attributes
Every route advertised in BGP has a number of attributes, or path attributes,
associated with it. A route’s attributes are critical to conveying and applying
routing policies, and are discussed further in this chapter.
BGP Confederations
BGP confederations allow a single AS to be broken into smaller ASs. Confed-
erations were introduced well after the first BGP RFC was published to solve
a problem whereby the protocol did not scale well in large autonomous sys-
tems (the current RFC for BGP Confederations is 3065).
The scaling problem of BGP results from the fact that every BGP speaker
within an autonomous system must form a peer relationship with every other
BGP speaker. A direct connection to every speaker is not required, but a full
mesh of every BGP speaker in the AS is. With confederations, a full mesh is cre-
ated within the confederation, not to each speaker within the confederation.
Each confederation must then be able to reach every other confederation.
AS_PATH
The AS_PATH attribute is utilized by EBGP for interdomain routing. The
attribute contains the full path to the destination network (see Figure 9-4).
That’s a rather surprising statement, because interior routing protocols nor-
mally do no such thing (although OSPF certainly knows the full path to a des-
tination within an area via its topology table). However, this is a list of
autonomous system IDs, not network IDs. At a glance, this would appear to be
source routing, but in fact traffic may or may not pass through the ASs speci-
fied in the attribute, depending on routing policies and other factors. Rather,
the AS_PATH attribute is BGP’s mechanism for preventing routing-loops. If a
BGP router receives a routing update that includes its own AS number in the
AS_PATH attribute, it knows that accepting the route would create a loop and
the update is therefore rejected.
352 Chapter 9
NEXT_HOP
The NEXT_HOP attribute specifies the IP address that packets should be for-
warded to. Naturally the value of this attribute will be updated each time the
route is advertised. The specified address will normally be the interface of the
router the route was learned from, but in the case of two IBGP routers
exchanging a route within another AS, the address will be the interface of the
EBGP router the route was learned from.
ORIGIN
The ORIGIN attribute is one of several attributes used to evaluate which route
to use for forwarding traffic to a particular network. Three possible values
exist: IGP, EGP, and Incomplete. If the value of the ORIGIN attribute is IGP, it
means the route was learned from an interior routing protocol, and the route
therefore is contained within the local AS. Such routes get a higher preference
than routes with an ORIGIN attribute of EGP or Incomplete. A value of EGP
for the ORIGIN attribute indicates the route was learned from an EBGP router
(learned from another AS) and has the next highest precedence for route selec-
tion. Finally, a value of Incomplete means that the origin of the route is
unknown, such as a redistributed route, and thus has the lowest precedence.
MULTI_EXIT_DISC
MULTI_EXIT_DISC, as in Multiple Exit Discriminator (MED), is an optional
attribute that can be used by EBGP speakers to tell another AS which path to
use when there are multiple links between the ASs. The MULTI_EXIT_DISC
attribute basically acts as a metric to set a preference for one path over another.
The attribute can be set to a particular value for routes advertised across one
link and set to another value for routes advertised over a redundant link. The
corresponding AS will then send traffic to the originating AS over the link where
the routes with the lowest-value MULTI_EXIT_DISC attribute were learned.
Keep in mind that like any attribute, MULTI_EXIT_DISC can be applied to a sin-
gle route or a group of routes.
Also note that although the MED is a way for one autonomous system to
suggest to another autonomous system how to route traffic, it is only a sug-
gestion. For example, if an ISP used the MED to say, tell another ISP to send
west-coast traffic through a west-coast interconnect and east-coast traffic
through an east-coast interconnect, no ISP would accept such a command
because it lets a competitor say how traffic flows within the ISPs network.
Rather, MEDs are generally used when an ISP has two routers on the same
LAN as another ISP to tell the other ISP which of the two routers to use.
12_772739 ch09.qxp 3/3/06 9:26 PM Page 353
LOCAL_PREF
The LOCAL_PREF attribute is an optional attribute used only within an AS
(IBGP). Like MULTI_EXIT_DISC, the value can be manually set to prefer one
path to a destination over a different path to the same destination. Although
LOCAL_PREF is only used internally, it can be applied to both internal routes
as well as routes to networks in other ASs.
COMMUNITY
The BGP COMMUNITY attribute is a handy little tool for simplifying the
application of routing policies. It provides a means of applying an attribute to
a group, or community of routes, rather than set the attribute on each route.
354 Chapter 9
AS 1138
ISP
Figure 9-5 Many companies may come under the umbrella of a single AS.
356 Chapter 9
AS 2001 AS 1138
NAP
AS451
AS 007
Customer 1 Customer 2
358 Chapter 9
Notes
1. As we went to press, RFC 1771 was being obsoleted. The new standard
was in draft form and did not yet have an RFC number. See the appen-
dix for a link to the draft document.
2. Some implementations of the RFC defining BGP utilize multi path
routing.
3. Hierarchical in the sense that BGP follows the roughly hierarchical
structure of the autonomous system based Internet, but not hierarchical
as in OSPF, which incorporates a distinct two-level hierarchy.
4. RFC 1930 was created to clear up confusion about AS numbers.
12_772739 ch09.qxp 3/3/06 9:26 PM Page 360
13_772739 ch10.qxp 3/3/06 9:26 PM Page 361
CHAPTER
10
Redistribution and Default
Routing
Overview
The topics of route redistribution and default routing have been saved until
after the routing protocols were covered because it’s easier to discuss these
topics if you already understand something about the mechanics of routing
protocols.
Default routing has to do with configuring a router to forward packets when
a destination network is not found in the route table. Normally, if a router can’t
find a path for a packet, the packet is dropped. Default routing helps prevent
that scenario by providing a path to forward such packets in hopes that
another router will have more information about the packet’s destination. The
default routing facility can be used to great advantage in managing the size of
route tables and the bandwidth used by routing updates.
Default routing, in and of itself, can be configured without any routing pro-
tocol. But if it is desirable to have the default route shared with other routers,
a routing protocol must get involved. When a default route, or in fact any
route, is made known to a routing protocol that did not natively discover the
route, it is known as redistribution.
Of course, the most common use of redistribution is to import routes
learned by other routing protocols. Routing data known to one protocol can be
redistributed into another routing protocol, and vice versa. These external
routes are then advertised by the native routing protocol.
361
13_772739 ch10.qxp 3/3/06 9:26 PM Page 362
362 Chapter 10
KEY TERMS
Redistribution
Route tagging
Route maps
Distibution lists
Metric translation
Default route
Static default route
Default gateway
Network 0.0.0.0
Gateway of Last Resort
Candidate default route
Stub router
Route Redistribution
Route redistribution refers to the process of importing routes learned from
other sources into a particular routing protocol. The source may be routes
known to another routing protocol, a statically entered route, or directly
connected routes where the interface is not enabled for the native routing
protocol.
When you’re redistributing routes learned by another routing protocol, it is
typical to configure the foreign routing protocol on a border router connected
to the other system. Both the native and the foreign protocols run on a single
router, thus laying the groundwork for routes to be redistributed into the AS.
Redistribution can be one-way or two-way. Even when multiple routing
protocols are enabled on a router, redistribution does not usually occur auto-
matically, as illustrated in Figure 10-1.1 Redistribution must be specifically
configured.
13_772739 ch10.qxp 3/3/06 9:26 PM Page 363
Router B Router C
Router A
Running RIP Running OSPF
Running RIP
Figure 10-1 Routing protocols don’t share learned routes with each other by default.
364 Chapter 10
Figure 10-2 cites a network model where two autonomous systems want to
share routing information. The systems are physically connected, but each
routing domain is running a different routing protocol. In this case, each sys-
tem’s border router must be configured to run the foreign routing protocol
before routes can be dynamically learned, as shown in Figure 10-3.
After the corresponding routing protocol and configuring redistribution are
activated, routes are shared with the opposing system.
Static routes can be redistributed as well. The most common example of this
is the static default route examples in the subsequent section on default rout-
ing. But any static route in a router’s route table can be redistributed.
All the common interior routing protocols are capable of redistribution (RIP,
IGRP, EIGRP, and OSPF). The ubiquitous exterior routing protocol BGP is
capable of redistribution as well.
RIP IGRP
RIP/IGRP IGRP/RIP
Redistribution Issues
As alluded to earlier, route redistribution must be done with care. If not prop-
erly configured, convergence will be slowed and/or routing-loops may
develop. For example, say a router is running both RIP and EIGRP. RIP learns
of routes known to EIGRP because they have been redistributed into RIP. RIP
begins to advertise the EIGRP learned routes along with its normal routing
updates. If the EIGRP routers are also configured to learn and redistribute RIP
routes, eventually the RIP routers will learn about their own routes again
through EIGRP. These are far less favorable paths to the networks within the
RIP routing domain. This scenario can sabotage routing, so there are a variety
of mechanisms available to ensure redistribution works smoothly. Let’s have a
cursory look at each available method.
366 Chapter 10
ROUTE DISTANCE
Static route 1
BGP (external) 20
EIGRP (internal) 90
IGRP 100
OSPF 110
IS-IS 115
RIP 120
EGP 140
Route Tagging
Routes injected into one protocol from another protocol can be tagged—
marked with unique identifiers noting their source. This allows other routers
to identify the redistributed routes as having been redistributed, and accept,
discard, or otherwise rank the route accordingly. The routing protocol must
support this feature.
13_772739 ch10.qxp 3/3/06 9:26 PM Page 367
Distribution Lists
Distribution lists are used to filter specific routes when redistribution takes
place. Distribution lists are a form of access lists (a filtering mechanism pro-
vided by the Cisco IOS) applied to routing updates.
Route Maps
Route maps are access lists on steroids. Route maps make it possible to test for
certain conditions and branch one way or another based on the condition.
When route maps are used with distribution lists, route filtering can be man-
aged in a very granular fashion.
Default Routing
The concept of a default route (also known as a default gateway) is quite
straight forward. A default route provides a way of saying none of the above. If
there is no entry in the route table matching the destination address of a
packet, rather than drop the packet, it can be forwarded to the address speci-
fied by the default route entry. Default routing was first mentioned in Chapter 2,
when it was noted that workstations usually rely on default routes to forward
packets off the local network. Routers may or may not employ a default route
depending on the configuration of the network. In point of fact however, if a
network is connected to the Internet, default routing is very likely in use.
Would you want to import the entire routing table for the Internet? Most ISPs
don’t even do that.
Default routing doesn’t happen automatically. Packets with no matching
route are normally dropped and an ICMP Destination Unreachable message is
returned to the sender. Furthermore, even if a default route is established
packets may still be dropped if default routing is not configured properly.
368 Chapter 10
ISP router
providing
Internet
B access
C
A
Figure 10-4 Arrows indicate the direction of packets along the default route.
13_772739 ch10.qxp 3/3/06 9:26 PM Page 369
If the border router was only connected to the target organization’s border
router, a default route might work there as well. If on the other hand, the bor-
der router also connected to an ISP for Internet access, it would be necessary to
populate the border router’s route table with the networks to the other
autonomous system and save the default route for directing unknown traffic
to the Internet. This could be accomplished by either running the routing pro-
tocol of the target organization on the border router and performing redistrib-
ution, or by creating static routes that point to the other system.
370 Chapter 10
ISP router
providing
Internet
access
B
C
A
routerA#config-term
routerA(config)#ip classless
routerA(config)#interface serial 0
13_772739 ch10.qxp 3/3/06 9:26 PM Page 371
routerB#config-term
routerB(config)#ip classless
routerB(config)#interface fastethernet 0
routerB(config-if)#ip address 192.168.0.1 255.255.255.255
routerB(config-if)#exit
routerB(config)#interface fastethernet 1
routerB(config-if)#ip address 192.168.3.1 255.255.255.255
routerB(config-if)#exit
routerB(config)#router eigrp
routerB(config-router)#network 192.168.0.0
routerB(config-router)#network 192.168.3.0
routerB(config-router)#exit
routerB(config)#
The route tables for the configuration after they have converged are depicted
in Figures 10-7 and 10-8.
ISP router
providing
Internet
access
E0 E1
192.168.0.0/24 .1 B .1 192.168.3.0/24
.2 E0
E0 E1 E1 S0 (T1)
C .5 66.77.88.4/30 .6
192.168.1.0/24 .1 .1 192.168.4.0/24 .2
A
.2 E2
E0 E1
192.168.2.0/24 .1 D .1 192.168.5.0/24
372 Chapter 10
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Notice the statement Gateway of last resort is not set in the printout of both
routers. The obvious conclusion is that this is where a configured default route
(default gateway) would show up. Often true . . . but not always, as these
examples will show.
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
N OT E If you are wondering why router A has not been configured to advertise
the 66.77.88.4, there really is no point. Although 66.77.88.4 is the link to the
Internet, simply advertising the route is not enough to coax the stub routers
into directing Internet bound traffic to it. In truth, whether or not the route is
ultimately advertised is based on which of the two methods are employed for
default routing. Read on.
At this point, all the routers know about all the internal networks. However,
the Internet is still unreachable by the stub routers, and even by the border
router for that matter. Any packet bound for a network other than the six inter-
nal networks will be dropped because there is no entry for destinations other
than the local networks in the route tables. Thus, a default route must be
added to enable Internet access.
The most likely place to configure the default route is router A. Why?
Because a routing protocol will do the job of advertising the default route. Giv-
ing router A a default route negates the need to manually configure it on the
other routers. Let’s start with an example of creating a default route with the
ip route command.
routerA#config-term
routerA(config)#ip route 0.0.0.0 0.0.0.0 s0
374 Chapter 10
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 10-9 Router A has been given a default route using the ip route statement.
13_772739 ch10.qxp 3/3/06 9:26 PM Page 375
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Router B has been provided with a path to the Internet without the need for
reconfiguration (as have routers C and D). As with router A, notice that not
only has a Gateway of Last Resort been set, but router B is in turn advertising
the default route in its updates. Downstream routers running EIGRP will be
made aware of a candidate default route as well. Pretty cool.
376 Chapter 10
The key difference with this method is that the network specified for the
default route must be in every router’s route table.2 This will require a slight
alteration to the base configuration of the network model at router A. The fol-
lowing statements must also be be added to the configuration:
routerA(config)#router eigrp
routerA(config-router)#network 66.0.0.0
routerA(config-router)#exit
routerA(config)#
Because all routers need the network ID of the default route listed in their
route tables, the best way to make that so is to propagate the 66.0.0.0 through-
out the system. With the network now being advertised, router A is configured
for a default route by executing the ip default-network command:
routerA#config-term
routerA(config)#ip default-network 66.0.0.0
Notice that the statement does not include a network mask. A mask is not
used with the ip default-network command. Now let’s examine the router
output in Figure 10-11.
routerA#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
Figure 10-11 Router A has been given a default route using the ip default-network
command.
13_772739 ch10.qxp 3/3/06 9:26 PM Page 377
The route table looks different from the earlier example with the ip route
command. To begin with, the Gateway of Last Resort entry shows no gateway
set. This is due to the fact that router A is itself the gateway. The ip route state-
ment in the previous example specified the interface address of the next hop
router, but the ip default-network statement specifies a network; which is
directly connected. Packets arriving at this router, finding no matching address
in the route table, will be forwarded out interface Serial 0 because of the default
route entry in the route table. This point also addresses the other difference in
the output: there is no 0.0.0.0 candidate default route. Rather, the asterisk is
next to the 66.0.0.0 network, indicating that it’s the candidate default route.
Let’s see how router B’s route table has been influenced after a routing
update by examining the output in Figure 10-12.
Router B now has a Gateway of Last Resort set. Additionally, the router is
also advertising the candidate default route to its neighbors. With just the two
commands entered at router A, every router in this system now has a route to
the Internet.
routerB#show ip route
Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIRGP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2, E – EGP
i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level 2, * - candidate default
U – per-user static route, o – ODR
T – traffic engineered route
378 Chapter 10
Notes
APPENDIX
A
Where Do You Go From Here?
Multicast Routing
With the popularity of the Web, multicasting (transmitting data to a group of
hosts) has become a hot item. You will be well-served to know about how mul-
ticasting works, and which routing protocols and networking equipment sup-
port multicasting the best.
379
14_772739 appa.qxp 3/3/06 9:27 PM Page 380
380 Appendix A
Security
As everyone knows, security is a key issue of 21st century networking. Learn-
ing about security as it relates to network routing, means learning about access
lists, Virtual LANs (VLANs), packet encryption, and Virtual Private Networks
(VPNs), for a start.
Redistribution
As stated in Chapter 10, redistribution must be approached with caution. If
you need to redistribute routes into your network, study this topic some more,
and be cautious with the metrics you set on redistributed routes. Fully under-
standing redistribution means understanding access lists, route maps, route tags,
and distribution lists.
On-Demand Routing
On-demand routing (ODR) was noted in Chapter 2. If you employ static routes
on your network, it would be of benefit to research the benefits of ODR, a
newer technology that may prove to be more versatile than static routes.
IPv6
Although it may be years until it’s fully deployed, IPv6 is coming. It’s wise to
start learning it, even if your shop is not running IPv6 protocol stacks yet.
APPENDIX
B
Recommended Reading
We recommend that you pick up a copy of one or all of these books to further
your knowledge of network routing:
■■ Routing TCP/IP volumes I & II, Jeff Doyle, Cisco Press, ISBN
1-57870-041-8, 1-57870-089-2
Put simply, this is the Bible of IP routing. This comprehensive two-volume
set should be on your bookshelf. The book was revised to a second
edition in 2005, so watch the edition number when ordering. There is a
great deal of granular information, such as a full treatment of IPv6,
OSPF packet formats, and OSPF Virtual Links. The bulk of the second
volume is devoted almost entirely to BGP.
■■ Troubleshooting IP Routing Protocols, Faraz Shamim, et al, Cisco Press,
ISBN 1-58705-019-6
This is an excellent resource for down-and-dirty troubleshooting. There
are lots of examples of failed routing scenarios and how to fix them.
381
15_772739 appb.qxp 3/3/06 9:27 PM Page 382
382 Appendix B
APPENDIX
C
RFCs Related to Routing
RIPv2
2453, 1582, 1721, 1724, 2082, 2091
OSPF
2328, 2370, 2740, 3101, 3623, 3630, 3883, 4136, 4203, 4222
BGP
4271, 1657, 1997, 2385, 2439, 2547, 2796, 2918, 3065, 3107, 3392, 3765, 3882
IGMP
1112, 2236
383
16_772739 appc.qxp 3/3/06 9:27 PM Page 384
384 Appendix C
VLSM
1878
IPv6
2460, 2461, 2462, 2463, 2464, 2675, 2711, 3041, 3122, 3513, 3587, 3633, 3646,
3697, 3736
IP
791
CIDR
1518, 1519
Subnetting
950
VLSMs
1009
Route Summarization
1518
DHCP
1541
16_772739 appc.qxp 3/3/06 9:27 PM Page 385
BOOTP
951, 1395, 1497, 1532, 1542
Broadcast on Subnets
919, 922
DVMRP
1075
TCP/IP utilities
1739
APPENDIX
D
Web References
IP Address Allocation
Internet Corporation for Assigned Names and Numbers (ICANN):
www.icann.org
IANA (Internet Assigned Numbers Authority): www.iana.org
Number Resource Organization: www.nro.net
North America ARIN: www.arin.net
Europe, RIPE NCC: www.ripe.net
Asia Pacific APNIC: www.apnic.net
Latin America LATNIC: www.latnic.net
Africa AfriNIC: www.afrinic.net
387
17_772739 appd.qxp 3/3/06 9:28 PM Page 388
388 Appendix D
APPENDIX
E
Administrative Distance Table
ROUTE DISTANCE
Static route 1
BGP (external) 20
EIGRP (internal) 90
IGRP 100
OSPF 110
RIP 120
Unknown 255
389
18_772739 appe.qxp 3/3/06 9:28 PM Page 390
19_772739 appf.qxp 3/3/06 9:28 PM Page 391
APPENDIX
F
Quick-and-Dirty Subnetting—
No Calculator
The key to subnetting “quick-and-dirty style” is via a trick known as the magic
number. Once you determine the magic number in a subnetting problem,
everything else is child’s play. See for yourself.
Follow these steps to subnet a /24 address (former class C) with no binary
numbers and no calculator:
1. Determine the number of networks (subnets) needed.
This example uses the address 192.168.1.0:
(a) Count on your fingers, starting at two, doubling the number for
each finger until you get the number of subnets you need (1 finger =
two subnets, two fingers = 4 subnets, and so on).
(b) Subtract 2 from the result, and if you still have enough subnets, that
is the number of binary digits to borrow. If not, you’re one finger
short, so just borrow 1 additional bit.
Example for 6 subnets: 1 finger = 2; two fingers = 4; three fingers = 8.
Subtract 2 (8-2 = 6) and you know that borrowing 3 bits will provide
enough subnets.
391
19_772739 appf.qxp 3/3/06 9:28 PM Page 392
392 Appendix F
7. Determine the host IDs and broadcast address for any subnet:
■■ The number of host IDs per subnet is always the magic number – 2.
■■ The first host ID is always one greater than the subnet number.
■■ The last host ID is always two less than the next subnet number.
■■ The broadcast address is always one less than the next subnet
number.
Example using subnet 192.168.1.32 (255.255.255.224):
■■ There are 30 host addresses (32-2=30).
■■ The first host number is 192.168.1.33 (32+1).
■■ The last host number is 192.168.1.62 (64-2).
■■ Broadcast address is 192.168.1.63 (64-1)
This technique works for any classful or classless address. Just remem-
ber to borrow from the correct octet.
20_772739 appg.qxp 3/3/06 9:29 PM Page 393
CHAPTER
G
Subnetting Helper Sheet
Network address
to subnet
Default subnet
mask
# of networks
required
# of hosts
per network
# of bits
borrowed
Custom subnet
mask
Subnet IDs 1st Host ID Last Host ID Broadcast
Address
10
393
20_772739 appg.qxp 3/3/06 9:29 PM Page 394
21_772739 bindex.qxd 3/3/06 9:29 PM Page 395
Index
2-way state, OSPF routers, algorithms, SPF, running, LSAs and, 251
236 286–288 multiple-area operation,
ANDing 269–283, 271–277
introduction, 34–35 not-so-stubby area,
A subnetting and, 46 275–277
ABR (Area Border APIs (application pro- packets, 261–269
Router), 317 gramming interfaces), 6 partitioned, 238–239
default routing and, 295, Application layer (7), redi- single area operation,
296 rector, 8 252–261
OSPF, 239, 278 area 1 nssa default- standard area, 237–238,
access-list statement, 163 information originate 272–274
ACK (acknowledgement) command, 329 standard area, network
packets, EIGRP, 60, 188 area 1 stub statement, design and, 303–305
active route states, EIGRP, 317–318 stub area, 238, 274–275
191 Area ID packet field, Totally Stubby Area, 275
addressing. See also IP Hello packet (OSPF), transite, 239
addressing 263 virtual links, 239
hierarchical, 39 area range command, 333 ARPANET, EGP and, 345
loopback address, 73–74 area x default-cost com- ARP.EXE, 66
adjacency, OSPF mand, 336 AS (autonomous system)
establishing, 256–258 area x nssa statement, 328 interior/exterior proto-
overview, 235 area x range statement, cols, 108–109
administrative distance, 331 AS number, 345, 354
routing areas, OSPF ASBR (Autonomous Sys-
overview, 84–85 backbone area, 237, tem Boundary Router)
redistributed routes, 366 271–272 LSAs, 241
table, 389 backbone area, network default routing and, 295,
advertising routes, 140 design and, 302–303 296
AGGREGATOR attribute, introduction, 244 OSPF, 239, 278
BGP, 353 isolated, 239
395
21_772739 bindex.qxd 3/3/06 9:29 PM Page 396
396 Index
Index 397
398 Index
Index 399
400 Index
Index 401
402 Index
Index 403
404 Index
Index 405
406 Index
Index 407
408 Index