Static routes are manually configured and maintained, and the command lines are simple and clear. They apply to small-scale or stable networks. However, static routes have the following disadvantages:
l Unable to adapt to large-scale networks: As the number of devices increases, the configuration workload increases sharply.
l Unable to dynamically respond to network changes: If the network topology changes, the network cannot automatically converge, and static routes must be manually modified.

Dynamic routing protocols are widely used on live networks because of their high flexibility, high reliability, and easy scalability. The Open Shortest Path First (OSPF) protocol is a widely used dynamic routing protocol.
Implement of OSPF
1. LSA flooding
Routers that run a link-state protocol establish a neighbor relationship and then exchange Link State Advertisements (LSAs). Each router generates an LSA that describes status information about its directly connected interface. The LSA contains the interface cost and the relationship between the router and its neighboring routers.
2. LSDB Creation
Each router generates LSAs and adds the received LSAs to its own link state database (LSDB). Routers learn the whole network topology through the LSDB.

3. SPF Calculation
Each router uses the Shortest Path First (SPF) algorithm and LSDB information to calculate routes. Each router calculates a loop-free tree with itself as the root and the shortest path. With this tree, a router determines the optimal path to each corner of a network.

4. Routing Table Generation
Ultimately, the router installs routes for the calculated preferred paths into its routing table.

OSPF Feathers
l OSPF is a typical link-state routing protocol and one of the widely used IGPs in the industry.
l OSPFv2, as defined in RFC2328, is designed for IPv4. OSPFv3, as defined in RFC2740, is designed for IPv6.
l OSPF routers exchange link status information, but not routes. Link status information is key information for OSPF to perform topology and route calculation.
l An OSPF router collects link status information on a network and stores the information in the LSDB. Routers are aware of the intra-area network topology and are able to calculate loop-free paths.
l Each OSPF router uses the SPF algorithm to calculate the shortest path to a Specific destination. Routers generate routes based on these paths and install the routes to the routing table.
l OSPF supports the variable-length subnet mask (VLSM) mechanism and manual route Summarization.
l The multi-area design enables OSPF to support a larger network.
OSPF is applicable to medium-sized networks with several hundred routers supported, such as enterprise networks. The following is an example of OSPF application on a campus network.




