CS440 Computer Networks 1
Link State Routing and OSPFLink State Routing and OSPF
Neil TangNeil Tang10/31/200810/31/2008
CS440 Computer Networks 2
OverviewOverview Basic Idea
Flooding
Route Calculation
Distance Vector VS. Link State
OSPF
CS440 Computer Networks 3
Basic IdeaBasic Idea Each router gets information of its direct neighbors and the cost of the
link to each of them by exchanging Hello messages periodically.
Each router disseminates the neighbor and link cost information to all other routers in the network such that each router will have a complete view of the network topology and the link costs.
Each router uses Dijkstra’s algorithm to calculate the shortest paths to all other routers.
CS440 Computer Networks 4
Link State Packet (LSP)Link State Packet (LSP) LSP is used to record the link state (cost) information. It will be
flooded into the network by each router.
An LSP includes the following fields - The address of the router creating this packet - A list of directly connected neighbors, with the cost of the link to each one. - A sequence number - TTL
CS440 Computer Networks 5
FloodingFlooding A router will generate an LSP and broadcast it to all its neighbors. Tho
se neighbors will continue to broadcast it. Next time when the router generates a new LSP, the Sequence Number (SN) will be increased by one.
For a particular router, every other router only keeps the LSP with largest SN from it. When receiving the old (smaller SN) or duplicate (same SN) LSPs, the routers will simply drop them and will not re-broadcast it.
CS440 Computer Networks 6
FloodingFlooding
(a)
X A
C B D
(b)
X A
C B D
(c)
X A
C B D
(d)
X A
C B D
CS440 Computer Networks 7
FloodingFlooding Efficient: Each router must be aware of the change of network status a
s early as possible. LSPs will be flooded periodically and whenever the network status changes.
Low Overhead: Flooding is only conducted when really necessary. A relatively long timer can be set for periodical flooding.
CS440 Computer Networks 8
Route CalculationRoute CalculationThe Dijkstra’s Shortest Path Algorithm (Refer to pp.280 for formal presentation)
10
5
0
10
52
1
936
8
5
14
0
10
52
1
936
7
8
5
13
0
10
52
1
936
7
8
5
9
0
10
52
1
936
7
8
5
9
0
10
52
1
936
7
6
1
0
10
52
93
A
B
C
D
E
CS440 Computer Networks 9
Route CalculationRoute CalculationForward Search Algorithm (An implementation of the Dijkstra’s algorithm)
Step Confirmed Tentative
1 (A,0,-) (B,10,B)(C,5,C)
2 (A,0,-)(C,5,C)
(B,8,C)(D,14,C)(E,7,C)
3 (A,0,-)(C,5,C)(E,7,C)
(B,8,C)(D,13,C)
4 (A,0,-)(C,5,C)(E,7,C)(B,8,C)
(D,9,C)
5 (A,0,-)(C,5,C)(E,7,C)(B,8,C)(D,9,C)
6
1
10
52
93A
B
C
D
E
CS440 Computer Networks 10
Distance Vector (DV) VS. Link State (LS)Distance Vector (DV) VS. Link State (LS) Difference: In DV, the distributed Bellman-Ford algorithm is used. Ever
y node talks to only its neighbors but tells them everything it has learned; In LS, the centralized Dijkstra’s algorithm is used. Every node talks to all other nodes via flooding but tells them only its neighborhood information.
Strength: DV needs to store relatively small amount of routing information in each router. LS stabilizes very quickly.
Weakness: DV stabilizes slowly. LS needs to store a large amount of information in each router.
CS440 Computer Networks 11
Open Shortest Path First (OSPF) RoutingOpen Shortest Path First (OSPF) Routing Authentication of routing messages: 8-byte password is used for
authentication to prevent routing hole.
Load balancing: every router maintains multiple routes for a particular destination.
CS440 Computer Networks 12
Control MessagesControl Messages Hello Message
Link State Advertisement (LSA) Message: It advertises the costs of all links incident to that router.
LS Age Options Type=1
0 Flags 0 Number of links
Link type Num_TOS Metric
Link-state IDAdvertising router
LS sequence number
Link IDLink data
Optional TOS informationMore links
LS checksum Length
Top Related