OSPF – Open Shortest Path First is a link-state protocol that, as the name implies, uses Dijkstra’s Shortest Path First(SPF) algorithm and this is open –RFC 2328.
What is link-state protocols, [OSPF, IS-IS]
The fundamental difference between distance vector and link state routing protocols is in the nature of the routing information routers send to each other. In link state routing protocols, each router describes itself and its interfaces to its directly connected objects; these objects can be either neighboring adjacent routers, or they can be directly attached networks. This information is passed unchanged from one router to another, so that in the end, every router knows about every other router, its interfaces and what exactly they connect to. In essence, in link state routing protocols, each router knows the entire network topology down to every single router and every single interconnection, also called the state of a link, hence the name link state routing protocol. Link state routing protocols allow a router to have a complete map of the network, and use specific algorithms to find shortest paths to every object in the network, including destination IP networks.
Like all link-state protocols, OSPF’s major advantage over distance vector protocols are fast reconvergence, scalability to much larger networks, and less susceptibility to bad routing information.
Operation of OSPF
- OSPF-speaking router send Hello packets out all OSPF enabled interfaces. If two routers sharing a common data link agree on certain parameters specified in their respective Hello packets, they will become neighbors.
- Adjacencies, which can be thought of as virtual point-to-point links, are formed between some neighbors. OSPF defines several network types and several router types. The establishment of an adjacency is determined by the type of routers exchanging Hellos and type of network over which the Hellos are exchanged.
- Each router sends link-state advertisements (LSAs) over all adjacencies. The LSAs described all of the router’s link, or interfaces, the router’s neighbors, and the state of the links. This links might be to stub networks,to other OSPF routers,to networks in other areas, or to external networks. OSPF defines multiple LSA types.
- Each router receiving an LSA from a neighbor, records the LSA in its link-state database and sends copy of the LSA to all of its other neighbors. By flooding LSAs througout an area, all routers will build identical link-state database.
- when the database are complete, each router uses the SPF algorithm to calculate a loop-free graph describing the shortest path to every known destination, with itself as a root. This graph is the SPF tree. Each router builds its route from its SPF tree.
Neighbors and Adjacencies
The OSPF router begins a neighbor relationship by advertising its Router ID in Hello Packets
Hello Protocol:
what the wild card means:
First octet: Check all bits
Second octet: Check all bits
Third octet: Check leftmost bit, don’t care about the rest
Fourth octet: Don’t care
To put it in binary you have:
00001010 01100100 00100000 00000000
cccccccc cccccccc cddddddd dddddddd
Here c = check and d = don’t care
So this means that you then have:
00001010 01100100 0xxxxxxx xxxxxxxx
what is Hello and Dead Interval
R1#debug ip ospf events
OSPF events debugging is on
R1#
00:39:23: OSPF: Rcv hello from 192.168.12.2 area 0 from FastEthernet0/0 192.168.12.2
00:39:23: OSPF: End of hello processing
00:39:33: OSPF: Rcv hello from 192.168.12.2 area 0 from FastEthernet0/0 192.168.12.2
00:39:33: OSPF: End of hello processing
OSPF Single Area LAB work
OSPF Multiple Area LAB work


Leave a comment