OSPF Dynamic Routing · Topic 1 of 8
What OSPF Is, Hello Protocol and LSAs
Learn what OSPF is, how the Hello protocol finds neighbours, how the link state database is shared, and what each LSA type carries in RouterOS.
- 5 min
- OSPF is a link state protocol that runs over IP protocol 89.
- Routers exchange LSAs and each runs SPF on the same database.
- Hello packets use 224.0.0.5, and the designated routers use 224.0.0.6.
What it is
OSPF is a link state routing protocol where every router builds the same map of the network and calculates its own routes.
Unlike distance vector protocols, OSPF routers do not trade routing tables. They trade descriptions of links, called link state advertisements, or LSAs. Each router collects the LSAs into a database and runs a shortest path calculation on it.
OSPF runs directly over IP as protocol 89. It uses multicast for most traffic, and it converges quickly after a change.
How it works
Routers meet through Hello packets, exchange their databases, and then keep them in step with updates.
The Hello protocol
Each router sends Hello packets on its OSPF interfaces. A Hello carries the router ID, the area, the Hello and dead intervals, and a list of neighbours it has already seen.
Two routers become neighbours only when key settings match. The area, the Hello interval and the dead interval must agree, and any authentication must also match.
A neighbour is declared down if no Hello arrives within the dead interval. RouterOS uses 10 seconds for the Hello interval and 40 seconds for the dead interval on broadcast and point to point links.
Hellos go to the multicast address 224.0.0.5, which means all OSPF routers. The address 224.0.0.6 is for the designated routers.
Database distribution
After the Hello exchange, neighbours swap summaries of their databases, ask for the LSAs they miss, and receive them in update packets. Each received LSA is acknowledged.
When the neighbours hold the same database, they are fully adjacent. From then on, a change is flooded as a new LSA, and every router in the area updates its copy.
LSAs also age. Each router re-floods its own LSAs about every 30 minutes, and an LSA that is not refreshed is removed after about an hour.
The five packet types
| Packet | Purpose |
|---|---|
| Hello | Find neighbours and keep them alive |
| Database description | Summarise the database |
| Link state request | Ask for missing LSAs |
| Link state update | Carry LSAs |
| Link state acknowledgement | Confirm receipt |
LSA types
Each LSA type describes a different part of the network, and has a different flooding scope.
| Type | Name | Created by | Flooded in |
|---|---|---|---|
| 1 | Router LSA | Every router | Its own area |
| 2 | Network LSA | The designated router | Its own area |
| 3 | Summary LSA | Area border router | Other areas |
| 4 | ASBR summary LSA | Area border router | Other areas |
| 5 | AS external LSA | AS boundary router | Whole domain, except stub areas |
| 7 | NSSA external LSA | AS boundary router in an NSSA | That NSSA only |
A router LSA lists the links of one router and their costs. A network LSA lists the routers on a multi access segment.
A summary LSA advertises a network from one area into another. An external LSA advertises a route that came from outside OSPF.
Basic RouterOS configuration
In RouterOS v6, an instance, an area and a network statement start OSPF. The backbone area exists by default.
/routing ospf instance set [find default=yes] router-id=1.1.1.1
/routing ospf network add network=10.0.0.0/24 area=backbone
The network statement selects the interfaces that run OSPF and the networks that are advertised. In RouterOS v7, the menus changed. You create an instance, an area, and an interface template that names the networks.
/routing ospf instance add name=default version=2 router-id=1.1.1.1
/routing ospf area add name=backbone area-id=0.0.0.0 instance=default
/routing ospf interface-template add area=backbone networks=10.0.0.0/24
Set the router ID by hand. A stable address on a loopback style bridge is a good choice, because it does not go down with a link.
Verifying
/routing ospf neighbor print
/routing ospf lsa print
/ip route print
If two routers never reach Full, check that the area, the intervals and the authentication match on both sides.
What to remember for the exam
Eight facts cover most questions on this topic.
- OSPF is a link state protocol that runs over IP protocol 89.
- Routers exchange LSAs and each runs SPF on the same database.
- Hello packets use 224.0.0.5, and the designated routers use 224.0.0.6.
- Area, Hello interval, dead interval and authentication must match.
- The RouterOS defaults are a Hello interval of 10 seconds and a dead interval of 40 seconds.
- LSA type 1 is router, 2 network, 3 summary, 4 ASBR summary, 5 external and 7 NSSA external.
- Types 1 and 2 stay inside one area.
- Set the router ID manually.
In v6 the network statement decides both which interfaces run OSPF and which networks are advertised. A missing statement means no adjacency.
Common mistakes
These four errors appear often.
Mismatched timers or area. The Hello arrives, but the neighbour is rejected, and the adjacency never forms.
Leaving the router ID to chance. It can change when addresses change, and then the databases show a router that appears to vanish.
Confusing LSA scopes. Types 1 and 2 never leave their area, and types 3 and 4 are created by area border routers.
Expecting OSPF to exchange routing tables. It exchanges link descriptions, and each router calculates the routes itself.
Check yourself
Work through these three questions.
Which settings must match for two routers to become OSPF neighbours?
The area, the Hello interval, the dead interval and any authentication must match. A mismatch stops the adjacency.
What do LSA types 1, 2 and 3 describe?
Type 1 describes the links of a router, type 2 describes a multi access segment, and type 3 summarises a network into another area.
What is the difference between OSPF and a distance vector protocol?
OSPF routers exchange link descriptions and each builds the same database. Each router then runs SPF on that database to calculate its own routes.
Topic 1 of 8 in OSPF Dynamic Routing
Test yourself on OSPF Dynamic Routing
The full MikroTik MTCRE question bank has 417 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.