Beruflich Dokumente
Kultur Dokumente
Chapter 3
Single-Area OSPF
Link-state routing protocols differ from distance vector protocols. Link-state
protocols flood link-state information and thus give every router a complete view
of the network topology. With a distance vector protocol, routers do not learn
about the complete network topology. Open Shortest Path First (OSPF) is a link-
state protocol.
In OSPF, the shortest path first (SPF) algorithm, discovered by the computer
scientist Dijkstra, is used to determine the best path – the lowest-cost path to a
link.
The SPF algorithm was conceived as an algorithm for point-to-point network
connections. To implement OSPF on the variety of networks that are available
today, OSPF must be aware of the network type in which it operates. This allows
OSPF to work correctly for these different network types.
Before link-state information is exchanged, the OSPF protocol establishes a
neighbor relationship between routers. The OSPF Hello protocol is used for this
purpose.
OSPF is a complex protocol and is described by a set of operational steps.
OSPF is a link-state routing protocol based on open standards. It is described in
several standards of the Internet Engineering Task Force (IETF); the most recent is
RFC 2328.
The Open in OSPF means that it is open to the public and is nonproprietary. OSPF
is becoming the preferred IGP protocol compared to the Routing Information
Protocol (RIP) because it is scalable.
RIP cannot scale beyond 15 hops, it converges slowly, and it can choose slow
routes because it ignores critical factors such as bandwidth in route determination.
OSPF deals with these limitations and has been proven to be a robust, scalable
routing protocol suitable for modern networks. OSPF can be used for large
networks because it scales to larger networks if hierarchical network design
principles are used. OSPF can also be used and configured as a single area for
small networks.
OSPF can be used for large networks. OSPF routing scales to large networks if
hierarchical network design principles are used.
Large OSPF networks use hierarchical design principles. Multiple areas connect to
a distribution area, area 0, also called the backbone. This design approach allows
for extensive control of routing updates. Defining areas reduces routing overhead,
speeds up convergence, confines network instability to an area, and improves
performance.
20
Concept Questions
Demonstrate your knowledge of these concepts by answering the following
questions in the space provided.
Link-state routers identify neighboring routers and then communicate with these identified
neighbors. OSPF comes with a new set of terms.
Information gathered from OSPF neighbors is not a complete routing table. Each OSPF
router tells about the status of its connections, or links. This information is flooded to all
its neighbors.
An OSPF router advertises its link-states and passes on received link-states. The routers
process this information and build a link-state database. Every router in the OSPF area,
will have the same link-state database. Every router has the same information about the
state of the links and every other router’s neighbors.
Each router then runs the Shortest Path First (SPF) algorithm, also known as the Dijkstra
algorithm, on its copy of the database. This calculation determines the best route to a
destination. OSPF routers record information about their neighbors in the adjacency
database. To reduce the number of exchanges of routing information among several
neighbors on the same network, OSPF routers elect a Designated Router (DR) and a
Backup Designated Router (BDR) that serve as focal points for routing information
exchange.
Exstart
Exchange
Loading
Full adjacency
Describe what occurs in each of these states.
Down State - In the Down state, the OSPF process has not exchanged information with
any neighbor. OSPF is waiting to enter the next state, which is the Init state.
Init State -OSPF routers send Type 1 (hello) packets at regular intervals (usually 10
seconds) to establish a relationship with neighbor routers. When an interface receives its
first hello packet, the router enters the Init state, which means the router knows a neighbor
is out there and is waiting to take the relationship to the next step.
There are two kinds of relationships - two-way state and adjacency - although there are
many phases in between. A router must receive a hello from a neighbor before it can
establish any relationship.
Two-Way State -Using hello packets, every OSPF router tries to establish a Two-way
state, or bi-directional communication, with every neighbor router on the same IP network.
Among other things, hello packets include a list of the sender's known OSPF neighbors. A
router enters the Two-Way state when it sees itself in a neighbor's hello. For example,
when RTB learns that RTA knows about RTB, RTB declares a two-way state to exist with
RTA.
The Two-Way state is the most basic relationship that OSPF neighbors can have, but
routing information is not shared between routers in this relationship. To learn about other
routers' link-states and eventually build a routing table, every OSPF router must form at
least one adjacency. An adjacency is an advanced relationship between OSPF routers that
involves a series of progressive states that rely not just on hellos, but also on the other four
types of OSPF packets. Routers that attempt to become adjacent to one another exchange
routing information even before the adjacency is fully established. The first step toward
full adjacency is the ExStart state, which is described next.
ExStart State - Technically, when a router and its neighbor enter the ExStart state, their
conversation is characterized as an adjacency, but the routers have not become fully
adjacent yet. ExStart is established using Type 2 database description (DBD) packets, also
known as DDPs. The two neighbor routers use hello packets to negotiate who is the
"master" and who is the "slave" in their relationship and DBD packets to exchange
databases.
The router with the highest OSPF router ID "wins" and becomes master. (The OSPF
router ID is discussed later in this chapter.) When the neighbors establish their roles as
master and slave, they enter the Exchange state and begin sending routing information.
Exchange State - In the Exchange state, neighbor routers use Type 2 DBD packets to send
each other their link-state information. In other words, the routers describe their link-state
databases to each other. The routers compare what they learn with their existing link-state
databases. If either of the routers receives information about a link that is not already in its
database, the router requests a complete update from its neighbor. Complete routing
information is exchanged in the Loading state.
22
Loading State - After the databases have been described to each router, they may request
information that is more complete by using Type 3 packets, link-state requests (LSRs).
When a router receives an LSR, it responds with an update by using a Type 4 link-state
update (LSU) packet. These Type 4 LSU packets contain the actual link-state
advertisements (LSAs), which are the heart of link-state routing protocols. Type 4 LSUs
are acknowledged using Type 5 packets, called link-state acknowledgments (LSAcks).
Full Adjacency - With the Loading state complete, the routers are fully adjacent. Each
router keeps a list of adjacent neighbors, called the adjacency database. Do not confuse the
adjacency database with the link-state database or the forwarding database.
Vocabulary Exercise
Define the following terms as completely as you can. Use the online curriculum or
Chapter 3 of the Cisco Networking Academy Program CCNA 3 and 4 Companion
Guide, Third Edition, for help.
Backbone - The part of a network that acts as the primary path for traffic that is most
often sourced from, and destined for, other networks.
Designated router (DR) - OSPF router that generates LSAs for a multiaccess network
and has other special responsibilities in running OSPF. Each multiaccess OSPF network
that has at least two attached routers has a designated router that is elected by the OSPF
Hello protocol. The designated router enables a reduction in the number of adjacencies
required on a multiaccess network, which in turn reduces the amount of routing protocol
traffic and the size of the topological database.
Flooding - Process that sends out information out all ports, with the exception of the port
on which the information was received.
Hello protocol - Protocol used by OSPF systems for establishing and maintaining
neighbor relationships.
Process identifier – A numerical number assigned during the OSPF configuration process
that identifies each OSPF process running on a router.
Router identifier (Router ID) – IP address that identifies a router participating in OSPF.
The router ID is taken from the active interface with the highest ip address or from a
configured loopback interface.
Shortest Path First (SPF)Algorithm - Routing algorithm that iterates on length of path to
determine a shortest-path spanning tree. Commonly used in link-state routing algorithms.
Sometimes called Dijkstra's algorithm.
23
Focus Questions
4. RIP broadcasts full routing tables to all neighbors every ______ seconds.
However, this is especially problematic over slow WAN links, because these
updates consume large amounts of bandwidth. Alternatively, OSPF ________
minimally sized link-state updates and sends the updates only when a
________ is in the network.
6. List the OSPF network type that matches each topology shown in Figure 3-1.
9. Another noteworthy point about OSPF is that it does not perform ________
and ________; these functions are performed at the IP layer.
11. Fill in Figure 3-2, which shows the different parts of the OSPF header.
12. ________ packets are sent periodically out of each interface using IP
multicast addresses.
13. The Hello process provides quicker detection of failed routers because Hellos
are exchanged every ____ seconds. If a router is silent for ____ seconds, its
neighbors believe it is down.
15. Routers from the same ________ each have the same link-state database
information.
16. In a typical broadcast LAN environment such as Ethernet or Token Ring, the
OSPF routers communicate with the DR using multicast address ________.
17. The following are used to determine which routers are elected as DR and
BDR:
The router with the highest set ________ value is the ____.
The router with the second-highest set priority value is the _____.
The default value for OSPF interface priority is ___. In case of a tie, the
router ___ is used as a tiebreaker.
The only time a DR or BDR changes is if one of them ________ ________.
26
18. Fill in the circles pointing out the two DRs and one BDR in Figure 3-3.
19. The process used to discover the network routes is called the ________
process.
It is performed to advance the routers to a ________ state of communication.
20. The routers must be in the ________ state before they can route traffic.
22. Sometimes, a link goes up and down rapidly. This is called ________.
23. The ___ ________ command was added to the Cisco IOS software to prevent
routers from computing a new routing table until ____ seconds after a route
change.
24. When there is a change in a link state, the router uses a ________ process to
notify the other routers in the network of the change.
25. When a router notices a change in a link state, it ________ an LSU packet
that includes the updated LSA entry to ________, the “all DR routers” (and
BDR) address.
router(config)#router ospf processid
27. ________ -____ is a user-defined number that identifies multiple OSPF processes
running in a single router.
p2r2#debug ip ospf ?
27
1. Link-state routers maintain a common picture of the network and exchange link
information upon initial discovery or changes. Link-state routers do not broadcast
their routing tables periodically, like distance vector routing protocols do.
2. While RIP is appropriate for small networks, OSPF was written to address the
needs of large, scaleable internetworks.
4. RIP broadcasts full routing tables to all neighbors every 30 seconds. However, this
is especially problematical over slow WAN links because these updates consume
large amounts of bandwidth. Alternately, OSPF multicasts minimally sized link-
state updates and sends the updates only when there is a change in the network.
5. In contrast, OSPF selects optimal routes using cost as a factor (This is a metric
based on bandwidth).
Discover routes.
8. Because OSPF routing is dependent on the status of a link between two routers,
neighbor routers must "recognize" each other on the network before they can
share information.
28
9. Another noteworthy point about OSPF is that it does not perform fragmentation
and reassembly; these functions are performed at the IP layer.
11. Fill in the graphic explaining the different parts of the OSPF header:
12.Hello packets are sent periodically out of each interface using IP multicast
addresses.
13.The Hello process also provides quicker detection of failed routers because Hellos
are exchanged every 10 seconds. Routers expect to hear from their neighbors
every 10 seconds. If a router is silent for 40 seconds, its neighbors believe it is
down.
15. Routers from the same area will each have the same link-state database
information.
16.In a typical broadcast LAN environment such as Ethernet or Token Ring, the
OSPF routers communicate with the DR by using multicast address 224.0.0.6
17.The following are used to determine which routers are elected as DR and BDR:
18. Fill in the circles pointing out the locations of the two DRs and one BDR below:
29
19. The process used to discover the network routes is called the exchange process,
and is performed to advance the routers to a Full state of communication.
20.The routers must be in the Full state before they can route traffic.
21.To calculate the lowest cost to a destination, link-state protocols such as OSPF use
the Dijkstra algorithm.
22. Sometimes a link will go up and down rapidly. This is called flapping.
23.The spf holdtime command was added to the Cisco IOS software to prevent
routers from computing a new routing table until 10 seconds (default) after a route
change.
24. When there is a change in a link-state, the router uses a flooding process to notify
the other routers in the network of the change.
27. process-id is a user defined number to identify multiple OSPF processes running
within a single router.
30
A. Exstart
B. Full
C. Loading
D. Exchange
2. What OSPF packet type establishes and maintains neighbor
adjacencies?
A. Link-state request
B. Link-state acknowledgment
C. Hello
D. Database description packet
3. What is the default cost metric for OSPF based on?
A. Delay
B. Media bandwidth
C. Efficiency
D. Network traffic
4. What multicast address represents all OSPF routers?
A. 224.0.0.6
B. 224.0.0.1
C. 224.0.0.4
D. 224.0.0.5
5. What command can be used to change OSPF priority on an
interface?
A. 224.0.0.6
B. 224.0.0.1
C. 224.0.0.4
D. 224.0.0.5
7. What is a common feature of NBMA networks?
A. ip ospf neighbor
B. ospf neighbor
C. neighbor
D. ip neighbor
9. What command displays the routes known to a router and how they were
learned?
A. show ip protocol
B. show ip route
C. show ip ospf
D. show ip ospf neighbor detail
10. Which of the following are two basic types of dynamic routing?
A. Distance-vector, link-state
B. Distance-vector, hybrid
C. Link-state, distance-vector
32
D. Dynamic, static