- OSPF have its own protocol number 89.
- OSPF OSPF is a link state protocol it exchanges detailed topology information within a area and only summary out of the area.
- OSPF uses Dijkstra algorithm. Each device running will apply Dijkstra algo to the database and try to find out best route to each subnet in the database.
- Process ID can be different it should be anything ospf neighborship will still form.
- All router in same subnet should be in same area.
- Multicase address 220.127.116.11 is used to address all OSPF routers. Multicase address 18.104.22.168 is used to address all DR and BDR.
- Backbone area is the area which should connect all other area. All traffic from one area to another are should go through backbone area. The reasoning behind this is that OSPF expects all areas to inject routing information into the backbone and in turn the backbone will disseminate that information into other areas.
Metric of OSPF is cost.
cost = reference bndwidth/ interface bandwidth
OSPF message type:
Hello: Hello message are sent on regular interval of time and are used to discover neighbor. Hello message also used indicate its neighbor that device is still active.
Following is the hello message sent initially when a OSPF process starts.
Source OSPF router is the Route. Network mask is the subnet configured on the interface. When there is not DR and BDR eleected at that time the DR router and BDR router field will be 0.0.0.0
When the devices receives above hello message then they will compare the field that are required to form the neighorbship and if the parameter matches then they will start sending below hello message. Note in the below hello message DR,BDR,Active neighbor field have been populated.
Following is the hello message sent after election of DR and BDR, after forming neighborship.
Once the DR and BDR are selected for a subnet then the DR and BDR field will be populated with IP address of DR’s and BDR’s interface in that subnet.
List of neighbor contain the router ID of active neighbor.
Database descripitor: DBD contain summary of LSA. These message are exchanged to get to know about the LSA that neighbor have.
LSR(Link State request): A device can request for some information of LSDB from its neighbors with the help os LSR.
LSU (ink state update): LSU contain detailed information about the LSA. This message cna be sent in response of LSR or when some change happen in the network.
Link state Acknowledgment: LSAAck is sent for acknowledging LSU. For multiple LSU a single LSAck can be sent.
OSPF route preference:
- Intra area routes O
- Inter area route O IA
- External type 1 O E1
- External type 2 O E2
- NSSA N1
- NSSA N2
DR and BDR election criteria:
- Router with highest router priority will become DR and second highest will become BDR.
- If router priority is same then router with highest router ID will become DR and second highest will become BDR.
- If the router priority is 0 then that router will not take part in DR and BDR election.
Why OSPF router form full adjacency with DR and BDR but not with DROther?
Just to preserve network bandwidth DROther will exchange information with DR and BDR.
When an interface is configured as passive interface then a router will not send any hello messages but will advertise that network in ospf process.
Router-ID selection in CISCO: Order of selection of router ID is as follows:
- Manually specified router ID.
- Highest IP address of loopback interface which is up.
- Highest IP address of any other interface which is up.
OSPF neighborship requirement:
- Router ID must me unique.
- Must have same area type (must match between neighbors).
- Hello and Dead timers must match.
- MTU must match
- Area ID (must match between neighbors).
- DR and BDR IP addresses.
- Authentication must match.
- Hello timer: This timer defines how frequently hello message are sent.
- Dead timer: Dead time indicate for how much time a device will wait without receving any hello message before declaring it dead.
OSPF authentication types:
There are three types of authenticaiton in OSPF type 0 type 1 type 2:
- No authentication:
- Type 1 clear text authentication.
- Type 2 MD5 authentication.
OSPF neighbor state:
- Down: This is first state in OSPF. Initially device will be in down state. If a device doesn’t receive any OSPF hello message then that device will move to down state hello message can be send.
- Attempt: This state occurs only in Non-Broacast Multiacccess network. If a device is in attempt state then it means that It have not recevied any hello from neighbor and device will try to send hello message till dead interval expires.
- Init: Device have receieved a hello message from another device but the receieved hello message doesn’t have its own router ID in Active neighbor filed of the hello message.
- 2-Way: In this state a device have receieved a hello message and in that message router ID have been mentioned. In this state router will decide whether it have to form full adjacency or to become neighbors. DR and BDR election happens in this state.
- Exstart: In this state DRother and DR, BDR will form master and slave relationship. DD sequence number is negotiated here. Router having highest router ID will become master. MTU is exchanged in DBD packet and if MTU is mis matching then neighborship will stuck in Exstart state.
- Exchange: In exchange state devices will exchange DBD. LSR and LSU are also being exchanged in this state.
- Loading: In this state whatever information is not present in one device will be requested with the help of LSR and LSU.
- Full: Devices have synched their database.
E1 and E2 Routes:
External type 1 and External type 2 routes comes into picture when we are redistributing routes into OSPF.
For E1 route the metric will advertised cost + cost to reach ASBR.
For E2 route the metric will always be same (Default 20).
Master and Slave election:
Master and Slave relation is between DR and DROther.