The Open Shortest Path First (OSPF) protocol is a hierarchical interior gateway protocol (IGP) for routing in Internet Protocol, using a link-state in the individual areas that make up the hierarchy. A computation based on Dijkstra's algorithm is used to calculate the shortest path tree inside each area. The current version, Version 3, defined in RFC 2740 (OSPFv3 1999)[1], supports IPv6 only, for IPV4 you need OSPF version 2. (OSPFv2 1998)[2].
A link state database (LSDB) is constructed as a tree-image of the network topology, and identical copies of the LSDB are periodically updated on all routers in each OSPF-aware area (region of the network included in an OSPF area type - see "Area types" below). By convention, area 0 represents the core or "backbone" region of an OSPF-enabled network, and other OSPF area numbers may be designated to serve other regions of an enterprise (large, business) network - however every additional OSPF area must have a direct or virtual connection to the backbone OSPF area. The backbone area has the identifier 0.0.0.0. Inter-area routing goes via the backbone.
OSPF is perhaps the most widely-used IGP in large enterprise networks; IS-IS is more common in large service provider networks. The most widely-used exterior gateway protocol (EGP) is BGP. The OSPF Protocol can operate (communicate with other routers about "best-path" routes to save in their LSDBs) securely, optionally using a cleartext password or using MD5 to authenticate peers before forming adjacencies, and before accepting link-state advertisements (LSA). A natural successor to the Routing Information Protocol (RIP), it was classless - or able to use Variable-Length Subnet Masking (VLSM) - from its inception. Multicast extensions to OSPF, the Multicast Open Shortest Path First (MOSPF) protocols, have been defined but these are not widely used at present.
Routers in the same broadcast domain or at each end of a point-to-point telecommunications link form adjacencies when they have detected each other. This detection occurs when a router "sees" itself in a hello packet. This is called a two way state and is the most basic relationship. The routers elect a designated router (DR) and a backup designated router (BDR) which act as a hub to reduce traffic between routers. OSPF uses both unicast and multicast to send "hello packets" and link state updates. Multicast addresses 224.0.0.5 (all SPF/link state routers) and 224.0.0.6 (all Designated Routers) are reserved for OSPF. In contrast to the Routing Information Protocol (RIP) or the Border Gateway Protocol (BGP), OSPF does not use TCP or UDP but uses IP directly, via IP protocol 89. OSPF handles its own error detection and correction, therefore negating the need for TCP or UDP functions.








