Featured Posts

CCIE-Journals

CCIE-Journals
From Student to Engineer,a journey of discovery.

OSPF Cheat sheet

 OSPF Cheat Sheet


OSPF (Open Shortest Path First) is a popular routing protocol used in many large enterprise networks. This protocol is designed to distribute routing information within a single autonomous system (AS) in a scalable and efficient manner. OSPF is a classless routing protocol, which means that it supports variable-length subnet masks (VLSMs), route summarization, and hierarchical network design. In this article, we'll provide a cheat sheet for OSPF that covers the most important concepts and components of the protocol.


OSPF Headers:

OSPF packets contain several different headers that provide information about the packet's origin, destination, and contents. Some of the key headers used in OSPF packets include:

OSPF header: Provides information about the packet's length, type, and the source of the packet.

LSA header: Provides information about the type and length of the LSA (Link State Advertisement) being carried by the packet.

Router ID header: Specifies the unique identifier of the router that originated the packet.


Packet Type:

OSPF packets are categorized into several different types, each of which serves a specific purpose. Some of the most important types of OSPF packets include:

Hello packets: Used to establish and maintain adjacencies between OSPF routers.

Database Description (DBD) packets: Used to exchange information about the contents of the OSPF link-state database between routers.

Link-State Request (LSR) packets: Used to request specific LSAs from other routers.

Link-State Update (LSU) packets: Used to distribute LSAs to other routers.


Algorithm:

OSPF uses the Dijkstra algorithm to calculate the shortest path to each destination network. This algorithm considers the cost of each link in the network, as well as the available bandwidth, to determine the most efficient path.


Metric:

The metric used by OSPF to determine the cost of a link is referred to as the OSPF Cost. This value is calculated based on the bandwidth of the link and is used by the Dijkstra algorithm to determine the shortest path to each destination network.

AD:

The Administrative Distance (AD) is a value that specifies the trustworthiness of a routing protocol. In OSPF, the AD is set to 110, which is lower than most other routing protocols and indicates that OSPF is a highly reliable protocol.


Standard:

OSPF is an Internet Engineering Task Force (IETF) standard, which means that it is widely supported and standardized across the industry. This makes OSPF an attractive option for large enterprises that require a scalable and reliable routing protocol.


Multicast Addresses Used by OSPF:

OSPF uses several different multicast addresses to send and receive information between routers. Some of the most important multicast addresses used by OSPF include:

All OSPF routers: 224.0.0.5

Designated Router (DR): 224.0.0.6

Backup Designated Router (BDR): 224.0.0.5


LSA Types:

LSAs are the building blocks of the OSPF link-state database. There are several different types of LSAs, each of which provides information about different aspects of the network. Some of the most important LSA types include:

Router LSA: Provides information about the interfaces and neighbors of a router.

Network LSA: Provides information about the routers attached to a network.

Summary LSA: Provides information about the routes summarized by an area border router.

External LSA: Provides information about routes that are external to the OSPF AS.

Type 7 LSA: Used in Not-So-Stubby Areas (NSSA) to propagate external routes into the area.


OSPF Metric Formula:

The OSPF metric is calculated using the following formula:

Cost = Reference Bandwidth / Bandwidth of the Interface

The reference bandwidth is set to 100 Mbps by default, but can be changed if needed.


OSPF Neighbor States:

OSPF routers use Hello packets to establish and maintain adjacencies with their neighbors. There are several different states that a neighbor relationship can be in, including:

Down: The neighbor relationship has not yet been established.

Init: The router has received a Hello packet from the neighbor, but has not yet sent a Hello packet in response.

2-Way: The router has received a Hello packet from the neighbor and has sent a Hello packet in response.

Exstart: The router and its neighbor are in the process of negotiating the contents of the DBD packets.

Exchange: The router and its neighbor are exchanging DBD packets to build their link-state databases.

Loading: The router is in the process of calculating its routing table based on the information in its link-state database.

Full: The router has completed the process of calculating its routing table and is fully adjacent with its neighbor.


DR/BDR Election:

In OSPF, a Designated Router (DR) and a Backup Designated Router (BDR) are elected for each broadcast network. The DR is responsible for generating and distributing LSAs, while the BDR serves as a backup in case the DR fails. The election of the DR and BDR is based on the router ID, with the highest router ID being elected as the DR and the second highest being elected as the BDR.


External Route Types:

In OSPF, there are two different types of external routes: Type 1 and Type 2. Type 1 external routes have a higher metric than Type 2 external routes, making Type 2 routes preferred by default. The choice between Type 1 and Type 2 can be controlled using route-maps or other means.


OSPF Virtual Link:

A virtual link is a logical connection between two areas that allows for communication between routers that are not directly connected. Virtual links are used to connect a stub area to the rest of the OSPF AS when a physical connection is not possible.


Types of Routes Allowed in Each OSPF Area:

In OSPF, each area has its own separate link-state database and operates independently of other areas. However, there are restrictions on the types of routes that can be allowed in each area. Some areas, such as the backbone area, can contain both intra-area and inter-area routes, while others, such as stub areas, can only contain intra-area routes.


Here is a basic example of how to configure OSPF on a Cisco router:

Router(config)# router ospf [process-id]
Router(config-router)# network [network-number] [wildcard-mask] area [area-number]
Router(config-router)# passive-interface default
Router(config-router)# no passive-interface [interface-name]
Router(config-router)# end


Basic Troubleshooting Steps to Configure OSPF:


Verify the OSPF configuration on all routers in the network, including process ID, network number, wildcard mask, and area number.
Verify that the correct interfaces are being included in the OSPF process.
Check the status of the OSPF adjacencies using the show ip ospf neighbor command.
Use the show ip ospf database command to check the contents of the link-state database.
Check for errors in the OSPF logs using the show logging command.
Verify that the correct OSPF hello and dead intervals are set for each interface.
Ensure that the OSPF router ID is unique for each router in the network.
If you are experiencing slow convergence, check the SPF timers and adjust if necessary.
If virtual links are being used, verify that the correct configuration has been applied to both ends of the virtual link.
Check for any Access Control List (ACL) or firewall rules that may be blocking OSPF packets.
If the OSPF is struck in Exstart state , Check the MTU mismatch between both neighbors


0 comments:

Post a Comment