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