Lesson 5-2: Open Shortest Path First Protocol

smashlizardsNetworking and Communications

Oct 29, 2013 (3 years and 11 months ago)

87 views

Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
203
Lesson 5-2: Open Shortest Path First Protocol
At a Glance
The Open Shortest Path First (OSPF) protocol was developed to answer
problems that RIP could not resolve. By the mid-1980’s, RIP was unable to
adequately serve large differentiated internetworks. OSPF is based on
Dijkstra’s algorithm, named for its creator E.W. Dijkstra, and can operate
in large hierarchical networks.
What You Will Learn
After completing this lesson, you will be able to do the following:
 Briefly compare distance-vector and link-state protocols.
 Diagram the three OSPF phases.
 Describe the advantages of link-state routing.

Tech Talk
 Dijkstra’s Algorithm—A routing algorithm created by E.W. Dijkstra
that calculates the shortest path for delivery of a packet across a
network.
 Hello Packet—Messages broadcast across a network by a node to
itself to the other nodes and to indicate that the node is still operational
 Interdomain Routing Protocols—Routing protocols that operate
within and between domains.
 Link-state Update Message—Message issued by an OSPF router
informing neighboring routers of a path change in the network.
 OSPF's Flooding Protocol—The process of forwarding update
messages across the network to all the OSPF routers.



Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
204

Link-State Routing
Link-state routing differs from distance-vector routing in that each router
in the network maintains a complete model of the entire network. Where
distance-vector protocols keep only two pieces of information about a
network, its distance and the next hop towards its destination, link-state
protocols keep information about every single node in the network, and the
states of every link between them. Using this information they can
compute the shortest path to any destination, and from that they can infer
a next hop.
Instead of distributing the selection of the shortest path between two
points across all the routers in the network, link-state protocols force each
router to compute the shortest path between itself and every other node.
From experience, the network managers know that link-state protocols
scale much better than their distance-vector protocols. While RIP may still
be the most popular routing protocol on local networks, link-state protocols
are used more often in larger networks. The most common link-state
protocol is the Open Shortest Path First (OSPF) protocol.
Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
205
Open Shortest Path First Protocol
As stated previously, the Open Shortest Path First (OSPF) protocol is the
most common link-state protocol. It is a member of the TCP/IP family.
The OSPF algorithm has three phases. The first phase is finding
neighbors. To do this, OSPF sends a "Hello" packet to each neighbor.
Among the things in this packet is a list of neighbors from which the
sender has recently received a Hello. In the illustration below, for
instance, Router B is turned on for the first time. It sends a Hello packet
to Router A.

Hello Packets Are Exchanged
Shortly after that, Router A will, in the normal course of events, send a
Hello to Router B, which lists Router B as a neighbor from whom it has
heard recently. Router B is then assured that it has an adjacency to
Router A. The routers continue to send periodic Hello packets to their
neighbors, to verify the states of their links.
Router A
LAN
LAN
Router B
LAN
Router C
LAN
LAN
LAN
LAN
LAN
LAN
Hello B
Hello
1st Step
2nd Step
Router D
Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
206
In the second phase of the OSPF process, a new router obtains a complete
copy of its neighbor's link-state database. This is a complex and careful
process that goes to considerable length to be certain that the new router
has an exact copy of the existing routers database.

New Router Received Complete Link-State Database
Router A
LAN
LAN
Router B
LAN
Router C
LAN
LAN
LAN
LAN
LAN
LAN
Router D
LAN
Router E
Router D’s
Link-State
Database
New
Router

Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
207
The third and final phase of the OSPF protocol is the normal state for a
running OSPF router. The fully initialized router sends and accepts
updated describing changes in the states of network links. This process is
accomplished with OSPF's "flooding" protocol.

Flooding
Router A
LAN
LAN
Router B
LAN
Router C
LAN
LAN
LAN
LAN
LAN
LAN
Router D
LAN
Router E
Router D’s
Link-State
Database
Updates
Updates
(Receives)
(Sends)

Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
208
Suppose the link between Router A and Router B fails in the network
previously illustrated. Router A and Router B will both notice the failure
and immediately broadcast Link-state Update messages to Routers C and
D, respectively. These messages will indicate a change in a particular
record in the shared database. Since Routers A and B have identical
databases, they will both identify the same record.

Link-state Update Messages
Router A
LAN
LAN
Router B
LAN
Router C
LAN
LAN
LAN
LAN
LAN
LAN
Router D
LAN
Router E
1st Break
Updates
Updates
2nd
2nd

Routers C and D, upon receiving the message will compare the serial
number for the newly arrived record to the serial number for the existing
record in their databases. Based on this comparison they will take one of
three actions:
 If the new serial number is the same as the old, they will discard the
message
 If the new serial number is less than the old, they will discard the new
message, and send a Link-state update message containing the record
from the local database back to the originator.
 If the new serial number is greater than the old, they update their local
databases, and forward the update to all neighbors, except the one from
which they received it.
Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
209
In the example, then, Router C will forward the update to Router D.
Router D will forward to Routers C and E. At that point, since Routers C
and D have both already seen the update, they do not forward it further.
All routers have now been informed of the failure of the link between
Routers A and B.

Link-state Update Messages Are Forwarded
Router A
LAN
LAN
Router B
LAN
Router C
LAN
LAN
LAN
LAN
LAN
LAN
Router D
LAN
Router E
Router D’s
Link-State
Database
Updates
Updates
Updates

Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
210
Check Your Understanding
 Given the scenario in the diagram below, outline how OSPF would
update the routers on the network of the conditions in the diagram.
What is the most likely path to deliver packets to Router E in this
diagram?
Router A
LAN
LAN
Router B
LAN
Router C
LAN
LAN
LAN
LAN
LAN
LAN
Router D
LAN
Router E
BREAK!!


Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
211
Advantages of Link-State Routing
The description of the OSPF protocol above is considerably simplified. The
document that specifies OSPF is more that 100 pages of fine type, and
more that five times the length of the specification for RIP. Why, then, do
most large networks use link-state routing, instead of the simpler distance-
vector protocols? There are three main reasons:
 Fast convergence
 Concise, multiple metrics
 Support for multiple paths
Fast Convergence
RIP's primary flaw is the amount of time it takes all of the routers in a
network to adapt to a change in the network. In general transients
particularly affect distance-vector routing protocols because they distribute
the computation of new routes across the whole network. It may take
several exchanges of information before a group of routers finally agrees on
the new topology.
In link-state protocols, on the contrary, in the time it takes a packet to
cross the network, all routers know exactly what has changed, and has an
accurate new database.
Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
212
Router A
Router B
Router C
Router D
Router E
Router F
4
3
4
4
4
1
(Total = 16!)
Multiple, Concise Metrics
Because of the counting-to-infinity problem, it is difficult for a distance-
vector protocol to support concise metrics. RIP uses only integers from 0 to
16. In a network that is differentiated between four different line speeds,
assigning them weights of 1 to 4, the maximum distance between two
routers might have to be no more than 3 physical hops.
In the diagram below, the distance from Router A to Router F, using the
weighted hop counts indicated, is 16. These two routers would be
unreachable from each other, using RIP.

RIP’s Counting to Infinity
Since link-state protocols specify the exact information about a link, it is
possible to include very precise specification of metrics. It is even possible
to include several kinds of metrics: delay, reliability, and price. With this
information a router can route a packet based on the particular type of
service it requests.
Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
213
Support for Multiple Paths
Consider the network shown below.
There are two paths, ACDE, and ABDE, of equal cost, from Router A to
Router E. Suppose the vast majority of traffic on this network is from
Router A to Router E. Using a distance-vector routing protocol, Router A
will choose one or the other of those two paths, arbitrarily, and use it for all
of the traffic to Router E. For instance, it might choose the path through
Router C, and never use the path through Router B. This would waste half
of the network's bandwidth from Router A to Router E.

Link-state Algorithm Maps the Entire Network
Router A
LAN
LAN
Router B
LAN
Router C
LAN
LAN
LAN
LAN
LAN
LAN
Router D
LAN
Router E
43
1
1
2

Since a link-state algorithm has an entire map of the network, it has the
information necessary to compute alternative paths.
Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
214
Try It Out
What’s My Topology?
In this activity you will discover the topology of the network drawn in
advance by your teacher.
Materials Needed:
 Topology handout for drawing the network
 Link-state Routing Table to record node locations
 Dijkstra's Algorithm Worksheet
 Teams of three students, each team representing a node
 Pen/Pencil and Paper
Part One: The Game
Rules:
1. To start the game, all teams must name their node and take their
starting link table to an assigned location. Your teacher will tell you
the locations of your neighbors, and when to start.
2. You may send a runner any number of times to any adjacent neighbor
and request their link state data (names of their neighbors, their
neighbors’ neighbors, and so on).
3. The runner must return to his/her home site and update their link
table with the new information.
4. When you update your table, draw the emerging topology.
5. A team member must be available at your home site to answer requests
from other runners.
6. If you arrive at a node when an update is in progress, wait for it to
complete before getting the link table.
7. The game is over when all teams have announced to their site
administrator (your teacher) that they have discovered the topology
and drawn it.
8. Gather together with the rest of the teams.
9. Compare your topologies with the other teams and choose the topology
that is correct for the network designed by your teacher.
Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
215
Part Two: Dijkstra’s Algorithm
1. Using the Dijkstra’s algorithm worksheet, fill in the routing table for
your node according to the rules of the algorithm. Were there problems
using the algorithm to map your topology? If so, why?
Rubric: Suggested Evaluation Criteria and Weightings
Criteria % Your Score
Enthusiastic and cooperative participation 50
Correct network topology diagram 25
Correct Dijkstra’s algorithm routing table 25
TOTAL 100


Developed by Nancy Ishihara, Blake Meike, Deborah Muscella, and John
Zinky for the Connecting Communities Project, TERC. Copyright 1996
by TERC. Reprinted with permission.

















Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
216
What’s My Topology?
Master Link Table for Node___________
Location___________________________
Neighbor Locations
_____________________________
_____________________________
_____________________________
_____________________________




















Li
nks:


From: (Node Name) To: (Node Name)
Team Members:
Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
217
What’s My Topology?
Runner Link Table
Node___________(name of node visited) has links:

From: (Node Name)
To: (Node Name)























Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
218
What’s My Topology?
Dijkstra’s Algorithm
For finding the shortest path to all nodes follow these steps:
1. Mark yourself as length 0
2. Look at the length 0 node for length 1 nodes
3. Mark the length 1 nodes
4. Look at length 1 nodes for length 2 nodes
5. Mark the length 2 nodes
6. Look at length 2 nodes for length 3 nodes
7. Mark the length 3 nodes
Routing Table for Node:
To Toward Length
A

B

C

D

E

F

G

H

Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
219
Stretch Yourself
Body Routing
In this activity you will deliver all the messages to their destinations and
return an acknowledgement to the originating node.
Materials Needed:
 Tape
 Complete routing table for each node (developed in Try It Out)
 One log/node to record messages sent and received
 Node signs
 Message tags
 Rules to post at node
 Pen/Pencil and Paper
Players:
 2 students/node are “Nodes”
 All other students are “Messages”
 One adult/node
 One game facilitator to visit nodes and answer questions and facilitate
communication.
Rules:
1. Use the topology from the Try It Out with the names filled in.
2. All nodes must choose and announce their names.
3. Decide what the destination of your messages will be and fill in the tags
with the appropriate information.
4. Messages are not “intelligent.” They need to follow the instructions of
the Nodes. Each node has an equal number of messages.
5. Nodes handle messages as follows:
a. If you are the destination of the Message (TO:). Check the
“RECEIVED” box. Cross out TO: and FROM: nodes. Rewrite TO: as
FROM: and FROM: as TO: (message is now on its return trip) and
return the message to its originator (now TO:)
Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
220
b. If you are the originator of the Message (you are the original FROM:
and RECEIVED is checked), mark it as “RECEIVED” in your log.
This message has been successfully sent and acknowledged and is
no longer in play.
c. Otherwise, look up the TO: node of the Message in your table and
send it Towards the corresponding node.
6. There is only one wire. Messages may not pass each other (congestion).
When 2 messages meet going in opposite directions (collisions) the
Nodes must decide on a “rule” to get the Messages where they need to
go.
7. To start the game: Messages will be given a FROM: and TO: Node
address on their tag and started at the FROM: node. Nodes will be
stationed at their nodes.
8. The game is over when all the messages have gotten to their
destination and returned.
As a team, write a summary of your experiences in this game. What
problems occurred? What were the solutions? Relate the game to what you
have learned about routing algorithms. How well does the game simulate
the algorithms? If you were creating a game, what would you do
differently?
Rubric: Suggested Evaluation Criteria and Weightings
Criteria % Your Score
Attentive and cooperative participation 50
Successful delivery of all Messages 25
Insightful summary of experiences and critique of
the game
25
TOTAL 100


Developed by Nancy Ishihara, Blake Meike, Deborah Muscella, and John
Zinky for the Connecting Communities Project, TERC. Copyright 1996
by TERC. Reprinted with permission.




Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
221
Body Routing
Message Log for Node_______________

Body Routing








Team Members:
TO FROM RECEIVED

TO:






MESSAGE:





FROM: REPLY:




RECEIVED________
TO:






MESSAGE:




FROM: REPLY:





RECEIVED_______
Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
222
Network Wizards
Design Your Own Algorithm
A routing algorithm can be calculated using many different metrics
(parameters or values). Each algorithm that has been written for routing
has been designed on multiple types of metrics. Some algorithms use only
one metric; for example, RIP uses hop count, other use multiple metrics.
These algorithms did not just appear. They were written by network
designers as a means to create ever more efficient routing procedures.
In this activity you will discover the topology of the network drawn in
advance by your teacher.
Materials Needed:
 Windows 95 PC
 Internet Connection
 Any Word Processor (e.g., MS Word)
 Pen/Pencil and Paper
1. Research other routing algorithms over the Internet and any other
source you feel appropriate. Reference at least five resources.
2. Design an algorithm (name it after yourself, of course) that can be used
for creating routing tables and assuring efficient delivery of packets
across a network.
3. It is entirely possible that your algorithm will have problems, perhaps
problems that are not self-evident. Try using your algorithm with a
team of students.
4. Write a clear and concise description of your algorithm, including each
step. With your description, write a summary of the success of your
algorithm based on the trial simulation you conducted with your team.
Rubric: Suggested Evaluation Criteria and Weightings
Criteria % Your Score
Thorough research including five resources 25
Creative algorithm reflecting quality analysis 50
Clear and concise description and critique of
algorithm
25
TOTAL 100

Unit 5: Intradomain and Interdomain Routing Protocols
ST0025804A
223
Summary
In this lesson, you learned the following:
 The comparison between distance-vector and link-state protocols.
 How to diagram the three OSPF phases.
 The advantages of link-state routing.
Review Questions Name_______________
Lesson 5-2: Open Shortest Path First Protocol
Part A
1. Compare the basic features of distance-vector and link-state routing
protocols.
Part B
1. Diagram the three OSPF phases in building a link-state routing table.

Part C
1. Describe the advantages of link-state routing.












Lesson 5-2: Open Shortest Path First Protocol
ST0025804A Routing
224
Scoring
Rubric: Suggested Evaluation Criteria and Weightings
Criteria % Your Score
Part A: Briefly compare distance-vector and
link-state protocols
25
Part B: Diagram the three OSPF phases 50
Part C: Describe the advantages of link-state
routing
25
TOTAL 100

Try It Out 100

Stretch Yourself 100

Network Wizards 100

FINAL TOTAL 100



Resources
Comer, D. E. (1995). Internetworking With TCP/IP : Principles, Protocols,
and Architecture 3rd edition
, Prentice Hall, Upper Saddle River, New
Jersey.
Perlman, R. (1992). Interconnections: Bridges and Routers
, Addison-Wesley
Publishing Co.,Reading, MA.
Stevens, W. R.(1994). TCP/IP Illustrated, Volume 1: The Protocols
,
Addison-Wesley Publishing Co., Reading, MA.
Tannenbaum, A.S. (1996). Computer Networks
, Prentice Hall, Upper
Saddle River, New Jersey.