OSPF routers must first discover each otherbefore they can exchange their topological databases. Once eachrouter has the complete topological database, it can use the SPFalgorithm to compute the shortest path to every network. This sectionfocuses on neighbor discovery and the exchange of topologicaldatabases.
Let’s begin at the beginning.OSPFpackets are encapsulated directly in IP with the protocol field setto 89. The destination IP address in OSPF depends on the networktype. OSPF uses two IP multicast addresses on broadcast andpoint-to-point networks: 225.0.0.5
for all OSPFrouters and 224.0.0.6
for all DR/BDR (designatedrouter/backup designated router) routers. Using IP multicastaddresses is more efficient than using broadcast addresses. Ifbroadcast addresses are used, all attached devices must receive thebroadcast packet, unwrap it, and then discard the contents if theyare not running OSPF. NBMA networks and virtual links use unicastaddresses because they do not support multicast addresses.
Following the IP header is the OSPF header (see Figure 6-5). The OSPF header is common to all types ofOSPF packets. The following list defines the format of the OSPFheader and the five types of OSPF packets:
- Version
The OSPF version in use. The current version number is 2.
- Type
There are five types of OSPF packets:
- Type 1
Hello packets, described in the next section.
- Type 2
Database description packets, described later under Section 6.4.5.
- Type 3
Link state requests, ...