OSPF II - OSPF States Discussion

Today I am going to write another article on OSPF where i am going to discuss on OSPF states only.

OSPF States:
OSPF have following States between their neighbours for propagating the flow of traffic.

State 1: Down State
Down state is one of the initial state state of the routers in OSPF domain where you routers don't know anything about each other. The stage is come when you are going to deploy an OSPF network. So the routers learnt about the information like RID values, interfaces for the OSPF instances. RID here is the unique identifier with each router identifies each other.

Note: In short, where router wants to learn about its neighbour and collects information to start the OSPF instances in the OSPF domain but not initiate anything yet.

State 2: INIT state
INIT state of the OSPF where router initiates the hello packet for the initial communication. The Hello packet is sent to multicast address of 224.0.0.5 where the information of the router called RID (Area ID, Hello Interval, Hold Timer, Flag and MTU information). Let's take an example, there are two routers and want to start the INIT state, R1 initiate the hello packet on multicast address towards R2 which contains the RID information which i already explained above, in this way R2 learn the information about R1. 

Note: In Short, INIT state where Hello packet sent to other router will RID information which contain Area ID, Hello Interval, Hold Timer, Flag and MTU.

State 3: Attempt state
In Non-broadcast multi-access environment such as Frame Relay and X.25, OSPF uses Attempt state instead of Init state. OSPF uses this state only if neighbors are statically configured with neighbor command. In this situation, it does not have to discover them dynamically. As it already knows the neighbors, it will use unicast instead of multicast in this state.

Once neighborship is built, OSPF uses hello packets as keep alive. If a router does not receive a hello packet from any particular neighbor in dead interval, it will change its state to down from full. After changing the state it will make an effort to contact the neighbor by sending Hello packets. This effort is made in Attempt state.
Basically Both Init and Attempt states describe similar situation where one router has sent a hello packet and waiting for response.

Note: In Short, Attempt state is only valid in NBMA network type like Frame Relay and X.25 networks.

State 4: 2-Way State
Before the 2-way state, R2 router received the Hello packet from R1 router and have all information about the R1 router. Now in 2-Way state, R2 added R1 in its neighbour table and sent the hello packet with his information towards R1. Make sure you remember one thing here, the reply hello packet will be unicast hello not multicast hello. 

Beside RID and configuration values, this packet also contains the R2’s neighbor table data. As we know R2 has already added R1 in its neighbor table. So when R1 will see R2’s neighbor table data, R1 would also see its name in this data. This will assure R1 that R2 has accepted its neighborship request. As we know that this hello packet contains one additional field; Neighbor table data field which indicates that this is not a regular neighbor discovery hello packet. This packet is a reply of its own request.

Note: In Short, 2-Way state where R2 received Hello packet via multicast address and added in his neighbour table and send Unicast hello packet with his information. At this stage both R1 and R2 knows about each other's information like RID which contains Area ID, Hello Interval, Hold Timer, Flag and MTU.

Note: DR/BDR election process is done in this state (Specified in Broadcast, NBMA networks only); All other networks don't have the DR/BDR selection.

State 5: Ex-Start State
In Ex-Start state, Routers who decided to build adjacency will form a master / slave relationship. In each adjacency router who has higher RID will become master and other will become slave. Do not mix Master /Slave relationship with DR/ BDR/ DROTHER relationship. Both terms look similar but have different meaning. DR/ BDR/ DROTHER relationship is built in a segment and have a wider meaning while Master / Slave relationship is built between two interfaces which need to exchange routing information. 

Master / Slave relationship has limited purpose. It is used to decide the Router who will start exchange process. Always Master starts exchange process.Once routers settle down on Master/Slave, they will establish the initial sequence numbers which will be used in routing information exchange process. Sequence numbers insure that routers get most accurate information.

Note: In Short, Ex-start stage where adjacency formed, where one is act as Master and other is Slave (Master with higher RID value and slave with lower RID value). Master will start exchange process and start sequence number for accurate Information.

State 6: Exchange State
In Exchange state, Master and slave decide how much information needs to be exchange. A router that has more than one interface may learn same network information from different sources. An OSFP router is smart enough to filter the updates before receiving it. It will ask only for the updates which it does not have. In this state, routers will filter the updates which need be to exchange on the basis of LSA's and send as DBDs.

DBD -Database description packets 
It contain the list of LSA. This list includes link state type, cost of link, ID of advertising router and sequence number of link. Make sure you understand this term correctly. It is only a list of all LSAs from its respective database. It does not include full LSAs. In this state, routers exchanges DBDs. Through DBDs routers can learn which LSAs they already have. 

Note: In Short, Exchange state where master slave exchange information as a DBDs which is called as Database description packets and ready for data traffic to flow. Still no data traffic flows.

Fig 1.1- OSPF states- Exstart till Full states

State 7: Loading State
In Loading state, Routers will use LSU (Link state update) to exchange the LSAs. Each LSA contains routing information about a particular link. Routers also maintain a retransmission list to make sure that every sent LSA is acknowledged.This exchange process will continue till router has any unsent LSA in LSR list.

State 8: Full State
Full state indicates that both routers has been exchanged all LSAs from LSR list. Now they have identical LSDB. Adjacent routers remain in this state for life time. This state also referred as adjacency. If any change occurs in network, routers will go through this process again.

Now OSPF is ready for the data traffic for within the network this this process. Please let me know your queries and want to understand more about it.