OSPF Routing Protocol
Campus Design ArchitectureBuilding Block DesignServer Farm DesignCore Block DesignWAN Design Architecture
Campus Design ConsiderationsLayer 2 versus Layer 3 Core DesignWAN Design ConsiderationsDesign Recommendation Summary
Planning and Implementation
IP AddressingSummarizationScalabilityMigrationConvergence TuningDesign Case Study
Operating the Solution
IntroductionOpen Shortest Path First (OSPF) is an interior gateway protocol (IGP) link state protocol. Contrary to the distancevector protocol in which the actual Internet Protocol (IP) network is advertised periodically, in a link state protocolthere is no IP route exchange. Every participant router creates a Link State Advertisement (LSA) describing itslocal interface (IP address, network mask, reachable neighbor, link type, and so on) and places it in its database.LSAs are distributed through reliable flooding during database synchronization, and the collection of all LSAsconstitute a link-state database.
Cisco - OSPF Routing Protocol
http://www.cisco.com/partner/sdm/ci/routing/ospf/CI_OSPF.html (1 of 48) [10/11/2001 5:34:43 PM]
All routers within an area have the exact same link state database and run in parallel with the shortest path orDijkstra algorithm. Each router constructs a tree of shortest path with itself as a root. The shortest path tree givesthe route to all destinations within the autonomous system.
Compared to distance vector protocols that have a flat architecture, OSPF uses a hierarchical architecture. Byhaving a hierarchical design, routing control packets in the domain are decreased and limited to a given area. Inaddition, summarization between different hierarchical levels significantly increases the stability of the networkand decreases the size of the routing table.
OSPF allows a network to be segmented into multiple areas. An area is a collection of routers and networks. Allareas are attached, physically or logically, to a common area called the backbone area (area 0). Routing betweenareas is achieved through area 0, and summarization occurs at Area Border Routers (ABRs) that are attached to thebackbone area 0 and another non-backbone area.
The three components in OSPF include:
Shortest Path First (SPF) calculation
There are four types of routing nodes in OSPF. Each routing node provides a specific function.
Internal routerA router that has all its interfaces in a given area
ABR (Area Border Router)A router that has active interfaces in at least two areas, one being the backbonearea 0
ASBR (Autonomous System Border Router)A router that injects external routes into the OSPF domain byredistributing any routing protocol or external route to the OSPF domain is known as an ASBR
Backbone routerA router that has an interface to the backbone area 0, this can be an ABR or backboneinternal router
There are four types of areas in OSPF. Each area provides a specific function.
Area 0The backbone area having the specific function of connecting all areas together and passinginformation between areas.
Transit areaAny area including area 0, having external routing capability. In other words, type 5 LSA willbe flooded into such an area. A transit area can also exist to provide a virtual link between an area notphysically connected to backbone area 0.
Stub areaAn area that does not have external routing capability, hence type 5 LSAs are not flooded intothis area. ASBR cannot be placed inside this area and a virtual link cannot be configured through this area.
Cisco - OSPF Routing Protocol
http://www.cisco.com/partner/sdm/ci/routing/ospf/CI_OSPF.html (2 of 48) [10/11/2001 5:34:43 PM]
Not So Stubby Area (NSSA)NSSA has the same capability as a stub area in that type 5 LSA are notflooded into this area and a virtual link cannot be configured through this area. However, an ASBR could beplaced inside such an area and external routes could be imported into the NSSA area and flooded furtherinto OSPF domain.
OSPF runs on top of IP and is assigned protocol 89. OSPF control packets have a 24-byte common header. Toguarantee neighbor discovery and maintenance and database synchronization, the following packet types aredefined within the Type field of an OSPF control packet.
2 Database Description
3 Link State Request
4 Link State Update
5 Link State Acknowledgment
Packet Type 1
Hello packets are used to establish and guarantee neighbor discovery and maintenance.
Packet Type 2
Database Description packets are used in the initial database synchronization. In order to check what instance oftheir database needs to be exchanged, routers exchange a summary of their database (LSA header) and mark anymissing LSA or a newer instance in order to request it through the Link State Request packet.
Packet Type 3
During a database description exchange, the routers request their missing LSA. If they need a more recent instantof an LSA, they add these LSAs in the Link State Request list. Once the database description exchange iscomplete, the routers send Link State Request packets in order to request these LSAs.
Packet Type 4
A router replies to the Link State Request packet by sending a Link State Update. Link State Update is also usedwhen the routers are in Full state and there is a need to generate a new LSA due to any changes.
Packet type 5
The flooding operation should be reliable in order to guarantee that no information was lost while synchronizingthe database. Link State Acknowledgment is sent in reply to a Link State Update packet.
Cisco - OSPF Routing Protocol
http://www.cisco.com/partner/sdm/ci/routing/ospf/CI_OSPF.html (3 of 48) [10/11/2001 5:34:43 PM]
LSA Types and Definitions
Link State Advertisement is the information generated by every router describing its local interface in an area.Depending on the LSA type, a router might generate additional information such as a reachable network outside anarea or OSPF domain.
The following table lists the 11 LSA types.
LSA Type Description
1 Router LSA
2 Network LSA
3 Summary LSA
4 Summary LSA
5 External LSA
6 MOSPF LSA
7 NSSA LSA
8 External Attribute LSA
9 Opaque LSA
10 Opaque LSA
11 Opaque LSA
LSA Type 1
LSA Type 1 is a router LSA that is generated by every router into a given area. Routers attached to multiple areasgenerate this LSA into each attached area. A Router LSA describes the router's interface for a given area. Itcontains information such as IP address, network mask, remote neighbor, link type, link cost, and so on. This LSAis flooded within each area.
LSA Type 2
LSA Type 2 is a network LSA. In order to better understand the use of this LSA, you should first understand howOSPF considers multi-access networks.
A network is said to be multi-access if it can have more than two routers attached to it. Depending on broadcastcapability, this is further divided into two types of networks.
Broadcast networkHas the broadcast capability for example Ethernet
Non Broadcast MultiAccess (NBMA)Does not have the broadcast capability for example AsynchronousTransfer Mode Permanent Virtual Circuit (ATM PVC)
SPF needs to consider a network as a collection of nodes and point-to-point links.
To satisfy the SPF requirement, consider the media itself as a node (Pseudonode) that is represented by one of therouters on this media called Designated Router (DR). Thus, the adjacency between routers attached to themulti-access is the adjacency between every attached router and the Pseudonode.
Cisco - OSPF Routing Protocol
http://www.cisco.com/partner/sdm/ci/routing/ospf/CI_OSPF.html (4 of 48) [10/11/2001 5:34:43 PM]
All attached routers advertise a link to the Pseudonode, represented by DR in their Router LSA. An advertisementis needed from Pseudonode to all attached routers: This is performed by LSA Type 2.
LSA type 2 is generated by DR on behalf of the network and announces all routers attached to the multi-accessnetwork (also referred to as transit network). This LSA is flooded within an area.
LSA Type 3
Summary type 3 announces the IP destination outside a given area in order to ensure that an ABR does thefollowing:
Summarize intra-area route to the backbone
Summarize intra-area and inter-area route (learned through the backbone) into non-backbone area
Note that routing between areas has a distance vector behavior. This means that the route learned from an area, andinstalled in the routing table, is summarized for other attached areas. It is not advertised back to the same area.
A backbone router processes only the summary received from the backbone. The only time an ABR processes asummary received through a non-backbone area is:
If the ABR loses its connection to the backbone (no neighbor) but still is an ABR and has an active interfacein area 0
If there is a virtual link in the TransitArea and the TransitCapability of the area is set to true (see later)
LSA Type 4
When a type 5 LSA is flooded within a domain, the location of the ASBR (advertising router) is only knownwithin the area in which the type 5 LSA is flooded. It is the responsibility of the ABR attached to thi