One of popular link state dynamic routing protocol is OSPF routing which is typically used for large Internet Protocol (IP) networks. Open Shortest Path First (OSPF) is a routing protocol that enables routers on an IP internetwork to dynamically share their routing table information with each other.
OSPF routing is a popular routing protocol for IP networks for several key reasons such as classless, offering full CIDR and VLSM support; it scales well, converges quickly, and guarantees loop free routing. Besides, it also supports address summarization and the tagging of external routes, similar to EIGRP routing protocol. For networks that require additional security, you can configure OSPF routers to authenticate with one another to ensure that unauthorized devices can’t affect routing tables. See also the IP routing guide.
OSPF routing is widely used by large organizations due to it’s features both as an open standard and a mature protocol and supported by most vendors of routing hardware and software. With these features, OSPF routing becomes the choice of multivendor enterprise networks including the ISP networks. Unfortunately with the above powerful features, OSPF routing is considerably more complicated to set up than EIGRP or RIP. See also static routing
OSPF Routing Usages
As a mature dynamic routing, OSPF routing is widely used in two areas of networking:
- OSPF Routing works well in WAN environment such as large Enterprise-level private IP internetworks, including networks that span several countries, regions, or even continents due to its efficient feature, updating the routing tables only if necessary and typically deployed in a large enterprise with at least 50 routers and more.
- Deployed mostly by the Internet which maintain the collection of publicly accessible IP internetworks and backbones connecting them.
Cisco routers with its IOS system support OSPF routing, and Windows 2000/2003/2008 also support it for RRAS (Routing and Remote Access Service) system. See also routing protocol solution.
Architecture
The way the dynamic routing protocols work is by enabling routers to exchange routing table information with each other automatically without administrative intervention. As a link state routing protocols, OSPF routers store information about the “state of the link” between the local router and other routers in a link state database, which essentially stores a topological map of all routers in the same administrative portion of the internetwork. Each OSPF router stores this link state database information in the form of a tree whose root is centered on the local router itself.
Each OSPF router interfaces are assigned a cost value which is generally inversely proportional to the bandwidth of the link the interface is connected to, although different cost values can be assigned as desired to shape the flow of traffic through the network. The metrics for different routes within routing tables are created based on those cost values. The least cost will then become the preference.
OSPF routers compute the shortest path between the two subnets in the AS or area using Shortest Path First (SPF) algorithm (aka Dijkstra’s algorithm) based on the constructed link state database. Thus, when traffic needs to be routed from one point of the internetwork to another, the router calculates the optimal path from the link state database and forwards packets accordingly. The SPF algorithm enables routing information to be quickly recalculated if routers go down, a feature called Fast Convergence. The algorithm also ensures that routing loops do not occur.
OSPF routers communicate with each other using HELLO packets, which are sent periodically every 10 to 15 seconds and basically tell other OSPF routers that the sending router is still alive. If an OSPF router does not receive a HELLO packet from another router within an expected time, it assumes that the other router is down and that the link state database is no longer accurate. The router then floods the network with link state advertisements (LSAs) that are picked up by other OSPF routers, and a recalculation of the link state database for all routers is initiated. This recalculation process generally converges quickly, depending on the size of the internetwork and the number of routers used. LSAs contain information about incremental changes to network topology and therefore are efficient in terms of bandwidth usage. LSAs can be secured by either password protection or MD5 checksums.
Implementation
OSPF routing is designed hierarchically to allow large internetworks to scale well and to allow large autonomous systems to be further subdivided into multiple areas. OSPF routers within an area only need to know about other routers within their own area, not outside their area, and all OSPF routers within a given area share the same link state database. This keeps the routing tables small enough to prevent processing bottlenecks from occurring. OSPF areas within an AS are designated by unique 32-bit identifiers and typically have no more than about 30 or 40 routers within them.

The above diagram shows an internetwork using OSPF routing with different types of OSPF routers.
In this OSPF routing design, if an Autonomous System (AS) is subdivided into multiple OSPF areas, one of these areas must be a specially designated area called the backbone area, which has the identifier 0 (zero). Every other area within an AS must be directly connected to the backbone area in hub-and-spoke fashion, and adjacent areas communicate with each other directly between their backbones.
In this OSPF routing design, all OSPF routers can be designated to operate in one of the following four different roles to support the hierarchical router topology:
1. Internal router (I)
In OSPF routing, if all the interfaces of a router are all within the same area where the router resides, it is called an Internal Router (I). Internal routers are used for routing traffic within the area, and their routing tables contain information only about all other internal routers in that area.
2. Backbone router (B)
A backbone router is a router which has at least one interface connected to the backbone area which is used for routing traffic within the backbone area.
3. Area border router (ABR)
In Area Border Router (ABR), one of the interfaces of a router that has multiple interfaces must be connected to the backbone area. ABRs are used for routing traffic between the backbone area and other areas.
4. Autonomous system boundary router (ASBR)
ASBR router is used to connect an autonomous system running OSPF routing to an autonomous system running a different interior gateway protocol.
Advantages and Disadvantages
Compared to RIP and other gateway protocols (such as IGRP and EIGRP), OSPF routing has the following advantages:
- OSPF routing converges very quick and the occurring of routing loops can be minimized.
- IP summarization is allowed, thus minimizing the size of routing tables and processing power of the routers. Therefore OSPF routing is highly scalable and suitable for very large internetworks.
- Consumes little bandwidth compared to RIP routers (which periodically broadcast their entire routing table to neighbors) unless a change in network topology has occurred. OSPF routing transmits only incremental changes to network topology.
- OSPF routing optimizes the use of network bandwidth through multicasting instead of broadcasting.
- For classless routing, OSPF supports VLSM (variable-length subnet masking).
- OSPF network is fault-tolerant because they can automatically reroute traffic when a link goes down, and the administrator can configure the routers to route to specific preference routes over others.
Notes
In designing the OSPF routing, the top down model should be taken. That means autonomous system should be planned first as well as how it will interact with other autonomous systems, and then subdivide the autonomous system into areas and then into individual networks. IP address space and subnets should be mapped to this hierarchy of areas and networks and assigning each area a small set of network IDs that can be summarized as a small series of routes.
Be sure that areas connect to each other through your high-speed backbone area and not directly to each other. (In other words, avoid back doors.) Specify cost values that relate to the amount of traffic and each router’s hardware characteristics.
Reference: CCNA certification guide and Microsoft
See also:
- WAN technologies and topologies
- Speed-up Internet connection
- Router redundancy – best practice
- Microsoft Windows XP networking
- Microsoft Windows XP – secure guide





Recent Comments