CS440 Computer Networks 1 Link State Routing and OSPF Neil Tang 10/31/2008
CS440 Computer Networks 2 Overview Basic Idea Flooding Route Calculation Distance Vector VS. Link State OSPF
CS440 Computer Networks 3 Basic 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) 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 Flooding A router will generate an LSP and broadcast it to all its neighbors. Those 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 Flooding
7 Flooding Efficient: Each router must be aware of the change of network status as 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 Calculation The Dijkstra’s Shortest Path Algorithm (Refer to pp.280 for formal presentation) 10 5 A BCDE
CS440 Computer Networks 9 Route Calculation Forward Search Algorithm (An implementation of the Dijkstra’s algorithm) StepConfirmedTentative 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) A B C D E
CS440 Computer Networks 10 Distance Vector (DV) VS. Link State (LS) Difference: In DV, the distributed Bellman-Ford algorithm is used. Every 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) 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 Messages Hello Message Link State Advertisement (LSA) Message: It advertises the costs of all links incident to that router.