-
Notifications
You must be signed in to change notification settings - Fork 4
bridging
One possiblity to connect your simulated Contiki (and real) nodes to other IPv6 networks is via a Router. By configuring a second network (i.e. a different prefix), the route advertisment (radvd) and a few static routes you can direct IP traffic to your WSN. Alternatively you can setup up a network bridge - a node that simply copies packets between two interfaces. The only caveat is that you have to run the Edison in AP mode.
So switch your Edison into AP mode (hold down PWR button between 3-7 seconds, a WiFi network with Edison-xx will be there, or check here. Then we create a new bridge interface and add the wlan0 and tap0, tap1 ... tapX interface of each emulated Contiki process to the bridge. The same setup can be used whether you simulate nodes in Cooja (and use tunslip or the native-border-router), emulate contiki nodes natively or run on a real device (which also hands over its IP packets via the tap mechanism):
$ brctl addbr br0
$ brctl addif br0 wlan0
$ brctl addif br0 tap0
$ ifconfig br0 up # start up the bridge
Now join the Wifi network with your local machine, join the aaaa::/64 network by statically configuring your network interface (with ifconfig on linux for example, or a dialog on windows). After that you should be able to ping6 and connect to the global IPv6 address Contiki tells you when you start the process, or the IPv6 addresses listed in Cooja. HINT: figure out a way to execute the above commands whenever a tap device is created.
You can confirm that this works by having your webserver example started and running this ping6 command on any connected machine:
ping6 fe80::206:98ff:fe00:232%wlan0
PING fe80::206:98ff:fe00:232%wlan0(fe80::206:98ff:fe00:232) 56 data bytes
64 bytes from fe80::206:98ff:fe00:232: icmp_seq=2 ttl=64 time=7.97 ms
64 bytes from fe80::206:98ff:fe00:232: icmp_seq=3 ttl=64 time=11.6 ms
64 bytes from fe80::206:98ff:fe00:232: icmp_seq=4 ttl=64 time=18.4 ms
64 bytes from fe80::206:98ff:fe00:232: icmp_seq=5 ttl=64 time=7.14 ms
However this only allows to bridge on the Access Point. So all AP need to be connected via WDS.
Needs more resarch, only AP mode seems to work right now.
Bridging in Client mode is not possible because of reasons.
Maybe this is possible in Ad-Hoc mode? -> No.
Or enabling WDS Mode. You can enable WDS mode with the 'iw' tool (Download from AlexT's Galileo & Edison pages):
iw wlan0 set 4addr on # does not work on the Edison
In theory this will enable a special 4addr mode in wifi client mode, which would allow to bridge traffic between tap0 and wlan0. However on the Edison this special mode is not implemented.