An edge or border router is a device sitting between 2 networks, forwarding messages from either side. In a 6LoWPAN network, the border router connects to IPv6 networks, allowing to translate between each other. This is the default topology for any network intended to be connected to an infrastructure network. Interfaces like Ethernet, WiFi or GPRS/2G/3G are used to connect a border router to i.e Internet.
In Contiki and other OS traditionally the border routers are implemented via a
tunslip6 script. Tunslip is a tool used to bridge IP traffic between a host and a border router over a serial line.
Tunslip creates a virtual network interface (tun) on the host side and uses SLIP (serial line internet protocol) to encapsulate and pass IP traffic to and from the other side of the serial line. The network element sitting on the other side of the line does a similar job with it’s network interface. The
tunslip6 script can run on a laptop or PC, Raspberry Pi, BeagleBone, etc.
A drawback about this solution is its requirement of an extra utility running in a system, and for most cases in which only a border router is needed, ending up with a dedicated host solely for this task.
One feasible option is to use a ready to use the ENC28J60, an Ethernet module driven over SPI, bundled with the RE-Mote or the Firefly for instant gratification. One advantage about this setup, is being able to "talk" directly to IPv4 devices as it runs below the hood an IP64 implementation, translating from IPv6 to IPv4.
We are currently developing our own router module, but in the meantime you can build your own!
- A RE-Mote or a Firefly platform.
- A ENC28J60 breakout module, this one is available from OLIMEX.
- A protoboard with wires, or jumper wires.
First connect the ENC28J60
SPI pins to the
Firefly, we will only need to connect the
3.3V. Both the
Firefly provides 3.3V so you only need to power up the nodes, and the ENC28J60 module will be powered by the
Below is the pin-out of the ENC28J60 module from OLIMEX.
RST pin #8 is
Active Low, we pull the pin to 3.3V as well as pin #10 as shown in the photo below.
The RE-Mote and Firefly uses the
SPI0 port to communicate with the built-in
CC1200 radio transceiver, to communicate with the ENC28J60 module we use the
SPI1 instead (in the case of the RE-Mote it is shared with the Micro-SD).
Below is the pin-out of the Firefly:
The RE-Mote pin-out is available in its own wiki page.
CS (chip select) pin #7 pin is connected to the
eth-gw IoT Ethernet gateway solution based on the Zoul is currently under evaluation and production (stay tuned!)
In the meantime we have pushed the code support in a development branch, available for testing and review. The code is pin compatible with the setup described above.
git clone https://github.com/alignan/contikigit checkout pull/eth-gwcd examples/zolertia/zoul/ip64-http-example/ip64-eth-gwmake TARGET=zoul BOARD=eth-gw ip64-router.upload
Read the README file for more instructions.
Alternatively you can flash the attached pre-compiled binaries and start playing!