Discussion:
OLSR 0.6.5.2 QUAGGA plugin but does not export all routes to QUAGGA
Ros Molodyko
2013-04-03 21:45:56 UTC
Permalink
All,

I tested the QUAGGA plugin and discovered that it successfully imports the routes from QUAGGA to OLSR (I tested OSPF and OSPFv6), but exporting from OLSR to QUAGGA is not working well.

I have few wireless ad-hoc routers with IP 10.0.0.x/32 and one OLSR/OSPF gateway with the trivial address 10.0.1/24 on the wired LAN side (screenshots of topologies and routing are included).

OLSR_24_lan.png
================
IP addresses of wireless ad-hoc routers are from 10.0.0.x/24:
- all routes from OSPF are imported to OLSR,
- only route what are TWO OR MORE HOPS AWAY from the OLSR/OSPF gateway are exported to OSPF.

OLSR_32_lan.png
================
IP addresses of wireless ad-hoc routers are from 10.0.0.x/32:
- all routes from OSPF are still imported to OLSR,
- no one route from OLSR is exported to OSPF.

Plugin parameters are:
LoadPlugin "olsrd_quagga.so.0.2.2"
{
PlParam "Redistribute" "ospf"
PlParam "Redistribute" "ospf6"
PlParam "ExportRoutes" "both"
PlParam "Distance" "125"
PlParam "LocalPref" "true"
PlParam "SockPath" "/var/run/quagga/zserv.api"
PlParam "Version" "2"
}

What is wrong here???

Thank you
Saverio Proto
2013-04-04 01:01:18 UTC
Permalink
Hello,

first of all please tell us what version of quagga you are using.
to export OLSR to QUAGGA you need a patched version of quagga that
supports the OLSR protocol.

you can use the OpenWRT Linux distribution, or get quagga from here:
https://github.com/ninuxorg/quagga-manet/tree/olsrpatch-0.99.21

once you installed this version of quagga
in zebra if you do:

show ip route olsr

can you see the OLSR routes ?

if yes the redistribution of routes from from OLSR to OSPF should be
configured inside zebra.

ciao :)

Saverio
Post by Ros Molodyko
All,
I tested the QUAGGA plugin and discovered that it successfully imports the routes from QUAGGA to OLSR (I tested OSPF and OSPFv6), but exporting from OLSR to QUAGGA is not working well.
I have few wireless ad-hoc routers with IP 10.0.0.x/32 and one OLSR/OSPF gateway with the trivial address 10.0.1/24 on the wired LAN side (screenshots of topologies and routing are included).
OLSR_24_lan.png
================
- all routes from OSPF are imported to OLSR,
- only route what are TWO OR MORE HOPS AWAY from the OLSR/OSPF gateway are exported to OSPF.
OLSR_32_lan.png
================
- all routes from OSPF are still imported to OLSR,
- no one route from OLSR is exported to OSPF.
LoadPlugin "olsrd_quagga.so.0.2.2"
{
PlParam "Redistribute" "ospf"
PlParam "Redistribute" "ospf6"
PlParam "ExportRoutes" "both"
PlParam "Distance" "125"
PlParam "LocalPref" "true"
PlParam "SockPath" "/var/run/quagga/zserv.api"
PlParam "Version" "2"
}
What is wrong here???
Thank you
--
Olsr-users mailing list
https://lists.olsr.org/mailman/listinfo/olsr-users
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Ros Molodyko
2013-04-05 19:17:25 UTC
Permalink
Hello Saverio,

thank you for the fast response.

I use QUAGGA 0.99.21mr2.2 with the OLSR patch from Vasilis (zebra_rib.c file required manual porting since MDR is slightly different from the baseline of QUAGGA)

Also I modified the OLSR indicator in the lib/route_types.txt from "o" to "l" to distinguish it from OSPF6:
===========================================================
ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'o', 1, 1, "OSPF6"
ZEBRA_ROUTE_OLSR, olsr, olsrd, 'l', 1, 1, "OLSR"
===========================================================

I guess I found one bug in the olsr-quagga plugin, one potential bug (or feature?) in the QUAGGA patch, and one potential solution.

The first bug is the not supported parameter "ExportRoutes" "both" in the olsr-quagga plugin.
The second potential bug is the route type in the QUAGGA patch.

I ran show "ip route olsr" and got nothing, all routes from OLSR cluster were "kernel ones":

=============================================
# "10.0.0.0/32, PlParam "ExportRoutes" "both"

n1# show ip route olsr
n1# show ip route kernel
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, o - OSPF6, I - IS-IS, B - BGP, H - HSLS,
l - OLSR, b - BATMAN, A - Babel,
- selected route, * - FIB route
K * 10.0.0.2/32 via 10.0.0.2, eth0 inactive
K * 10.0.0.3/32 via 10.0.0.3, eth0 inactive
K * 10.0.0.4/32 via 10.0.0.3, eth0 inactive
K * 10.0.0.5/32 via 10.0.0.3, eth0 inactive
K * 10.0.0.6/32 via 10.0.0.6, eth0 inactive
K * 10.0.0.7/32 via 10.0.0.7, eth0 inactive
K * 10.0.0.8/32 via 10.0.0.2, eth0 inactive
=============================================

So OLSR exported routes as "kernel", that's why "redistribute olsr" command
in the OSPF configuration did not work! Neither "redistribute kernel" worked because of "inactive" status of routes. (For the network 10.0.0.0/24 only directly connected nodes
had inactive route status, so "redistribute kernel" injected few routes to QUAGGA).

Only when I changed the "ExportRoutes" to "only" OLSR exported routes as "olsr".

=============================================
# "10.0.0.0/32, PlParam "ExportRoutes" "only"

n1# show ip route kernel
n1# show ip route olsr
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, o - OSPF6, I - IS-IS, B - BGP, H - HSLS,
l - OLSR, b - BATMAN, A - Babel,
- selected route, * - FIB route
l>* 10.0.0.2/32 [125/1] is directly connected, eth0, 00:01:07
l>* 10.0.0.3/32 [125/1] is directly connected, eth0, 00:01:06
l> 10.0.0.4/32 [125/2] via 10.0.0.3, eth0, 00:00:57
l> 10.0.0.5/32 [125/2] via 10.0.0.3, eth0, 00:01:00
l>* 10.0.0.6/32 [125/1] is directly connected, eth0, 00:01:08
l>* 10.0.0.7/32 [125/1] is directly connected, eth0, 00:01:07
l> 10.0.0.8/32 [125/2] via 10.0.0.2, eth0, 00:00:35
=============================================

I looked at the patch code lib/quagga/src/plugin.c and found the only supported "ExportRoutes" parameters "only" and "additional" in the zplugin_exportroutes().
Looks like the parameter "both" listed in the README_QUAGGA file is not handled.

With "ExportRoutes" "only" QUAGGA redistributed OLSR routes to the OSPF domain, but the gateway node n1 still did not have the one-hop neighbors in the FIB:

==============================================================================
[***@n1 n1.conf]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.5 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.4 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.8 10.0.0.2 255.255.255.255 UGH 2 0 0 eth0
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.0.2.0 10.0.1.2 255.255.255.0 UG 20 0 0 eth1
[***@n1 n1.conf]#
==============================================================================

Only after I commented out the statement in the QUAGGA patch zebra/rt_netlink.c:
"if (rib->type == ZEBRA_ROUTE_OLSR) req.r.rtm_scope = RT_SCOPE_LINK;"
the gateway n1 got all routes in the FIB and all tests passed fine with OLSR-OSPF(wired) and
OLSR-OSPF6/MDR(wireless) routing protocols:

==============================================================================
n1# sho ip ro olsr
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, o - OSPF6, I - IS-IS, B - BGP, H - HSLS,
l - OLSR, b - BATMAN, A - Babel,
- selected route, * - FIB route
l>* 10.0.0.2/32 [125/1] is directly connected, eth0, 00:03:15
l>* 10.0.0.3/32 [125/1] is directly connected, eth0, 00:03:15
l>* 10.0.0.4/32 [125/2] via 10.0.0.3, eth0, 00:03:06
l>* 10.0.0.5/32 [125/2] via 10.0.0.3, eth0, 00:03:09
l>* 10.0.0.6/32 [125/1] is directly connected, eth0, 00:03:18
l>* 10.0.0.7/32 [125/1] is directly connected, eth0, 00:03:18
l>* 10.0.0.8/32 [125/2] via 10.0.0.2, eth0, 00:02:44
n1#

[***@n1 n1.conf]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.5 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.4 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.7 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.6 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.3 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.2 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.8 10.0.0.2 255.255.255.255 UGH 2 0 0 eth0
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.0.2.0 10.0.1.2 255.255.255.0 UG 20 0 0 eth1
[***@n1 n1.conf]#
==============================================================================

I'm not sure if the RT_SCOPE_LINK route scope is the bug - it may be correct setting for
the baseline QUAGGA but invalid for QUAGGA/MDR branch. I think it worth to be noticed
in README.

Regards,

Rostislav Molodyko
Mayflower Communications
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Saverio Proto
2013-04-08 22:48:46 UTC
Permalink
Hello,

please I still don't have some information.

what version of OLSR you are using ?

can you reproduce the same bug with my version of Quagga and the latest OLSR ?

if you can't, then we can say for sure the problem is in QUAGGA MDR.

in such case the only person that can really help you is Vasilis

ciao :)

Saverio
Post by Ros Molodyko
Hello Saverio,
thank you for the fast response.
I use QUAGGA 0.99.21mr2.2 with the OLSR patch from Vasilis (zebra_rib.c file required manual porting since MDR is slightly different from the baseline of QUAGGA)
===========================================================
ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'o', 1, 1, "OSPF6"
ZEBRA_ROUTE_OLSR, olsr, olsrd, 'l', 1, 1, "OLSR"
===========================================================
I guess I found one bug in the olsr-quagga plugin, one potential bug (or feature?) in the QUAGGA patch, and one potential solution.
The first bug is the not supported parameter "ExportRoutes" "both" in the olsr-quagga plugin.
The second potential bug is the route type in the QUAGGA patch.
=============================================
# "10.0.0.0/32, PlParam "ExportRoutes" "both"
n1# show ip route olsr
n1# show ip route kernel
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, o - OSPF6, I - IS-IS, B - BGP, H - HSLS,
l - OLSR, b - BATMAN, A - Babel,
- selected route, * - FIB route
K * 10.0.0.2/32 via 10.0.0.2, eth0 inactive
K * 10.0.0.3/32 via 10.0.0.3, eth0 inactive
K * 10.0.0.4/32 via 10.0.0.3, eth0 inactive
K * 10.0.0.5/32 via 10.0.0.3, eth0 inactive
K * 10.0.0.6/32 via 10.0.0.6, eth0 inactive
K * 10.0.0.7/32 via 10.0.0.7, eth0 inactive
K * 10.0.0.8/32 via 10.0.0.2, eth0 inactive
=============================================
So OLSR exported routes as "kernel", that's why "redistribute olsr" command
in the OSPF configuration did not work! Neither "redistribute kernel" worked because of "inactive" status of routes. (For the network 10.0.0.0/24 only directly connected nodes
had inactive route status, so "redistribute kernel" injected few routes to QUAGGA).
Only when I changed the "ExportRoutes" to "only" OLSR exported routes as "olsr".
=============================================
# "10.0.0.0/32, PlParam "ExportRoutes" "only"
n1# show ip route kernel
n1# show ip route olsr
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, o - OSPF6, I - IS-IS, B - BGP, H - HSLS,
l - OLSR, b - BATMAN, A - Babel,
- selected route, * - FIB route
l>* 10.0.0.2/32 [125/1] is directly connected, eth0, 00:01:07
l>* 10.0.0.3/32 [125/1] is directly connected, eth0, 00:01:06
l> 10.0.0.4/32 [125/2] via 10.0.0.3, eth0, 00:00:57
l> 10.0.0.5/32 [125/2] via 10.0.0.3, eth0, 00:01:00
l>* 10.0.0.6/32 [125/1] is directly connected, eth0, 00:01:08
l>* 10.0.0.7/32 [125/1] is directly connected, eth0, 00:01:07
l> 10.0.0.8/32 [125/2] via 10.0.0.2, eth0, 00:00:35
=============================================
I looked at the patch code lib/quagga/src/plugin.c and found the only supported "ExportRoutes" parameters "only" and "additional" in the zplugin_exportroutes().
Looks like the parameter "both" listed in the README_QUAGGA file is not handled.
==============================================================================
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.5 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.4 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.8 10.0.0.2 255.255.255.255 UGH 2 0 0 eth0
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.0.2.0 10.0.1.2 255.255.255.0 UG 20 0 0 eth1
==============================================================================
"if (rib->type == ZEBRA_ROUTE_OLSR) req.r.rtm_scope = RT_SCOPE_LINK;"
the gateway n1 got all routes in the FIB and all tests passed fine with OLSR-OSPF(wired) and
==============================================================================
n1# sho ip ro olsr
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, o - OSPF6, I - IS-IS, B - BGP, H - HSLS,
l - OLSR, b - BATMAN, A - Babel,
- selected route, * - FIB route
l>* 10.0.0.2/32 [125/1] is directly connected, eth0, 00:03:15
l>* 10.0.0.3/32 [125/1] is directly connected, eth0, 00:03:15
l>* 10.0.0.4/32 [125/2] via 10.0.0.3, eth0, 00:03:06
l>* 10.0.0.5/32 [125/2] via 10.0.0.3, eth0, 00:03:09
l>* 10.0.0.6/32 [125/1] is directly connected, eth0, 00:03:18
l>* 10.0.0.7/32 [125/1] is directly connected, eth0, 00:03:18
l>* 10.0.0.8/32 [125/2] via 10.0.0.2, eth0, 00:02:44
n1#
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.5 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.4 10.0.0.3 255.255.255.255 UGH 2 0 0 eth0
10.0.0.7 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.6 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.3 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.2 0.0.0.0 255.255.255.255 UH 1 0 0 eth0
10.0.0.8 10.0.0.2 255.255.255.255 UGH 2 0 0 eth0
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.0.2.0 10.0.1.2 255.255.255.0 UG 20 0 0 eth1
==============================================================================
I'm not sure if the RT_SCOPE_LINK route scope is the bug - it may be correct setting for
the baseline QUAGGA but invalid for QUAGGA/MDR branch. I think it worth to be noticed
in README.
Regards,
Rostislav Molodyko
Mayflower Communications
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Ros Molodyko
2013-04-08 23:53:12 UTC
Permalink
Hi Saverio!
Post by Saverio Proto
what version of OLSR you are using ?
I'm using the latest OLSR 0.6.5.2, as posted in the subject.
Post by Saverio Proto
can you reproduce the same bug with my version of Quagga and the latest OLSR ?
What is your version of Quagga?
If that's the 0.91.21 (baseline w/o MDR), I will try it.

Regards,

Rostislav Molodyko
Mayflower Communications
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Saverio Proto
2013-04-09 08:35:45 UTC
Permalink
Post by Ros Molodyko
I'm using the latest OLSR 0.6.5.2, as posted in the subject.
OK
Post by Ros Molodyko
What is your version of Quagga?
If that's the 0.91.21 (baseline w/o MDR), I will try it.
https://github.com/ninuxorg/quagga-manet/tree/olsrpatch-0.99.21
checkout the olsrpatch-0.99.21 branch of the repository

Saverio
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Ros Molodyko
2013-04-11 19:23:48 UTC
Permalink
Hi Saverio,

I tested the OLSR patch with quagga 0.99.21, it works fine, all routes are exported and imported. I compared it with my patch for 0.99.21mdr2.2 and found that I placed the line

if (rib->type == ZEBRA_ROUTE_OLSR) req.r.rtm_scope = RT_SCOPE_LINK;

onto the wrong place in the file rt_netlink.c, because the QUAGGA-MDR version of that file have few more lines. I adjusted the position of the foregoing statement, now everything works fine.

My final version of the patch for QUAGGA 0.00.21mdr2.2 is enclosed.

As I noticed, the "both" value of the "ExportRoutes" parameter in the OLSR plugin is not handled. I think the olsrd-0.6.5.2\lib\quagga\README_QUAGGA needs to be updated.

Thank you for your help,

Rostislav Molodyko
Mayflower Communications
Ferry Huberts
2013-04-11 19:30:25 UTC
Permalink
Hi guys,

Great work!

If possible, then please coordinate between each other and submit a
combined patch. That way we have 3 knowledgeable quagga people agreeing
on the patch. So that we can add all the 'Signed-of-by' and 'Tested-by'
tags in the commit :-)
Post by Ros Molodyko
Hi Saverio,
I tested the OLSR patch with quagga 0.99.21, it works fine, all routes are exported and imported. I compared it with my patch for 0.99.21mdr2.2 and found that I placed the line
if (rib->type == ZEBRA_ROUTE_OLSR) req.r.rtm_scope = RT_SCOPE_LINK;
onto the wrong place in the file rt_netlink.c, because the QUAGGA-MDR version of that file have few more lines. I adjusted the position of the foregoing statement, now everything works fine.
My final version of the patch for QUAGGA 0.00.21mdr2.2 is enclosed.
As I noticed, the "both" value of the "ExportRoutes" parameter in the OLSR plugin is not handled. I think the olsrd-0.6.5.2\lib\quagga\README_QUAGGA needs to be updated.
Thank you for your help,
Rostislav Molodyko
Mayflower Communications
--
Ferry Huberts
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Saverio Proto
2013-04-11 21:49:34 UTC
Permalink
Hello Ros,

the problem about ExportRoutes has already been fixed in this commit
of the master branch: df19c5d9b7573fa469ae66cbfff598a8fcab9b47

http://olsr.org/git/?p=olsrd.git;a=commitdiff;h=df19c5d9b7573fa469ae66cbfff598a8fcab9b47

however this commit is not yet into release branch, because noone had
time for testing :)

feel free to cherry-pick this commit and test the quagga plugin with
your setup. If it works for you we can cherry-pick it to release
branch.

thanks !

ciao.

Saverio
Post by Ros Molodyko
Hi Saverio,
I tested the OLSR patch with quagga 0.99.21, it works fine, all routes are exported and imported. I compared it with my patch for 0.99.21mdr2.2 and found that I placed the line
if (rib->type == ZEBRA_ROUTE_OLSR) req.r.rtm_scope = RT_SCOPE_LINK;
onto the wrong place in the file rt_netlink.c, because the QUAGGA-MDR version of that file have few more lines. I adjusted the position of the foregoing statement, now everything works fine.
My final version of the patch for QUAGGA 0.00.21mdr2.2 is enclosed.
As I noticed, the "both" value of the "ExportRoutes" parameter in the OLSR plugin is not handled. I think the olsrd-0.6.5.2\lib\quagga\README_QUAGGA needs to be updated.
Thank you for your help,
Rostislav Molodyko
Mayflower Communications
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Saverio Proto
2013-04-11 21:59:18 UTC
Permalink
Post by Ros Molodyko
My final version of the patch for QUAGGA 0.00.21mdr2.2 is enclosed.
thanks, but this is not the way to submit code to a open source project :(

I cannot understand the changes from this zip file. Don't you use
anything like git or svn ? Do you need help getting started with those
tools ?

where I can download from the Internet the code of Quagga MDR ? what
are the differences with the normal Quagga ? I never heard before
about this MDR version. Thanks.

bye,

Saverio
--
Olsr-users mailing list
Olsr-***@lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-users
Loading...