Network Kings

LIMITED TIME OFFER

$999 $499 only For All Access Pass Today! USE PROMO CODE : LIMITED

d :
h :
m

OSPF STUB AREA – Explained 

ospf stub area
ospf stub area

Open Shortest Path First (OSPF) is a commonly used Internal gateway routing protocol for routing within an Autonomous System. OSPF’s capacity to optimize the routing table by separating the network into areas is one of its most important features.   

We have discussed OSPF, its backbone area, and standard areas in our previous blogs. Today, we will look at OSPF stub areas, a concept that simplifies routing and improves network performance, making it a must-know for anyone starting in network engineering. 

What are OSPF Stub Areas?

An OSPF Stub Area is a type of OSPF area that helps in simplifying routing in larger OSPF networks and makes routing more efficient. Stub areas are designed in such a way that they have certain characteristics that differ from regular OSPF areas. 

What are the features of OSPF Stub Areas?

Here are the key features of the OSPF Stub Areas- 

  • No Type 5 LSAs and Type 3 LSA 

In a stub area, routers do not flood external (Type 5) LSAs and Type 3 LSAs (according to the type of stub area). This means that routers within the stub area only know internal routes, making routing tables smaller and more efficient.  

  • Default Route 

Instead of external LSAs, a stub area has a default route (0.0.0.0/0) pointing to the Area Border Router (ABR). Hence, this default route is used to reach external destinations/networks that are unknown to the routers under the stub area.  

  • Reduced SPF Calculations 

Since there are no external LSAs in the case of stub area. SPF calculation is simpler and faster convergence is possible. Also, the network efficiency increases.  

Since Stub areas contain Type 1, Type 2, and in some cases, Type 3 LSAs, which describe routers, network links, and summary routes within the area and a default route, the LSA flooding is reduced to a minimum, Link State Database becomes smaller which further leads to the smaller routing table and a smaller number of SPF calculations. 

What are the different OSPF Stub Area types?

The different OSPF Stub Area types are as follows-  

  • STUB AREA 

This is the standard Stub area in which Type-5 LSA is blocked. Since it blocks all the type-5 LSA, routes that are redistributed into the OSPF are rejected in this area. Also, in the stub area, no ASBR is allowed, i.e. we cannot configure an ASBR into the stub area. This makes sense since we are not interested in receiving LSA Type-5, which means we do not require a router that generates Type-5 LSA, which is ASBR. Further, the Stub area uses a default route provided by the Area Border Router (ABR) to reach external destinations.  

  • Totally Stub Area 

Totally Stub area along with blocking all the Type-5 LSA, also prevents the advertisement of TYPE-3 LSA i.e., it does not allow summary LSA to enter into the area which further reduces the routing table. In the Totally Stub area, no ASBR is allowed.  

  • NSSA 

NSSA, also known as Not-So-Stubby Area, blocks Type-5 LSA, but ASBR routers are allowed in this area.   

However, the ASBR router does generate the Type 5 LSA. It sounds contradicting, isn’t it?   

Yes, it is contradicting. Not-So-Stubby Areas (NSSAs) are designed for situations where you need to introduce external routes (Type-5 LSAs) into a stub area without converting it into a standard OSPF area.  

NSSA routers convert Type-5 LSA into the Type-7 external LSA. Type-7 LSA are only understood by NSSA and Totally NSSA. It gets converted to Type-5 LSA when it leaves an NSSA by Area Border Router. Similarly, when Type-5 LSA gets into the NSSA, it gets converted to Type-7 LSA so that routers in the NSSA can understand and get the routing updates. 

what is ospf stub area
ospf stub area configuration
  • Totally NSSA 

A total Not-So-Stubby Areas is an extension of the NSSA. In the case of Totally Not-So-Stubby Areas, not only are external routes (Type 5 LSAs), but Type 3 (Summary) LSAs are also suppressed, making it similar to a stubby area in terms of routing information. The only difference is that it allows ASBR.   

It also works using the same concept as discussed in the case of NSSA.   

Totally NSSA routers convert the Type 5 LSA to Type 7 LSA so that they can read the Link State Advertisements and update the routing table accordingly. 

5 LSA to Type 7 LSA

These areas are used to further optimize the routing by reducing and minimizing the routing table and blocking the routes that are not needed but, it is important to note that in the case of these areas, we always use the default route at Area border routers to reach a particular prefix outside the area when needed. 

Configuration: -

cisco ospf stub area configuration

R1 

R1#conf t 

R1(config)#int fa0/0 

R1(config-if)#ip add 192.168.15.5 255.255.255.0 

R1(config-if)#no shutdown 

R1(config-if)#ip ospf 1 area 1 

R1(config)#int lo 0 

R1(config-if)#ip add 10.5.5.5 255.255.255.0 

R1(config-if)#ip ospf 1 area 1 

R1(config)#Router ospf 1 

R1(config-router)#router-id 10.5.5.5  

R2 

R2#conf t 

R2 (config)#int fa1/0 

R2(config-if)#ip add 192.168.10.1 255.255.255.0 

R2(config-if)#no sh 

R2(config-if)#ip ospf 1 area 0 

R2 (config)#int fa0/0 

R2(config-if)#ip add 192.168.15.1 255.255.255.0 

R2(config-if)#no sh 

R2(config-if)#ip ospf 1 area 1 

R2 (config)#int lo 0 

R2(config-if)#ip add 10.1.1.1 255.255.255.0 

R2(config-if)#ip ospf 1 area 0 

R2(config)#Router ospf 1 

R2(config-router)#router-id 10.1.1.1 

R3 

R3#conf t 

(config)#int fa1/0 

(config-if)#ip add 192.168.10.10 255.255.255.0 

(config-if)#no sh 

(config-if)#ip ospf 1 area 0 

R3(config)#int fa0/0 

R3(config-if)#ip add 192.168.20.10 255.255.255.0 

R3(config-if)#no sh 

R3(config-if)#ip ospf 1 area 0 

R3(config)#int lo 0 

R3(config-if)#ip add 10.10.10.10 255.255.255.0 

R3(config-if)#ip ospf 1 area 0 

R3(config)#Router ospf 1 

R3(config-router)#router-id 10.10.10.10 

R4 

R4#conf t 

R4(config)#int fa0/0 

R4(config-if)#ip add 192.168.20.2 255.255.255.0 

R4(config-if)#no sh 

R4(config-if)#ip ospf 1 area 0 

R4(config)#int fa1/0 

R4(config-if)#ip add 192.168.27.2 255.255.255.0 

R4(config-if)#no sh 

R4(config-if)#ip ospf 1 area 2 

R4(config)#int lo 0 

R4(config-if)#ip add 10.2.2.2 255.255.255.0 

R4(config-if)#ip ospf 1 area 0 

R4(config)#Router ospf 1 

R4(config-router)#router-id 10.2.2.2  

R5 

R5#conf t 

R5(config)#int fa1/0 

R5(config-if)#ip add 192.168.27.7 255.255.255.0 

R5(config-if)#no sh 

R5(config-if)#ip ospf 1 area 2 

R5(config)#int lo 0 

R5(config-if)#ip add 10.7.7.7 255.255.255.0 

R5(config-if)#ip ospf 1 area 2 

R5(config)#Router ospf 1 

R5(config-router)#router-id 10.7.7.7 

Now, let us redistribute some routes on R3 so that it becomes an ASBR. 

R3 

R3 (config)#int lo 1 

R3(config-if)#ip add 172.16.50.1 255.255.255.0 

R3(config-if)#int lo 2 

R3(config-if)#ip add 172.16.51.1 255.255.255.0 

R3(config)#router ospf 1 

R3(config-router)#redistribute connected subnets 

R1#show ip route  

Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP 

       D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area  

       N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2 

       E1 – OSPF external type 1, E2 – OSPF external type 2 

       i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2 

       ia – IS-IS inter area, * – candidate default, U – per-user static route 

       o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP 

       + – replicated route, % – next hop override 

The Gateway of last resort is not set. 

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks 

O IA     10.1.1.1/32 [110/2] via 192.168.15.1, 00:20:04, FastEthernet0/0 

O IA     10.2.2.2/32 [110/4] via 192.168.15.1, 00:11:22, FastEthernet0/0 

C        10.5.5.0/24 is directly connected, Loopback0 

L        10.5.5.5/32 is directly connected, Loopback0 

O IA     10.7.7.7/32 [110/5] via 192.168.15.1, 00:08:54, FastEthernet0/0 

      172.16.0.0/24 is subnetted, 2 subnets 

O E2     172.16.20.0 [110/20] via 192.168.15.1, 00:01:55, FastEthernet0/0 

O E2     172.16.51.0 [110/20] via 192.168.15.1, 00:01:28, FastEthernet0/0 

O IA  192.168.10.0/24 [110/2] via 192.168.15.1, 00:20:04, FastEthernet0/0 

      192.168.15.0/24 is variably subnetted, 2 subnets, 2 masks 

C        192.168.15.0/24 is directly connected, FastEthernet0/0 

L        192.168.15.5/32 is directly connected, FastEthernet0/0 

O IA  192.168.20.0/24 [110/3] via 192.168.15.1, 00:15:46, FastEthernet0/0 

O IA  192.168.27.0/24 [110/4] via 192.168.15.1, 00:11:40, FastEthernet0/0 

Notice that LSA Type 5 is present in its routing table. 

Configure Stub Area:-

R1 (config)#router ospf 1 

R1(config-router)#area 1 stub 

As soon as we configure the stub area on one router, OSPF neighborship goes down. Since stubs should be configured on all the routers in an area. 

Hence, we will configure it on R2. 

R2 (config)#router ospf 1 

R2(config-router)#area 1 stub 

R1#show ip route  

Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP 

       D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area  

       N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2 

       E1 – OSPF external type 1, E2 – OSPF external type 2 

       i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2 

       ia – IS-IS inter area, * – candidate default, U – per-user static route 

       o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP 

       + – replicated route, % – next hop override 

The Gateway of last resort is 192.168.15.1 to network 0.0.0.0 

O*IA  0.0.0.0/0 [110/2] via 192.168.15.1, 00:00:13, FastEthernet0/0 

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks 

O IA     10.1.1.1/32 [110/2] via 192.168.15.1, 00:00:13, FastEthernet0/0 

O IA     10.2.2.2/32 [110/4] via 192.168.15.1, 00:00:13, FastEthernet0/0 

C        10.5.5.0/24 is directly connected, Loopback0 

L        10.5.5.5/32 is directly connected, Loopback0 

O IA     10.7.7.7/32 [110/5] via 192.168.15.1, 00:00:13, FastEthernet0/0 

O IA  192.168.10.0/24 [110/2] via 192.168.15.1, 00:00:13, FastEthernet0/0 

      192.168.15.0/24 is variably subnetted, 2 subnets, 2 masks 

C        192.168.15.0/24 is directly connected, FastEthernet0/0 

L        192.168.15.5/32 is directly connected, FastEthernet0/0 

O IA  192.168.20.0/24 [110/3] via 192.168.15.1, 00:00:13, FastEthernet0/0 

O IA  192.168.27.0/24 [110/4] via 192.168.15.1, 00:00:13, FastEthernet0/0 

See the magic- Type 5 LSA, i.e., O E2 routes are blocked. Also, the default route is now present in the table. 

Totally Stub:-

R4 (config)#router ospf 1 

R4(config-router)# area 2 stub no-summary 

R5 (config)#router ospf 1 

R5(config-router)# area 2 stub no-summary 

R5#show ip route  

Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP 

       D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area  

       N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2 

       E1 – OSPF external type 1, E2 – OSPF external type 2 

       i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2 

       ia – IS-IS inter area, * – candidate default, U – per-user static route 

       o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP 

       + – replicated route, % – next hop override 

Gateway of last resort is 192.168.27.2 to network 0.0.0.0 

O*IA  0.0.0.0/0 [110/2] via 192.168.27.2, 00:00:20, FastEthernet1/0 

      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks 

C        10.7.7.0/24 is directly connected, Loopback0 

L        10.7.7.7/32 is directly connected, Loopback0 

      192.168.27.0/24 is variably subnetted, 2 subnets, 2 masks 

C        192.168.27.0/24 is directly connected, FastEthernet1/0 

L        192.168.27.7/32 is directly connected, FastEthernet1/0 

See, in a totally stub area, even the LSA-3 is filtered. 

NSSA and Totally NSSA can be configured using the following commands- 

Syntax to configure NSSA 

R(config)#router ospf 1 

R(config-router)#area 1 nssa 

Syntax to configure Totally NSSA 

R(config)#router ospf 1 

R(config-router)# area 1 nssa no-summary 

What is OSPF? Explained 

ospf stub area
ospf stub area

OSPF stands for Open Shortest Path First. It is a routing protocol used in computer networks to determine the best path for routing data packets from one network node to another.

What are the features of OSPF?

Here are some key features of OSPF: –  

  • It is a link-state routing protocol. 
  • OSPF is a nonproprietary Interior Gateway Protocol. 

There are two main versions of OSPF in production networks today: 

  1. OSPFv2 – Originally defined in RFC 2328 with IPv4 support 
  2. OSPFv3 – Modifies the original structure to support IPv6 
  • OSPF is a Layer 3 Protocol. 
  • The Protocol Number of OSPF is 89. 
  • AD value of OSPF is 110. 
  • The multicast address of OSPF is 224.0.0.5 (used by all the OSPF routers) and 224.0.0.6 (used to communicate to the Designated Router and Back Designated Router). 
  • OSPF uses the Dijkstra algorithm to calculate the shortest path tree, determining the best data routes to traverse the network. 
  • OSPF networks get divided into areas to improve scalability. Each area has its link-state database, and routers within an area only exchange summary information with routers outside their area, reducing the LSA flooding.
  • OSPF uses cost metrics to determine the best path. The cost of a path is based on link bandwidth. The higher the bandwidth lower the cost.
  • OSPF can quickly adapt to changes in the network. In case of link failure, it rapidly recalculates routes based on the updated link-state information.
  • OSPF supports authentication mechanisms to secure the network. 
  • OSPF is compatible with Variable Length Subnet Mask (VLSM) and Classless Inter-Domain Routing (CIDR). 

What tables do OSPF maintain?

OSPF maintains three tables, namely: – 

  • Neighbour Table

The Neighbour table contains information about the directly connected OSPF neighbours. 

  • Database Table

A Database table contains information about the entire view of the topology concerning each router.   

  • Routing Information Table

It contains the best path calculated by the shortest path algorithm or Dijkstra algorithm. 

Since OSPF is a link-state routing protocol, every router shares the information of its neighbour with the other router in a network. This is known as Link state advertisements

ospf stub area

NOTE: All the routers in a network need to learn this link-state advertisement to create a routing database known as the Link-State Database.

So, the scenario would look something like this. All the routers will flood the advertisements, leading to a lot of OSPF traffic.

ospf stub area

A lot of link state advertisements in a network will lead to network congestion, wastage of bandwidth, and ultimately an inefficient network. 

So, to eliminate this issue and make the network more efficient OSPF introduces us to the concept of AREA

Explain the concept of AREA in OSPF.

Let us understand this with the help of an example:- 

Suppose a router of a given topology goes down for any reason. Other routers would look into its LSDB for another best possible route, and hence, it will also advertise that R1 is down throughout the network. This causes a serious issue known as Link-state advertisement flooding

OSPF eliminates this flooding by introducing the concept of area. We can divide our network into different areas. Also, the Link State advertisements do not cross a particular area leading to a reduction in LSA flooding. 

NOTE: There are ways with the help of which OSPF advertises its information outside the area, which we will discuss later. 

What should we remember while grouping the routers?

An area is a logical grouping of routers. Some Important points to remember regarding the OSPF area: – 

  • Each OSPF topology must have Area 0 
  • Area 0 is also called the backbone area. 
  • If in topology, we have only 1 area, it should be AREA 0 
  • All the area must be connected to Area 0 
  • Area 0 should be contiguous, i.e., it should not get divided into two or more parts. If, for some reason, area 0 is not contiguous, we must combine it using the concept of virtual links.
virtual link
virtual link
routes between the areas

What are Designated Router and Backup Designated Router?

In OSPF networks, designated routers and backup designated routers are used whose main purpose is to reduce the amount of overhead traffic and to improve the efficiency of routing updates. 

  • Designated Router

In each multi-access network segment, one router is elected as a Designated router which is responsible for generating and sending OSPF network information to all the other routers in the same area. Since only DR is responsible for sending the updates, the amount of duplicate traffic is reduced.

  • Backup Designated Router

Along with the Designated Router, a backup designated router is elected. BDR takes up the responsibility of the Designated router in case it fails.

How does Designated Router and Backup Designated Router is elected?

  • Router Priority

Each router has some priority value. The router with the highest priority becomes the Designated Router, and the one with the second highest priority becomes the Backup Designated Router. The default priority is 1, but it can be set manually.

  • Router ID

The router ID is a 32-bit unique identifier assigned to each router. The highest loopback IP becomes the router ID. If no loopback is configured to a router, the highest IP address on a physical interface becomes a router ID. 

If more than one router has the same priority, the router with the highest Router ID becomes the Designated router. 

NOTE: The Designated Router and Backup Designated Router are only needed in multi-access networks and are not required in the case of point-to-point networks. In point-to-point links, there is no need for DR and BDR because there are only two routers involved and they directly exchange OSPF information.

What are Backbone Router, ABR, and ASBR?

  • Backbone Router

A backbone router is the one that resides within the backbone area, i.e., area 0 of an OSPF network. This router is responsible for exchanging routing information and network updates with other routers in the same backbone area. It ensures the connectivity between different OSPF areas. 

  • Area Border Router

ABR, also known as Area Border Router, is the one that connects two or more OSPF areas, including the backbone area. Its primary role is to route traffic between different areas with the help of LSA Type 3. For a router to become an Area Border Router, at least one link must be in Area 0 while other links are in areas other than Area 0. 

  • Autonomous System Border Router (ASBR)

An ASBR is a router connecting an OSPF domain to routers in another routing domain. A router becomes an ASBR router when one link is configured with OSPF while the other link gets configured with a protocol other than OSPF. The protocol can be EIGRP, a static route, a default router, etc. ASBR router imports external routes into the OSPF domain and exports OSPF routes to the external network. 

ospf stub area

What are the OSPF messages?

The OSPF messages are as follows-

  • Hello

A Hello message is used to discover neighbours and establish adjacency. Routers sends hello message periodically to their directly connected neighbours. This message includes information about Router ID, Area ID, network mask, priority hello interval, dead time interval, authentication options if configured, etc. Hello, the message uses multicast address 224.0.0.5. 

  • Database Description Message (DBD)

The router sends a DBD message to describe its own Link state database to a neighbouring router. DBD is a summary of the Link State Database. 

  • Link State Request (LSR)

After DBD is received, the receiving router identifies the missing routes and sends an LSR message to request a missing LSA from its neighbour. 

  • Link State Update (LSU)

LSU is sent in response to the Link State Request. When a router receives an LSR message requesting a particular LSA, it responds with one or more LSU which contains the requested LSA. 

  • Link State Acknowledgment (LSAck)

When a requesting router receives an LSU, it sends back LSAck, i.e., the acknowledgement which confirms that the LSA is correctly received. 

What are the OSPF states?

The OSPF states are as follows-

  • Down State

In this state, a router has no information about its neighbour, and no OSPF hello message is received. This is the initial state before any OSPF communication begins.

  • Init State

When a router sends out a hello message to its neighbour, it comes into the Init State. The router waits for a response to its hello message from a neighbour. 

  • Two-way state

After a router receives the hello message from its neighbour, it enters into a two-way state. In this state, a bidirectional communication has been established. 

  • Exstart state

Once the router has established two-way communication, i.e., Two-way state, it transitions to Exstart state. This is the initial state of OSPF adjacency formation. In this state, master and slave mode is determined. 

  • Exchange

In this state router exchanges the DBD packets that summarize their Link State Database. This helps them to identify the missing route. 

  • Loading

In this state router exchanges Link State Request and Link State Update packets to synchronize their Link State Database. 

  • Full state

Once the router has successfully exchanged LSA and has a matching link state database, it enters into the full state. In this state, routers have a complete understanding of network topology, and the Link state Database is also in sync. Hence, adjacency is established.