03-20-2005 07:28 PM - edited 03-03-2019 09:05 AM
I recently had a practice exam question that asked "Which state marks the beginning of the neighbor process in OSPF?"
I answered "init", because this is the state in which I have seen a hello so I know about the neighbor, but I have not seen his hello with my RID in the packet. Apparently this answer was wrong, and the test actually wanted "down".
That got me thinking, because I do not understand how a neighbor relationship can exist, and be "down". Would you ever see a neighbor as "down" in show ip ospf neighbor? I would have thought that if the neighbor was "down" then it would not appear in then neighbor table at all, because I have never heard from it, so I do not know of its existance yet. Isn't that so? The first time I become aware of the existance of the neighbor is when I see his (empty) Hello, in which case the state is "init". (For manually configured neighbors in NBMA, there is the "attempt" state", but that is irrelevant for this argument, I think.)
That is why I think "Which state marks the beginning of the neighbor process in OSPF?", the answer is "init". Can someone explain to me why I am wrong?
Kevin Dorrell
Luxembourg
03-20-2005 07:38 PM
Kevin,
This is probably another question that the test expects the "Cisco" answer. You are right on the fact that a neighbor cannot see another until it sees a packet from that router. So technically Init should be the beginning of the OSPF neighbor relationship.
I was going through a whitepaper from Cisco. If you go through it, it clearly marks Down state as the first neighbor state. Check this out
http://www.cisco.com/warp/public/104/13.html
02-21-2018 08:19 PM
1. When the ospf is enabled on an interface, the Hello packet is initiated and sent out the interface, the state is "Down".
2. When the router receives the Hello packet without its own RID, the state is transited to "Init" meaning that the neighbour has been discovered but still uni-directional (one-way)
3. When the router receives the Hello packet with its own RID, the state is transited to "2-way"
Eric
03-20-2005 11:02 PM
Hi Kevin,
I think the answer: down, complies with the RFC.
Excerpt from RFC2328, "10.1. Neighbor states" [Page 82]
"Down
This is the initial state of a neighbor conversation. It
indicates that there has been no recent information received
from the neighbor. On NBMA networks, Hello packets may
still be sent to "Down" neighbors, although at a reduced
frequency (see Section 9.5.1)."
In this case, Hello's are sent to a "down" neighbour at a reduced rate - every "PollInterval" instead of every "HelloInterval".
"Would you ever see a neighbor as "down" in show ip ospf neighbor?" The answer is yes, according to this document:
http://www.cisco.com/warp/public/104/29.html
Reference:
ftp://ftp.rfc-editor.org/in-notes/rfc2328.txt
Regards,
Mustafa
03-22-2005 01:59 AM
Hi Mastafa,
Thanks for the reply and the document reference. I think I shall find that particularly useful for my studies, because I see lots of practice exam questions about "you see a router stuck int such-and-such a state - what could be the reason."
There were lots of other useful-looking configuration and troubleshooting references in that doc as well.
I am going to have a go at producing the "Down" state in the lab as soon as I have ( ... if I ever have ... ) the time.
Kevin Dorrell
Luxembourg
03-21-2005 02:10 PM
Hello Kevin,
I find helpful Section 10.5 of the RFC (Receiving Hello Packets).
First, a received Hello packet must pass some basic sanity checks.
"At this point, an attempt is made to match the source of the
Hello Packet to one of the receiving interface's neighbors."...
"The interface's current list of neighbors is contained in the interface's data structure.
If a matching neighbor structure cannot be found,
(i.e., this is the first time the neighbor has been detected), one is created.
The initial state of a newly created neighbor is set to Down."...
"Now the rest of the Hello Packet is examined, generating events
to be given to the neighbor and interface state machines.
These state machines are specified either to be executed or scheduled (see Section 4.4).
For example, by specifying below that the neighbor state machine be executed in line,
several neighbor state transitions may be effected by a single received Hello:
o Each Hello Packet causes the neighbor state machine to be executed
with the event HelloReceived.
o Then the list of neighbors contained in the Hello Packet is examined.
If the router itself appears in this list, the neighbor state machine should be executed
with the event 2-WayReceived.
Otherwise, the neighbor state machine should be executed with the event
1-WayReceived, and the processing of the packet stops."
The points above I find most important are:
"several neighbor state transitions may be effected by a single received Hello"
"Each Hello Packet causes the neighbor state machine to be executed
with the event HelloReceived."
Note that the last means that next state is Init (page 90 of the RFC).
And after the RFC theory (which I do find very useful),
a few implementation-oriented points (stolen from Moy):
When a neighbor is first allocated, it's initial state is set to Down.
The usual reason for allocating a neighbor structure is that
a Hello packet is received from the neighbor,
in which case the neighbor state immediately transitions to Init.
When Hellos cease to be heard from a neighbor or
the neighbor is otherwise found to be inoperative,
the neighbor transitions back to the Down state and
storage associated with the neighbor is returned to the heap.
The other reason for allocating a neighbor is when a neighbor is statically configured.
In the case of statically configured neighbors, lack of received Hellos
causes the neighbor to fall back to Down without freeing the configured neighbors.
As I see it, initializing newly discovered dynamic neighbors to the Down state
(because of a received Hello) is rather temporary (state is destined to transition to Init),
while those dynamic neighbors who "really" fall into the Down state are destroyed.
I suppose it makes sense starting with Down, so as to keep a unified approach
on which the initial state of the neighbor state machine is,
regardless of the neighbors' type (dynamic/static).
Have fun,
Maria
03-22-2005 01:52 AM
Hello Maria,
Thank you very much for that analysis of the state. I admire your persistence in reading all 244 pages of RFC2328, which you must have done to know it so thoroughly. There is an awful lot of detail in that document, but that does mean it ties down the behavior pretty well.
I take the point that "Down" is a transitory state, and that I go immediately into "Init" or "2-way" depending on whether I can see my RID in the Hello. If I don't see my RID, I go into "Init" rather than staying "Down" on the assumption that I have already sent out at least one Hello which he should have heard.
I saw some other interesting things there in the RFC, like if I see 1-WayReceived (a Hello without my RID in it), then I slip back to "Init" state in all cases, and clear the LSA database. (Page 94)
The other interesting thing was that the InactivityTimer always forces the "Down" state, but I did not find anything in the RFC about when I should remove the data structure altogether. (Unless I wasn't looking hard enough.) From what you say, it would usually return the data structure to the heap immediately, in which case you would not see any "Down" in the show ip ospf neighbor.
You mention "stolen from Moy" in your bit about the implementation detail. Would that be the "Anatomy of a Routing Protocol" book? I don't have it on my bookshelf yet, but if that is the one, I shall add it to my Safari bookshelf.
If you have a statically configured neighbor (NBMA or Cisco P2MP nonbroadcast), then you fall back to "Down" after the InactivityTimer. But also in that case, don't got produce a Hello immediately and go back into "Attempt"?
The great thing is that I think I have taken the state machine on board sufficiently to answer the original question as "Down", at the same time understanding the shortcomings of the answer. Which must be progress.
Thanks again, and have a nice Easter weekend.
Kevin Dorrell
Luxembourg
03-22-2005 02:49 PM
Hello Kevin,
The first time I saw the RFC, I was scared to death. English is not my mother-tongue...
I haven't read it cover-to-cover, but I try to "surround" it with my special forces team!
Specifications are written in a way so that information about one thing is spread all over.
I normally use the search facilities in the document.
I just need to find the "magic" word and glue things together.
(With books I use indexes to overcome the same problem.)
I concentrate on one feature at a time, depending on motivation.
For example, recently I was searching the word "multipoint" everywhere...
And now you motivated me with your question.
A question in many cases is more important than the answer.
Speaking of the answer, when I saw how big it had grown I was reluctant to send it...
So, thank you for taking the time to read it ;-)
I have decided to avoid recommending books,
because I don't want to be considered selling anything in here,
and because I sometimes change my mind about a book later.
Nevertheless, it's quite safe to recommend Moy's stuff. ;-)
The "OSPF Anatomy of an Internet Routing Protocol" is small,
and if you skip MOSPF and other general stuff,
the core OSPF part is approximately 120 pages, which is a realistic goal.
The "OSPF Complete Implementation" (in C++) has the stolen stuff.
When I find some time I will try to have some fun with the code on the CD.
The removal of the neighbor data structure is mentioned in Moy's
implementation. Haven't seen this in the RFC either.
Probably cisco does the same thing. I have never seen in the output of
"show ip ospf neighbor" a dynamic neighbor that has gone down.
Some implementation guidelines are not necessarily a mandatory part of the specification.
Paragraph 1.4 of the RFC:
"The detailed specification of the protocol is presented in terms of data structures.
This is done in order to make the explanation more precise.
Implementations of the protocol are required to support the functionality described,
but need not use the precise data structures that appear in this memo."
As for your other question, (how would you say it ? ok, now I remember!)
haven't read that chapter yet!
I will do it as soon as I can, but if you can't wait, maybe someone else can enlighten us both.
How did I manage to write so much AGAIN ? And haven't even answered all questions.
I do envy guys with small, correct postings.
But hey, I am a woman! I am supposed to talk much!
Have a nice Easter weekend!
We don't have Easter in Greece yet, but fortunately
on Friday we have some national holiday.
Hello from Athens,
Maria
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