6LowPAN Border Router

Build a 6LBR using a Raspberry Pi Zero and CC2650 LaunchPad.

What is a Border Router?

Border Router is a component that actuate at the edge of a netwok. Your main role is to adapt a protocol to communicate to another, and in this case it will encapsulate 6lowpan packets into udp packets to global network.

Code

You need to download contiki source tree at: https://github.com/contiki-os/contiki

We need to comment some lines of the code:

git clone --recursive https://github.com/contiki-os/contiki.git
vi contiki/examples/ipv6/rpl-border-router/project-conf.h 
/*
#ifndef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE    140
#endif
#ifndef UIP_CONF_RECEIVE_WINDOW
#define UIP_CONF_RECEIVE_WINDOW  60
#endif
*/

In the next step, we need to compile the code to the correct target:

cd contiki/examples/ipv6/rpl-border-router 
make TARGET=srf06-cc26xx BOARD=launchpad/cc2650 -j8

You need now flash the program into the launchpad, i recommend to use Flash Programmer 2. The .hex file is on contiki/examples/ipv6/rpl-border-router directory.

Raspberry Pi

We need to run tunslip, tunslip creates a bridge between the RPL network and the Raspberry.

cd contiki/tools
make tunslip6

Now, connect the launchpad to the raspberry usb host port and run tunslip.

sudo ./tunslip6 aaaa::/64 -s /dev/ttyACM0
ifconfig tun0
tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
         inet addr:127.0.1.1  P-t-P:127.0.1.1  Mask:255.255.255.255
         inet6 addr: fe80::1/64 Scope:Link
         inet6 addr: aaaa::1/64 Scope:Global
         UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:500 
         RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Rime started with address 0.18.116.1.0.1.1.1
MAC 00:12:74:01:00:01:01:01 Contiki 2.7 started. Node id is set to 1.
CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26
Tentative link-local IPv6 address fe80:0000:0000:0000:0212:7401:0001:0101
Starting 'Border router process' 'Web server'
*** Address:aaaa::1 => aaaa:0000:0000:0000
Got configuration message of type P
Setting prefix aaaa::
Server IPv6 addresses:
aaaa::212:7401:1:101
fe80::212:7401:1:101

Ok, now you have an 6lowPAN Border Router running! You can check the neighbors table in browser by inserting server ipv6 address.

You can access your nodes from anywhere in the world, if you configure them with real ipv6 address.

Hope this can help you to start!

Thank you.

Source: 6LowPAN Border Router


About The Author

Muhammad Bilal

I am highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top