OSPF is
| Examples | ||
|---|---|---|
| Link state protocol | OSPF | Faster, Better routes |
| Distance vector protocol | RIP | Slower |
The router ID
The selection criteria for the router ID is
[!tip] Best practice Manually configure the router ID and a loopback interface with the same address. Enable OSPF on the loopback interface.
OSPF routers exchange hello LSAs periodically on OSPF-enabled interfaces.
The hello message is addressed to 224.0.0.5 (all OSPF routers) and contains information to establish a adjacency with other OSPF routers.
Data in the LSAs exchanged between two OSPF routers has to match or routers remain in the INIT state.

| OSPF router type | Advertised LSA types | Adjacency |
|---|---|---|
| DR | Type 2, LSU to 224.0.0.5 | With all other routers |
| BDR | LSU to DR | With all other routers |
| DROTHER | LSU to 224.0.0.6 | With DR and BDR |
Multi-area OSPF divides the OSPF system into multiple areas for
Multi-area OSPF uses a two-tiered hierarchy to scale:
OSPF router that connect a non-backbone areas to the backbone area are ABR (Area Border Router) and maintain LSDB for both areas.
ASBR (Autonomous System Broder Router) connect to an external network and redistribute routes into the OSPF system.

| Type | Name | Advertised by | Scope | Included information |
|---|---|---|---|---|
| 1 | Router | All routers | Area | Links (ID, type, metric) |
| 2 | Network | DR for broadcast networks | Area | DR IP, network mask, IDs of routers on the network |
| 3 | Summary | ABRs | Area | Network in another area (network IP, mask, metric) |
| 4 | ASBR | ABRs | Area | ASBR router ID and metric |
| 5 | AS external | ASBRs | All normal areas in the AS | External network, mask, metric, metric type |
| 7 | NSSA external | ASBRs | Area | External network, mask, metric, metric type |
| 9 | Opaque link local | All capable OSPF routers | Link | Extensions (graceful restart) |
| 10 | Opaque area-local | All capable OSPF routers | Area | Extensions (traffic engineering) |
| 11 | Opaque AS | Capable ASBRs | Non-stub areas | Extensions |
LSA type 1 is advertised by all routers and local to the area the router is part of. This LSA contains information of all directly connected routes.
LSA type 2 is advertised by the DR on a segment. The DR advertises its connected subnets.
LSA type 3 are generated by ABRs to summarize
[!tip] Best practice: Route summarization on ABR Route summarization reduces the amount of LSUs and SPF recalculation by aggregating routes. The ABR advertises a few type 3 LSAs instead of one type 3 LSA for every network in an area.
LSA type 4 are generated by the ABR to advertise the presence of an ASBR.
LSA type 5 are generated by the ASBR to advertise external redistributed routes into the OSPF system.
router ospf <PROCESS_ID>router-id <ROUTER_ID>area <AREA>ip ospf area <AREA>ip ospf network <NETWORK-TYPE>