OpenWrt Forum Archive

Topic: mobilemesh port

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello-

I am working on a port of mobilemesh[1], a mesh networking package, to OpenWRT.  Currently I have patched the software to the point that it compiles against uclibc++.  However when it is compiled it crashes almost immediatly.  When it is compiled against stdlibc++ with my patches on a x86 box it works as expected however.  So this implies that it is a platform specific issue and I was hoping I could call on you guys for some help and advice.

The svn repo for the code thus far can be found here: https://lug.oregonstate.edu/svn/mmwrt/p … obilemesh/

If anyone has any suggestions or patches please post them here or email me brandon at ifup dot org.   Also if people are interested on running it on there PCs I would suggest using the Debian packages, or using their patches[2] if you compile your own.

Thanks

[1] http://www.mitre.org/work/tech_transfer/mobilemesh/
[2] http://ftp.debian.org/debian/pool/main/ … rig.tar.gz http://ftp.debian.org/debian/pool/main/ … -6.diff.gz

I tried it on my whiterussian buildroot and it builds fine. I tried the resulting mmdiscover binary on my whiterussian-rc4 router and it works.
Are you sure you use the same branches (whiterussian?) for building your packages and testing them?

Here's a patch to rationalize the Makefile:

--- package/mobilemesh/Makefile (revision 13)
+++ package/mobilemesh/Makefile (working copy)
@@ -21,10 +21,12 @@
 $(PKG_BUILD_DIR)/.built:
        rm -rf $(PKG_INSTALL_DIR)
        mkdir -p $(PKG_INSTALL_DIR)/usr/bin
-       $(MAKE) -C $(PKG_BUILD_DIR)     $(TARGET_CONFIGURE_OPTS) \
-        $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS)" \
-        CXXFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -I$(PKG_BUILD_DIR)/  -I$(PKG_BUILD_DIR)/include-fixes -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -nodefaultlibs -luClibc++ -fno-builtin -fno-rtti -nostdinc++ -D_GNU_SOURCE -lm"
-       make -C $(PKG_BUILD_DIR) DESTDIR=$(PKG_INSTALL_DIR) install
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CXXFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -I. -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -fno-builtin -fno-rtti -nostdinc++" \
+               LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -luClibc++ -lc -lm" \
+               DESTDIR=$(PKG_INSTALL_DIR) \
+               all install
        touch $@

 $(IPKG_MOBILEMESH):

This package might end up in our buildroot now that you contributed it... smile

Thanks for the patch, and for testing it out.

Did you run mmrp and mmdiscover with another host on the network? 

It seems to crash under the situation when you have hosts trying to update routes.  It updates the first route on the wrt and then crashes.

My WRT54G is currently running Whiterussion RC4 and I am using the latest SDK to build everything.

Here is the FAQ[1] entry for getting up and running with mobilemesh.  It would be a huge help if you could test with a two node network and report the results (or even a patch :-)).

I hang out in #openwrt nick is philips I can help you debug it there if I am around.

Thanks!

2.2 Can you give me a quick primer on how to run the mmdiscover and
    mmrp tools?

Sure. But before you try to run the tools, you really should
understand the fundamentals of IP and be familiar with tools like
"ifconfig", "route", "netstat", and "tcpdump". For simplicity, let's
assume you have three laptops: A, B, and C. Let's also assume each
laptop has a single IP interface that happens to be a wireless LAN
card. ( Please don't assume that you must have a wireless LAN card in
order to use Mobile Mesh...you can run Mobile Mesh on any IP interface
regardless of media! ) Now let's assume that the name of the interface
on each laptop is "eth0". We are doing alot of assuming here. Finally,
let's assume that we want to run Mobile Mesh because we have no fixed
infrastructure to leverage, like 802.11 access points.

If all we want to do is allow the three laptops to communicate,
possibly across a multihop path, and the laptops are not connected to
any media other than the wireless LAN, then we should begin by
removing any static routes that each laptop may have. In a shell
window, type "netstat -rn" to see the current list of IP routes. Make
sure there are none listed. If there are some listed, delete them
using the "route" command. You're on your own to delete the routes...I
warned you before that you should be familiar with these tools!

You should now start the link discovery tool on each laptop. In a
shell window, as root, type "mmdiscover -i eth0 -z". The "-z" option
prevents the tool from becoming a daemon and running in the
background. I suggest using this mode at first, since any error
messages will be sent to the shell window rather than
/var/log/syslog. 

Now, you should make sure that the interfaces you want to run "mmrp"
on are listed in the mmrp config file.  You can change the parameters
that each protocol uses by editing their respective default config
files: /etc/mobilemesh/mmdiscover.conf and /etc/mobilemesh/mmrp.conf.
Make sure a line "interface eth0" is in the mmrp config file. You can
supply your own config file rather than using the default config
file...read the mmrp man page and look for the "-f" option.  You can
now start the router by typing, as root, in a shell window "mmrp -z".

After a little time, you should see routes get added to the IP table;
use "netstat" to verify this. If you want more details about what the
tools are doing you can turn on debugging (see the next FAQ question.)

[1] http://www.mitre.org/work/tech_transfer/mobilemesh/FAQ

It looks like it may be a bug in the uClibc++ iterator for map.  Only under the uClibc++ implementation does the iterator return a routerId 0.


Excerpt from https://code.ifup.org/public/mesh/mobilemesh/MmRouter.h

        // Should we transmit someone else's Lsp?
        if(double(txTime) <= double(now)) {
          // Iterate over the tx time map...send any that need to go
          TimeMap::iterator it;
          for(it = cTxTimeMap.begin(); it != cTxTimeMap.end();) {
            if(double((*it).second) < double(now)) {
              // Make sure we have this Lsp!!
              unsigned int routerId = (*it).first;
              LspMap::const_iterator j = cLspMap.find(routerId);
              if(j != cLspMap.end()) {
                BroadcastLsp((*j).second);
              }
              else {
                Report::Error("Router::Run() - tx time map and lsp map are out of sync!");
              }
              // Remove this entry from the tx time map
              // NOTE: the trick to not invalidate the iterator is to post-increment
              cTxTimeMap.erase(it++);
            }
            else {
              it++;
            }
          }
        }

This is the code in suspect.  Everything works under uClibc++ with multiple other hosts on the network if the rebroadcast lines are commented out and this map iterator is skipped. 

If anyone else can help debug or offer some insight it would be a huge help, C++ is not my strongest language :-)

Thanks

Have you been able to port mobilemesh to OpenWrt?

Can you write a few words to compare mobilemesh with olsr?

Thanks

Wallace

so this is a year+ later- has anyone actually got a compiled MobileMesh package (compatible with RC6?) available? I'd really like to not reinvent the wheel and would appreciate being able to use the hard work several of you have done.

The discussion might have continued from here.