Testing OSPF in simple configuration: bugs detected
Posted: Tue Dec 14, 2021 10:38 am
In order to test OSPF in RouterOS v7.1 I've created this project in GNS3:
The configuration is the same for every router, changing only IP addresses:
I start the routers in order so R1 gets elected as DR and R2 as BDR:
Now, I start ping from nuc-1 to nuc-2 and I disable the link between R4 and the switch. After several seconds, R1 won't show R4 as a neighbor and there is no packet loss between nuc-1 and nuc-2 as expected.
But, when the link between R4 and the switch is resumed, packets are lost from nuc-1 to nuc-2:
BUG: Looking at R1 neighbors I can see that R4 has been selected as the new DR (why? DR was previously elected) and adjacency get stucked between R1 and R4:
And in R4:
In order to see if this bug is caused by a bug in DR election, I repeat the lab but this time, I start the routers in reversed order, so R4 get elected as DR and R3 as BDR. If I suspend the link between R1 and the switch and wait for timeouts... when the link is resumed R1 can't get the adjacency:
And from R4 point of view:
Hope this can help MikroTik developers to find and fix it.
PD: Please @anav feel free to improve the thread title
BUG: When routers get out of OSPF and after some time they come back, adjacency isn't recovered and DR election seems erratic.The configuration is the same for every router, changing only IP addresses:
Code: Select all
# R1 configuration
/interface bridge
add name=loopback
/routing id
add id=172.0.0.11 name=ospf
/routing ospf instance
add name=ospf-instance-1 router-id=ospf
/routing ospf area
add instance=ospf-instance-1 name=backbone
/ip address
add address=172.17.0.11/24 interface=ether1 network=172.17.0.0
add address=192.168.1.1/24 interface=ether2 network=192.168.1.0
add address=172.17.0.11 interface=loopback network=172.17.0.11
/routing ospf interface-template
add area=backbone networks=172.17.0.0/24
add area=backbone networks=192.168.1.0/24 passive
add area=backbone networks=172.17.0.11
/system identity
set name=R1
Code: Select all
[admin@R1] > routing/ospf/neighbor/print
Flags: V - virtual; D - dynamic
0 D instance=ospf-instance-1 area=backbone address=172.17.0.12 priority=128
router-id=172.17.0.12 dr=172.17.0.11 bdr=172.17.0.12 state="Full"
state-changes=6 adjacency=1m39s timeout=31s
1 D instance=ospf-instance-1 area=backbone address=172.17.0.13 priority=128
router-id=172.17.0.13 dr=172.17.0.11 bdr=172.17.0.12 state="Full"
state-changes=6 adjacency=49s timeout=34s
2 D instance=ospf-instance-1 area=backbone address=172.17.0.14 priority=128
router-id=172.17.0.14 dr=172.17.0.11 bdr=172.17.0.12 state="Full"
state-changes=6 adjacency=19s timeout=35s
But, when the link between R4 and the switch is resumed, packets are lost from nuc-1 to nuc-2:
Code: Select all
...
From 192.168.1.1 icmp_seq=108 Destination Net Unreachable
From 192.168.1.1 icmp_seq=110 Destination Net Unreachable
...
Code: Select all
[admin@R1] > routing/ospf/neighbor/print
Flags: V - virtual; D - dynamic
0 D instance=ospf-instance-1 area=backbone address=172.17.0.12 priority=128
router-id=172.17.0.12 dr=172.17.0.14 bdr=172.17.0.12 state="Full"
state-changes=6 adjacency=7m59s timeout=31s
1 D instance=ospf-instance-1 area=backbone address=172.17.0.13 priority=128
router-id=172.17.0.13 dr=172.17.0.14 bdr=172.17.0.12 state="TwoWay"
state-changes=7 timeout=34s
2 D instance=ospf-instance-1 area=backbone address=172.17.0.14 priority=128
router-id=172.17.0.14 dr=172.17.0.14 bdr=172.17.0.12 state="ExStart"
state-changes=3 timeout=31s
Code: Select all
[admin@R4] > routing/ospf/neighbor/print
Flags: V - virtual; D - dynamic
0 D instance=ospf-instance-1 area=backbone address=172.17.0.11 priority=128
router-id=172.0.0.11 dr=172.17.0.14 bdr=172.17.0.12 state="TwoWay"
state-changes=2 timeout=35s
1 D instance=ospf-instance-1 area=backbone address=172.17.0.12 priority=128
router-id=172.17.0.12 dr=172.17.0.14 bdr=172.17.0.12 state="Full"
state-changes=6 adjacency=10m55s timeout=35s
2 D instance=ospf-instance-1 area=backbone address=172.17.0.13 priority=128
router-id=172.17.0.13 dr=172.17.0.14 bdr=172.17.0.12 state="Full"
state-changes=6 adjacency=10m52s timeout=39s
Code: Select all
[admin@R1] > routing/ospf/neighbor/print
Flags: V - virtual; D - dynamic
0 D instance=ospf-instance-1 area=backbone address=172.17.0.12 priority=128
router-id=172.17.0.12 dr=172.17.0.14 bdr=172.17.0.13 state="TwoWay"
state-changes=4 timeout=33s
1 D instance=ospf-instance-1 area=backbone address=172.17.0.13 priority=128
router-id=172.17.0.13 dr=172.17.0.14 bdr=172.17.0.13 state="ExStart"
state-changes=3 timeout=37s
2 D instance=ospf-instance-1 area=backbone address=172.17.0.14 priority=128
router-id=172.17.0.14 dr=172.17.0.14 bdr=172.17.0.13 state="ExStart"
state-changes=3 timeout=37s
Code: Select all
[admin@R4] > routing/ospf/neighbor/print
Flags: V - virtual; D - dynamic
0 D instance=ospf-instance-1 area=backbone address=172.17.0.11 priority=128
router-id=172.0.0.11 dr=172.17.0.14 bdr=172.17.0.13 state="TwoWay"
state-changes=2 timeout=34s
1 D instance=ospf-instance-1 area=backbone address=172.17.0.12 priority=128
router-id=172.17.0.12 dr=172.17.0.14 bdr=172.17.0.13 state="Full"
state-changes=6 adjacency=5m36s timeout=31s
2 D instance=ospf-instance-1 area=backbone address=172.17.0.13 priority=128
router-id=172.17.0.13 dr=172.17.0.14 bdr=172.17.0.13 state="Full"
state-changes=6 adjacency=6m16s timeout=34s
PD: Please @anav feel free to improve the thread title