cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2364
Views
0
Helpful
9
Replies

Ospf neighborship

Hello Guys,

Please help me with the following query.
According to ospf hello packets the following field should be equal for neighborship creation.

1.area id
2.netmask.
3.auth info.
4.hello/dead timer.

I am doing some R and D on gns3.
Router A is connected to Router B using serial point to point link.Router A s1/0 is connected with Router B s1/1 int.

Output of Router A

interface Serial1/0
 ip address 10.10.10.3 255.255.255.0
 serial restart-delay 0

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 10.10.10.0 0.0.0.255 area 0

Output of Router B.

interface Serial1/1
 ip address 20.20.20.1 255.255.255.0
 serial restart-delay 0

R2(config)#router ospf 1
R2(config)#router-id 2.2.2.2
R2(config-router)#network 20.20.20.0 0.0.0.255 area 0
R2(config-router)#

Now all the parameter required parameter is same in hello parameter.Hello packet only consists of netmask field not the ip address of interface,as here the ip address net id is different but the netmask on both the side is same so there should not be any issue while neighbor creation.But I am not able to see anything in the neighbor table.
Please let me know why the neighorship not getting up?

What is the problem if i take the different interface ip on both he link but the netmask on both the link is same.
Also I think the neighbor shoud stuck in ex start state since this is the steps where it sends dbd and for sending dbd interface id is required.

Thanks,

Mrityunjay Singh

9 Replies 9

Vinit Jain
Cisco Employee
Cisco Employee

Hello Mrityunjay

Two routers will not become neighbors unless they agree on the following:

  • Area-id: Two routers having a common segment; their interfaces have to belong to the same area on that segment. Of course, the interfaces should belong to the same subnet and have a similar mask.

  • Authentication: OSPF allows for the configuration of a password for a specific area. Routers that want to become neighbors have to exchange the same password on a particular segment.

  • Hello and Dead Intervals: OSPF exchanges Hello packets on each segment. This is a form of keepalive used by routers in order to acknowledge their existence on a segment and in order to elect a designated router (DR) on multiaccess segments.The Hello interval specifies the length of time, in seconds, between the hello packets that a router sends on an OSPF interface. The dead interval is the number of seconds that a router's Hello packets have not been seen before its neighbors declare the OSPF router down.

    OSPF requires these intervals to be exactly the same between two neighbors. If any of these intervals are different, these routers will not become neighbors on a particular segment. The router interface commands used to set these timers are: ip ospf hello-interval seconds and ip ospf dead-interval seconds .

  • Stub area flag: Two routers have to also agree on the stub area flag in the Hello packets in order to become neighbors. Stub areas will be discussed in a later section. Keep in mind for now that defining stub areas will affect the neighbor election process.

Thus, the subnet has to be the same on both the sides. You can try to perform a sniffer capture on GNS3 and see the packet exchanges happening.

 

Hope this helps.

Regards,

Vinit

 

Thanks
--Vinit

Hello Vinijain,

Thank you for replying.

Could you please let me know why the interface ip address should belong to same subnet as the subnet information does not go inside the hello packets ?

If you remember in order to achieve neighbor state the above parameter should be equal.

As per the configuration all the parameter are equal except the ip address of the interface.

when we see the hello packet in detail then you will see hello packet does not  contain any layer3 address of interface,it just include or checks the netmask not the ip for neighbor creation.

So I think the neighborship should be created here though adjacency may not be created.

Correct me if I am wrong.

Please find the detail of hello packet field attached herewith.

Thanks,

Mrityunjay Singh

Hello Mrityunjay

yes, you are right. But think about this, if the link is not in the same subnet, how will the sending router know how to reach the other subnet or vice versa. Thats the whole purpose of configuring routing that we have reachability across different subnets.

The hello packet reaches the other side, it will just drop the packet.

 

On the Cisco router, if you do a show ip cef 20.1.1.1, you will not see any information or no adjacency information i.e. the router doesn't know how to send a packet to this subnet.

Hope this answers your question.

 

Regards

 

Vinit

Thanks
--Vinit

Hello Vinijain,

At very first communication router will send hello at multicast address i.e 224.0.0.5. So at starting no one knows about the its neighbor since they communicate via multicast address.once they get reply at 224.0.0.5 they look for the router-id from where they got the reply.Till now there were no need for interface ip for neighbor formation.

I know in order to communicate the device interface should be in same subnets but according to RFC if the interface id is different on serial then also the neighborship creates.

Also think of the wan network ,is it possible in wan that both interface belong to same subnets.

I am trying to understand this at packet level where I am not able to see any interface layer 3 address.

Please guide me with more appropriate answers.

Thanks in advance.

Regards,

Mrityunjay Singh

Hello Mrityunjay

First of all, we need to understand from the routing protocol perspective (OSPF ) the only time we are allowed to form adjacency over a media and have different subnets (for example R1 has 10.1.1.1/24 and R2 has 20.1.1.1/24) is when you run "ip unnumbered". In all other cases the subnet needs to match, in most cases also the mask.

Coming back to your point on RFC, the RFC also talks about the adjacency criteria:

 

7.5 The graph of adjacencies

An adjacency is bound to the network that the two routers have in

common.  If two routers have multiple networks in common, they may have

multiple adjacencies between them.

Also, the RFC mentions the below statement:

"

All routers connected to a common network must agree on certain

    parameters (Network mask, HelloInterval and RouterDeadInterval).

"

So what you are trying here is already outside the scope of RFC.

Thus the network/subnet has to match for the adjacency to form.

 

Regards

Vinit

Thanks
--Vinit

What you can also try is try to run debug ip ospf adj:

 

R2#debug ip ospf adj
OSPF adjacency events debugging is on
R2#
*Mar  1 01:10:03.615: OSPF: Rcv pkt from 10.1.1.1, FastEthernet0/0, area 0.0.0.0 : src not on the same network
R2#

 

the OSPF process clearly tells that the packet received is not from the same subnet and thus not eligible for an adjacency formation.

Hope this clarifies more.

Regards

Vinit

Thanks
--Vinit

Hi,

RFC stated that:

"Therefore, the packet's IP source address is required to be on the same network as the receiving interface.  This can be verified by comparing the packet's IP source address to the interface's IP address, after masking both addresses with the interface mask."

 

So you are right saying that IP address is not it hello packet but OSPF process has to check it based on IP packet.

 

Bye,

enrico

Vinit Jain
Cisco Employee
Cisco Employee

You can also refer to the below CCO links:

 

http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/9237-9.html#q30

http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/7039-1.html

 

Thanks
--Vinit

Hello


Try

Router A

int loopback 1

ip address 1.1.1.1 255.255.255.255

interface Serial1/0
 ip unnumbered loopback 1


no router ospf 1

router ospf 1
 router-id 1.1.1.1
 network 1.1.1.1 0.0.0.0 area 0

ip route 2.2.2.2 255.255.255.255 Serial1.0

 

 

Router B

in loopback 1
ip address 2.2.2.2 255.255.255.255

interface Serial1/0
 ip  unnumbered loopback 1


no router ospf 1

router ospf 1
 router-id 2.2.22
 network 2.2.2.2 0.0.0.0 area 0

ip route 1.1.1.1 255.255.255.255 Serial1.0


This way the router "borrows" it ip address from the loopbacks and the static creates the NLRI between the routers

 

Another way is to use Virtual-templates via PPP


res

Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul