
- •Warning and Disclaimer
- •Feedback Information
- •Trademark Acknowledgments
- •About the Author
- •About the Technical Reviewers
- •Dedication
- •Acknowledgments
- •Contents at a Glance
- •Contents
- •Icons Used in This Book
- •Command Syntax Conventions
- •Cisco’s Motivation: Certifying Partners
- •Format of the CCNA Exams
- •What’s on the CCNA Exams
- •ICND Exam Topics
- •Cross-Reference Between Exam Topics and Book Parts
- •CCNA Exam Topics
- •INTRO and ICND Course Outlines
- •Objectives and Methods
- •Book Features
- •How This Book Is Organized
- •Part I: LAN Switching
- •Part II: TCP/IP
- •Part III: Wide-Area Networks
- •Part IV: Network Security
- •Part V: Final Preparation
- •Part VI: Appendixes
- •How to Use These Books to Prepare for the CCNA Exam
- •For More Information
- •Part I: LAN Switching
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Brief Review of LAN Switching
- •The Forward-Versus-Filter Decision
- •How Switches Learn MAC Addresses
- •Forwarding Unknown Unicasts and Broadcasts
- •LAN Switch Logic Summary
- •Basic Switch Operation
- •Foundation Summary
- •Spanning Tree Protocol
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Spanning Tree Protocol
- •What IEEE 802.1d Spanning Tree Does
- •How Spanning Tree Works
- •Electing the Root and Discovering Root Ports and Designated Ports
- •Reacting to Changes in the Network
- •Spanning Tree Protocol Summary
- •Optional STP Features
- •EtherChannel
- •PortFast
- •Rapid Spanning Tree (IEEE 802.1w)
- •RSTP Link and Edge Types
- •RSTP Port States
- •RSTP Port Roles
- •RSTP Convergence
- •Edge-Type Behavior and PortFast
- •Link-Type Shared
- •Link-Type Point-to-Point
- •An Example of Speedy RSTP Convergence
- •Basic STP show Commands
- •Changing STP Port Costs and Bridge Priority
- •Foundation Summary
- •Foundation Summary
- •Virtual LANs and Trunking
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Review of Virtual LAN Concepts
- •Trunking with ISL and 802.1Q
- •ISL and 802.1Q Compared
- •VLAN Trunking Protocol (VTP)
- •How VTP Works
- •VTP Pruning
- •Foundation Summary
- •Part II: TCP/IP
- •IP Addressing and Subnetting
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •IP Addressing Review
- •IP Subnetting
- •Analyzing and Interpreting IP Addresses and Subnets
- •Math Operations Used to Answer Subnetting Questions
- •Converting IP Addresses from Decimal to Binary and Back Again
- •The Boolean AND Operation
- •How Many Hosts and How Many Subnets?
- •What Is the Subnet Number, and What Are the IP Addresses in the Subnet?
- •Finding the Subnet Number
- •Finding the Subnet Broadcast Address
- •Finding the Range of Valid IP Addresses in a Subnet
- •Finding the Answers Without Using Binary
- •Easier Math with Easy Masks
- •Which Subnet Masks Meet the Stated Design Requirements?
- •What Are the Other Subnet Numbers?
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Extended ping Command
- •Distance Vector Concepts
- •Distance Vector Loop-Avoidance Features
- •Route Poisoning
- •Split Horizon
- •Split Horizon with Poison Reverse
- •Hold-Down Timer
- •Triggered (Flash) Updates
- •RIP and IGRP
- •IGRP Metrics
- •Examination of RIP and IGRP debug and show Commands
- •Issues When Multiple Routes to the Same Subnet Exist
- •Administrative Distance
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Link-State Routing Protocol and OSPF Concepts
- •Steady-State Operation
- •Loop Avoidance
- •Scaling OSPF Through Hierarchical Design
- •OSPF Areas
- •Stub Areas
- •Summary: Comparing Link-State and OSPF to Distance Vector Protocols
- •Balanced Hybrid Routing Protocol and EIGRP Concepts
- •EIGRP Loop Avoidance
- •EIGRP Summary
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Route Summarization and Variable-Length Subnet Masks
- •Route Summarization Concepts
- •VLSM
- •Route Summarization Strategies
- •Sample “Best” Summary on Seville
- •Sample “Best” Summary on Yosemite
- •Classless Routing Protocols and Classless Routing
- •Classless and Classful Routing Protocols
- •Autosummarization
- •Classful and Classless Routing
- •Default Routes
- •Classless Routing
- •Foundation Summary
- •Advanced TCP/IP Topics
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Scaling the IP Address Space for the Internet
- •CIDR
- •Private Addressing
- •Network Address Translation
- •Static NAT
- •Dynamic NAT
- •Overloading NAT with Port Address Translation (PAT)
- •Translating Overlapping Addresses
- •Miscellaneous TCP/IP Topics
- •Internet Control Message Protocol (ICMP)
- •ICMP Echo Request and Echo Reply
- •Destination Unreachable ICMP Message
- •Time Exceeded ICMP Message
- •Redirect ICMP Message
- •Secondary IP Addressing
- •FTP and TFTP
- •TFTP
- •MTU and Fragmentation
- •Foundation Summary
- •Part III: Wide-Area Networks
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Review of WAN Basics
- •Physical Components of Point-to-Point Leased Lines
- •Data-Link Protocols for Point-to-Point Leased Lines
- •HDLC and PPP Compared
- •Looped Link Detection
- •Enhanced Error Detection
- •Authentication Over WAN Links
- •PAP and CHAP Authentication
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •ISDN Protocols and Design
- •Typical Uses of ISDN
- •ISDN Channels
- •ISDN Protocols
- •ISDN BRI Function Groups and Reference Points
- •ISDN PRI Function Groups and Reference Points
- •BRI and PRI Encoding and Framing
- •PRI Encoding
- •PRI Framing
- •BRI Framing and Encoding
- •DDR Step 1: Routing Packets Out the Interface to Be Dialed
- •DDR Step 2: Determining the Subset of the Packets That Trigger the Dialing Process
- •DDR Step 3: Dialing (Signaling)
- •DDR Step 4: Determining When the Connection Is Terminated
- •ISDN and DDR show and debug Commands
- •Multilink PPP
- •Foundation Summary
- •Frame Relay
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Frame Relay Protocols
- •Frame Relay Standards
- •Virtual Circuits
- •LMI and Encapsulation Types
- •DLCI Addressing Details
- •Network Layer Concerns with Frame Relay
- •Layer 3 Addressing with Frame Relay
- •Frame Relay Layer 3 Addressing: One Subnet Containing All Frame Relay DTEs
- •Frame Relay Layer 3 Addressing: One Subnet Per VC
- •Frame Relay Layer 3 Addressing: Hybrid Approach
- •Broadcast Handling
- •Frame Relay Service Interworking
- •A Fully-Meshed Network with One IP Subnet
- •Frame Relay Address Mapping
- •A Partially-Meshed Network with One IP Subnet Per VC
- •A Partially-Meshed Network with Some Fully-Meshed Parts
- •Foundation Summary
- •Part IV: Network Security
- •IP Access Control List Security
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Standard IP Access Control Lists
- •IP Standard ACL Concepts
- •Wildcard Masks
- •Standard IP ACL: Example 2
- •Extended IP Access Control Lists
- •Extended IP ACL Concepts
- •Extended IP Access Lists: Example 1
- •Extended IP Access Lists: Example 2
- •Miscellaneous ACL Topics
- •Named IP Access Lists
- •Controlling Telnet Access with ACLs
- •ACL Implementation Considerations
- •Foundation Summary
- •Part V: Final Preparation
- •Final Preparation
- •Suggestions for Final Preparation
- •Preparing for the Exam Experience
- •Final Lab Scenarios
- •Scenario 1
- •Scenario 1, Part A: Planning
- •Solutions to Scenario 1, Part A: Planning
- •Scenario 2
- •Scenario 2, Part A: Planning
- •Solutions to Scenario 2, Part A: Planning
- •Part VI: Appendixes
- •Glossary
- •Answers to the “Do I Know This Already?” Quizzes and Q&A Questions
- •Chapter 1
- •“Do I Know This Already?” Quiz
- •Chapter 2
- •“Do I Know This Already?” Quiz
- •Chapter 3
- •“Do I Know This Already?” Quiz
- •Chapter 4
- •“Do I Know This Already?” Quiz
- •Chapter 5
- •“Do I Know This Already?” Quiz
- •Chapter 6
- •“Do I Know This Already?” Quiz
- •Chapter 7
- •“Do I Know This Already?” Quiz
- •Chapter 8
- •“Do I Know This Already?” Quiz
- •Chapter 9
- •“Do I Know This Already?” Quiz
- •Chapter 10
- •“Do I Know This Already?” Quiz
- •Chapter 11
- •“Do I Know This Already?” Quiz
- •Chapter 12
- •“Do I Know This Already?” Quiz
- •Using the Simulation Software for the Hands-on Exercises
- •Accessing NetSim from the CD
- •Hands-on Exercises Available with NetSim
- •Scenarios
- •Labs
- •Listing of the Hands-on Exercises
- •How You Should Proceed with NetSim
- •Considerations When Using NetSim
- •Routing Protocol Overview
- •Comparing and Contrasting IP Routing Protocols
- •Routing Through the Internet with the Border Gateway Protocol
- •RIP Version 2
- •The Integrated IS-IS Link State Routing Protocol
- •Summary of Interior Routing Protocols
- •Numbering Ports (Interfaces)

190 Chapter 6: OSPF and EIGRP Concepts and Configuration
Foundation Topics
Link-State Routing Protocol and OSPF Concepts
The ICND exam covers link-state protocol concepts and a single link-state routing protocol—OSPF. In this chapter, you will read about the basics. If you find yourself thinking that there has to be more to OSPF than what is covered here, you’re right! If you move on to the CCNP certification, you will need to learn many more details about OSPF and link-state protocols. For CCNA, you just need to know the basics.
Link-state and distance vectors share a common goal—filling the routing tables with the currently-best routes. They differ significantly in how they accomplish this task. The largest difference between the two is that distance vector protocols advertise sparse information. In fact, distance vector protocols know that other routers exist only if the other router broadcasts a routing update to them. When a distance vector protocol in a router receives a routing update, the update says nothing about the routers beyond the neighboring router that sent the update. Conversely, link-state protocols advertise a large amount of topological information about the network, and the routers perform some CPU-intensive computation on the topological data. They even discover their neighbors before exchanging routing information.
Figure 6-1 illustrates what a router might advertise with a link-state protocol. The actual contents of the routing updates are not shown. This is a graphical representation.
The network topology is shown in the upper part of the figure. With a link-state protocol, the whole network topology is described in the routing update, as shown in the lower part of the figure. Rather than Router B’s telling Router A what the metric (or cost) for the route should be, Router B tells Router A the metric associated with every link in the network.
Router B also tells Router A about all the routers in the network, including which subnets they are attached to and their status. In effect, it is like Router A has been given a map of the network, along with the cost associated with each link. Of course, the map is not literally a drawn map—it is a mathematical model of the network based on the topology information.
The link-state protocol on Router A calculates the lowest-cost route to all subnets based on the topology information, including the route to subnet 10.1.1.0, mask 255.255.255.0. When more than one route to a subnet exists, the link-state routing protocol chooses the lowest metric. Packets traveling to 10.1.1.0 from Router A go through Router C because this route has the lower cost.

Link-State Routing Protocol and OSPF Concepts 191
Figure 6-1 Content Advertised to a Neighboring Router: Link State
C |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
E |
B |
|
A |
|||
|
||||||
|
|
|
|
|
|
|
Subnet 10.1.1.0,
Mask 255.255.255.0
D
Up |
Cost 10 |
Cost |
|
|
Cost |
C |
Cost |
|
|
|
Up |
100 |
|||
10 |
|
|
10 |
|||
|
|
|
Up |
|||
|
|
|
|
Up |
|
|
Up |
|
|
|
|
|
|
|
E |
|
|
|
||
|
|
|
|
|
||
Subnet 10.1.1.0, |
Up |
Up |
Up |
Up |
||
|
|
|
Cost |
|||
Mask 255.255.255.0 |
|
|
Cost |
|||
|
|
|
||||
|
|
|
|
100 |
|
100 |
|
|
|
|
|
D |
|
|
|
|
|
|
Cost 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
Up |
|
Up |
Cost |
Up |
Cost |
|
|
|
|
|
|
||
|
|
|
|
||
|
100 |
|
|
10 |
|
|
|
|
|
|
|
B |
Up |
A |
Up |
|
|
|
|
|
|
|
|
Unlike distance vector protocols, link-state protocols must calculate the metric instead of simply being told the metric in the received routing update. For instance, with distance vector protocols, Router B tells Router A something like “subnet 10.1.1.0, metric 3.” With linkstate protocols, the topology information learned by a router includes a cost associated with each link in the network. A router totals the cost associated with each link in each route to find the metric associated with the route. For instance, Router A discovers two routes to subnet 10.1.1.10, with a metric of 220 for the route to 10.1.1.0 through Router C and a metric of 310 for the route to 10.1.1.0 through Router D. In both cases, Router A uses Router B as the next hop. Therefore, Router A puts a route to 10.1.1.0 in its routing table, using Router B’s interface IP address as the next hop. Similarly, Router B calculates routes to 10.1.1.0 through Router C and Router D and places the better route (through Router C) in Router B’s routing table.

192 Chapter 6: OSPF and EIGRP Concepts and Configuration
The algorithm used to calculate routes with link-state protocols is called the Shortest Path First (SPF) algorithm. It is sometimes called the Dijkstra SPF algorithm, or simply Dijkstra after its inventor. You can look at Figure 6-1 and figure out the two routes and total the metrics to find the lowest-cost route. Routers, however, cannot just look at the figure. In fact, routers really just know the list of routers and subnets and which routers are connected to which subnets. The SPF algorithm processes all that topology information to come up with the best route to each subnet.
Link-state protocols do not just start broadcasting topology information out every interface when the router first boots. Instead, link-state protocols first use a process by which they discover neighbors. (Neighbors can also be statically defined instead of being discovered.) Neighbors are other routers, also running the same link-state protocol, that share a common subnet. As soon as routers know that they are neighbors, they can exchange their respective copies of the topology information—called the topology database—and then run SPF to calculate new routes.
The process of identifying neighbors can be complicated—and it has to happen before any topology information is exchanged. Also, the rules by which neighbors are located, and what that means to the process of exchanging topology information, changes based on router configuration and the type of data-link protocol used on an interface. Look to the CCNP routing exam, and books covering OSPF and the CCNP routing exam more fully, for more information about neighbor relationships.
After a router identifies a neighbor, they exchange the information in their topology databases. The routing updates sent by an OSPF router are called link-state updates (LSUs), and the items sent in an LSU include individual link-state advertisements (LSAs). For instance, a link LSA describes a subnet number and mask, the cost (metric), and other information about the subnet. Also, OSPF uses a reliable protocol to exchange routing information, ensuring that lost LSU packets are retransmitted. So OSPF routers can know with certainty whether a neighbor has yet received all the LSAs when exchanging routing information.
Although many of the details of how OSPF and link-state protocols work have not been covered, the basic sequence has been covered. The basic process of learning routes for the first time with OSPF goes something like this:
1.Each router discovers its neighbors on each interface. The list of neighbors is kept in a neighbor table.
2.Each router uses a reliable protocol to exchange topology information (LSAs) with its neighbors.
3.Each router places the learned topology information in its topology database.

Link-State Routing Protocol and OSPF Concepts 193
4.Each router runs the SPF algorithm against its own topology database to calculate the best routes to each subnet in the database.
5.Each router places the best route to each subnet in the IP routing table.
Link-state protocols require more work from the routers, but the work is typically worth the effort. A router running a link-state protocol uses more memory and more processing cycles than do distance vector protocols. The topology updates take many more bytes compared to distance vector routing updates, although because OSPF does not advertise all routes every update interval like distance vector protocols do, the overall number of bytes sent can be smaller with OSPF. A link-state protocol uses a neighbor table and a topology database in addition to adding routes to the routing table. Also, the SPF algorithm must be used to recalculate routes when links go up or down, and the algorithm itself requires memory and processing on each router. However, you can reduce the amount of memory and processing required by following some good design practices, some of which are covered in this section. Also, OSPF converges much more quickly than do distance-vector protocols—and fast convergence is the most important feature of a routing protocol.
Steady-State Operation
Unlike distance vector protocols, link-state protocols keep in touch with their neighbors by sending occasional small packets to each other instead of full routing updates. OSPF, the most popular link-state routing protocol, calls these small packets Hello packets. Hello packets simply identify the subnet, the router sending the packets and a few other details. As long as a router continues to receive Hellos from existing neighbors, the attached link must still be usable, and the neighbor that sent the Hello must still be up and working. Figure 6-2 depicts link-state Hello packets.
Figure 6-2 Link-State Hello Packets
B |
A |
Hello |
Hello |
Hello |
Hello |
Interval |
Interval |
Hello |
Hello |
Hello packets serve the same purpose as timed, regular full routing updates serve for distance vector protocols. With distance vector protocols, when a router fails to hear routing updates from a neighbor for some multiple of the update interval, the router believes the silent router has failed. The router then marks all routes it learned from the now-silent router as having an infinite metric.