6LoWPAN-installation

Version 8 (6lowpan group from 18-748 -, 05/06/2010 08:13 pm)

1 1 6lowpan group from 18-748 -
2 8 6lowpan group from 18-748 -
h1. Nano-RK 6LoWPAN Installation
3 8 6lowpan group from 18-748 -
4 8 6lowpan group from 18-748 -
*STEP 1: Install Linux*
5 8 6lowpan group from 18-748 -
6 1 6lowpan group from 18-748 -
Install a Linux kernel >= 2.6.32.  The 6LoWPAN network driver has only been tested on 2.6.32 and
7 1 6lowpan group from 18-748 -
will not compile on previous versions.
8 1 6lowpan group from 18-748 -
9 8 6lowpan group from 18-748 -
*STEP 2: Obtain an IPv6 Address*
10 1 6lowpan group from 18-748 -
11 1 6lowpan group from 18-748 -
For 6LoWPAN to work you need to have an IPv6 address.  Unfortunately, most ISPs only provide
12 1 6lowpan group from 18-748 -
IPv4 connectivity.  If this is the case you can obtain an IPv6 address by using the Freenet6
13 8 6lowpan group from 18-748 -
tunnelling service.  You can find more info here: "You will need to register so that their service can give you an IPv6 address.
14 1 6lowpan group from 18-748 -
15 4 6lowpan group from 18-748 -
Once you have registered, you will have to download the 'gw6c' software.  This can be obtained from
16 1 6lowpan group from 18-748 -
the previous website, or through your distro's package management system.  The latest versions are
17 4 6lowpan group from 18-748 -
available in the repositories for Ubuntu and Gentoo.  When the software has been installed, it can
18 1 6lowpan group from 18-748 -
be configured by editing 'gw6c.conf'.  This file is installed with gw6c, on Ubuntu it is located at
19 4 6lowpan group from 18-748 -
'/etc/gw6c/gw6c.conf', and on Gentoo it is at '/etc/gateway6/gw6c.conf'.  You will have to enter your
20 4 6lowpan group from 18-748 -
login information, and change the server from 'anon' to 'broker'.
21 4 6lowpan group from 18-748 -
22 8 6lowpan group from 18-748 -
Full installation details for Gentoo can be found at [http://www.gentoo.org/doc/en/ipv6.xml":http://gogonet.gogo6.com/page/freenet6-services]. under
23 4 6lowpan group from 18-748 -
the section for freenet6.  The procedure is similar for Ubuntu.
24 4 6lowpan group from 18-748 -
25 8 6lowpan group from 18-748 -
*STEP 3: Obtain an IPv6 Network prefix*
26 1 6lowpan group from 18-748 -
27 1 6lowpan group from 18-748 -
Because we will be distributing IPv6 addresses to each node you will also need to acquire a
28 1 6lowpan group from 18-748 -
network prefix.  Luckily, freenet6 also offers a service where you can get a full IPv6
29 1 6lowpan group from 18-748 -
network prefix.
30 1 6lowpan group from 18-748 -
31 3 6lowpan group from 18-748 -
To do this make sure to change your gw6c.conf configuration file to 'router':
32 3 6lowpan group from 18-748 -
33 8 6lowpan group from 18-748 -
<pre>
34 3 6lowpan group from 18-748 -
host_type=router
35 8 6lowpan group from 18-748 -
</pre>
36 3 6lowpan group from 18-748 -
37 1 6lowpan group from 18-748 -
Also change the Network interface to 6lowpan0:
38 3 6lowpan group from 18-748 -
39 8 6lowpan group from 18-748 -
<pre>
40 1 6lowpan group from 18-748 -
if_prefix=6lowpan0
41 8 6lowpan group from 18-748 -
</pre>
42 4 6lowpan group from 18-748 -
43 4 6lowpan group from 18-748 -
If you notice problems, make sure the 6lowpan driver is loaded and that the interface exists.
44 1 6lowpan group from 18-748 -
Also make sure that 'radvd' is installed if it was not pulled down as a dependency of gw6c.  It
45 1 6lowpan group from 18-748 -
is required to send router advertisements to the network.  Note however that gw6c will configure
46 7 6lowpan group from 18-748 -
and start radvd, you should not have to configure it manually.  In fact, doing so could prevent
47 7 6lowpan group from 18-748 -
gw6c from working correctly.
48 1 6lowpan group from 18-748 -
49 8 6lowpan group from 18-748 -
*STEP 4: Setup Edge Router Network Device Driver*
50 1 6lowpan group from 18-748 -
51 1 6lowpan group from 18-748 -
go to the driver directory...
52 1 6lowpan group from 18-748 -
53 8 6lowpan group from 18-748 -
<pre>
54 1 6lowpan group from 18-748 -
cd edge/driver/kernel-2.6.32
55 8 6lowpan group from 18-748 -
</pre>
56 1 6lowpan group from 18-748 -
57 1 6lowpan group from 18-748 -
and compile the driver...
58 1 6lowpan group from 18-748 -
59 8 6lowpan group from 18-748 -
<pre>
60 1 6lowpan group from 18-748 -
make
61 8 6lowpan group from 18-748 -
</pre>
62 1 6lowpan group from 18-748 -
63 1 6lowpan group from 18-748 -
now start up the 6LoWPAN module...
64 1 6lowpan group from 18-748 -
65 8 6lowpan group from 18-748 -
<pre>
66 1 6lowpan group from 18-748 -
sudo insmod sixlowpan.ko
67 8 6lowpan group from 18-748 -
</pre>
68 1 6lowpan group from 18-748 -
69 8 6lowpan group from 18-748 -
<pre>
70 1 6lowpan group from 18-748 -
sudo ifconfig 6lowpan0 up
71 8 6lowpan group from 18-748 -
</pre>
72 1 6lowpan group from 18-748 -
73 1 6lowpan group from 18-748 -
Running "ifconfig" should now display "6lowpan0" as a network interface:
74 1 6lowpan group from 18-748 -
75 8 6lowpan group from 18-748 -
<pre>
76 1 6lowpan group from 18-748 -
$ifconfig
77 2 6lowpan group from 18-748 -
6lowpan0  Link encap:Ethernet  HWaddr 92:9d:0b:44:66:c2
78 2 6lowpan group from 18-748 -
          inet6 addr: fe80::909d:bff:fe44:66c2/64 Scope:Link
79 1 6lowpan group from 18-748 -
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
80 1 6lowpan group from 18-748 -
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
81 2 6lowpan group from 18-748 -
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
82 2 6lowpan group from 18-748 -
          collisions:0 txqueuelen:0
83 2 6lowpan group from 18-748 -
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
84 8 6lowpan group from 18-748 -
</pre>
85 1 6lowpan group from 18-748 -
86 1 6lowpan group from 18-748 -
Now start up gw6c...
87 1 6lowpan group from 18-748 -
88 8 6lowpan group from 18-748 -
<pre>
89 1 6lowpan group from 18-748 -
sudo /etc/init.d/gw6c start
90 8 6lowpan group from 18-748 -
</pre>
91 1 6lowpan group from 18-748 -
92 1 6lowpan group from 18-748 -
Running "ifconfig" again should now display the IPv6 prefix associated with 6lowpan0
93 1 6lowpan group from 18-748 -
94 8 6lowpan group from 18-748 -
<pre>
95 2 6lowpan group from 18-748 -
$ifconfig
96 2 6lowpan group from 18-748 -
6lowpan0  Link encap:Ethernet  HWaddr 16:38:96:c7:4f:48  
97 1 6lowpan group from 18-748 -
          inet6 addr: 2001:5c0:1107:9b00::1/64 Scope:Global
98 1 6lowpan group from 18-748 -
          inet6 addr: fe80::1438:96ff:fec7:4f48/64 Scope:Link
99 2 6lowpan group from 18-748 -
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
100 2 6lowpan group from 18-748 -
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
101 1 6lowpan group from 18-748 -
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
102 1 6lowpan group from 18-748 -
          collisions:0 txqueuelen:0 
103 2 6lowpan group from 18-748 -
          RX bytes:0 (0.0 B)  TX bytes:298 (298.0 B)
104 2 6lowpan group from 18-748 -
105 8 6lowpan group from 18-748 -
</pre>
106 1 6lowpan group from 18-748 -
107 8 6lowpan group from 18-748 -
*STEP 5: Setup the Edge Router Radio Node*
108 1 6lowpan group from 18-748 -
109 1 6lowpan group from 18-748 -
We now need to configure the radio node to be used by the edge router so that it may communicate
110 1 6lowpan group from 18-748 -
with the firefly network.
111 1 6lowpan group from 18-748 -
112 1 6lowpan group from 18-748 -
First go to the radio node directory...
113 1 6lowpan group from 18-748 -
114 8 6lowpan group from 18-748 -
<pre>
115 1 6lowpan group from 18-748 -
cd edge/node
116 8 6lowpan group from 18-748 -
</pre>
117 1 6lowpan group from 18-748 -
118 1 6lowpan group from 18-748 -
Compile and program a node...
119 1 6lowpan group from 18-748 -
120 8 6lowpan group from 18-748 -
<pre>
121 2 6lowpan group from 18-748 -
make && make program
122 8 6lowpan group from 18-748 -
</pre>
123 1 6lowpan group from 18-748 -
124 8 6lowpan group from 18-748 -
*STEP 6: Setup the Edge Router User Level Process*
125 1 6lowpan group from 18-748 -
126 1 6lowpan group from 18-748 -
Last thing to setup is the user level process.
127 1 6lowpan group from 18-748 -
128 1 6lowpan group from 18-748 -
Go to the user space process directory
129 1 6lowpan group from 18-748 -
130 8 6lowpan group from 18-748 -
<pre>
131 1 6lowpan group from 18-748 -
cd edge/user
132 8 6lowpan group from 18-748 -
</pre>
133 1 6lowpan group from 18-748 -
134 1 6lowpan group from 18-748 -
compile...
135 1 6lowpan group from 18-748 -
136 8 6lowpan group from 18-748 -
<pre>
137 1 6lowpan group from 18-748 -
make
138 8 6lowpan group from 18-748 -
</pre>
139 1 6lowpan group from 18-748 -
140 1 6lowpan group from 18-748 -
and run the process...
141 1 6lowpan group from 18-748 -
142 8 6lowpan group from 18-748 -
<pre>
143 1 6lowpan group from 18-748 -
sudo ./edge
144 8 6lowpan group from 18-748 -
</pre>
145 1 6lowpan group from 18-748 -
146 8 6lowpan group from 18-748 -
*STEP 7: Setup the nodes*
147 1 6lowpan group from 18-748 -
148 8 6lowpan group from 18-748 -
See the "6LoWPAN api":http://www.nanork.org/wiki/6LoWPAN-api to find the correct way of programming
149 1 6lowpan group from 18-748 -
on the nodes.  Examples can be found in the apps/ folder.
150 1 6lowpan group from 18-748 -
151 8 6lowpan group from 18-748 -
*STEP 8: Setup the MAC Addresses*
152 1 6lowpan group from 18-748 -
153 1 6lowpan group from 18-748 -
You should now assign each firefly node in your network with a unique 16-bit address.  You can
154 1 6lowpan group from 18-748 -
do this by using the config-eeprom program.
155 1 6lowpan group from 18-748 -
156 8 6lowpan group from 18-748 -
<pre>
157 1 6lowpan group from 18-748 -
./config-eeprom
158 8 6lowpan group from 18-748 -
</pre>
159 1 6lowpan group from 18-748 -
160 8 6lowpan group from 18-748 -
*STEP 9: Test*
161 1 6lowpan group from 18-748 -
162 1 6lowpan group from 18-748 -
Congratulations you should now have a network of firefly nodes connected to the internet.  Test
163 1 6lowpan group from 18-748 -
that this is in fact true by going to [http://www.ipv6tools.org] and try pinging one of the nodes
164 1 6lowpan group from 18-748 -
in your network.