07-24-2012 09:42 AM - edited 03-07-2019 07:56 AM
Hi,
I have some basic doubts in basic OSPF adjacency formation.
Assume a topology where in 5 routers R1..R5 are connected by a switch and R3 is the DR and R2 is the BDR. All these routers are fully adjacent. Now another router R6 is connected to LAN.
Can you tell me how ospf adjacency is formed. Or can you clarify these doubts for me.
1. When a hello packet is sent to 224.0.0.5 by R6, all routers in the LAN will receive the hello. Will all the routers reply back to the hello? I am having this doubt since i learnt, the routers only for adjacencies with DR and BDR.
2. After the 2way state, i am confused with the master slave process. R6 will send an empty DD packet. Who will process that DD packet inorder to become the master for the database exchange? Logically i think the DR should, but how does this happen in protocol.
3. Once it crosses the exstart state, on exchanging the lsa's will all the other router be able to listen the lsa's being advertised since it is on a LAN.
Now in another case, assuming this R6 is connected to R1 ( not to the LAN ). R1 is DROTHER. R1 should have established full adjacency with R3 and R2 only. So how will R1 and R6 exchange the database. If R6 happens to be an ABR how will this change.
I think my questions are vague. may be i dont know to put it in proper words. If you are not able to get the question, please tell me.
Thanks
Chidambaram
07-24-2012 09:55 AM
Hello,
I just know one answer for one of your question:
If a new device comes onto the segment with the higher priority or router-id it can take the DR/BDR status away from the current device. "New device MUST wait for a failure of the DR or BDR before the next election occurs"
Thanks
07-24-2012 10:01 AM
Thank you I guess it is "it can't take the DR/BDR status" .
07-24-2012 10:16 AM
Hello Chidambaram,
with OSPF we need to discriminate between neighborship and adjacency.
OSPF neighboship is formed when two routers see each other OSPF router-id listed in respective hello messages.
This corresponds to OSPF neighbor state two way.
In a LAN segment where a DR and BDR are elected every ( DRother) router builds only two adjacencies one with DR and one with BDR. So it is not true that the existing R1-R5 are fully adjacent. They have neighborships between all of them but OSPF adjacencies are built only with DR and BDR. So DR and BDR are adjacent to all other nodes
The OSPF adjacency is formed if the neighbor state machine reach the FULL state.
OSPF hellos are sent to 224,0.0.5 ALL SPF routers on segment. There is no a mechanism of question/answer in hello.
Each router generates its own Hello packets with some key information:
area-id
area type ( if normal or stub or NSSA)
hello and dead timers
the list of routers the local node has heard hello on the segment ( list of OSPF router-ids)
authentication information
local node Router-id
IP address subnet and subnet mask
OSPF priority
OSPF DR
OSPF BDR
All these key parameters must match except the OSPF RID and the list of neighbors.
OSPF hellos are used to reach two way state and to trigger OSPF DR and BDR election.
When R6 is added to the network it starts to send out Hellos and to receive hellos from all the other ones.
As it sees itself listed in neighbor list of other routers and other routers are added to its neighbor list. The new router reach Two Way state with all R1-R5.
Let's suppose that R1 is the DR and R2 is the BDR.
R6 will learn this information from hello received and first of all it will agree on DR and BDR identities.(note it can take over as new BDR, let's suppose it doesn't happen for a moment)
R6 now knows that it has to progress the neighbor state machine with R1 and R2 and knows their IP addresses on the LAN segment.
So it progresses with R1 passing through the other states
exstart state: a master/slave relationship is negotiated the master is the device with the highest OSPF RID, but this communication is already a unicast communication between R1 and R6.
exchange state: database descriptor packets are exchanged and contain the LSA headers. the slave builds a list of LSA that are missing from its database. Again this is unicast communication.
loading phase: the new router sends out Link state request for each missing LSA, the other router answers with a LSU that contains the whole LSA not only the header the new router answers with a LS Ack (unicast communication)
At the end of this process R1 and R6 have identical database they are synchronized and they reach the FULL state
The same happens between R6 and R2
Edit:
R6 can be DRother or it can trigger a new BDR election it can never become directly the DR of segment.
So R6 can become the new BDR if its priority combined with Router-id is higher than that of current BDR. DR cannot be preempted.
Edit2:
BDR role cannot be preempted too and this makes sense.
Hope to help
Giuseppe
07-24-2012 10:35 AM
Thank you Guiseppe. I clearly understood how the neighborship takes place in a common LAN segment. Just two queries in that.
exstart state: a master/slave relationship is negotiated the master is the device with the highest OSPF RID, but this communication is already a unicast communication between R1 and R6.
So, all the messages ( twice, one for DR another for BDR ) will have destip as DR and BDR's ip or 224.0.0.6. Since DR cannot be pre-empted, in the ideal case, if R6's RID is less than DR's ip, then no problem. DB exchange will happen as expected. If R6's RID is bigger than DR's RID what will happen.
exchange state: database descriptor packets are exchanged and contain the LSA headers. the slave builds a list of LSA that are missing from its database
If R6 has, some three Type1 LSA's for instance, how will the slave ( R6 in this case ) find out, what LSA does it miss. Since R1 ( DR ) is the master, how will the slave request for LSA's missing in database. Sorry i did not get that part clearly. Apart from this, the neighborship process in a LAN is very clear to me.
My second case also, i was not able get it. When R6 is connected to a DROTHER router ( not to a switch ), how will the neighborship take place. R6 will hear only R2's ( DROTHER ) hello and vice versa. How will the lsa in R6 and R2LAN be propogated.
Thanks
Chidambaram
07-24-2012 10:52 AM
Hello Chidambaram,
>> If R6's RID is bigger than DR's RID what will happen.
R6 can become BDR not DR. in real world the DR router is the router with the highest uptime in the segment
if R6 is better then current BDR a new BDR election is triggered and R6 is promoted BDR. DR is left untouched in any case.
>> If R6 has, some three Type1 LSA's for instance, how will the slave ( R6 in this case ) find out, what LSA does it miss.
During the receiption of DB descriptor packets the slave compares each received LSA header with the contents of the local database if the LSA is missing or newer it is added to the list of the LSA to be later asked to the master.
So it is easy for the slave to find out what is missing in the local LS DB!
LSA header is formed by:
LSA id (how it is chosen depends from LSA type it is an IPv4 address or subnet in any case in OSPFv2)
LSA sequence number ( unique per LSA it is a 32 bit unsigned integer this field starts at 0x80000000 )
LSA age
And advertising router OSPF RID (the router that originated the LSA)
When only two routers are connected together on a LAN interface a DR/DBR election is performed between the two, if one device has OSPF priority = 0 it cannot be DR or BDR so only the other device becomes the DR and no BDR is elected.
Hope to help
Giuseppe
07-24-2012 11:08 AM
Thanks once again for patiently answering for my questions.
Case 1: Yes, I totally missed the point you mentioned about R6 becoming the BDR in the event of its RID being greater than DR's. I understand that DR cannot be pre-empted and R6 will become the BDR. Now this forces me to ask another question. All the other neighbors would be "fully" adjacent with the previous BDR. Now the election is going to break it. So all the neighborship will be formed again and the database will be exchanged completely to R6??
Also now i understood what you meant by slaves will request for missing LSA. Sorry for that lame question.
Case 2: Sorry, its my fault not to have come up with a picture. I have attached the topology to this reply. R6 is the newly joining router. R2 is DROTHER. Now in this case, can you throw light how the lsa between the LAN and this router flow.
Thanks
Chidambaram
07-24-2012 11:25 AM
Hello Chidambaram,
1) yes a change in BDR role would trigger the formation of a new set of adjacencies. Sot it is best practice to configure an OSPF priority higher then default 1 to keep the DR and BDR stable.
2) the segment R2-R6 is a separated segment where OSPF DR/BDR election is performed and a new adjacency is formed
As soon as R2 is adjacent with R6 it sends a LS Update with destination 224.0.0.6 ( ALL DR routers in segment ) listing the R6 router LSA and the new network LSA for segment R2-R6.
the DR in segment R1-R5 will acknowledge the receipt of the LSU (also the BDR) and the DR will flood the LSU to all routers in segment using the 224.0.0.5 address all routers acknowledge the receipt of the update.
Here we see how the DR/DBR concept helps in saving resources: any new routing information is provided first upstream to the DR an then the DR propagated the new info downstream to all devices.
Hope to help
Giuseppe
07-24-2012 11:32 AM
Giuseppe,
I find myself in disagreement about some of your statements.
R6 can become BDR not DR. in real world the DR router is the router with the highest uptime in the segment
if R6 is better then current BDR a new BDR election is triggered and R6 is promoted BDR. DR is left untouched in any case.
The uptime is not a DR/BDR election parameter. The non-preemptiveness of DR/BDR elections may result in the oldest router indeed becoming DR in the long run, but under no circumstances does the uptime influence the actual DR/BDR elections. If the longest living router is the DR, it is a consequence, not a defining property.
In addition, the BDR role is non-preemptive as well. Once the BDR is elected, a new router coming to the same segment, even if having higher priority and/or RID, is not going to take over the BDR. (This is sometimes confused with HSRP - in HSRP, the Standby role is preemptive regardless of the preempt setting.)
Best regards,
Peter
07-24-2012 11:52 AM
Hello Peter,
the mentioning of uptime was only done to make a practical example I'm sorry if it is misleading, I haven't listed uptime as a criteria for DR/BDR election.
About BDR not being pre-empted you are right according to valuable source like Routing TCP/IP Vol I second edition pag. 343 says this.
It makes sense that BDR is not preempted.
I'm afraid I'm becoming old ...:).
thanks for your correction.
Hope to help
Giuseppe
07-24-2012 12:53 PM
Hi Giuseppe,
I apologize... I was too harsh myself ... I somehow let my tempers run unguarded. I was kind of ill-tempered at the moment I was writing my response. I should have avoided responding in that state of mind.
Please accept my apologies once again.
I'm afraid I'm becoming old ...:).
Absolutely not. It's just too many similar mechanisms with subtle differences in similar areas. I have my own fair share of troubles with them.
Best regards,
Peter
07-24-2012 06:41 PM
Thanks experts,
You are doing wonders to me. So i will ascertain my thinking.
When a new router joins a LAN, irrespective of whatever IP it has, it will be a DROTHER and form full adjacency with DR and BDR only with IP's of them being found in the hello packet. This is fair and sqaure and no other corner case is possible,
Regarding my second case, the fact that dr bdr is per segment has got into my head now. As pointed out by peter in another thread, i was in the wrong assumption that, when R6 joins with R2 it will try to communicate with DR / BDR of that LAN. Ok, now assuming R6 is the DR for the R2-R6 segment, I understood the flow of information fro R2-R6 segment to R1..R5 segment. i.e R2 will learn R6's router and network lsa and send it to DR of the R1..R5 segement. Then tat DR will send to 224.0.0.5 and all other routers will learn. This point i got it nailed. Considering the reverse case, say, R1 learns some new LSA. It will flood to 224.0.0.6 and DR will send to 224.0.0.5 which will reach R2. Now R2 is the BDR for R2-R6 LAN. Who will propogate this information to R6?
Thanks
Chidambaram
07-25-2012 04:33 PM
Hello Chidambaram,
Ok, now assuming R6 is the DR for the R2-R6 segment, I understood the flow of information fro R2-R6 segment to R1..R5 segment. i.e R2 will learn R6's router and network lsa and send it to DR of the R1..R5 segement.
In fact, R2 will learn R6's new LSA or LSAs, depending on what the R6 has to say, and R2 will forward them to the IP address 224.0.0.6 (i.e. not just to the DR alone). Under this address, both DR and BDR on the R1-R5 segment are listening. Both DR and BDR will store these LSAs in their link state databases. BDR will then remain silent while the DR will reflood the same LSAs to the same segment to the IP address of 224.0.0.5 on which all OSPF routers listen.
Considering the reverse case, say, R1 learns some new LSA. It will flood to 224.0.0.6 and DR will send to 224.0.0.5 which will reach R2. Now R2 is the BDR for R2-R6 LAN. Who will propogate this information to R6?
If a BDR learns about a new LSA, it is allowed to send it immediately to 224.0.0.5 to inform all remaining routers on the same segment because it is already fully adjacent to all other routers. In other words, a BDR can inform all remaining routers immediately, and it does rely on DR to propagate this information. This is also stated by RFC 2328, Section 13.3 Step 5:
On broadcast networks, the Link State Update packets are multicast. The destination IP address specified for the Link State Update Packet depends on the state of the interface. If the interface state is DR or Backup, the address AllSPFRouters should be used. Otherwise, the address AllDRouters should be used.
Best regards,
Peter
07-25-2012 07:37 PM
Thanks a ton Peter and Guiseppe for answering all my questions. I am now clear with these concepts. I am moving through slowly, and will get back when i have anyother doubts.
Chidambaram
09-04-2012 01:12 AM
Dr All
I got a question recently on ospf ,question is "in ospf is neighborship is formed first or adajency is formed first"
pls help
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide