220 likes | 286 Views
OSPF (Open Shortest Path First). Malathi Veeraraghavan EE136/EL537. What ’ s OSPF?. Open Developed by IETF IGP working group, RFC2328 SPF Each router floods link-state information to its neighbors to other routers
E N D
OSPF (Open Shortest Path First) Malathi Veeraraghavan EE136/EL537 Haobo Wang
What’s OSPF? • Open • Developed by IETF IGP working group, RFC2328 • SPF • Each router floods link-state information to its neighbors to other routers • Based on the flooded link-state information, each router maintains a complete link-state database • Based on the link-state database, routing table is constructed using SPF(Dijkstra’s) algorithm • Runs over IP directly, protocol number 89 Haobo Wang
OSPF is a Link-State based, IGP routing protocol • Link-State vs. Distance-Vector (RIP) • Link-State: Each router monitors the state of the link to each of its neighbors and floods the link-state information to all routers in the network • Distance-Vector: ? • IGP vs. EGP (BGP) • IGP: Inside the AS • EGP: ? Haobo Wang
Features of OSPF • Use flexible metrics instead of hop count • Support variable-length subnetting • Allow load balancing among equal-cost paths • Support type of services (ToS) • Authenticate route exchanges • Quick convergence • Support multicast Haobo Wang
Hierarchical OSPF • AS is partitioned into self-contained areas, areas are organized as two-level hierarchy • Routing traffic is limited inside the area - Scalability • Areas are interconnected by backbone area • Areas are identified by 32-bit area ID, 0.0.0.0 is reserved for backbone area • Four types of routers • Internal router, area border router, backbone router, autonomous system boundary router Haobo Wang
OSPF areas Within each area, border router responsible for routing outside the area Exactly one area is backbone area Backbone area contains all area border routers and possibly others Haobo Wang
OSPF packets • Five types of OSPF packets • Hello(1) • Database description(2) • Link-State Request(3)/Update(4)/Acknowledgement(5) • OSPF common header Haobo Wang
Hello Packet Haobo Wang
Database Description packet • Database description packet • LSA header Haobo Wang
Link-state Request/Update/ Acknowledgement • Link-state Request • Link-state Update • Link-state Acknowledgement Haobo Wang
OSPF operations • Hello protocol • Database synchronization • Propagation of link-state information • Building of routing table Haobo Wang
Hello Protocol • Hello packets are transmitted to all interfaces periodically • Discover neighbor, establish and maintain neighbor relationship • Ensure the communication between neighbors is bi-directional • Elect Designated Router (DR) Haobo Wang
Database synchronization • Two neighboring routers exchange database description packets to synchronize their link-state databases. • Master/slave mode • Database description includes a list of LSA headers. New or more up-to-date LSAs will be requested later Haobo Wang
Propagation of link-state information • Link-state Request • A router wants to update parts of its link-state database • Link-state Update • When requested or link-state changed or periodically • Reliable flooding • Link-state Update is transmitted periodically until Link-state Acknowledgement received Haobo Wang
Building of routing table • Router S has knowledge of the entire area topology (complete link-state database) • Dijkstra’s algorithm is used to generate shortest path tree, rooting from router S • Only the next hop will be used in the routing table Haobo Wang
Dijkstra’s Algorithm • Calculate the shortest path from node S to all other nodes S Source node Dn cost of the least-cost path from node S to node n M = { S }; for each n M Dn = dsn; while (M all nodes) do find w M for which Dw = min{Dj : j M}; add w to M; for each n M Dn = minw[Dn, Dw + dwn]; update route; enddo Haobo Wang
Dijkstra’s Algorithm - Example • Construct the routing table at router 1 using Dijkastra’s algorithm 5 3 2 3 2 5 3 2 1 1 6 1 2 4 5 1 Haobo Wang
Dijkstra’s Algorithm (cont’) • Start with M consisting of only router 1 Haobo Wang
Dijkstra’s Algorithm (cont’) • Resulting shortest path tree 2 3 2 1 1 6 2 1 4 5 1 • The tree is translated into a routing table Haobo Wang