Wednesday, 28 December 2016

BEST INTERVIEW QUSTION SERIES OSPF 8WAY PROCESS Q4

OSPF 8WAY PROCESS 

summary of ospf mechanism: 
1. Each router establishes a relationship (“adjacency”) with its neighbors
2.Each router generates link state advertisements (LSAs) which are distributed
 to all routers LSA = (link id, state of the link, cost, neighbors of the link)
3. Each router maintains a database of all received LSAs (topological database or
 link state database), which describes the network has a graph with weighted edges
4. Each router uses its link state database to run a shortest path algorithm
(Dijikstra’s algorithm) to produce the shortest path to each network




Down

This is the first OSPF neighbor state. It means that no information (hellos) has been
 received from this neighbor, but hello packets can still be sent to the neighbor in this state.
During the fully adjacent neighbor state, if a router doesn't receive hello packet from a neighbor
 within the RouterDeadInterval time (RouterDeadInterval = 4*HelloInterval by default) or if the
manually configured neighbor is being removed from the configuration, then the neighbor
state changes from Full to Down.

Attempt

This state is only valid for manually configured neighbors in an NBMA environment.
In Attempt state, the router sends unicast hello packets every poll interval to the
neighbor, from which hellos have not been received within the dead interval.

Init

This state specifies that the router has received a hello packet from its neighbor, but the
 receiving router's ID was not included in the hello packet. When a router receives a
 hello packet from a neighbor, it should list the sender's router ID in its hello packet
 as an acknowledgment that it received a valid hello packet.

ospf hello packet:


2-Way

This state designates that bi-directional communication has been established between two routers.
 Bi-directional means that each router has seen the other's hello packet. This state is attained
when the router receiving the hello packet sees its own Router ID within the received hello packet's
 neighbor field. At this state, a router decides whether to become adjacent with this neighbor.
On broadcast media and non-broadcast multiaccess networks, a router becomes full only with the
designated router (DR) and the backup designated router (BDR); it stays in the 2-way state with all
 other neighbors. On Point-to-point and Point-to-multipoint networks, a router becomes full with all
 connected routers.
At the end of this stage, the DR and BDR for broadcast and non-broadcast multiacess
networks are elected.

Note: Receiving a Database Descriptor (DBD) packet from a neighbor in the init state
 will also a cause  a transition to 2-way state.

Exstart

Once the DR and BDR are elected, the actual process of exchanging link state information can start
between the routers and their DR and BDR.

In this state, the routers and their DR and BDR establish a master-slave relationship and choose
the initial sequence number for adjacency formation. The router with the higher router ID becomes
the master and starts the exchange, and as such, is the only router that can increment the sequence
 number. Note that one would logically conclude that the DR/BDR with the highest router ID will
become the master during this process of master-slave relation. Remember that the DR/BDR election
 might be purely by virtue of a higher priority configured on the router instead of highest router
ID. Thus, it is possible that a DR plays the role of slave. And also note that master/slave election
 is on a per-neighbor basis.

Exchange

In the exchange state, OSPF routers exchange database descriptor (DBD) packets. Database descriptors
 contain link-state advertisement (LSA) headers only and describe the contents of the entire link-state
 database. Each DBD packet has a sequence number which can be incremented only by master which is
 explicitly acknowledged by slave. Routers also send link-state request packets and link-state update
 packets (which contain the entire LSA) in this state. The contents of the DBD received are compared
to the information contained in the routers link-state database to check if new or more current
link-state information is available with the neighbor.

Loading

In this state, the actual exchange of link state information occurs. Based on the information provided
 by the DBDs, routers send link-state request packets. The neighbor then provides the requested
link-state information in link-state update packets. During the adjacency, if a router receives an
 outdated or missing LSA, it requests that LSA by sending a link-state request packet. All link-state
 update packets are acknowledged.

Full

In this state, routers are fully adjacent with each other. All the router and network LSAs are exchanged
 and the routers' databases are fully synchronized.

Full is the normal state for an OSPF router. If a router is stuck in another state, it's an indication
that there are problems in forming adjacencies. The only exception to this is the 2-way state, which is
 normal in a broadcast network. Routers achieve the full state with their DR and BDR only. Neighbors
always see each other as 2-way.


Summary:




Lab on OSPF



configuration on R1

R1(config-if)#router ospf 1
R1(config-router)#net 10.1.1.0 0.0.0.255 ar 0
R1(config-router)#net 1.1.1.1 0.0.0.0 ar 0
R1(config-router)#end

R1#debug ip ospf adj
OSPF adjacency events debugging is on
R1#debug ip ospf events
OSPF events debugging is on

configuration on R2

R2(config-if)#router ospf 1
R2(config-router)#net 2.2.2.2 0.0.0.0 ar 0
R2(config-router)#net 10.1.1.0 0.0.0.255 ar 0
R2(config-router)#


now take the debug output on R1 and it will tell the 8 way process

R1#debug ip ospf events
OSPF events debugging is on
R1#
*Mar  1 00:02:26.323: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
R1#
*Mar  1 00:02:36.323: OSPF: end of Wait on interface FastEthernet0/0
*Mar  1 00:02:36.323: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:02:36.327: OSPF: Elect BDR 1.1.1.1
*Mar  1 00:02:36.327: OSPF: Elect DR 1.1.1.1
*Mar  1 00:02:36.327: OSPF: Elect BDR 0.0.0.0
*Mar  1 00:02:36.331: OSPF: Elect DR 1.1.1.1
*Mar  1 00:02:36.331:        DR: 1.1.1.1 (Id)   BDR: none
*Mar  1 00:02:36.335: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:02:36.835: OSPF: No full nbrs to build Net Lsa for interface FastEthernet0/0
*Mar  1 00:02:46.335: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:02:56.335: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:03:06.335: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:03:16.335: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:03:26.335: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:03:28.267: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet0/0 10.1.1.2
*Mar  1 00:03:28.271: OSPF: Send immediate hello to nbr 2.2.2.2, src address 10.1.1.2, on FastEthernet0/0
*Mar  1 00:03:28.275: OSPF: Send hello to 10.1.1.2 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:03:28.275: OSPF: End of hello processing
*Mar  1 00:03:36.335: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 10.1.1.1
*Mar  1 00:03:36.387: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/0 seq 0x21EF opt 0x52 flag 0x7 len 32  mtu 1500 state INIT
*Mar  1 00:03:36.391: OSPF: 2 Way Communication to 2.2.2.2 on FastEthernet0/0, state 2WAY
*Mar  1 00:03:36.391: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:03:36.395: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:03:36.395: OSPF: Elect BDR 2.2.2.2
*Mar  1 00:03:36.395: OSPF: Elect DR 1.1.1.1
*Mar  1 00:03:36.399:        DR: 1.1.1.1 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:03:36.399: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0xDD opt 0x52 flag 0x7 len 32
*Mar  1 00:03:36.403: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar  1 00:03:36.407: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x21EF opt 0x52 flag 0x2 len 52
*Mar  1 00:03:36.411: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet0/0 10.1.1.2
*Mar  1 00:03:36.41
R1#5: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:03:36.415: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:03:36.419: OSPF: Elect BDR 2.2.2.2
*Mar  1 00:03:36.419: OSPF: Elect DR 1.1.1.1
*Mar  1 00:03:36.419:        DR: 1.1.1.1 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:03:36.419: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:03:36.419: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:03:36.419: OSPF: Elect BDR 2.2.2.2
*Mar  1 00:03:36.419: OSPF: Elect DR 1.1.1.1
*Mar  1 00:03:36.419:        DR: 1.1.1.1 (Id)   BDR: 2.2.2.2 (Id)
*Mar  1 00:03:36.419: OSPF: End of hello processing
*Mar  1 00:03:36.427: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/0 seq 0x21F0 opt 0x52 flag 0x3 len 52  mtu 1500 state EXCHANGE
*Mar  1 00:03:36.431: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x21F0 opt 0x52 flag 0x0 len 32
*Mar  1 00:03:36.491: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/0 seq 0x21F1 opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Mar  1 00:03:36.491: OSPF: Exchange Done with 2.2.2.2 on FastEthernet0/0
*Mar  1 00:03:36.491: OSPF: Send LS REQ to 2.2.2.2 length 12 LSA count 1
*Mar  1 00:03:36.491: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x21F1 opt 0x52 flag 0x0 len 32
*Mar  1 00:03:36.491: OSPF: Rcv LS REQ from 2.2.2.2 on FastEthernet0/0 length 36 LSA count 1
*Mar  1 00:03:36.491: OSPF: Send UPD to 10.1.1.2 on FastEthernet0/0 length 52 LSA count 1
*Mar  1 00:03:36.491: OSPF: Rcv LS UPD from 2.2.2.2 on FastEthernet0/0 length 76 L  SA count 1
*Mar  1 00:03:36.491: OSPF: Synchronized with 2.2.2.2 Loading to state FULL


-------------thanx--

No comments:

Post a Comment