OSPF (Open Shortest Path First)
The OSPF is an open, non-proprietary standard which was created by the IETF (Internet Engineering Task Force), a task force of the IAB. It is a link state routing protocol and is thus able to maintain a complete and more current view of the total iternetwork, than distance-vector routing protocols. Link state routing protocols have these features:
They use link state packets (LSPs) which are special datagrams that determine the names of and the cost or distance to any neighbouring routers and associated networks.
Any information learned about the network is then passed to all known routers, and not just neighbouring routers, using LSPs. Thus all routers have a fuller knowledge of the entire internetwork than the view of only the immediate neighbours.
OSPF is a classless routing protocol, which means that in its updates, it includes the subnet of each route it knows about, thus, enabling variable-length subnet masks. With variable-length subnet masks, an IP network can be broken into many subnets of various sizes. This provides network administrators with extra network-configuration flexibility.These updates are multicasts at specific addresses (224.0.0.5 and 224.0.0.6).
The cool 3D diagram below shows us the information that each field of an OSPF packet contains:


Analysis Of "Type" Field
All OSPF packets begin with a 24-byte header, which is shown right above. There is however one field I would like to give a bit more attention to, and this is the "Type" field which is 1 byte long.
As illustrated in the diagram, the "Type" field identifies the OSPF packet type as one of the following:
Hello: Establishes and maintains neighbour relationships.
Database Description: Describes the contents of the topological database. These messages are exchanged when an adjacency is initialized.
Link-state Request: Requests pieces of the topological database from neighbour routers. These messages are exchanged after a router discovers (by examining database-description packets) that parts of its topological database are out of date.
Link-state Update: Responds to a link-state request packet. These messages also are used for the regular dispersal of Link-State Acknowledgments (LSA). Several LSAs can be included within a single link-state update packet.
Link-state Acknowledgment: Acknowledges link-state update packets.
OSPF has two primary characteristics:
1) The protocol is open (non proprietary), which means that its specification is in the public domain. The OSPF specification is published as Request For Comments (RFC) 1247.
2) The second principal characteristic is that OSPF is based on the SPF algorithm, which sometimes is referred to as the Dijkstra algorithm, named for the person credited with its creation.
OSPF is a Link State routing protocol that calls for the sending of link-state advertisements (LSAs) to all other routers within the same hierarchical area. Information on attached interfaces, metrics used, and other variables is included in OSPF LSAs. As OSPF routers accumulate link-state information, they use the SPF algorithm to calculate the shortest path to each node.
As a Link State routing protocol, OSPF contrasts with RIP and IGRP, which are Distance Vector routing protocols. Routers running the Distance Vector algorithm send all or a portion of their routing tables in routing-update messages to their neighbours.
Additional OSPF features include equal-cost, multipath routing, and routing based on upper-layer type-of-service (TOS) requests. TOS-based routing supports those upper-layer protocols that can specify particular types of service. An application, for example, might specify that certain data is urgent. If OSPF has high-priority links at its disposal, these can be used to transport the urgent datagram.
OSPF supports one or more metrics. If only one metric is used, it is considered to be arbitrary, and TOS is not supported. If more than one metric is used, TOS is optionally supported through the use of a separate metric (and, therefore, a separate routing table) for each of the eight combinations created by the three IP TOS bits (the delay, throughput, and reliability bits). If, for example, the IP TOS bits specify low delay, low throughput, and high reliability, OSPF calculates routes to all destinations based on this TOS designation.