(OPEN SHORTEST PATH FIRST)
- OSPF is a classless routing protocol
- converge network faster
- It’s an IGP protocol
- open standard
- Network Changes in OSPF are propagated quickly
- Area 0 is reserved for backbone area
- OSPF is a link-state protocol
- OSPF supports VLSM(variable length subnet mask)
- OSPF uses multicasting in areas
- It supports route-summarization
- OSPF is a very processor intensive
- OSPF maintain multIPle copies of routing information which increase the memory usage
- Priority in OSPF is used in selecting DR, BDR, DR OTHERS by default this value is 1.
- To send hello packets OSPF uses multicast address 126.96.36.199
- To send routing information OSPF uses multicast address 188.8.131.52.6
- OSPF uses path cost as its basic routing metric
- Stub areas can’t include a virtual link.
- Stub areas can’t include an ASBR.
- Stubbiness must be configured on all routers in the area.
- It uses Dijkstra’s SPF algorithm to select routes
OSPF ROUTER ID:
There are three ways to configure router-id in OSPF:
Highest physical IP address
If no virtual link is available then the highest physical IP will act as the router-id
If one virtual interface is available then router will not concern with physical IP that virtual IP will act as router-id. But if two loopback address are available then the highest virtual IP will won the election and will act as router-id
If we want any IP to be act as router-id may that IP exist or not in the network then we hard coat that IP address before running OSPF
NOTE: If router-id is selected once that could not change until router restart or DR/BDR are not refreshed.
There are seven router types in OSPF
The router having all its interfaces in one area called internal router
Router having all its interfaces in backbone area means area 0 called backbone router
AREA BORDER ROUTER(ABR)
A router with connects area 0 with other areas called ABR
Autonomous system border router(ASBR)
A router which connects two different autonomous system called ASBR
The router having highest priority no become DR
DR is elected on the following bases:
- If the priority setting on an OSPF router is set to 0, that means it can NEVER become a DR or BDR (Backup Designated Router).
- When a DR fails and the BDR takes over, there is another election to see who the replacement BDR becomes.
- The router sending the Hello packets with the highest priority wins the election.
- If two or more routers tie with the highest priority setting, the router sending the Hello with the highest RID (Router ID) wins. NOTE: a RID is the highest logical (loopback) IP address configured on a router, if no logical/loopback IP address is set then the Router uses the highest IP address configured on its active interfaces. (e.g. 192.168.0.1 would be higher than 10.1.1.2).
- Usually the router with the second highest priority number becomes the BDR.
- The priority values range between 0 – 255 with a higher value increasing its chances of becoming DR or BDR.
- IF a HIGHER priority OSPF router comes online AFTER the election has taken place, it will not become DR or BDR until (at least) the DR and BDR fail.
- If the current DR ‘goes down’ the current BDR becomes the new DR and a new election takes place to find another BDR. If the new DR then ‘goes down’ and the original DR is now available, it then becomes DR again, but no change is made to the current BDR.
BDR(backup designated router):
The router having 2nd highest priority no becomes the BDR.it is used when the DR is failed due to any reason
All remaining routers after selecting DR and BDR becomes DR OTHER’s
OSPF Message Types:
Unlike RIP, OSPF does not send its information using the User Datagram Protocol (UDP). Instead, OSPF forms IP datagrams directly, packaging them using protocol number 89 for the IP Protocol field. OSPF defines five different message types, for various types of communication:
As the name suggests, these messages are used as a form of greeting, to allow a router to discover other adjacent routers on its local links and networks. The messages establish relationships between neighboring devices (called adjacencies) and communicate key parameters about how OSPF is to be used in the autonomous system or area.
These messages contain descriptions of the topology of the AS or area. That is, they convey the contents of the link-state database for the autonomous system or area from one router to another. Communicating a large LSDB may require several messages to be sent; this is done by having the sending device designated as a master device and sending messages in sequence, with the slave (recipient of the LSDB information) responding with acknowledgements.
Link State Request:
These messages are used by one router to request updated information about a portion of the LSDB from another router. The message specifies exactly which link(s) about which the requesting device wants more current information.
Link State Update:
These messages contain updated information about the state of certain links on the LSDB. They are sent in response to a Link State Request message, and also broadcast or multicast by routers on a regular basis. Their contents are used to update the information in the LSDBs of routers that receive them.
Link State Acknowledgment:
These messages provide reliability to the link-state exchange process, by explicitly acknowledging receipt of a Link State Update message. Signature: These notes are belongs to INECert.com
OSPF NEIGHBORE STATES:
This is the first OSPF neighbor state. It means that no information (hellos) has been received from this neighbor, but hello packets can still be sent to the neighbor in this state.
During the fully adjacent neighbor state, if a router doesn’t receive hello packet from a neighbor within the Router Dead Interval time (Router Dead Interval = 4*Hello Interval by default) or if the manually configured neighbor is being removed from the configuration, then the neighbor state changes from Full to Down.
This state is only valid for manually configured neighbors in an NBMA environment. In Attempt state, the router sends unicast hello packets every poll interval to the neighbor, from which hellos have not been received within the dead interval.
This state specifies that the router has received a hello packet from its neighbor, but the receiving router’s ID was not included in the hello packet. When a router receives a hello packet from a neighbor, it should list the sender’s router ID in its hello packet as an acknowledgment that it received a valid hello packet.
This state designates that bi-directional communication has been established between two routers. Bi-directional means that each router has seen the other’s hello packet. This state is attained when the router receiving the hello packet sees its own Router ID within the received hello packet’s neighbor field. At this state, a router decides whether to become adjacent with this neighbor. On broadcast media and non-broadcast multi-access networks, a router becomes full only with the designated router (DR) and the backup designated router (BDR); it stays in the 2-way state with all other neighbors. On Point-to-point and Point-to-multipoint networks, a router becomes full with all connected routers.
At the end of this stage, the DR and BDR for broadcast and non-broadcast multi-access networks are elected. For more information on the DR election process, refer to DR Election.
Note: Receiving a Database Description (DBD) packet from a neighbor in the init state will also a cause a transition to 2-way state.
Once the DR and BDR are elected, the actual process of exchanging link state information can start between the routers and their DR and BDR.
In this state, the routers and their DR and BDR establish a master-slave relationship and choose the initial sequence number for adjacency formation. The router with the higher router ID becomes the master and starts the exchange, and as such, is the only router that can increment the sequence number. Note that one would logically conclude that the DR/BDR with the highest router ID will become the master during this process of master-slave relation. Remember that the DR/BDR election might be purely by virtue of a higher priority configured on the router instead of highest router ID. Thus, it is possible that a DR plays the role of slave. And also note that master/slave election is on a per-neighbor basis.
In the exchange state, OSPF routers exchange database descriptor (DBD) packets. Database descriptors contain link-state advertisement (LSA) headers only and describe the contents of the entire link-state database. Each DBD packet has a sequence number which can be incremented only by master which is explicitly acknowledged by slave. Routers also send link-state request packets and link-state update packets (which contain the entire LSA) in this state. The contents of the DBD received are compared to the information contained in the routers link-state database to check if new or more current link-state information is available with the neighbor.
In this state, the actual exchange of link state information occurs. Based on the information provided by the DBDs, routers send link-state request packets. The neighbor then provides the requested link-state information in link-state update packets. During the adjacency, if a router receives an outdated or missing LSA, it requests that LSA by sending a link-state request packet. All link-state update packets are acknowledged.
In this state, routers are fully adjacent with each other. All the router and network LSAs are exchanged and the routers’ databases are fully synchronize
COMMON HEADER FORMAT:-
Table 126: OSPF Common Header Format
|Version Number: Set to 2 for OSPF version 2.|
|Packet Length: The length of the message, in bytes, including the 24 bytes of this header.|
|Router ID: The ID of the router that generated this message (generally its IP address on the interface over which the message was sent).|
|Area ID: An identification of the OSPF area to which this message belongs, when areas are used.|
|Checksum: A 16-bit checksum computed in a manner similar to a standard IP checksum. The entire message is included in the calculation except the Authentication field.|
|Authentication: A 64-bit field used for authentication of the message, as needed.|
OSPF AREA TYPE’S:
v Stub area
Stub area does not allow LSA5 routes and as well as it also blocks LS4 but full information is kept by the ABR but it propagate a default route and there is no ASBR
v Totally stubby area
In this area LSA 3,4,5 are also blocked with this command on the ABR
Area 1 stub no-summary
v Not-so-stubby area
This area works like stub it does not receive LSA5 information but it can send LS5 advertisement
v TOTALLY NSSA:
This area works like totally stubby area, an addition the standard functionality of an NSSA, called a NSSA totally stubby area. It takes on the attributes of a TSA, meaning that type 3 and type 4 summary routes are not flooded into this type of area
A transit area is an area with two or more OSPF border routers and is used to pass network traffic from one adjacent area to another. The transit area does not originate this traffic and is not the destination of such traffic.
TIMERS OF OSPF SHOULD BE SAME TO ESTABLISH A NEIGHBOURSHIP.
ü NON-BROADCAST:(OVER FRAMERELAY)
If we run OSPF over frame relay then the network by default work as non-broadcast. In non-broadcast network neighbor ship is established manually and DR/BDR elected
Hello time is 30 sec and dead is 120sec
ü BROADCAST:(OVER ETHERNET)
In broadcast network DR/BDR are elected and neighbor ship is established dynamically, it is running on Ethernet by default.
Hello time is 10 sec and dead is 40sec
ü PPP network:-(OVER serial PPP/HDLC):
No DR/BDR are elected but it establish dynamic neighbor ship
Hello time is 10sec and dead is 40 sec
No DR/BDR are elected but it establish dynamic neighbor ship
Hello time is 30sec dead is 120sec
ü POINT-TO-MULTIPOINT non-broadcast:
No DR/BDR are elected and neighbor ship is established manually
Hello time is 30sec and dead is120 sec
We use route-maps for policies implementation or to use attributes or to set a condition for routes If we have used set feature we should then install an empty route so that other routes are allowed by default
OSPF ROUTE SUMMARIZATION:
v SUMMARY ON ASBR:
Summary address yy.yy.xx.xx mask 255.255.255.0
v SUMMARY ON ABR:
Area 0 range xx.yy.yy.xx 255.0.0.0
We must create summary-address on all ABR’s so that they can propagate in all their areas
v DISTRIBUTE LIST:
It blocks LSA2 filtration but it cannot block on area routes, it can only filter routing table but could not filter database of OSPF, if ABR is stopping route’s and also connected to area 0 then it will not put that route in its routing table but it will advertise it towards next router
v FILTER LIST:
Filter list is used to filter database and it can be apply in both directions
SUMMARY-ADDRESS YY.XX.XX.YY NOT ADVERTISE
We create GRE tunnel where we are not allowed to create virtual links such as in stub areas there is no need to include in between routers in this tunnel as in virtual links
CCIE OSPF TROUBLESHOOTING:
1) Incorrect mask
Debug IP OSPF hello
2) Timers mismatch
Debug IP OSPF events
3) DUPLICATE Router ID
4) STUB/WRONG AS
DEBUG IP OSPF PACKETS
6) MTU SIZE
By default MTU size on router interface is 1500 and on switch interfaces are 1504
7) OSPF Network Type miss match
8) Filter list issues
9) Network not advertised
10) Virtual link not available for non-directly connected Areas