OPEN SHORTEST PATH FIRST(OSPF)
Biggest advantage of OSPF over EIGRP is that it will run on any device as its based on open standard
- It will run on most routers, since it is based on an open standard.
- It uses the SPF algorithm, developed by Dijkstra, to provide a loop-free topology.
- It provides fast convergence with triggered, incremental updates via Link State Advertisements (LSAs).
- It is a classless protocol and allows for a hierarchical design with VLSM and route summarization.
- It requires more memory to hold the adjacency (list of OSPF neighbors), topology and routing tables.
- It requires extra CPU processing to run the SPF algorithm
- It is complex to configure and more difficult to troubleshoot.
- OSPF implements a two-layer hierarchy: the backbone (area 0) and areas off of the backbone (areas 1– 65,535)
- To provide scalability OSPF supports two important concepts: autonomous systems and areas.
- Synchronous serial links, no matter what the clock rate of the physical link is, the bandwidth always defaults to 1544 Kbps.
- OSPF uses cost as a metric, which is the inverse of the bandwidth of a link.
Router IdentitiesEach router in an OSPF network needs a unique ID that is used to provide a unique identity to the OSPF router. The router ID is chosen according to one of the two following criteria:
- The highest IP address on its loop back interfaces (this is a logical interface on a router)
- The highest IP address on its active interfaces
First before a router will accept any routing information from another OSPF router, they have to build an adjacency with each other on their connected interfaces. When this adjacency is built, the two routers (on the connected interfaces) are called a neighbor, which indicates a special relationship between the two. In order for two routers to become neighbors, the following must match on each router:
- The area number and its type
- The hello and dead interval timers
- The OSPF password (optional), if it is configured
- The area stub flag (used to contain OSPF messages and routing information,
- 1. Down state The new router has not exchanged any OSPF information with any other router.
- 2. Init state A destination router has received a new router's hello and adds it to its neighbor list (assuming that certain values match). Note that communication is only unidirectional at this point.
- 3. Two-Way state The new router receives a unidirectional reply to its initial hello packet and adds destination router to its neighbor database. Once the routers have entered a two-way state, they are considered neighbors.
- For each network multi-access segment, there is a DR and a BDR as well as other routers.
- This process is true for multi-access segments, (an example, if you have ten VLANs in your switched area, you’ll have ten DRs and ten BDRs.) but not point-to-point links, where DRs are not necessary.
- The router with the highest priority (or highest router ID) becomes the DR.
Loop back InterfacesA loop back interface is a logical, virtual interface on a router that always remains up. By default, the router doesn't have any loop back interfaces, but they can easily be created.
OSPF routers use Link State Advertisements (LSAs) to communicate with each other. One type of LSA is a hello, which is used to form neighbor relationships and as a keep-alive function. Hellos are generated every ten seconds.
When sharing link information (directly connected routes), links are sent to the DR (220.127.116.11) and the DR Disseminates this to everyone (18.104.22.168) else on the segment.
Sharing Routing InformationAfter electing the DR/BDR pair, the routers continue to generate hellos to maintain communication. This is considered an exstart state, in which the OSPF routers are ready to share link state information. The process the routers go through is called an exchange protocol
The DR and BDR form adjacencies with the other OSPF routers on the segment, and then within each adjacency, the router with the highest router ID becomes the master and starts the exchange process first (shares its link state information)—note that the DR is not necessarily the master for the exchange process. The remaining router in the adjacency will be the slave.
2. Exchange state
The master starts sharing link state information first, with the slave. These are called DBDs (database description packets), also referred to as DDPs. The DBDs contain the link-state type, the ID of the advertising router, the cost of the advertised link, and the sequence number of the link. The slave responds back with an LSACK—an acknowledgment to the DBD from the master. The slave then compares the DBD's information with its own.
3. Loading state
If the master has more up-to-date information than the slave, the slave will respond to the master's original DBD with an LSR (Link State Request). The master will then send a LSU (Link State Update) with the detailed information of the links to the slave. The slave will then incorporate this into its local link state database. Again, the slave will generate an LSACK to the master to acknowledge the fact that it received the LSU. If a slave has more up-to-date information, it will repeat the "exchange" and "loading" states.
4. Full state
Once the master and the slave are synchronized, they are considered to be in a full state. To summarize these four steps, OSPF routers share a type of LSA message in order to disclose information about available routes. Basically, an LSA update message contains a link and a state, as well as other information.
A link is the router interface on which the update was generated (a connected route).
The state is a description of this interface, including the IP address configured on it as well as the relationship this router has with its neighboring router. However, OSPF routers will not share this information with just any OSPF router.
A two-way state indicates that two OSPF routers are neighbors. A full state indicates the completion of sharing of links between routers.
Cost metric is the inverse of the accumulated bandwidth values of routers’ interfaces. The default Measurement that Cisco uses in calculating the cost metric is: cost = 108/(interface bandwidth).