- Classless – It is classless by design; therefore, it supports VLSM and CIDR.
- Efficient – Routing changes trigger routing updates (no periodic updates). It uses the SPF algorithm to choose the best path.
- Fast convergence – It quickly propagates network changes.
- Scalable – It works well in small and large network sizes. Routers can be grouped into areas to support a hierarchical system.
- Secure – It supports Message Digest 5 (MD5) authentication. When enabled, OSPF routers only accept encrypted routing updates from peers with the same pre-shared password.
Single and Multi area
- Single-Area OSPF – All routers are in one area called the backbone area (area 0).
- Multiarea OSPF – OSPF is implemented using multiple areas, in a hierarchal fashion. All areas must connect to the backbone area (area 0). Routers interconnecting the areas are referred to as Area Border Routers (ABR). With multiarea OSPF, OSPF can divide one large autonomous system (AS) into smaller areas. The advantages are:
- Smaller routing tables – Fewer routing table entries because network addresses can be summarized between areas. Route summarization is not enabled by default.
- Reduced link-state update overhead – Minimizes processing and memory requirements.
- Reduced frequency of SPF calculations .
OSPF creates and maintains three databases:
- Adjacency database – Creates the neighbor table, list all neighbor routers, it is unique for each router. Use
show ip ospf neighborcommand to check.
- Link-state database (LSDB) – Creates the topology table, list information about all other routers in the network, LSDB represents the network topology. All routers within an area have identical LSDB. Can be viewed by
show ip ospf databasecommand.
- Forwarding database – Creates the routing table, list of routes generated by the running algorithm, each router’s routing table is unique and contains information on how and where to send packets to other routers. Viewed by
show ip routecommand.
Routing protocol messages
OSPF messages transmitted over an Ethernet link contain the following information:
- Data Link Ethernet Frame Header – Identifies the destination multicast MAC addresses 01-00-5E-00-00-05 or 01-00-5E-00-00-06.
- IP Packet Header – Identifies the IPv4 protocol field 89 which indicates that this is an OSPF packet. Used in hello packet and so forth. It also identifies one of two OSPF multicast addresses, 126.96.36.199 or 188.8.131.52. Remind that IP multicast addresses 184.108.40.206 for RIPv2 and 220.127.116.11 for EIGRP.
- OSPF Packet Header – Identifies the OSPF packet type, the router ID and the area ID.
- OSPF Packet Type Specific Data – Contains the OSPF packet type information. The content differs depending on the packet type. In this case, it is an IPv4 Header.
Types of OSPF packet(LSPs):
- Type 1-Hello packet: used to establish and maintain adjacency with other OSPF routers.
- Discover OSPF neightbors and establish neighbor adjacencies, OSPF Hello packets are transmitted to multicast address 18.104.22.168 in IPv4 and FF02::5 in IPv6.
- Advertise parameters on which two routers must agree to become neighbors.
- Elect the Designated Router(DR) and Backup Designated Router(BDR). PPP links do not require DR or BDR.
- Type – Identifies the type of packet. A one (1) indicates a Hello packet. A value 2 identifies a DBD packet, 3 an LSR packet, 4 an LSU packet, and 5 an LSAck packet.
- Router ID – A 32-bit value expressed in dotted decimal notation (an IPv4 address) used to uniquely identifying the originating router.
- Area ID – Area from which the packet originated.
- Network Mask – Subnet mask associated with the sending interface.
- Hello Interval – Specifies the frequency, in seconds, at which a router sends Hello packets. The default Hello interval on multiaccess networks is 10 seconds (cisco use 40 seconds).This timer must be the same on neighboring routers; otherwise, an adjacency is not established. 10 seconds (default on multiaccess and point-to-point networks), 30 seconds (default on nonbroadcast multiaccess [NBMA] networks; for example, Frame Relay)(cisco use 120 seconds).
- Router Priority – Used in a DR/BDR election. The default priority for all OSPF routers is 1, but can be manually altered from 0 to 255. The higher the value, the more likely the router becomes the DR on the link.
- Dead Interval – Is the time in seconds that a router waits to hear from a neighbor before declaring the neighboring router out of service. By default, the router Dead Interval is four times the Hello interval. This timer must be the same on neighboring routers; otherwise, an adjacency is not established.
- Designated Router (DR) – Router ID of the DR.
- Backup Designated Router (BDR) – Router ID of the BDR.
- List of Neighbors – List that identifies the router IDs of all adjacent routers.
- Type 2-Database Description packet(DBD): cantains an abbreviated list of the sending router’s LSDB and is used by receiving routers to check against the local LSDB.
- Type 3 -Link-state request packet(LSR): Receiving routers can then request more information about any entry in the DBD by sending an LSR.
- Type 4 -Link-state update packet(LSU): Used to reply to LSRs and to announce new information. LSUs contain seven different types of LSAs. For more see here.
- Type 1: Router LSAs
- Type 2: Network LSAs
- Type 3 or 4: Summary LSAs
- Type 5: Autonoumous system External LSAs
- Type 6: Multicast OSPF LSAs
- Type 7: defined for Not-so-stubby areas
- Type 8: External attributes LSA for Border Gateway Protocol (BGP)
- Type 9, 10,11: Opaque LSAs.
- Type 5 -Link-state acknowledgment packet(LSAck): When an LSU is received, the router sends an LSAck to confirm receipt of the LSU. The LSAck data field is empty.
They are there to keep life sane for the router itself in the case of more than one simultaneous processes.
They are locally significant only, and have no bearing on the structure of any OSPF packet or LSA update. So you can have a separate process-id on every single router in your network if you so desire.
Cisco routers may have up to 32 simultaneous processes. A single interface can only belong to a single process (although you can redistribute to “share”).
So there often is reason to split things up. Keep in mind that one of the rules of OSPF is that EVERYONE in an OSPF area must have an identical database.