<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=gb2312"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I am really having difficulty getting my mesh network to operate reliably and would appreciate any help to diagnose what is going on. Here is my test scenario:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>5 Raspberry PI¡¯s running Linux strung together line-of-site using a USB WiFi on the adhoc network<o:p></o:p></p><p class=MsoNormal>One PI acts as the gateway to the Internet (10.100.18.4)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>========== ======== ========== ======== =========<o:p></o:p></p><p class=MsoNormal>10.100.18.4 -> 10.100.18.5 -> 10.100.18.6 -> 10.100.18.7 -> 10.100.18.8<o:p></o:p></p><p class=MsoNormal>========== ========= ========== ========= =========<o:p></o:p></p><p class=MsoNormal> ¡¬<o:p></o:p></p><p class=MsoNormal> V<o:p></o:p></p><p class=MsoNormal> Eth0 (Internet gateway)<o:p></o:p></p><p class=MsoNormal>==========<o:p></o:p></p><p class=MsoNormal>192.168.1.100<o:p></o:p></p><p class=MsoNormal> ==========<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have 2 Android devices ¨C 10.100.18.106 and 10.100.18.202 that join the adhoc network.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Everything seems to set up nicely. When I am in my home all of the nodes are within WiFi range of the gateway, they will register with 10.100.18.4 as the default gateway<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>E.g ¡°ip route¡± for 10.100.18.5 is below (replace src 5 with 6, 7 and 8 for the other nodes)<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>default via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.5 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.0/24 dev wlan0 proto kernel scope link src 10.100.18.5 metric 9<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.4 via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.5 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.6 via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.5 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.7 via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.5 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.8 via 10.100.18.8 dev wlan0 proto 100 src 10.100.18.5 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.106 via 10.100.18.106 dev wlan0 proto 100 src 10.100.18.5 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.202 via 10.100.18.202 dev wlan0 proto 100 src 10.100.18.5 metric 2 onlink<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The Android nodes will set up in the same way<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>default via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.106 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.0/24 dev wlan0 proto kernel scope link src 10.100.18.106 metric 9<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.4 via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.106 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.5 via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.106 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.6 via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.106 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.7 via 10.100.18.4 dev wlan0 proto 100 src 10.100.18.106 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.8 via 10.100.18.8 dev wlan0 proto 100 src 10.100.18.106 metric 2 onlink<o:p></o:p></p><p class=MsoNormal> 10.100.18.202 via 10.100.18.202 dev wlan0 proto 100 src 10.100.18.106 metric 2 onlink<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal>The gateway node 10.100.18.4 will set up with a default gateway which is my home router<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>default via 192.168.1.1 dev eth0 <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal>This looks all great to me. However, Internet packets do not pass through the 192.168.1.1 gateway unless I set up IP table rules to force the packets through even in the local home setup.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> # forward all traffic coming from wlan0 (that's not destined for the laptop) to eth0<o:p></o:p></p><p class=MsoNormal> iptables -A FORWARD ! --dst ${WlanIP} -i wlan0 -o eth0 -j ACCEPT<o:p></o:p></p><p class=MsoNormal> # forward traffic coming from wlan0 to eth0<o:p></o:p></p><p class=MsoNormal> iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT<o:p></o:p></p><p class=MsoNormal> # forward traffic coming from eth0 to wlan0<o:p></o:p></p><p class=MsoNormal> iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT<o:p></o:p></p><p class=MsoNormal> # setup Network Area Translation (NAT) so that all forwarded traffic to eth0 appears to be coming from the laptop's IP address<o:p></o:p></p><p class=MsoNormal> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I found this nice freifunk traceroute tool that displays the MPR route to any node and beyond (<a href="https://downloads.open-mesh.org/fftrace/"><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:#2A5685;background:white'>https://downloads.open-mesh.org/fftrace/</span></a>)<o:p></o:p></p><p class=MsoNormal>Without the iptables, fftrace just stops at the gateway. I can get to the 192.168.1.1 gateway address via any of the nodes including the Android nodes but it won¡¯t go through 192.168.1.1 without the iptables.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>fftrace 192.168.1.1 inside home:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>target-ip: 192.168.1.1 seq: 4 olsr-udp-packets<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>hop Quality etx lq nlq PingIp<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>__________________________________________________<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 10.100.18.6 1<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 10.100.18.4 2<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 192.168.1.1<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>fftrace google.com inside home will do the DNS lookup and then trace as below<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>target-ip: 216.58.194.174 seq: 1 olsr-udp-packets<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>hop Quality etx lq nlq PingIp<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>__________________________________________________<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 10.100.18.6 1<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 10.100.18.4 2<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 192.168.1.1 3<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 10.97.0.1 4<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 96.34.122.10 5<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 96.34.120.108 6<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 96.34.2.2 7<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 96.34.0.0 8<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 96.34.3.1 9<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 72.14.220.11 10<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 216.239.49.168 11<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 64.233.175.249 12<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> 216.58.194.174<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal>Outside of the home from node 8, fftrace to google.com will look like<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>target-ip: 216.58.194.174 seq: 1 olsr-udp-packets<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>hop Quality etx lq nlq PingIp<o:p></o:p></p><p class=MsoNormal>__________________________________________________<o:p></o:p></p><p class=MsoNormal> 10.100.18.7 1<o:p></o:p></p><p class=MsoNormal> 10.100.18.6 2<o:p></o:p></p><p class=MsoNormal> 10.100.18.5 3<o:p></o:p></p><p class=MsoNormal> 10.100.18.4 4<o:p></o:p></p><p class=MsoNormal> 192.168.1.1 5<o:p></o:p></p><p class=MsoNormal> 10.97.0.1 6<o:p></o:p></p><p class=MsoNormal> 96.34.122.10 7<o:p></o:p></p><p class=MsoNormal> 96.34.120.108 8<o:p></o:p></p><p class=MsoNormal> 96.34.2.2 9<o:p></o:p></p><p class=MsoNormal> 96.34.0.0 10<o:p></o:p></p><p class=MsoNormal> 96.34.3.1 11<o:p></o:p></p><p class=MsoNormal> 72.14.220.11 12<o:p></o:p></p><p class=MsoNormal> 216.239.49.168 13<o:p></o:p></p><p class=MsoNormal> 64.233.175.249 14<o:p></o:p></p><p class=MsoNormal> 216.58.194.174<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Now comes the real issue for me and I haven¡¯t been able to figure out why when I string the nodes outdoors line of sight, why things don¡¯t work as well as the 1 hop inside the home through the gateway. Some observations on the outdoor nodes:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>fftrace works fine on all nodes<o:p></o:p></p><p class=MsoNormal>ping works on all nodes with reasonable ping times<o:p></o:p></p><p class=MsoNormal>I can sit in my home and ssh into all the Linux nodes down the line and run tests with reasonable performance.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>All the nodes line up nicely. Node 5 sets up as shown above.<o:p></o:p></p><p class=MsoNormal>Node 6 will set up to route through node 5.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>default via 10.100.18.5 dev wlan0 proto 100 src 10.100.18.6 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.0/24 dev wlan0 proto kernel scope link src 10.100.18.6 metric 9<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.4 via 10.100.18.5 dev wlan0 proto 100 src 10.100.18.6 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.5 via 10.100.18.5 dev wlan0 proto 100 src 10.100.18.6 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.7 via 10.100.18.5 dev wlan0 proto 100 src 10.100.18.6 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.8 via 10.100.18.5 dev wlan0 proto 100 src 10.100.18.6 metric 2 onlink<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>10.100.18.106 via 10.100.18.106 dev wlan0 proto 100 src 10.100.18.6 metric 2 onlink<o:p></o:p></p><p class=MsoNormal> 10.100.18.202 via 10.100.18.202 dev wlan0 proto 100 src 10.100.18.6 metric 2 onlink<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As will node 7 through 6 and through 7, etc<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The fftrace on all of the nodes show that packets are chasing down the chain as expected both for Android and for the Linux PI¡¯s when the nodes are strung out in the neighborhood.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The reliability issue occurs as soon as the Android device (which is how I test the Internet) moves more than 2 nodes down the chain. If the Android device has a default gateway of 10.100.18.4, 10.100.18.5 or even 10.100.18.6 depending on which PI is closest, it all seems to work fine. As soon as I move further down the line to 10.100.18.7 or 10.100.18.8 as the default Android gateway, the Internet access becomes very flaky. Te bowser times out with ¡°No connection¡± and pages sometimes stop displaying. Youtube will work when there are 2 hops but won¡¯t even connect when more.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Are there any log files that I should look at to determine why. In theory, it looks like to me it should work. Unfortunately it isn¡¯t reliable. Sigh!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any guidance would be greatly appreciated.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Peter Emanuel<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>