1. 1 Introduction to OSPF Protocol Design By: Ranjeet Saini Engineering Test Lead Agnity Technologies, Inc. March, 2008
2. 2 Agenda References & Standard II. Terminology OSPF Format IV. OSPF Algorithm
3. 3 References & Standard RFC 2328 OSPF Version 2 April, 1998 by John Moy 2. RFC 2370 The OSPF Opaque LSA Option April, 1998 by R. Coltun Understanding TCP/IP December, 1995 SynOptics Communications 4. RFC 1349 Type of Service in the Internet Protocol July, 1992
4. 4 References & Standard II. Terminology OSPF Format IV. OSPF Algorithm
5. 5 Internet Routing Rate % Rate % Rate % Rate % Rate % Rate % Rate % Rate % Rate % Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 5 35 5 35 5 35 5 35 5 35 5 35 5 35 5 35 5 35 20 20 20 20 20 20 20 20 20 20 20 20 1 1 1 1 1 1 1 1 1 1 1 1 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Util% Util% Util% Util% Util% Util% Util% Util% Util% Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Status Status Status Status Status Status Status Status Status Status Status Status Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Diag Diag Diag Diag Diag Diag Diag Diag Diag Diag Diag Diag Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Core System Area Border Router Area Border Router R7 R8 R1 R2 Area Border Router R9 R3 R4 R5 Autonomous System #1 Autonomous System #3 R6 Autonomous System #2
6. 6 Exterior Gateway Protocol Rate % Rate % Rate % Rate % Rate % Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 5 35 5 35 5 35 5 35 5 35 20 20 20 20 20 20 20 20 1 1 1 1 1 1 1 1 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Util% Util% Util% Util% Util% Demo Demo Demo Demo Demo Demo Demo Demo Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Status Status Status Status Status Status Status Status Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Diag Diag Diag Diag Diag Diag Diag Diag Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M IGP1 IGP2 IGP1 IGP1 IGP2 IGP2 EGP IGP1 IGP2 Autonomous System1 Autonomous System #2 An External Links Advertisement originates for each destination outside The AS, and these advertisements are in turn flooded throughout the AS. An External Links Advertisement is used for externally derived routing Information obtained by another routing protocol such as EGP or BGP.
7. 7 Terminology Autonomous Systems(AS) Each AS is a group of networks & routers administered by single authority using a common routing protocol. Interior Gateway Protocol(IGP) Routers within single AS communicate using one of several dynamic routing protocols, known generically as an IGP. Exterior Gateway Protocols(EGP) Communication between routers belonging to different AS requires additional protocol, so-called EGP. Open Shortest Path First(OSPF) is an Interior Gateway Protocol(IGP) IP routing protocol.
8. 8 Configurable Metrics Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 20 20 20 1 1 1 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Demo Demo Demo Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Status Status Status Select/Link Select/Link Select/Link Diag Diag Diag Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Hop = 1 Cost= 10 Hop = 1 Cost= 10 T1 T1 56Kb Hop = 1 Cost= 100 B A Using RIP, traffic would be routed over slow 56K link since the hop count Metric is 1. Using OSPF as the IGP, traffic can be routed over faster T-1 Link since total cost would be 20. For single destination, there may be separate routing table entries for each Type Of Service. A metric for TOS 0 must always be specified.
9. 9 Network Types OSPF operates over below physical networks : Point-to-point Network A network joining single pair of routers. Broadcast Network A network with more than 2 attached routers, and the ability to address single physical messages to all of attached routers. Non-broadcast Network A network with more than 2 attached router, but having no broadcast capability such as X.25 public data network. DR BDR
10. 10 Adjacencies Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 20 20 20 1 1 1 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Demo Demo Demo Config Link SNMP Config Link SNMP Config Link SNMP Filter% Filter% Filter% Status Forward% Status Forward% Status Forward% Select/Link Select/Link Select/Link Diag Diag Diag 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M Full/Half Full/Half Full/Half An “adjacency” is a two-way communication between selected neighboring routers for the purpose of exchanging routing information through link-state advertisements. Router Router Adjacency Router
11. 11 Routing Area Rate % Rate % Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 30+ 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 10 50 10 Collision 50 Collision 5 35 5 35 5 35 5 35 5 35 20 20 20 20 20 1 1 1 1 1 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 5 Tx/Rx 5 5 Tx/Rx Tx/Rx 5 Tx/Rx 5 Tx/Rx Util% Util% Util% Util% Util% Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Demo Demo SNMP Demo SNMP Demo Demo Status Filter% SNMP Forward% Filter% Forward% Filter% Filter% SNMP Status Filter% SNMP Forward% Forward% Config Link Config Link Config Link Config Link Forward% Config Link Status Status Status Select/Link Select/Link Select/Link Select/Link Select/Link Diag Diag Diag Diag Diag Full/Half Full/Half Full/Half Full/Half Full/Half 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M Area 2 Area 1 N9 N10 Router N1 N3 AS 200 Router Router AS 100 Area Border Router (ABR) N6 N7 N8 N4 N2 Router Router N5 AS 300 Note : Each area has its own topological link-state database. All routers within an area contain Router LSAs & Network LSAs. Router is Autonomous System Boundary Router(ASBR).
12. 12 Routing Area(Con’t) OSPF allows collections of contiguous networks and hosts to be grouped together. This group, along with the routers having interfaces connected to the networks in this group, is called an “area”. A single area limits the boundary for Link-Stat Advertisement(LSA) flooding. the Shortest Path First(SPF) tree is computed on a per-area basis, and any intra-area destinations are derived from the SPF tree. All areas must have at least one route/interface connected to area 0.0.0.0( the backbone area). An Area Border Router(ABR) is an OSPF router having interface connected to multiple areas. ABRs must keep a distinct link-state database for each area, and run the SPF algorithm on distinct database.
13. 13 Routing Area- Backbone Area If an AS is divided into areas, the areas must be connected to each other Via special area called the “Backbone Area”. Backbone consists of those Networks not contained in any area. All ABRs in an AS must belong to the Backbone Area. Backbone area is assigned an area_ID to 0.0.0.0 Backbone Area AS 300 Area-1 ABR Area-2 ABR Area-3 ABR
14. 14 Backbone Area(Con’t) An ABR connected to the Backbone executes two copies of OSPF protocol: Operates on the interface connected to local area and accept flooded advertisements from other routers that are members of the area Executes over the interface that connects to the backbone. This second copy won’t propagate flooded advertisements from the area across the backbone. Instead, it sends Summary Link Advertisements over the backbone so that attached area can learn about backbone reachability.
15. 15 Stub Area OSPF Domain AS 101 RIP or IGP Area 0.0.0.0 Stub Area 51 0.0.0.0 Default ASBR When an OSPF area within an AS has a single entry/exit router that is used by all externally addressed traffic, it is possible to block the import of the AS External Link Advertisements into the area : ~ No LSA type 4 & 5’s ~ ASBRs are not supported with stub area ~ Virtual links are not supported in stub area ~ The ABR must be configured as default router for stub area ~ The ASBR can be configured to be disabled for an area
16. 16 Virtual Link A virtual link can be configured to allow the connection of an ABR to backbone When the ABR and its are aren’t contiguous to the backbone. In below figure, Area 1 cannot directly learn all inter-area from the other areas Since it lacks a direct connection to the backbone. Area 1 is connected to the Backbone by a virtual link between the ABRs in Area 2. All inter-area routes From the backbone are flooded over virtual link to the ABR in Area 1. The ABR In Area 1 will summarize all intra-area routes for Area 1 over virtual link for Transmission on the backbone. AS 200 Area 1 Area2 ABR Area 4 ABR Router Router Router ABR Area 3 ABR Router Backbone
17. 17 Virtual Link(Con’t) Virtual Link Area 0.0.0.0 Area 0.0.0.51 Area 0.0.0.7 ABR ABR Any physical arrangement of areas can be logically attached to the Backbone through a virtual link. Virtual links allow summary-LSAs to be tunneled across a non- Backbone area to exchange the routing information.
18. 18 Virtual Link(Con’t) C A D Virtual link Area 51 Data Area 0.0.0.0 B Area 0.0.0.7 Data Area 52 Data Virtual link The exchange of routing information continues to follow via virtual link but the forwarding of data packets does not. A data packets from router C destine for router D would go through routers A & B, but not through Area 0.
19. 19 Area Routing Advantages Routing Area greatly reduce the amount of routing information traffic that must be propagated throughout entire AS Areas allow the development of a hierarchy of routing information, thus protecting each area from external routing information. The area’s information is hidden from routers outside of the area. This “information hiding” technique is important from a security standpoint, since it prohibits other areas from identifying the physical topology of an area.
20. 20 References & Standard II. Terminology OSPF Format IV. OSPF Algorithm
21. 21 IPv4 Format 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Total Length 0 Type Of Service LEN VERS Identification Fragment Offset 4 Flags Protocol= 89 Time To live = 1 8 Header Checksum Source IP Address C E Destination IP Address 10 Padding Option 14 D A T A Total: 20 bytes
22. 22 OSPF Assigned Class D Address Multicast Class D addresses assigned for OSPF : 224.0.0.5 All OSPF routers must be capable of transmitting & receiving packets with this destination IP address 224.0.0.6 All OSPF Designated Routers must be capable of receiving packets with this destination address. This includes the Backup Designated Router. IP Address MAC 224.0.0.5 01005E-000005 224.0.0.6 01005E-000006 Note : OSPF multicast addresses are used on both point-to-point links & multi-access networks, but does not use over non-broadcast networks or virtual links. To ensure that multicast OSPF messages won’t travel multiple hops, their IP TTL must be set to 1.
23. 23 OSPF Packet Header 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Packet Length Type 0 4 8 C 10 14 Version No. Router ID Area ID AuType Header Checksum Authentication Type Description 1 Hello 2 Database Description 3 Link State Request 4 Link State Update 5 Link State Acknowledgment OSPF Packet Header = 24 bytes
24. 24 OSPF Hello Packet Type = 1 Hello Packet Length Version No. Network Mask HelloInterval Option Rtr Pri RouterDeadInterval Designated Router Backup Designated Router Neighbor : : Router ID Area ID Entry 1 (24 bytes) Checksum AuType Authentication Network Mask HolloInterval Option Rtr Pri RouterDeadInterval Designated Router Backup Designated Router Neighbor D A T A Entry n Note: DR/BDR = 0 means no designated router
25. 25 Hello Message Contents The router’s “Router Priority” used to determine the Designated Router & Backup Designated Router. The hello interval in which the transmitting router sends Hello packets on given network. The interval(in seconds) in which the transmitting router expects to receive Hello packets from a neighbor before determining that the neighbor is down. A list of routers from which Hello packets have been recently received. The router’s current choice fro the Designated Router & Backup Designated Router. A value of zero in these fields indicates that one has not yet been selected.
26. 26 The OSPF Optional Capability 6 5 4 3 2 1 0 - - DC EA N/P MC E - AS-external-LSAs are flooded Whether IP multicast datagrams are forwarded The handling of Type-7 LSAs The router’s willingness to receive & forward External-attributes-LSAs The router’s handling of demand circuits
27. 27 Designated Router & Backup Designated Router Rate % Rate % Rate % Rate % Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 5 35 5 35 5 35 5 35 20 20 20 20 20 20 20 1 1 1 1 1 1 1 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Util% Util% Util% Util% Demo Demo Demo Demo Demo Demo Demo Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Forward% Filter% Config Link SNMP Status Status Status Status Status Status Status Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Select/Link Diag Diag Diag Diag Diag Diag Diag Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M Full/Half 10 M/ 100 M DR Router Router Router Multi-access Network Router BDR Router X 2X 3X Each router on the network exchanges link-state information(forms an adjacency) Only with the Designated Router(DR) and the Backup Designated Router(BDR). Each neighbor exchanged information with a DR & BDR specified, the number of Exchanges is reduced to O(2n). The router with the highest configured Router Priority is elected DR. The BDR is elected at the same time as the DR. The router with second highest Router Priority is elected the BDR.
28. 28 OSPF Database Description Packet Type = 2 Packet Length Version No. Router ID Area ID 0 4 8 C 10 14 18 Interface MTU Option 0 0 0 0 0 I M MS Checksum AuType DD Sequence number Authentication Authentication An LSA Header D A T A : : :
29. 29 Link State Request Packet Type = 3 Packet Length Version No. Router ID Area ID LS Type 0 4 8 Checksum AuType Link State ID Advertising Router Authentication : : : D A T A
30. 30 Link State Update Packet Type = 24 Packet Length Version No. Router ID Area ID # LSA 0 4 8 C 10 14 18 Checksum AuType Authentication LSAs D A T A : : :
31. 31 Link State Acknowledgment Packet Type = 5 Packet Length Version No. Router ID Area ID 0 4 8 C 10 14 18 Checksum AuType An LSA Header Authentication : : : D A T A
32. 32 Forming Adjacency IP-172.16.32.1RID-100.100.100.4 IP-172.16.32.2RID-100.100.100.6 DownInit Down Hello (Packet 15 & 17) 2-WayExStart Hello (Packet 16 & 18) ExStart DB Description (Packet 19 & 21) Exchange Exchange Exchange DB Description (Packet 20) Link State Request (Packet 22) Loading Loading Link State Update (Packet 25) (Adjacency Up) Full Full Full Hello Hello
33. 33 OSPF LSA Header 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 4 8 C 10 LS type Option LS age Link State ID Advertising Router LS sequence number LS Checksum Length Type Description 1 Router-LSAs 2 Network-LSAs 3 Summary-LSAs (IP network) 4 Summary-LSAs (ASBR) 5 AS-external-LSAs OSPF LSA Header = 20 bytes
34. 34 Router-LSAs Format LS age Options LS Type= 1 Link State ID Advertising Router LS sequence number 0 V E B 0 No. of Links 0 4 8 C 10 14 18 Length Checksum Link State ID Link Data D A T A Type # TOS Metric : : Note: V for virtual link; E for AS boundary router B for Area Border router. Each router in an area originates a router-LSA.
35. 35 Router-LSAs Format(Con’t) Type Description 1 Point-to-point connection to another router 2 Connection to a transit network 3 Connection to a stub network 4 Virtual link Type Link ID Link Data 1 Neighboring router’s Router ID Interface’s MIB ifIndex value 2 IP address of Designated Router DR IP address 3 IP network / subnet number Network IP address 4 Neighboring router’s Router ID Network IP address
36. 36 Network-LSAs Format LS age Options LS Type=2 0 4 8 C 10 14 18 Link State ID Advertising Router LS sequence number Length Checksum Network Mask Attached Router Note: the distance from network to all attached routers is 0. Network-LSA is originated by the network’s DR.
37. 37 Summary-LSAs(IP network) Format LS age Options LS Type=3 Link State ID Advertising Router Network Mask 0 4 8 LS sequence number 0 metric Length Checksum TOS TOS metric : : : D A T A Note: Link State ID= 0.0.0.0 & Network mask= 0.0.0.0 if default summary route. Metric is the cost of this route.
38. 38 Summary-LSAs(ASBR) Format LS age Options LS Type=4 Link State ID Advertising Router Network Mask 0 4 8 LS sequence number 0 metric Length Checksum TOS TOS metric : : : D A T A
39. 39 As-external-LSAs Format LS age Options LS Type= 5 Link State ID Advertising Router Network Mask 0 4 8 C 10 14 LS sequence number E 0 metric Length Checksum Forwarding address External Route Tag D A T A E TOS TOS metric Forwarding address : : :
40. 40 Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 20 20 20 1 1 1 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Demo Demo Demo Config Link SNMP Config Link SNMP Config Link SNMP Filter% Filter% Filter% Status Forward% Status Forward% Status Forward% Select/Link Select/Link Select/Link Diag Diag Diag 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M Full/Half Full/Half Full/Half Shortest Path Tree Network1 Router1 Network2 Cost = 20 Router2 Network3 Cost = 30 Router3 Network4
41. 41 Link State Database R1 R2 R3 (N1-0) (N2-0) (N3-0) (N2-0) (N3-0) (N4-0) (R2-20) (R1-20) (R2-30) (R3-30) From the Link-State Database, each router builds a shortest path tree using itself as the root. Each node of the tree shows the shortest, or best cost path to the vertex from the root. Each router then build its routing table from the shortest path tree.
42. 42 Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 20 20 20 1 1 1 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Demo Demo Demo Config Link SNMP Config Link SNMP Config Link SNMP Filter% Filter% Filter% Status Forward% Status Forward% Status Forward% Select/Link Select/Link Select/Link Diag Diag Diag 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M Full/Half Full/Half Full/Half Shortest Path Tree & Routing Table Network1 R1 20 Router1 R2 N2 N1 30 Network2 N3 Cost = 20 Router2 R3 Network3 N4 Cost = 30 Router3 Routing Table for R1 Destination Next Hop Metric N1 Direct 0 N2 Direct 0 N3 R2 20 N4 R2 50 Network4
43. 43 Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 20 20 20 1 1 1 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Demo Demo Demo Config Link SNMP Config Link SNMP Config Link SNMP Filter% Filter% Filter% Status Forward% Status Forward% Status Forward% Select/Link Select/Link Select/Link Diag Diag Diag 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M Full/Half Full/Half Full/Half Shortest Path Tree & Routing Table(Con’t) R2 Network1 Router1 20 30 R1 N3 N2 R3 Network2 Cost = 20 Router2 N4 N1 Network3 Cost = 30 Routing Table for R2 Router3 Destination Next Hop Metric N1 R1 20 N2 Direct 0 N3 Direct 0 N4 R3 30 Network4
44. 44 Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 5 35 5 35 5 35 20 20 20 1 1 1 100 M 10 100 M 10 100 M 10 Tx/Rx 5 Tx/Rx 5 Tx/Rx 5 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Util% Util% Util% Demo Demo Demo Config Link SNMP Config Link SNMP Config Link SNMP Filter% Filter% Filter% Status Forward% Status Forward% Status Forward% Select/Link Select/Link Select/Link Diag Diag Diag 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M Full/Half Full/Half Full/Half Shortest Path Tree & Routing Table(Con’t) R3 Network1 Router1 30 R2 20 N3 N4 Network2 Cost = 20 Router2 R1 N2 N1 Network3 Cost = 30 Routing Table for R3 Router3 Destination Next Hop Metric N1 R2 50 N2 R2 30 N3 Direct 0 N4 Direct 0 Network4
51. 47 Features of Link-State Algorithm OSPF uses a Link-State Routing Algorithm. All routers maintain identical routing tables. The database of each router describes complete topology of the router’s domain. The router’s domain may be the entire AS, or an area within the AS. Each router uses the database to calculate a set of shortest paths to all destinations. The routing table is built from these calculation.
52. 48 Rate % Rate % Rate % Rate % Rate % 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 30+ 30+ 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI 90+ 1 X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 Fast SwitcHub-8mi 20 70 10 Collision 50 10 Collision 50 10 Collision 50 10 50 10 Collision 50 Collision 5 35 5 35 5 35 5 35 5 35 20 20 20 20 20 1 1 1 1 1 100 M 10 100 M 10 100 M 10 100 M 10 100 M 10 5 Tx/Rx 5 5 Tx/Rx Tx/Rx 5 Tx/Rx 5 Tx/Rx Util% Util% Util% Util% Util% Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Full Duplex PWR 1 Demo Demo SNMP Demo SNMP Demo Demo Status Filter% SNMP Forward% Filter% Forward% Filter% Filter% SNMP Status Filter% SNMP Forward% Forward% Config Link Config Link Config Link Config Link Forward% Config Link Status Status Status Select/Link Select/Link Select/Link Select/Link Select/Link Diag Diag Diag Diag Diag Full/Half Full/Half Full/Half Full/Half Full/Half 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M 10 M/ 100 M Example of Link-State Algorithm Area 2 Area 1 N9 N10 ASBR N1 N3 AS 200 Router Router AS 100 Area Border Router (ABR) N6 N7 N8 N4 N2 Router ASBR N5 AS 300
53. 49 Basic Operation of Link-State Algorithm Exchange of Routing Information - Each router periodically sends out a description of its connections to its neighbors. - Routers are neighbors if they are directly connected via a common network. - A router sends the LSA to each of its neighbors. The LSA includes a listing of all interfaces & configured “cost” of each link and each configured cost- TOS pairing. 2) Routing Area - The LSA is flooded throughout the router’s domain. The router’s domain may be entire AS, or limited area within the AS. - Areas are configured by assigning an area_ID for each router interface. If the area_ID is identical for all ports on a router, then the router is contained in a single area. 3) Link-State Database - Each router in the domain maintains an identical, synchronized copy of a database composed of this link-state information. - Router belonging to multiple areas maintain a separate Link_State database for each area.
54. 50 Basic Operation of Link-State Algorithm(Con’t) 4) Shortest Path Tree - Each router runs an algorithm on the database used to create a shortest-path tree. A different shortest-path tree is constructed for each TOS support. - The shortest-path tree contains the shortest path to every router and every network that other routers can reach. The router performing the calculation places itself at the root of each tree. 5) Routing Table - The resulting shortest-path trees determine total cost to the destination network and next hop router. The shortest-path trees are used as the basis of creating the routing table. A different routing table is created for each TOS. 6) Optional TOS Support - OSPF allows the network administrator to configure OSPF routers to calculate/use only single routing table(TOS 0 table). - A router desiring to calculate/use single table informs its peers by resetting the TOS-capable bit in the option field of the router’s links advertisement. If a route cannot be found that uses a non-zero TOS value, the traffic is forwarded along the TOS 0 route.
55. 51 How to Forward datagrams The forwarding process uses routing tables to route datagrams. The destination network number is extracted from an incoming datagram. The TOS field is examined for information pointing to The datagram is forwarded towards its final destination. Datagram having same final destination may be routed along different paths based on the TOS requested by the source station.
56. 52 Initial Link-State Database Synchronization A pair of routers attempting to become adjacent send a summary of their Link- State databases to one another. This summary is called a “Database Description Packet”. The Database Description Packet consists of a list of abbreviated link-state Advertisements(LSA). Based on the Database Description Packet received from its neighbor, each router builds a list of requests for LSAs, required to update its own database. A router builds this list by checking its link-state database for a copy of each LSA received in the summary. If the router doesn’t have a particular LSA in its link-state database, or determines that its neighbor has a more recent version of A LSA, that LSA is added to the request list. Each router sends this list in a Link-State Request packet to its neighbor. Each router responds to a received Link-State Request packet with a Link- State Update packet containing the requested LSAs. The neighbors become Fully adjacent when they have received all requested LSAs. Once the routers become fully adjacent, they run the SPF algorithm on the data- Base, add OSPF routes to their routing tables, and periodically exchange LSAs.
57. 53 Maintain Link-State Database Synchronization Flooding Procedure When an LSA is flooded, it is passed from a router to an adjacent router until It has been distributed throughout the routing domain. Each router determines, individually, whether the LSA should be passed to An adjacent neighbor. More details are described in Section 13, 13.3 & 13.4 of RFC 2328. Reliable Updates Reliability is accomplished by requiring that both the receipt and transfer of an LSA be acknowledged by adjacent router. In the absence of such an acknowledgment, the source router retransmits the LSA until it is acknowledged. - Each router originates a router-LSA. - Area Border routers originate a single summary-LSA for each known inter- area destination. - AS Boundary routers originate a single As-external-LSA for each known AS external destination. (Ten events can cause new instance of an LSA to be originated)
58. 54 Maintain LS Database Synchronization(Con’t) Link-State Age An LSA’s age field is periodically incremented while residing in a router’s link- state database. It is possible for an LSA to reach an age where it is no longer used in the flooding procedure, and must be flushed from the link-state database. If There’s a change in the link-state database, a new shortest-path tree is constructed and the routing table is updated. Link-State Sequence Numbers A common event is for an LSA to be replaced by the receipt of more recent LSA from its adjacent neighbor. Each LSA contains 32-bit sequence number used by OSPF routers to detect old, or duplicate LSAs. A linearly ordered sequence number is used for LSA identification. All routers keep their link-state databases synchronized by ageing LSAs in their database, and updating with new incoming LSAs.