1-Introduction:
OSPF, or Open Shortest Path First, is a link-state, open-standard, dynamic routing protocol. OSPF uses an algorithm known as SPF, or Dijkstra’s Shortest Path First, to compute internally the best path to any given route.
OSPF is classless and converges fairly quickly, using cost as it’s metric. A router running OSPF creates its own database which contains information on the entire OSPF network, not simply neighbour's routes like EIGRP. This allows the router to make intelligent choices about path selection on its own instead of relying exclusively on neighbour information.
OSPF routers do form neighbour relationships though. They exchange hellos with neighbouring routers and in the process learn their neighbour's Router ID (RID) and cost. Those values are then sent to the adjacency table.
Every router is responsible for computing its own best paths to all destinations within an OSPF domain. Once the SPF algorithm selects the best paths, they are then eligible to be added to the routing table.
2-Area Types:
Backbone area:
Another name for area 0.
Regular area:
Non-backbone area, with both internal and external routes.
Stub area:
Contains only internal routes and a default route.
Totally Stubby Area:
Cisco proprietary option for a stub area.
Not-So-Stubby area (NSSA):
Contains internal routes, redistributed routes, and optionally a default route.
Totally Stubby NSSA:
Cisco proprietary option for NSSA.
3 tables:
Although OSPF does not send routing updates on a periodic interval, as do distance vector protocols, OSPF does reflood each LSA every 30 minutes based on each LSA’s age variable. The router that creates the LSA sets this age to 0 (seconds). Each router then increments the age of its copy of each LSA over time. If 30 minutes pass with no changes to an LSA–meaning no other reason existed in that 30 minutes to cause a reflooding of the LSA.
3-Router Roles:
Each interface is assigned a cost value based on bandwidth.The formula is:
Higher bandwidth means a lower cost.
5-OSPF Neighbors:
Hellos are sent out periodically using multicast on OSPF enabled routers. The router forms an adjacency with a peer router when it sees its own Router ID in the neighbor field of another router’s hello message. That indicates there is direct, bi-directional communication on the same subnet.
Note: On multi-access links, adjacencies are only formed between the router and the DR and BDR.
All of the following fields in an OSPF hello message must match for an adjacency to form:
-hello timer
-dead timer
-area ID
-authentication type
-password
-stub area flag
With OSPF, if four consecutive hellos are not received (the dead time), the router is considered down.
- Point-point interfaces: hellos every 10 seconds, 40 second dead timer.
-Non-broadcast multi-access (NBMA) interfaces: hellos every 30 seconds, 120 second dead timer
6-Packet Types:
7-OSPF States:
There are 7 different OSPF states when forming neighbor relationships. Take the time to learn the states and their corresponding functions.
SPF works by mapping all paths to every destination on each router. It uses the RID to identify hops along each path and uses bandwidth as a metric between those hops. This whole system works really well when routers are connected with point-to-point links and OSPF traffic is simply sent using multicast address 224.0.0.5.
It doesn’t work well, however, when a router is connecting to multi-access networks like an Ethernet VLAN. Multi-access OSPF links require a Designated Router (DR) be elected to represent the entire segment. Another router is then elected as the Backup Designated Router, or BDR. On that specific multi-access segment, routers only form adjacencies with the DR and BDR.
The DR uses type 2, network LSAs to advertise the segment over multicast address 224.0.0.5. The Non-Designated routers then use IP address 224.0.0.6 to communicate directly with the DR.
Elections:
Once a DR is elected, elections cannot take place again until either the DR or BDR go down. This essentially means that there is no OSPF DR preemption if another router comes online with a higher OSPF priority. In the case that the DR goes down, the BDR automatically is assigned the DR role and a new BDR election occurs.
Be aware that a router with a non-zero priority that happens to boots first can become the DR just because it did not receive any hellos when the OSPF process was started – even though it may have a low OSPF priority.
The default OSPF priority is 1 and Cisco recommends manually changing that on routers you want to become the DR and BDR.
Remember that DRs are only used on multi-access links, so they are only significant on an interface level. A router with two different interfaces connected to two different multi-access links will have separate DR elections for each segment.
First, it’s important to note that running the SPF algorithm ,a router uses a lot the CPU resources and can easily consume them all. The reason is because OSPF has to compute the best path to every destination within its area. Avoiding running the algorithm when it is not required. Summarization has two important benefits for OSPF. It prevents topology changes from being passed outside an area – thus reducing the number of routers re-running the SPF algorithm. It also consolidates many routes in to a single statement, reducing the memory load and database size on OSPF-enabled routers. There are two types of route summarization, inter-area and external.
This occurs on ABRs to summarize routes between areas. This really only works well if the networks contained within an area are subnetted contiguously so that they can be easily summarized into a single statement. The new summary route’s cost will be equal to the lowest cost route within the summary range. After the command is entered, the router will automatically create a static route pointing to Null0.
Example:
router ospf 1
area 1 range 10.10.0.0 255.255.252.0
Example:
router ospf 1
summary-address 192.168.0.0 255.255.252.0
OSPF supports the use of passive interfaces. The passive-interface interface command disables OSPF hellos from being sent out, thus disabling the interface from forming adjacencies out that interface.
Default routes are injected into OSPF via type 5 LSAs. There are multiple ways to inject default routes into OSPF, but Cisco recommends using the default-information originate command under the OSPF routing process.
Using the default-information originate command, there are two ways to advertise a default route into a normal area. The first is to advertise 0.0.0.0 into the OSPF domain, provided the advertising router already has a default route. The second is to advertise 0.0.0.0 regardless of whether the advertising router already has a default route. The second method can be accomplished by adding the keyword always to the default-information originate command.
Another option is to use the area range and summary-address commands discussed in the summarization above. Using these options will result in the router advertising a default route pointing to itself.
Type 1: Router link advertisements generated by each router for each area it belongs to. Type 1 LSAs are flooded to a single area only.
Type 2: Network link advertisements generated by designated routers (DRs) giving the set of routers attached to a particular network. Type 2 LSAs are flooded to the area that contains the network.
Type 3/4: These are summary link advertisements generated by ABRs. Type 3 describes inter-area routes to networks and is used for summarization. Type 4 describes how to reach the ASBR.
Type 5: Generated by the ASBR and provides links external to the Autonomous System (AS). Type 5 LSAs are flooded to all areas except stub areas and totally stubby areas.
Type 7: NSSA external routes generated by ASBR. Only flooded to the NSSA. The ABR converts LSA type 7 into LSA type 5 before flooding them into the backbone (area 0).
Note: only changes Type 1 and 2 LSAs require an SPF calculation
The commands used to see each LSA:
-LSA Type 1: show ip ospf database router
-LSA Type 2: show ip ospf database network
-LSA Type 3 : show ip ospf database summary
-LSA Type 4 : show ip ospf database asbr-summary
-LSA Type 5 : show ip ospf database external
-LSA Type 7 :show ip ospf database nssa-external
Standard Area:
In the Standard Area ,R2 is an ABR (Area Border Router) between a standard area and the backbone. R3 is an ASBR (Autonomous System Boundary Router )and redistributes routes fromanother routing protocol.
The LSAs Type 1 and 2 are flooded between routers sharing a common area. This applies to all area types, these LSAs are used to build an area's shortest-path tree. The LSAs Type 3 and 5 describe internal (inter-area) and external routes respectively, they are flooded throughout the backbone and all standard areas.
The LSAs Type 4 are injected into the backbone by the ABR of an area which contains an ASBR in order to ensure that all other routers in the OSPF domain can reach the ASBR.
Standard areas work well and ensure optimal routing since all routers know about all routes and about all LSAs . However, there are often situations when an area has limited access to the rest of the network, and maintaining a full link state database is unnecessary. Additionally, an area may contain some routers which do not have enough resources to maintain a full database for a large OSPF network. Such areas can be configured to block certain LSA types and become a small stub areas.
Stub Areas:
In the Stub Areas, area 1 is configured as a stub ,R2 and R3 share a common stub area. Instead of propagating external routes (LSAs Type 5) into the area, the ABR injects the LSA Type 3 containing a default route into the stub area. This ensures that routers in the stub area will be able to route traffic to external destinations without having to maintain all the external routes. Also because external routes are not received by the stub area, ABRs also do not forward the LSAs Type 4 from other areas into the stub.
For an area to become a stub, all routers belonging to it must be configured to operate as such. Stub routers and non-stub routers will not form adjacencies.
Router(config-router)# area 1 stub
This idea of substituting a single default route for many specific routes can be applied to the inter-area route as well, which is the case of totally stubby areas.
Totally Stubby Areas:
Like stub areas, totally stubby areas do not allow the LSAs Type 4 and 5. Also they also do not allow the LSAs Type 3 representing the inter-area routesexcept the LSA Type 3 for the default-route , all routing out of the area relies on the single default route injected by the ABR.
A stub area is extended to a totally stubby area by configuring all of its ABRs with the no-summary parameter:
Router(config-router)#area 1 stub no-summary
Stub and totally stubby areas can be convenient to reduce the resource utilization of routers in portions of the network not requiring full routing knowledge. Because there are no networks beyond the router R3 thus it's not necessary to have all routes (Inter-area IA),no need to have full routing table on R3,the advantages to dos this is to save the router memory and processor. However the LSAs Type 4 and 5 are not permitted inside the area. To solve this problem, Cisco introduced the concept of a not-so-stubby area (NSSA) in order to inject the external routes from an ASBR.
Not-so-stubby Areas:
In NSSA an ASBR creates the LSAs Type 7 for the external routes . This allows an ASBR to advertise external routes to an ABR, which converts the type 7 LSAs into type 5 before flooding them to the rest of the OSPF domain.
An NSSA can function as either a stub or totally stubby area. To configure a normal (stub) NSSA, all routers in the area must be so configured:
Router(config-router)#area 1 nssa
Type 3 LSAs will pass into and out of the area. Unlike with a normal stub area, the ABR will not inject a default route into an NSSA unless explicitly configured.
In NSSA totally stub area, the ABR generates a default summary route. As mentioned, if the NSSA area were not defined as totally stub, then a default summary route (LSA Type 3 default route) is not generated by the ABR. To generate a default summary route (LSA Type 3 default route) for a NSSA totally stub area, eliminating LSAs Type 3, all of its ABRs must be configured with the no-summary parameter:
router ospf 1 Area 1 nssa no-summary
An ABR can generate an LSA type 7 default route. You can configure this command on any NSSA ASBR or NSSA ABR with the following rules:
This command is used in order to generate an LSA Type 7 default route:
router ospf 1 Area 1 nssa default-information-originate
All areas in an OSPF autonomous system must be physically connected to the backbone area (area 0). In some cases where this physical connection is not possible, you can use a virtual link to connect to the backbone through a non-backbone area. You can also use virtual links to connect two parts of a partitioned backbone through a non-backbone area. The area through which you configure the virtual link, is known as a transit area.The transit area cannot be a stub area. Virtual links should be used only as a temporary solution.
15-OSPF Route Types:
There are several types of OSPF routes:
Intra-Area: In a multiarea OSPF network, routes, originated within an area, are known by the routers in the same area as Intra-Area routes. These routes are flagged as O in the show ip route command output.
Inter-Area: When a route crosses an OSPF Area Border Router (ABR), the route is known as an OSPF Inter-Area route. These routes are flagged as O IA in the show ip route command output.
Both Intra and Inter-Area routes are also called OSPF Internal routes, as they are generated by OSPF itself, when an interface is covered with the OSPF network command.
The cost to another OSPF area is calculated as the smallest cost to an ABR plus the smallest cost across the backbone.
External Routes: two categories, External Type-1 and External Type-2. These routes are redistributed into OSPF, such as Connected, Static, or other Routing Protocol. These routes are flagged as O E2 or O E1 in the show ip route command output. External Type-2 is the default.The difference between the two is in the way the cost (metric) of the route is being calculated. The cost of a Type-2 route is always the external cost, irrespective of the interior cost to reach that route. A Type-1 cost is the addition of the external cost and the internal cost used to reach that route. A Type-1 route is always preferred over a Type-2 route for the same destination.
NSSA external type 2 or NSSA external type 1: When an area is configured as a Not-So-Stub Area (NSSA), and routes are redistributed into OSPF, the routes are known as NSSA external type 2 or NSSA external type 1. These routes are flagged as O N2 or O N1 in the show ip route command output.
Rules Intra-area and Interarea Routes on ABRs:
-When choosing the best route, an intra-area route is always better than an inter-area route, regardless of metric.
-If an ABR learns a Type 3 LSA inside a non-backbone area, the ABR ignores that LSA when calculating its own routes, because the loop prevention mechanism of inter-area ospf.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: