Open Short Path Protocol - OSPF
Open Short Path Protocol - OSPF
Open Short Path Protocol - OSPF
1.3 Why an OSPF router forms a neighbor relationship with another OSPF router?
1.11 Conclusion
In OSPF, each router maintains a complete map of the network topology. When a change occurs in the network, such as when a link goes
down or comes back up, each router updates its map accordingly and then calculates the shortest path
to every destination using Dijkstra’s algorithm. The resulting paths are then stored in the form of routing table entries and used to
route packets accordingly.
OSPF has an Administrative Distance (AD) of 110 and uses a cost metric to determine the best route. The cost is calculated based
on the bandwidth of the link. The lower the bandwidth, the higher the cost. Therefore, a lesser cost is always preferred.
OSPF is a widely used routing protocol, especially in large enterprise networks. It is also used as a base routing protocol or as a
network backbone in some service provider networks. Most major router vendors, including Cisco, Juniper, etc., support OSPF.
OSPF is one of the oldest link-state routing protocols among the Interior Gateway Protocols (IGPs). The OSPF Working Group of
the Internet Engineering Task Force (IETF) developed it in the mid-1980s.
OSPF was initially developed in RFC 1131 and has been updated several times since then. Its latest specifications are in RFC 2328.
ADVANTAGES OF OSPF
OSPF is a standard IGP protocol that is easy to configure and widely known and accepted among network engineers in enterprise networks and service
provider networks.
OSPF supports IPv4 and IPv6 both.
OSPF supports plain text and MD5 authentication.
OSPF supports multiple areas, providing improved network scalability, easier troubleshooting, and reduced routing traffic.
OSPF offers fast convergence times, high scalability, and robustness compared to distance vector protocols like RIP.
In addition to calculating routes, OSPF provides automatic fault detection and recovery capabilities, making it ideal for large enterprises.
OSPF can improve your network’s speed and performance, especially for larger LANs or WANs.
OSPF uses VLSM and discontiguous networks.
You can manually summarize OSPF interarea routes at the ABR or ASBR.
Open Short Path First (OSPF) uses small hello packets to verify links first and ignores transferring large tables, which reduces traffic.
OSPF supports route tagging: Routes can be tagged to ease interoperability with arbitrary values.
Open shortest path first (OSPF) can route packets according to their ToS (Type of Service) field.
After gathering the necessary information, it will calculate the shortest paths to each reachable subnets/network using a
Shortest Path First (SPF) algorithm.
Neighbor Table: This table contains all discovered OSPF neighbors with which OSPF will exchange routing information.
Topology Table: It contains the entire route map of the network with the available OSPF routers as well as the calculated
best and alternative paths between any two nodes.
Routing Table: Contain the best current routes that OSPF will use to route data traffic between neighbors.
• Router-1 and Router-2 have both been configured for OSPF. (And simplicity, let’s assume this is a point-to-point OSPF network.)
• Router-1 sends a Multicast (224.0.0.5) Hello to Router-2.
• Router-2 responds to the Hello to the Router-1 if all parameters (mentioned below) are matched properly.
• Router-1 also responds to the Hello message of Router-2.
• Then OSPF neighborship goes through multiple OSPF states, forms neighborship, and exchanges their OSPF Database.
• OSPF neighborship turns into Full-state.
•These parameters should match to form the OSPF neighborship:-
•On Cisco routers, the OSPF hello timer is set to 10 seconds and the dead interval to 30 seconds. However, some implementations allow the OSPF dead time to be set to one second (or even less) with
correspondingly short dead times.
OSPF-speaking routers communicate with each other by periodically sending a •A Hello packet play several roles in OSPF. They
hello packet out of each OSPF-enabled interface. are responsible for:-
The default hello-interval is 10 seconds for broadcast networks and 30 seconds for non-broadcast networks.
The hello-interval can be configured on a per-interface basis with the “ip ospf hello-interval” command.
The default dead-Interval is four times the hello-interval, but you can change it with the command “ip ospf dead-
interval.”
I would instead recommend BFD (Bi-Directional Forwarding Detection). BFD is a lightweight protocol and does the job
better than fast-hellos.
Use “ip ospf dead-interval min hello-multiplier 10” – This will send 10 hello packets every 1 second with an interval of 100
ms.
Conclusion
In conclusion, OSPF is a robust link-state routing protocol widely used in enterprise networks to improve the efficiency of
network communications. It has several advantages, including its ability to form neighbors and its support for multiple
areas, which can be very useful in larger networks. However, it also has some disadvantages, including its complexity and
the need for careful configuration.
Table Of Contents
1. The OSPF Neighbor States Explained with Infographic
o OSPF states Infographic
o What are the OSPF states, and why are they important to understand?
o Down State
o Attempt State
o Init State OSPF states Explained
o 2-Way State [with Infograhic]
o Exstart State
o Exchange State
o Loading State
o Full State
o OSPF Packet Types
o What are DDP-Database Description Packets (type 2) or DBD (Data Base Descriptors)?
o What are LSR-Link State Request packets (type 3)?
o What are LSU-Link State Update packets (type 4)?
o What are LSAck-Link State Acknowledgement packets (type 5)?
o Conclusion
Open Shortest Path First (OSPF) is a link-state routing protocol that uses the Shortest Path First algorithm to discover the
best route between the source and the destination network. It is an Interior Gateway Protocol (IGP) and is designed to
work within an autonomous system.
OSPF has its own transport protocol number 89 and an Administrative Distance(AD) value of 110. OSPF uses multicast
address 224.0.0.5 for normal communication and 224.0.0.6 for updating Designated Router(DR) and Backup Designated
Router(BDR).
1
Down State
As the name suggests, in the Down state, the OSPF-enabled router has no information about any other OSPF routers and
does not participate in the OSPF routing process.
This is the initial state of a neighbor, and it indicates that no hellos are heard from its neighbor till the dead interval has
expired.
If a neighbor goes into the DOWN state, the link state retransmission, database summary, and link state request lists are
cleared.
2
Attempt State
An OSPF attempt state is valid only for neighbors manually configured on NBMA networks.
Instead of sending packets to neighbors every poll interval, routers send packets to neighbors at the hello intervals. The
local router will send a unicast Hello packet to the neighbor in the set hello interval if it has not yet received a hello packet
from that neighbor.
3
Init State
When a router is in the Init state, it is aware of the presence of another router but lacks sufficient information to exchange
routing updates with it.
In other words, when an OSPF router gets a hello packet but the local router ID isn’t specified in the received Neighbor
field, it enters the Init state. This means that during the last router dead-interval, the router received a Hello packet from
the neighbor, but 2-way communication has not yet been established.
4
2-Way State
In a 2-way state, the router knows enough about the other router to exchange routing updates, but the other router hasn’t
learned enough about this router to do the same.
This indicates that a two-way dialogue has been formed between two routers because its own router ID is visible in the
neighbor field of a neighbor’s Hello packets.
At this point, you can say that two OSPF-enabled routers are officially OSPF neighbors, but there are still many more
things to learn, like databases.
One thing to note here is that neighbors must be in a 2-way state or higher to be elected as the OSPF DR or BDR on
multi-access networks.
5
Exstart State
ExStart state is the first step in the adjacency formation process; the local router and its neighbor determine which router
is responsible for synchronizing the database.
Furthermore, to exchange Data Descriptor Packets (DDPs), an OSPF router will establish a Master/Slave connection
between itself and its neighbor.
The master is the neighbor with the highest router ID.
Please note: DDP (Data Descriptor Packets), short for DD or DBD (Data Base Descriptors), are all the same packet types
used to summarize database contents.
6
Exchange State
An OSPF router exchanges Data Descriptor Packets(DDPs) between the local router and its OSPF neighbor in the Exchange
state.
The router delivers DDPs to neighbors that summarize its whole link state database.
Link-state request packets can also be sent by the router to neighbors in this state, asking for more recent LSAs.
7
Loading State
In the loading state, OSPF routers send and receive Link State Requests (LSR) and Link State Updates (LSU) containing all
Link State Advertisements(LSA). These updates are based on neighbors’ DDP or Data Base Descriptors (DBD).
Link State Updates (LSUs) are envelopes that contain all of the Link State Advertisements (LSAs) that have been sent to
OSPF neighbors with fresh updates or new networks learned.
8
Full State
The full state is the normal functional state of OSPF, which signifies that everything is operating normally. This means all
router and network Link State Advertisements (LSAs) are exchanged periodically, and the databases of all routers are fully
synced.
It is important to note that for Broadcast networks and NBMA media, routers will only attain Full State with their DR and
BDR routers. However, for point-to-point and point-to-multipoint networks, a router should be in a full state with every
surrounding router.
2. Database Description Packet: Sent from one router to another to describe how to route traffic to the destination.
3. Router Advertisement: A router sends this packet to announce itself to the rest of the world.
5. Link State Update: Used to inform the local router about changes in the network topology.
In my last post, I discussed the Hello packet, which is essential to discover a neighbor; in this post, we will discuss the rest
of the packet types used to build adjacency between OSPF neighbors.
First, I-bit, or Initial bit, denotes the initial DDP transmission when set.
When the M-bit, or More bit, is set, it indicates that this is not the final DDP transmission.
The MS-bit, also known as the Master/Slave bit, is set in the DDP sent by the master.
The router analyses the sequence number of the LSA header received from the neighbor to determine if the neighbor has
a more current version of the LSA. If the sequence number is greater than its own, the router recognizes that the neighbor
has the latest version of the LSA and sends an LSR (Link State Request) packet to the neighbor to request one or more
LSAs.
Due to the acknowledgment of received update packets, transmitting LSR/LSU packets is a reliable procedure.
Furthermore, all LSAs sent in update packets must be individually acknowledged by one of two means:
Quick Tip:-LSA (Link State Advertisement) and (Link State Acknowledgement)are two different packet types.
Conclusion
This post has covered different OSPF states and packet types used to establish OSPF adjacency. Knowing these concepts
will not only help you troubleshoot OSPF-related issues like a neighbor not coming up and out-of-sync OSPF databases,
but it will also help you design better networks.
Table Of Contents
1. OSPF Link State Advertisements – All 11 OSPF LSA Types Explained
o What is OSPF Link State Advertisement(LSA)?
o OSPF LSA Types Explained – 11 Types of LSA
o 1. What is a Type 1 LSA or OSPF Router LSA?
o 2. What is a Type 2 LSA or OSPF Network LSA?
o 3. What is a Type 3 LSA or OSPF Network Summary LSA?
o 4. What is a Type 4 LSA or OSPF ASBR Summary LSA?
o 5. What is a Type 5 LSA or OSPF AS External LSAs?
o 6. What is a Type 6 LSA or OSPF MOSPF LSA?
o 7. What is a Type 7 LSA or OSPF NSSA External LSAs?
o 8. What is type 8 LSA?
o 9. What is an Opaque LSA – Type 9,10 and 11?
o How to protect OSPF link-state Database from overload?
o How can you slow down OSPF LSA updates during times of network instability?
o What are different OSPF LSA types? -OSPF LSA Types Summary
o Conclusion
LSAs are flooded throughout the OSPF network, so all routers can view the network topology consistently. When a router
receives an LSA, it updates its link state database with the new information.
The router will add this information to its database if the LSA contains information about a new link or neighbor. Likewise,
if the LSA contains updated information about an existing link or neighbor, the router will update its database accordingly.
The OSPF routing protocol uses a link state database (LSDB) to store LSAs. The OSPF routing algorithm uses the link state
information contained within LSAs to calculate the shortest path to each reachable destination.
Because LSAs age over time, they are stored for a certain amount of time (Max-age 1 hour) before being removed from
the link state databases.
Refreshing the LSA (LSRefresh Time) with an increased sequence number and an age of zero is performed every 30
minutes by the router that created the LSA.
Each router produces its own LSA, which is sent between routers within the same area and does not leave the area of
origin.
These intra-area routes are displayed as “O” routes when you do “show ip route OSPF.”
This information includes the router’s ID, the cost of the links connected to the router, the router’s neighbors, and
other
information. Other routers use this network information to build their routing table.
You can check Type 1 LSAs on Cisco routers by the command “show ip OSPF database router.”
Like router LSAs, network LSAs only have an intra-area flooding scope.
You can use “show ip OSPF database network” on Cisco routers to check type 2 LSAs.
This LSA is never propagated beyond the borders of the AS and is flooded with inter-area. They also provide information
about the router, which is doing redistribution.
You can use “show ip OSPF database asbr-summary” on Cisco routers to check type 4 LSAs.
And because they provide information external to OSPF AS, they are not associated with any area.
These routes are displayed as ‘O*E1’ or ‘O*E2’ routes when you do “show ip route OSPF.”
You can use the show command “show ip OSPF database external” on Cisco routers to check type 5 LSAs.
An important thing to note for this LSA is that an OSPF external route cannot be the next hop of another OSPF external
route.
Type 6 LSAs contain information about the multicast capabilities of the router that generated them.
Cisco and other network vendors no longer support MOSPF.
OSPF LSA
Type 7
LSA Type 7 is used in special area types that don’t allow external distributed routes and stop LSA Type 5 packets from
flooding through them. LSA Type 7 packets act as a shield for LSA Type 5 packets, letting them move through these
special areas and get to the ABR, which can turn LSA Type 7 packets back into LSA Type 5 packets.
These routes are displayed as ‘O*N 1’ or ‘O*N2’ routes when you do “show ip route OSPF.”
You can use “show ip OSPF database nssa-external” on Cisco routers to check type 7 LSAs.
8. What is type 8 LSA?
9. What is an Opaque LSA – Type 9,10 and 11?
It was originally intended for transit
A Type 8 LSA is used to deliver Gateway Protocol to be utilized as an
AS(Autonomous Systems), where
information about link-local addresses “External-Attributes-LSA” in OSPFv2
OSPFv2 may take the role of the
and a list of IPv6 addresses on the link. (iBGP).
internal Border
Router OSPF 1
How can you slow down OSPF LSA updates during times of network
instability?
You can use OSPF LSA throttling (configured with “timers throttle lsa all”) to slow down LSA updates during times of
network instability. It also allows for faster OSPF convergence by providing LSA rate limiting in milliseconds.
Router OSPF 1
What are different OSPF LSA types? -OSPF LSA Types Summary
Let us recap.
Type 1 – Router LSA: Information regarding locally connected links and neighbors with which a router has a direct and full
neighborship.
Type 2 – Network LSA: DRs (Designated Routers) generate type 2 LSAs on every multi-access network to describe the
attached routers, including themselves.
Type 3 – Summary LSA: Is generated by an ABR (Area Border Router) and has an inter-area flooding scope.
• Type 4 – Summary ASBR LSA: Area Boundary Routers
(ABRs) generate LSA Type 4 and are similar to Network
Summary LSAs, except that they advertise the location of
an ASBR, not any network.
• Type 5 – External LSA: Type 5 LSAs are External LSAs generated
by ASBRs and have an autonomous system-wide flooding
scope. They describe routes to networks external to the OSPF
AS, including an external default route.
• Type 6 – Multicast LSA: Not supported by Cisco and other
vendors and not used.
• Type 7 – External LSA: ASBRs generate OSPF NSSA External LSAs
within an NSSA or Not So-Stubby Area. They are almost the
same as Type 5 LSAs, except they can only be flooded within an
NSSA area.
•Conclusion
•We have discussed different OSPF LSA types in this article, used to
share different types of routing information between OSPF-enabled
devices. Ensure you understand all the types thoroughly, as the OSPF
routing process depends highly on LSA propagation, generation, and
reception.
•We will put the knowledge from this article into practical use in the
upcoming OSPF area configuration article. If you want to get this content
ahead of time, subscribe to one of our free newsletters.
OSPF(Open Shortest Path First) is a link-state dynamic routing protocol that provides the shortest path between two routers
within an autonomous system.
OSPF exchanges network topology information using control packets called Link State Advertisements (LSAs). These LSAs
contain information such as the link’s cost, the number of hops required to reach each destination, and the bandwidth
available at each node. This information enables routers to calculate the shortest paths through the network.
The primary reason for using multiple OSPF areas is to limit the amount of routing information exchanged between OSPF
routers. By dividing the OSPF network into multiple areas, the routers only exchange summary information about the routes
in the other areas rather than exchanging the entire routing table.
Adding OSPF areas can significantly reduce the bandwidth used for routing updates and the time required to process the
updates.
There are a few reasons why you might need to configure multiple OSPF areas: –
Your router may not be able to handle a large number of routers in one area. Your device vendor’s documentation
suggests dividing the routers into OSPF areas after a certain number has been added to a single area.
To control the movement of OSPF LSAs across the OSPF network.
To divide the network into logical groups or subnets. We can define these areas based on geographical locations,
business units, departments, etc.
To improve network stability and performance.
To reduce the size of the full routing table.
To reduce the amount of OSPF traffic on the network.
To isolate problems to a specific area.
To create a hierarchy of networks, with each area representing a different level in the hierarchy. These hierarchies or
areas can make it easier to manage the network and control traffic flow between other areas.
If you only need a single area network, it does not have to be area 0. For example, you can use area 1.
All areas must have a direct physical connection to the backbone (OSPF Area 0); hence a backbone area is required
if there is more than one area.
Routers belonging to two different areas should always communicate through area 0.
There are some limitations on how many routers you put in a single area; please check vendor-specific documents
for this limit.
Routers in the same area should communicate directly with each other but not with any router outside the area.
A router’s single interface can only belong to one area.
If a router has multiple interfaces, then each interface can belong to a different area.
All routers in a STUB or NSSA area must agree on the STUB or NSSA flag.
1. Standard/Normal Area
2. Backbone Area
3. Stub Area
4. Totally Stubby Area
5. Not So Stubby Area (NSSA)
6.NSSA Totally Stubby Area
Let us understand each in detail.
1. Standard Area:
A standard area in the OSPF network is any normal area other than Area 0, which allows LSA 1 through 5.
If you have two areas in your OSPF network, one area must be the backbone area (area 0), and the other can be a standard
area.
ABR uses Type 3 LSAs for advertising inter-area routes. You can
configure a standard area by using the below commands.
configure terminal router OSPF 1
network 10.100.100.0 0.0.0.255 area 2 –>
Here area 2 is standard area.
2. Backbone Area:
The backbone area is a special type of
standard area which allows all LSA types
except LSA types 4 and 7.
router OSPF 1
area stub –> You must configure this command on all routers in that area.
Totally stubby is one step ahead of the Stubby area; it not only restricts LSA type 4 and 5 but also restricts type 3 LSAs.
LSA types 3, 4, and 5 are not allowed in the totally Stubby area.
The OSPF Totally Stub area uses a default route to reach destinations outside the OSPF domain and all destinations
outside the OSPF area.
ABR of a totally stubby area blocks all type 3 LSAs, except a single type 3 LSA advertising a default route (0.0.0.0/0)
You can configure a Totally Stubby area by using the below commands.
configure terminal
router OSPF 1
area stub no-summary –> Only required on ABR; rest of the internal routers within that area can use default stub area
configuration.
• It allows redistribution while retaining the characteristics of a stub area to the rest
of the OSPF Domain.
• The two main differences between a stub area are that redistribution is allowed
through Type 7 LSA, and no default route is sent into the NSSA.
• Type 4 and 5 LSAs are not allowed, but AS-external routes are allowed in NSSA.
And this is done by the ASBR, which originates type 7 LSAs to advertise the
external routes.
• These NSSA external LSAs (type 7) are flooded throughout the NSSA but are
blocked at the NSSA ABR.
• The NSSA ABR converts type 7 LSA to Type 5 LSA.
• The ABR does not automatically originate a default route in NSSA. You must use
the “area nssa default- originate” command to generate the default route.
router OSPF 1
area nssa –> You must configure the command on all routers in
that area.
6. NSSA Totally Stub Area:
NSSA Totally Stubby Area is used when you want to allow redistribution but still keep the characteristics of a
Totally Stub area.
Similar to Totally Stubby area with the added advantage of redistribution of external routes. The ASBR
in an NSSA will originate type 7 LSAs to advertise these external destinations.
Same as an NSSA area but also blocks type 3 summary LSAs.
Another difference to NSSA is that ABR defines an NSSA as totally stubby and originates a default as
‘O*IA.’
LSA Type 3, 4, & 5 are not allowed but redistributed AS-external (type 7) routes are allowed.
You can configure an NSSA Totally Stubby area by using the below commands. configure
terminal
router OSPF 1
area nssa no-summary –> Only required on ABR; rest of the internal routers use the standard NSSA area configuration.
Let us also discuss Single Area OSPF design vs. Multi Area OSPF design.
A single area OSPF design is a network in which all routers are in the same area.
Single area OSPF design means that the OSPF network is one homogeneous network. Therefore, all the OSPF routers in
the network are in the same area.
Placing all routers in a Single Area OSPF is much simpler to configure and maintain. There is no need for Virtual Links, no
need for Area Border Routers, and no need for Backbone Routers. I always prefer this option considering device vendor
support and future requirement.
Multi-Area OSPF
Multi-Area OSPF design means that the OSPF network is divided into multiple areas. First, there is Area 0, which is the
backbone area. Then, the other areas (1,2,3, etc.) are connected to Area 0.
To improve scalability, we can use a hierarchical design. In this design, we divide the network into multiple areas, each with
its own ABR.
The difference between a single-area OSPF design and a multi-area OSPF design:
In a single-area OSPF design, all routers are in the same area, and traffic is routed between all areas through a
single area. In a multi-area OSPF design, each router is assigned to a specific area, and traffic is routed between
areas through a backbone area.
In a single-area OSPF design, all areas are equal, and traffic is routed between them without preference. However,
in a multi-area OSPF design, the backbone area is preferred for routing traffic between areas.
All areas use the same link state database in a single-area OSPF design. However, each area has its own link state
database in a multi-area OSPF design.
Conclusion
This post has explained the different types of OSPF areas, why they are useful, how they work, and how to configure them.
OSPF areas can be a great way to organize and simplify your network, and they can provide many benefits in terms of
routing efficiency and redundancy. However, I would suggest using a single OSPF Area 0 for simplicity.
OSPF is a link-state routing system used in Internet Protocol (IP) networks. It calculates the optimal next hop for each
packet using the shortest path first (SPF) method. OSPF is a classless routing protocol that does not use subnet masks in
its routing update packets.
ABRs are routers with multiple interfaces connected to multiple OSPF areas. They connect two or more OSPF areas of a network, and one of the
areas must be area 0. The ABR acts as a gateway for inter-area traffic.
An ABR has at least one interface in each network area and maintains separate link state databases for each area. This feature allows the ABR to
route traffic between the different areas while providing accurate information about the state of the overall OSPF network.
Since we are discussing multiple areas here, let us look at the requirement for multiple areas in OSPF.
One of the most powerful features of OSPF is its ability to support multiple areas. An OSPF area is a logical grouping of OSPF routers. Areas are
connected via Area Border Routers (ABRs), and all routers within an area have the exact link-state database.
Returning to the ABR discussion, let’s dig deeper into Area Border Routers.
ABRs generate Network Summary LSA type 3 and have an inter-area flooding scope.
Internal routes that are not part of an OSPF area but part of the OSPF routing domain are
advertised using Link State Advertisements (LSAs) type 3.
LSA type 3 are displayed as ‘O*IA’ routes in the routing table.
Use the “show ip OSPF database summary” command to check type 3 LSAs.
ABR also generates an ASBR Summary Type 4 LSA, and you can check that by using the
“show ip OSPF database
asbr-summary” command on Cisco routers.
Advertisement
backbone area. Summary LSAs are used for advertising a non-backbone area’s routes
to the backbone area. By doing this, the ABR allows the routes of a non-backbone
or LSA is
area to be propagated throughout the OSPF domain.
The ABR is also responsible for maintaining a separate LSDB for each area to which it
is connected. The LSDB is a database that contains all the link state information for
produced by an area. By maintaining a separate LSDB for each area, the ABR can ensure that the
routing information for each area is up-to-date and accurate.
ABR? ABRs can be configured to act as virtual links. Virtual links are used to connect OSPF
areas that are not physically connected.
If you have more than one ABR per area, then they can be configured to perform load
balancing. Load balancing is useful to distribute traffic evenly across multiple links.
ABRs play an important role in Stub, Totally Stub, NSSA (Not-So-Stubby Areas), and
Totally NSSA Areas by injecting default routes or filtering out required LSAs. For
example, ABR in the stub area injects the default route into the stub area, while ABR in
the totally stubby area blocks types 3 LSA from being flooded into the stub area.
In the NSSA and Totally NSSA areas, ABR converts type 7 LSAs to type 5 LSAs.
In a STUB or NSSA, all neighbor routers must agree on the STUB or NSSA flag. By
adding the keyword “no- summary” to the “stub or nssa” command, the ABR of the
stub or NSSA area decides if it is totally stubby or totally NSSA.
An OSPF stub configuration explicitly filters type 5 LSAs but also implicitly filters type
4 LSAs since the ABR doesn’t
need to generate type 4 LSAs.
How to Use ABRs to Improve Overall Network Performance and Security
One of the biggest advantages of ABR is that you can configure ABRs to filter and summarize routes before entering an
area.
Filtering:-
You should always be aware that filtering only occurs between areas according to RFC standards: “All neighboring routers
within an area need to have the same link state database.”
You can only filter inter-area routes and cannot filter intra-area routes within an area.
Filter-Lists
•You can use ABRs to filter type 3 LSAs into or out of an area.
•area 0 filter-list prefix DONT_SEND out –> Filters ip subnets matched by the prefix- list DONT_SEND leaving out of ( from) area 0, and it applies to all
areas that the local advertising router is connected to
•area 2 filter-list prefix DONT_RCV in –> Filters traffic matched by DONT_RCV prefix list received into area 2 only
•Summarization:-
•Per best practice, IP subnets of a non-backbone area should be summarized into the backbone area by the area’s own
•ABR.
The OSPF network types are designed to give the best routing
results in different topologies. For example, the point-to- point
network type is intended for use in networks with only two routers.
The broadcast network type is designed for use in networks with
multiple routers.
Conclusion You can also use Network types to control which interfaces will
form adjacencies with each other. By default, OSPF will only form
adjacencies with interfaces on the same network type.
Each type of interface on an OSPF router has its own data
structure. So, if you change the network type, OSPF will make the
necessary changes to the hello and dead timer.
We need OSPF network types to help us create a more efficient
and reliable network. By using different types of OSPF networks
in different network topologies, we can better control the overall
design and how data is routed through our network.
• Broadcast
• Point to Point
• Non-Broadcast
• Two more network types are Cisco proprietary.
• Point to Multipoint
• Point to Multipoint Non-Broadcast
• Bonus:-There is also a sixth network type
known as “Virtual links.” We will discuss the
OSPF Virtual Link in the next post.
What is the OSPF Broadcast Network type?
The OSPF broadcast network type is used on networks with multiple OSPF routers connected to a single shared broadcast
medium, such as an Ethernet LAN. For example, the broadcast network is the default network type on Ethernet interfaces.
Broadcast networks are the most common type of OSPF network. They are used when all routers in a network need to be
able to communicate with each other.
Interface Fastethernet0/0
ip OSPF network Broadcast –> You should always use under Interface config, and make sure another side has the same
network type defined.
What are the advantages and disadvantages of the OSPF Broadcast Network type?
Advantages
One of the main advantages of using a broadcast network type is that it’s very easy to configure. You need to specify the
IP addresses with the wildcard mask under the OSPF router configuration of the devices you want to include in the
network, and the OSPF broadcast network type will take care of the rest. It can be a big time saver compared to other
types of network topologies where you have to define each neighbor manually.
It scales well for medium-to-large networks.
It converges quickly after a link or node failure.
Disadvantages
The disadvantage of using an OSPF broadcast network type is that it is more vulnerable to network attacks and can
generate a lot of network traffic.
OSPF P2P network type is Default on T1, DS-3, and SONET links and on frame-relay point-to-point sub-interfaces.
There is no DR/BDR election.
Uses the multicast destination to AllSPFRouters (224.0.0.5), except for retransmitted LSAs, which are sent as unicast.
The IP of the advertising router is the next-hop IP.
On point-to-point links, OSPF doesn’t care if the subnet mask doesn’t match.
The hello interval is 10 seconds, and the dead interval is 40 seconds.
ip OSPF network point-to-point
–> You should always use under What are the advantages and
How to configure OSPF network
Interface Fastethernet0/0 Interface config and make sure disadvantages of the OSPF
type to Point-to-Point
the other side has the same Point-to-Point Network type?
network type defined.
OSPF non-broadcast network type is used on networks with multiple OSPF routers connected by point-
to-point links, such as Frame Relay or ATM virtual circuits. However, they are not widely used these
days as frame-relay, and ATMs are considered to be obsolete technology.
Interface Serial0/0
ip OSPF network non-broadcast –> You should always use under Interface config and make sure the other side has the
same network type defined.
What are the advantages and disadvantages of the OSPF Non-Broadcast Network type?
Advantages:
It can be easier to control traffic flow on the network. It can be helpful, for example, if you want to limit the amount of
traffic that goes through a particular link.
Non-Broadcast network types are more secure since hackers can intercept broadcasts.
Disadvantages:
• It does not choose a DR and BDR, and OSPF packets are sent to all known neighbors
simultaneously using a 224.0.0.5 multicast address.
• The next-hop IP is that of the neighbor who is advertising.
• You only need Layer3 to Layer2 resolution for neighbors that are directly connected.
• Recursive layer 3 IP routing is used for neighbors who are not connected directly.
• The endpoints of point-to-multipoint networks are also advertised as host routes (/32).
• The hello interval is 30 seconds, and the dead interval is 120 seconds.
• Interface Serial0/0
• ip OSPF network point-to-multipoint –> You should always use under Interface config, and make
sure the other side has the same network type defined.
• What are the advantages and disadvantages of the OSPF Point-to-Multipoint Network Type?
• Advantages
• Interface Serial0/0
• Advantages
Conclusion
In conclusion, the five different types of OSPF networks each have their own special configuration requirements and are
used in different scenarios. Therefore, depending on your needs, you must be familiar with all five types of networks to
make the best choices for your network.
OSPF route entries are classified based on their destination type, which can be either “network” or “router.”
Network entries are the addresses of networks that packets can be routed to and are potential candidates for insertion
into the routing table. This information can be seen using the command “show ip route OSPF.”
Router entries are routes to ABRs and ASBRs, which are kept in a separate internal OSPF router table. This information can
be seen using the command “show ip OSPF border-routers.”
1. The longest match:- The longest match is always preferred inside Cisco and almost all vendor devices, no matter what.
2. Most to least preferred path type :
o Intra-Area (O) –> Intra-area routes are local to an area and are always preferred the most.
o Inter-Area (O IA) –> Then comes Inter-area routes, which are routes between two OSPF areas and within the OSPF AS
(Autonomous system).
o External Type 1 (E1) –> Then comes routes to external destination. E1 takes External costs + internal costs both into
consideration.
o NSSA Type 1 (N1) –> Then comes N1.
o External Type 2 (E2) –> Then comes E2, which is also an external route to external destinations. Although, unlike E1, it only
considers external costs to the destination. The default classification for OSPF external routes is E2.
o NSSA Type 2 (N2) –> Then comes N2.
3. Then comes the OSPF cost, and OSPF uses the lowest cost metric to decide the best routes, for example, between two O
IA (Inter-Area routes), unless equal-cost paths exist.
Let us look into the external routes (E1, N1, E2, and N2) in more depth and see how you can use them to manipulate
the OSPF path selection process:-
The E1 and N1 metrics are both cumulative, meaning they consider the ASBR’s advertised cost and the internal OSPF cost
to the ASBR. And that is the reason E1 and N1 are often called ‘metrics that increase hop-by-hop.
On the other hand, the E2 and N2 metrics are static, as advertised by ASBR.
Use the E1 metrics when packets should exit the network at the closest exit point (within your OSPF AS).
Use the E2 metric when packets must exit the network at the closest point to the external destination (Outside your OSPF
AS).
If two or more E2 routes have the same external cost, the internal cost is used as a deciding factor.
How can I modify OSPF Cost to influence OSPF path selection rules?
You can modify the OSPF cost with the following commands :
You can also straight change cost inside an Interface using the “ip OSPF cost”
command.
interface F0/1
ip OSPF cost 10
Note: This command changes the outgoing interface cost for packets, not
incoming.
You can even manipulate the reference bandwidth, which in turn will change the
bandwidth and the cost of the interface.
Use “auto-cost reference-bandwidth” inside the OSPF process to change it.
router OSPF 1
You can enable iSPF inside the OSPF process by:- router OSPF 1
Conclusion
In this article, we’ve looked at the OSPF path selection process and
how you can change some parameters to change the
OSPF paths to a destination network. We have also looked into how
to use iSPF to improve OSPF path computation.
What is OSPF Virtual Link, when to use it, and how to configure it?
An OSPF virtual link is a shortcut that allows an isolated OSPF area to connect to the backbone area 0. The virtual link helps
network administrators extend their OSPF network while maintaining OSPF design requirements. In this article, we will discuss OSPF
virtual link, when you should use it, requirements, key points, and how to configure it. As a bonus, we will also discuss an alternative
option for the OSPF virtual link.
What is a Virtual link in OSPF, and When to use it?
An OSPF virtual link is a connection between two ABRs. The ABR connects the isolated area to the OSPF backbone area 0
through a transit area or a non-backbone area.
This helps administrators extend their OSPF network while maintaining OSPF design requirements.
When to use a Virtual Link in Your Network?
There are several scenarios where you may want to use a virtual link in your network. The following are some examples:
To configure a Virtual link in OSPF, you must meet the following requirements:
Must be configured between two ABRs, of which one must be connected to area 0.
The transit area may not be a stub area and must have full routing information.
The virtual link will transition to the fully functional point-to-point interface state when a route to the neighboring ABR is
found in the routing table.
The maximum path cost in the transit area should not exceed 65535; else, the virtual link will not come up.
To see the cost of using the transit area, “show ip OSPF virtual-link” and refer to ‘cost of using.
There are several key points to consider when configuring a Virtual link:
router OSPF 1
area (transit-area) virtual-link (ABR-Router-ID) —> You need a similar command on the other ABR as well.
One of the major drawbacks of OSPF Virtual links is that OSPF virtual links cannot transit stub areas. If a virtual link over a stub area is
required, then a GRE tunnel between ABRs is the only viable option.
OSPF over GRE works similarly to OSPF Virtual links. You have to make sure that the tunnel interface’s IP address must be
advertised in area 0 and have a network statement in area 0.
Conclusion
In a nutshell, through OSPF virtual link, you connect an isolated OSPF area to the OSPF backbone area 0, and you must configure
Virtual links on Area Border Routers.
Now that you have learned about the OSPF Virtual Link and its functionality, you are ready to begin configuring an OSPF Virtual link.
In summary, there are three main steps:
Step 2: Identify appropriate ABRs and make sure the above requirements are met. Step 3: Configure
under the OSPF process using the above command on both ABRs.
I have divided the troubleshooting method into use case basis. I would advise you to start/check with the basics as
explained in use-case 1 and then check for more complex scenarios as explained in later use cases.
The commands mentioned in this article have been tested on Cisco devices. Still, once you understand the concept and
troubleshooting method, you can diagnose and solve OSPF issues on any vendor equipment.
For easiness, I have presented the commands in table form so that you can print them out and use them as an OSPF
cheatsheet.
1. Use case 1 – When looking at the configuration of a single router, think about the following:
2. Use case 2 – When analyzing a huge OSPF area-wide problem, check the design
3. Use Case 3 – When checking OSPF neighbor adjacencies, look at the following things:
4. Use Case 4 – When trying to fix problems with authentication, think about the following:
5. Use Case 5 – Troubleshooting LSDB (Link state Database) related problems in OSPF:
Use case 1 – When looking at the configuration of a single router, think about the
following:
Are all the needed interfaces in a state of UP, UP (not admin show ip int brief
shut)?
Have the IP addresses and corresponding subnet masks for
show int | include Inter | line
all the interfaces been set up correctly?
What to Check Commands to use
Check if network area statements under OSPF and IP show int | include Inter|line|network
addresses for the interfaces match up.
Are the inverse or wildcard masks in the network area show ip ospf int brief
statements under OSPF correct and match with the OSPF
Interfaces subnet mask?
Do the network area statements put the interfaces in the right show ip ospf int brief
areas?
Because of the “passive-interface default global statement,” show ip ospf int | i line | Hello
are there any OSPF interfaces that should not be in passive
mode?
Does every router have the right OSPF Router ID? Are show ip ospf | inc ID
there duplicates on the network?
If address summarization is set up, is it applied to the right show run | i area range | summary-add
areas?
Use case 2 – When analyzing a huge OSPF area-wide problem, check the design:
Check if OSPF area 0 (backbone area) is contiguous, it No Commands; check the existing design and
must not be segregated. diagrams. If required, validate existing documents.
Check if all OSPF areas are connected to the backbone
area. Even if you use virtual links or GRE tunnels, ensure No Commands; check the existing design and
all areas connect to OSPF area 0. diagrams. If required, validate existing documents.
Check if all routers in an area are configured with the No Commands; check the existing design and
same area types (Normal, stub, NSSA, etc.) diagrams. If required, validate existing documents.
Are ABRs configured with the correct role for Totally
Stub and Totally NSSA areas? For example, you must
configure an ABR with the “area stub no-summary” show run | section ospf
command for a totally stubby area.
What to Check Commands to use
Does the OSPF domain have an external LSA? show ip OSPF database external
Check if the forwarding address is known as an OSPF internal sh ip route [forwarding address ip]
route.
Are you able to reach the forwarding address? ping [forwarding address ip]
Use Case 3 – When checking OSPF neighbor adjacencies, look at the following
things:
What to Check Commands to use
Always log the neighbor adjacency changes while troubleshooting. OSPF log-adjacency-changes
Check layer 2 ( mac addresses, ARP, etc.) and Layer3 ping [neighbor ip address]
reachability (ping, routes, etc.)
Are both OSPF neighbors sending and getting hellos from each debug ip OSPF hello show ip OSPF int brief
other?
– If hellos are not exchanged, check the network statements and
interface
What to Check Commands to use
addresses.
– Check the passive-interface default config or if any OSPF show run | inc passive
interface has been put in passive mode accidentally.
-If you are using different OSPF network types, are they compatible? show ip ospf int | i line |Type
-Neighbors’ hello/dead interval should match. show ip OSPF int | i line | Dead
-Optional capability value should match between neighbors. show ip OSPF neighbor detail | include Option
-Interfaces must be configured on the same subnet. P2p links show ip ospf int brief
are an exception.
-Is a router trying to form a neighbor to another router’s sh run | i netw | area
secondary IP address?
-Is OSPF protocol 89 being blocked by any access lists? sh ip interface | i line | list
In the case of the layer2/3 switch, are the MTUs compatible/match? debug ip ospf adj
Debug if you think the neighbors are unstable or have no other choice. debug ip ospf adj
Use Case 4 – When trying to fix problems with authentication, think about the
following:
What to Check Commands to use
Check authentication type (plain/md5) between OSPF neighbors. It show ip ospf int {int} | i auth | line
must be of the same type.
What to Check Commands to use
With clear-text authentication, are the passwords for show run | i auth . *key
neighboring interfaces the same?
Are the digest keys for MD5 authentication the same show run | i digest-key
between neighboring interfaces?
Debug adjacency to find out why authentication failed. debug ip ospf adj
Check if the local router is generating the expected LSAs. show ip ospf database self-originate
Check if the local router is receiving the expected show ip ospf database adv-router [ip address]
LSAs from a neighbor.
Check if any filters are configured to deny LSAs before show run | i filter-list
entering an area. For example, ABRs are configured to
filter type-3 LSAs.
Check if any distribute list is configured to deny entry in the show run | i distribute-list
local RIB (Routing Information Base).
Is summarization the reason why LSAs aren’t seen? show run | i area range | summary-add
Do all the routers in a certain area have the same number of show ip ospf database database-summary
LSAs? – show run | i database-filter
– If not, do any interfaces prevent LSAs from being sent out?
Do the checksums for every LSA in each router’s database show ip ospf database
match?
What to Check Commands to use
Are there many SPF calculations? Check if this is the cause. show ip ospf statistics
Check the memory and CPU utilization of a router. Check recent sh process CPU history
alarms on your monitoring software.
I will be adding the OSPF troubleshooting cheat sheet for download soon.
Conclusion
So, the next time you’re facing an OSPF problem or you need to verify that an OSPF configuration works, pull out this
cheat sheet for a quick reference on the most common OSPF commands. If you find the cheat sheet helpful, share it with
your network engineer and CCIE buddies, too!
1. What is OSPF Authentication, Why should you always use it, and How do you Configure and troubleshoot it?
o What is OSPF authentication?
o Why use OSPF authentication?
o OSPF Authentication Key Points:-
o Which type of authentication is used by the OSPF protocol?
o How does OSPF authentication work?
o How to configure ospf authentication in a cisco router
o How to check ospf authentication
o OSPF Authentication Troubleshooting
o Conclusion
o FAQs:
I would recommend you go through these posts to grasp a solid understanding of OSPF.
OSPF authentication can also help improve performance by making sure that only approved devices can connect to the
network. This can help reduce traffic and improve overall performance.
One of the key features of OSPF is that it supports authentication. This means each router can verify the identity of the
other routers it communicates with. Two types of authentication can be used with OSPF: simple password authentication
and MD5 authentication.
OSPF plain text authentication (Type 1) is the most basic form. With this method, each router has a clear-text password
configured that it uses to authenticate with other routers. The problem with this authentication method is that the
password is shown in the configuration and in OSPF messages. This is not a secure way to configure devices.
OSPF MD5 authentication (Type-2) is more secure than simple text authentication. This approach computes a hash value
from the contents of an OSPF packet and a password using the MD5 algorithm (or key). This hash value is delivered
alongside a key ID and a non-decreasing sequence number in the packet.
Step-1
You can enable OSPF authentication area-wide by using the below commands. Then, as mentioned in Step 2, you must
configure a clear-text password OR message digest key under an OSPF-enabled interface.
router OSPF 1
Interface Gig0/1
ip ospf authentication-key password –> Make sure the password/key should match between two neighbors.
For Type-2 – Md5 Authentication
Interface Gig0/1
ip ospf message-digest-key 1 md5 password –> Key should always match between neighbors.
Do all routers in a certain OSPF area have authentication show ip ospf | i Area
configured?
The authentication types (Type 0, 1, 2) between OSPF neighbors show ip ospf int {int} | i auth | line
must match.
Do the passwords for neighboring interfaces match when show run | i auth . *key
using clear-text authentication?
Do the MD5 authentication digest keys match between two show run | i digest-key
neighboring interfaces?
Do all the virtual links have authentication set up?
Note: If authentication is set up for Area 0, then authentication is show run | i virtual-link
also needed for virtual links.
Use the debug OSPF adjacency command to find out why debug ip ospf adj
authentication failed.
Conclusion
As we’ve seen, OSPF authentication is well worth the effort that goes into configuring it. Not only does it mitigate a
number of well-known security threats, but it’s also easy to set up and simple to troubleshoot. Unfortunately, the
networking world has been suffering from a lack of security for too long; with OSPF authentication, you can do your part
to reverse this trend.
It simply means that we can manipulate any one of the three parameters to
adjust our OSPF cost.
First of all we can apply the OSPF cost straight by the “ip ospf cost [1-65535]”
to the particular interface.Example:-
R1#conf t
R1(conf)#interface Serial0/0
R1(conf-if)#ip ospf cost 20
Second way to accomplish this by changing the Reference Bandwidth and this is done
under OSPF process:-
R1(conf)#router ospf 1
R1(config-router)#auto-cost reference bandwidth 20000
NOTE:-Whenever you change Reference Bandwidth make sure it should be same across
all routers in your OSPF domain,also the router will prompt for this:-
Rack1R1(config-router)#auto-cost reference-bandwidth ?
<1-4294967> The reference bandwidth in terms of Mbits per second
So thus using the default value and your network has interfaces with the bandwidth
greater than 100 million is not recommended,the reason is simple because OSPF
cannot differentiate between 100 mbps interface and an interface greater than
100 mbps,as in the above example “ip ospf cost”command enables you to change the
OSPF cost for an interface,but the better way to do this is to change the default
reference value.But always change the default behaviour of any protocol with
caution, so here in our scenario we need to change the default Reference cost in
every OSPF router in our routing domain.
The third way is also simple as here we need to manipulate the interface bandwidth,
to get our desired OSPF cost,it is simply done by the command:-
R1(conf)#interface Serial 0/0
R1(conf-if)#bandwidth [the numerical value]
E1(2048)=48
Ethernet=10
Fast Ethernet=1
Gig Ethernet=1
10 Gig Ethernet=1