]> pere.pagekite.me Git - homepage.git/blob - blog/tags/mesh network/mesh network.rss
85dd8454175059cb21fa8d86abf95ee901397aa4
[homepage.git] / blog / tags / mesh network / mesh network.rss
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries tagged mesh network</title>
5 <description>Entries tagged mesh network</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>Teaching vmdebootstrap to create Raspberry Pi SD card images</title>
11 <link>http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Teaching_vmdebootstrap_to_create_Raspberry_Pi_SD_card_images.html</guid>
13 <pubDate>Sun, 27 Oct 2013 17:00:00 +0100</pubDate>
14 <description>&lt;p&gt;The
15 &lt;a href=&quot;http://packages.qa.debian.org/v/vmdebootstrap.html&quot;&gt;vmdebootstrap&lt;/a&gt;
16 program is a a very nice system to create virtual machine images. It
17 create a image file, add a partition table, mount it and run
18 debootstrap in the mounted directory to create a Debian system on a
19 stick. Yesterday, I decided to try to teach it how to make images for
20 &lt;a href=&quot;https://wiki.debian.org/RaspberryPi&quot;&gt;Raspberry Pi&lt;/a&gt;, as part
21 of a plan to simplify the build system for
22 &lt;a href=&quot;https://wiki.debian.org/FreedomBox&quot;&gt;the FreedomBox
23 project&lt;/a&gt;. The FreedomBox project already uses vmdebootstrap for
24 the virtualbox images, but its current build system made multistrap
25 based system for Dreamplug images, and it is lacking support for
26 Raspberry Pi.&lt;/p&gt;
27
28 &lt;p&gt;Armed with the knowledge on how to build &quot;foreign&quot; (aka non-native
29 architecture) chroots for Raspberry Pi, I dived into the vmdebootstrap
30 code and adjusted it to be able to build armel images on my amd64
31 Debian laptop. I ended up giving vmdebootstrap five new options,
32 allowing me to replicate the image creation process I use to make
33 &lt;a href=http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html&quot;&quot;&gt;Debian
34 Jessie based mesh node images for the Raspberry Pi&lt;/a&gt;. First, the
35 &lt;tt&gt;--foreign /path/to/binfm_handler&lt;/tt&gt; option tell vmdebootstrap to
36 call debootstrap with --foreign and to copy the handler into the
37 generated chroot before running the second stage. This allow
38 vmdebootstrap to create armel images on an amd64 host. Next I added
39 two new options &lt;tt&gt;--bootsize size&lt;/tt&gt; and &lt;tt&gt;--boottype
40 fstype&lt;/tt&gt; to teach it to create a separate /boot/ partition with the
41 given file system type, allowing me to create an image with a vfat
42 partition for the /boot/ stuff. I also added a &lt;tt&gt;--variant
43 variant&lt;/tt&gt; option to allow me to create smaller images without the
44 Debian base system packages installed. Finally, I added an option
45 &lt;tt&gt;--no-extlinux&lt;/tt&gt; to tell vmdebootstrap to not install extlinux
46 as a boot loader. It is not needed on the Raspberry Pi and probably
47 most other non-x86 architectures. The changes were accepted by the
48 upstream author of vmdebootstrap yesterday and today, and is now
49 available from
50 &lt;a href=&quot;http://git.liw.fi/cgi-bin/cgit/cgit.cgi/vmdebootstrap/&quot;&gt;the
51 upstream project page&lt;/a&gt;.&lt;/p&gt;
52
53 &lt;p&gt;To use it to build a Raspberry Pi image using Debian Jessie, first
54 create a small script (the customize script) to add the non-free
55 binary blob needed to boot the Raspberry Pi and the APT source
56 list:&lt;/p&gt;
57
58 &lt;p&gt;&lt;pre&gt;
59 #!/bin/sh
60 set -e # Exit on first error
61 rootdir=&quot;$1&quot;
62 cd &quot;$rootdir&quot;
63 cat &amp;lt;&amp;lt;EOF &gt; etc/apt/sources.list
64 deb http://http.debian.net/debian/ jessie main contrib non-free
65 EOF
66 # Install non-free binary blob needed to boot Raspberry Pi. This
67 # install a kernel somewhere too.
68 wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update \
69 -O $rootdir/usr/bin/rpi-update
70 chmod a+x $rootdir/usr/bin/rpi-update
71 mkdir -p $rootdir/lib/modules
72 touch $rootdir/boot/start.elf
73 chroot $rootdir rpi-update
74 &lt;/pre&gt;&lt;/p&gt;
75
76 &lt;p&gt;Next, fetch the latest vmdebootstrap script and call it like this
77 to build the image:&lt;/p&gt;
78
79 &lt;pre&gt;
80 sudo ./vmdebootstrap \
81 --variant minbase \
82 --arch armel \
83 --distribution jessie \
84 --mirror http://http.debian.net/debian \
85 --image test.img \
86 --size 600M \
87 --bootsize 64M \
88 --boottype vfat \
89 --log-level debug \
90 --verbose \
91 --no-kernel \
92 --no-extlinux \
93 --root-password raspberry \
94 --hostname raspberrypi \
95 --foreign /usr/bin/qemu-arm-static \
96 --customize `pwd`/customize \
97 --package netbase \
98 --package git-core \
99 --package binutils \
100 --package ca-certificates \
101 --package wget \
102 --package kmod
103 &lt;/pre&gt;&lt;/p&gt;
104
105 &lt;p&gt;The list of packages being installed are the ones needed by
106 rpi-update to make the image bootable on the Raspberry Pi, with the
107 exception of netbase, which is needed by debootstrap to find
108 /etc/hosts with the minbase variant. I really wish there was a way to
109 set up an Raspberry Pi using only packages in the Debian archive, but
110 that is not possible as far as I know, because it boots from the GPU
111 using a non-free binary blob.&lt;/p&gt;
112
113 &lt;p&gt;The build host need debootstrap, kpartx and qemu-user-static and
114 probably a few others installed. I have not checked the complete
115 build dependency list.&lt;/p&gt;
116
117 &lt;p&gt;The resulting image will not use the hardware floating point unit
118 on the Raspberry PI, because the armel architecture in Debian is not
119 optimized for that use. So the images created will be a bit slower
120 than &lt;a href=&quot;http://www.raspbian.org/&quot;&gt;Raspbian&lt;/a&gt; based images.&lt;/p&gt;
121 </description>
122 </item>
123
124 <item>
125 <title>A Raspberry Pi based batman-adv Mesh network node</title>
126 <link>http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html</link>
127 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/A_Raspberry_Pi_based_batman_adv_Mesh_network_node.html</guid>
128 <pubDate>Mon, 21 Oct 2013 11:40:00 +0200</pubDate>
129 <description>&lt;p&gt;The last few days I have been experimenting with
130 &lt;a href=&quot;http://www.open-mesh.org/projects/batman-adv/wiki&quot;&gt;the
131 batman-adv mesh technology&lt;/a&gt;. I want to gain some experience to see
132 if it will fit &lt;a href=&quot;https://wiki.debian.org/FreedomBox&quot;&gt;the
133 Freedombox project&lt;/a&gt;, and together with my neighbors try to build a
134 mesh network around the park where I live. Batman-adv is a layer 2
135 mesh system (&quot;ethernet&quot; in other words), where the mesh network appear
136 as if all the mesh clients are connected to the same switch.&lt;/p&gt;
137
138 &lt;p&gt;My hardware of choice was the Linksys WRT54GL routers I had lying
139 around, but I&#39;ve been unable to get them working with batman-adv. So
140 instead, I started playing with a
141 &lt;a href=&quot;http://www.raspberrypi.org/&quot;&gt;Raspberry Pi&lt;/a&gt;, and tried to
142 get it working as a mesh node. My idea is to use it to create a mesh
143 node which function as a switch port, where everything connected to
144 the Raspberry Pi ethernet plug is connected (bridged) to the mesh
145 network. This allow me to hook a wifi base station like the Linksys
146 WRT54GL to the mesh by plugging it into a Raspberry Pi, and allow
147 non-mesh clients to hook up to the mesh. This in turn is useful for
148 Android phones using &lt;a href=&quot;http://servalproject.org/&quot;&gt;the Serval
149 Project&lt;/a&gt; voip client, allowing every one around the playground to
150 phone and message each other for free. The reason is that Android
151 phones do not see ad-hoc wifi networks (they are filtered away from
152 the GUI view), and can not join the mesh without being rooted. But if
153 they are connected using a normal wifi base station, they can talk to
154 every client on the local network.&lt;/p&gt;
155
156 &lt;p&gt;To get this working, I&#39;ve created a debian package
157 &lt;a href=&quot;https://github.com/petterreinholdtsen/meshfx-node&quot;&gt;meshfx-node&lt;/a&gt;
158 and a script
159 &lt;a href=&quot;https://github.com/petterreinholdtsen/meshfx-node/blob/master/build-rpi-mesh-node&quot;&gt;build-rpi-mesh-node&lt;/a&gt;
160 to create the Raspberry Pi boot image. I&#39;m using Debian Jessie (and
161 not Raspbian), to get more control over the packages available.
162 Unfortunately a huge binary blob need to be inserted into the boot
163 image to get it booting, but I&#39;ll ignore that for now. Also, as
164 Debian lack support for the CPU features available in the Raspberry
165 Pi, the system do not use the hardware floating point unit. I hope
166 the routing performance isn&#39;t affected by the lack of hardware FPU
167 support.&lt;/p&gt;
168
169 &lt;p&gt;To create an image, run the following with a sudo enabled user
170 after inserting the target SD card into the build machine:&lt;/p&gt;
171
172 &lt;p&gt;&lt;pre&gt;
173 % wget -O build-rpi-mesh-node \
174 https://raw.github.com/petterreinholdtsen/meshfx-node/master/build-rpi-mesh-node
175 % sudo bash -x ./build-rpi-mesh-node &gt; build.log 2&gt;&amp;1
176 % dd if=/root/rpi/rpi_basic_jessie_$(date +%Y%m%d).img of=/dev/mmcblk0 bs=1M
177 %
178 &lt;/pre&gt;&lt;/p&gt;
179
180 &lt;p&gt;Booting with the resulting SD card on a Raspberry PI with a USB
181 wifi card inserted should give you a mesh node. At least it does for
182 me with a the wifi card I am using. The default mesh settings are the
183 ones used by the Oslo mesh project at Hackeriet, as I mentioned in
184 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html&quot;&gt;an
185 earlier blog post about this mesh testing&lt;/a&gt;.&lt;/p&gt;
186
187 &lt;p&gt;The mesh node was not horribly expensive either. I bought
188 everything over the counter in shops nearby. If I had ordered online
189 from the lowest bidder, the price should be significantly lower:&lt;/p&gt;
190
191 &lt;p&gt;&lt;table&gt;
192
193 &lt;tr&gt;&lt;th&gt;Supplier&lt;/th&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;NOK&lt;/th&gt;&lt;/tr&gt;
194 &lt;tr&gt;&lt;td&gt;Teknikkmagasinet&lt;/td&gt;&lt;td&gt;Raspberry Pi model B&lt;/td&gt;&lt;td&gt;349.90&lt;/td&gt;&lt;/tr&gt;
195 &lt;tr&gt;&lt;td&gt;Teknikkmagasinet&lt;/td&gt;&lt;td&gt;Raspberry Pi type B case&lt;/td&gt;&lt;td&gt;99.90&lt;/td&gt;&lt;/tr&gt;
196 &lt;tr&gt;&lt;td&gt;Lefdal&lt;/td&gt;&lt;td&gt;Jensen Air:Link 25150&lt;/td&gt;&lt;td&gt;295.-&lt;/td&gt;&lt;/tr&gt;
197 &lt;tr&gt;&lt;td&gt;Clas Ohlson&lt;/td&gt;&lt;td&gt;Kingston 16 GB SD card&lt;/td&gt;&lt;td&gt;199.-&lt;/td&gt;&lt;/tr&gt;
198 &lt;tr&gt;&lt;td&gt;Total cost&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;943.80&lt;/td&gt;&lt;/tr&gt;
199
200 &lt;/table&gt;&lt;/p&gt;
201
202 &lt;p&gt;Now my mesh network at home consist of one laptop in the basement
203 connected to my production network, one Raspberry Pi node on the 1th
204 floor that can be seen by my neighbor across the park, and one
205 play-node I use to develop the image building script. And some times
206 I hook up my work horse laptop to the mesh to test it. I look forward
207 to figuring out what kind of latency the batman-adv setup will give,
208 and how much packet loss we will experience around the park. :)&lt;/p&gt;
209 </description>
210 </item>
211
212 <item>
213 <title>Oslo community mesh network - with NUUG and Hackeriet at Hausmania</title>
214 <link>http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html</link>
215 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Oslo_community_mesh_network___with_NUUG_and_Hackeriet_at_Hausmania.html</guid>
216 <pubDate>Fri, 11 Oct 2013 14:10:00 +0200</pubDate>
217 <description>&lt;p&gt;Wireless mesh networks are self organising and self healing
218 networks that can be used to connect computers across small and large
219 areas, depending on the radio technology used. Normal wifi equipment
220 can be used to create home made radio networks, and there are several
221 successful examples like
222 &lt;a href=&quot;http://www.freifunk.net/&quot;&gt;Freifunk&lt;/a&gt; and
223 &lt;a href=&quot;http://www.awmn.net/&quot;&gt;Athens Wireless Metropolitan Network&lt;/a&gt;
224 (see
225 &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_wireless_community_networks_by_region#Greece&quot;&gt;wikipedia
226 for a large list&lt;/a&gt;) around the globe. To give you an idea how it
227 work, check out the nice overview of the Kiel Freifunk community which
228 can be seen from their
229 &lt;a href=&quot;http://freifunk.in-kiel.de/ffmap/nodes.html&quot;&gt;dynamically
230 updated node graph and map&lt;/a&gt;, where one can see how the mesh nodes
231 automatically handle routing and recover from nodes disappearing.
232 There is also a small community mesh network group in Oslo, Norway,
233 and that is the main topic of this blog post.&lt;/p&gt;
234
235 &lt;p&gt;I&#39;ve wanted to check out mesh networks for a while now, and hoped
236 to do it as part of my involvement with the &lt;a
237 href=&quot;http://www.nuug.no/&quot;&gt;NUUG member organisation&lt;/a&gt; community, and
238 my recent involvement in
239 &lt;a href=&quot;https://wiki.debian.org/FreedomBox&quot;&gt;the Freedombox project&lt;/a&gt;
240 finally lead me to give mesh networks some priority, as I suspect a
241 Freedombox should use mesh networks to connect neighbours and family
242 when possible, given that most communication between people are
243 between those nearby (as shown for example by research on Facebook
244 communication patterns). It also allow people to communicate without
245 any central hub to tap into for those that want to listen in on the
246 private communication of citizens, which have become more and more
247 important over the years.&lt;/p&gt;
248
249 &lt;p&gt;So far I have only been able to find one group of people in Oslo
250 working on community mesh networks, over at the hack space
251 &lt;a href=&quot;http://hackeriet.no/&quot;&gt;Hackeriet&lt;/a&gt; at Husmania. They seem to
252 have started with some Freifunk based effort using OLSR, called
253 &lt;a href=&quot;http://oslo.freifunk.net/index.php?title=Main_Page&quot;&gt;the Oslo
254 Freifunk project&lt;/a&gt;, but that effort is now dead and the people
255 behind it have moved on to a batman-adv based system called
256 &lt;a href=&quot;http://meshfx.org/trac&quot;&gt;meshfx&lt;/a&gt;. Unfortunately the wiki
257 site for the Oslo Freifunk project is no longer possible to update to
258 reflect this fact, so the old project page can&#39;t be updated to point to
259 the new project. A while back, the people at Hackeriet invited people
260 from the Freifunk community to Oslo to talk about mesh networks. I
261 came across this video where Hans Jørgen Lysglimt interview the
262 speakers about this talk (from
263 &lt;a href=&quot;https://www.youtube.com/watch?v=N2Kd7CLkhSY&quot;&gt;youtube&lt;/a&gt;):&lt;/p&gt;
264
265 &lt;p&gt;&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/N2Kd7CLkhSY&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
266
267 &lt;p&gt;I mentioned OLSR and batman-adv, which are mesh routing protocols.
268 There are heaps of different protocols, and I am still struggling to
269 figure out which one would be &quot;best&quot; for some definitions of best, but
270 given that the community mesh group in Oslo is so small, I believe it
271 is best to hook up with the existing one instead of trying to create a
272 completely different setup, and thus I have decided to focus on
273 batman-adv for now. It sure help me to know that the very cool
274 &lt;a href=&quot;http://www.servalproject.org/&quot;&gt;Serval project in Australia&lt;/a&gt;
275 is using batman-adv as their meshing technology when it create a self
276 organizing and self healing telephony system for disaster areas and
277 less industrialized communities. Check out this cool video presenting
278 that project (from
279 &lt;a href=&quot;https://www.youtube.com/watch?v=30qNfzJCQOA&quot;&gt;youtube&lt;/a&gt;):&lt;/p&gt;
280
281 &lt;p&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/30qNfzJCQOA&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
282
283 &lt;p&gt;According to the wikipedia page on
284 &lt;a href=&quot;http://en.wikipedia.org/wiki/Wireless_mesh_network&quot;&gt;Wireless
285 mesh network&lt;/a&gt; there are around 70 competing schemes for routing
286 packets across mesh networks, and OLSR, B.A.T.M.A.N. and
287 B.A.T.M.A.N. advanced are protocols used by several free software
288 based community mesh networks.&lt;/p&gt;
289
290 &lt;p&gt;The batman-adv protocol is a bit special, as it provide layer 2
291 (as in ethernet ) routing, allowing ipv4 and ipv6 to work on the same
292 network. One way to think about it is that it provide a mesh based
293 vlan you can bridge to or handle like any other vlan connected to your
294 computer. The required drivers are already in the Linux kernel at
295 least since Debian Wheezy, and it is fairly easy to set up. A
296 &lt;a href=&quot;http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide&quot;&gt;good
297 introduction&lt;/a&gt; is available from the Open Mesh project. These are
298 the key settings needed to join the Oslo meshfx network:&lt;/p&gt;
299
300 &lt;p&gt;&lt;table&gt;
301 &lt;tr&gt;&lt;th&gt;Setting&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;
302 &lt;tr&gt;&lt;td&gt;Protocol / kernel module&lt;/td&gt;&lt;td&gt;batman-adv&lt;/td&gt;&lt;/tr&gt;
303 &lt;tr&gt;&lt;td&gt;ESSID&lt;/td&gt;&lt;td&gt;meshfx@hackeriet&lt;/td&gt;&lt;/tr&gt;
304 &lt;td&gt;Channel / Frequency&lt;/td&gt;&lt;td&gt;11 / 2462&lt;/td&gt;&lt;/tr&gt;
305 &lt;td&gt;Cell ID&lt;/td&gt;&lt;td&gt;02:BA:00:00:00:01&lt;/td&gt;
306 &lt;/table&gt;&lt;/p&gt;
307
308 &lt;p&gt;The reason for setting ad-hoc wifi Cell ID is to work around bugs
309 in firmware used in wifi card and wifi drivers. (See a nice post from
310 VillageTelco about
311 &quot;&lt;a href=&quot;http://tiebing.blogspot.no/2009/12/ad-hoc-cell-splitting-re-post-original.html&quot;&gt;Information
312 about cell-id splitting, stuck beacons, and failed IBSS merges!&lt;/a&gt;
313 for details.) When these settings are activated and you have some
314 other mesh node nearby, your computer will be connected to the mesh
315 network and can communicate with any mesh node that is connected to
316 any of the nodes in your network of nodes. :)&lt;/p&gt;
317
318 &lt;p&gt;My initial plan was to reuse my old Linksys WRT54GL as a mesh node,
319 but that seem to be very hard, as I have not been able to locate a
320 firmware supporting batman-adv. If anyone know how to use that old
321 wifi access point with batman-adv these days, please let me know.&lt;/p&gt;
322
323 &lt;p&gt;If you find this project interesting and want to join, please join
324 us on IRC, either channel
325 &lt;a href=&quot;irc://irc.freenode.net/#oslohackerspace&quot;&gt;#oslohackerspace&lt;/a&gt;
326 or &lt;a href=&quot;irc://irc.freenode.net/#nuug&quot;&gt;#nuug&lt;/a&gt; on
327 irc.freenode.net.&lt;/p&gt;
328
329 &lt;p&gt;While investigating mesh networks in Oslo, I came across an old
330 research paper from the university of Stavanger and Telenor Research
331 and Innovation called
332 &lt;a href=&quot;http://folk.uio.no/paalee/publications/netrel-egeland-iswcs-2008.pdf&quot;&gt;The
333 reliability of wireless backhaul mesh networks&lt;/a&gt; and elsewhere
334 learned that Telenor have been experimenting with mesh networks at
335 Grünerløkka in Oslo. So mesh networks are also interesting for
336 commercial companies, even though Telenor discovered that it was hard
337 to figure out a good business plan for mesh networking and as far as I
338 know have closed down the experiment. Perhaps Telenor or others would
339 be interested in a cooperation?&lt;/p&gt;
340
341 &lt;p&gt;&lt;strong&gt;Update 2013-10-12&lt;/strong&gt;: I was just
342 &lt;a href=&quot;http://lists.alioth.debian.org/pipermail/freedombox-discuss/2013-October/005900.html&quot;&gt;told
343 by the Serval project developers&lt;/a&gt; that they no longer use
344 batman-adv (but are compatible with it), but their own crypto based
345 mesh system.&lt;/p&gt;
346 </description>
347 </item>
348
349 </channel>
350 </rss>