Bridge border router and 6LowPan interfaces

Hi Bernhard:

I think power consumption is a good reason for having a RIOT border router.

I worked in some WSNs that measured the isotherm level of snow in a mountain (data sent via GPRS), it was not easy to get there and you don’t have power lines. So you need batteries.

Considering you are using batteries as a power supply, a Zolertia Z1 (for example) consumes 20-25 mA in average, and 200uA in idle. A PI Zero consumes 140 mA in average, and 65mA while in idle.

If you send data every 5 minutes (4:50 minutes in idle, wake up and 10 seconds for sending data) from a Pi Zero, while in idle you are using more than 300 times the power consumption of the Z1. You get a major improvement in battery life using a node as a border router.

Also if you are measuring a critical process, you could need redundant border routers to make sure that data is sent. In that case it’s nice to have the same hardware for border routers and nodes (you just need to add a GPRS module to a node and with “a few tweaks” is a new border router).

Cheers!

From LINUX:

@/RIOT-2016.02/examples/gnrc_networking$ ping6 -I tun0 affe::2 PING affe::2(affe::2) from affe::1 tun0: 56 data bytes 64 bytes from affe::2: icmp_seq=1 ttl=64 time=974 ms 64 bytes from affe::2: icmp_seq=2 ttl=64 time=21.7 ms 64 bytes from affe::2: icmp_seq=3 ttl=64 time=22.3 ms ^C --- affe::2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2001ms rtt min/avg/max/mdev = 21.747/339.440/974.234/448.867 ms

@Cenk (or anyone), could you give me some help on that please?

Hey,

I want to be able to send a packet from LINUX to board B through board A (border router) LINUX -> A -> B

and then receive the answer from B to LINUX through A LINUX <- A <- B

So I will be able to open an UDP socket on my LINUX on the interface tun which will receive packets from board B. Does it make sense?

Baptiste

Hi Baptiste,

I guess what you're trying to achieve is the common use case of the border router AFAIK. Did you try to setup an "affe::x"-style address on node B? I'm still not too familiar with IPv6 terms, but I think that those fe80:: addresses are in a local scope and therefore not forwarded by a router, while the "affe::x" addresses are global.

Node B: # ifconfig 7 add affe::3 # udp server start 8888

Linux: $ netcat -6u affe::3

I had this exact same setup (with same addresses) already and it worked out of the box that way, so I'm pretty sure that in principle what you're trying to do is possible and you're not far away :wink:

Cheers, Daniel

Hey,

I guess what you're trying to achieve is the common use case of the border router AFAIK.

Yes. Guess we need more documentation / FAQ for this.

Did you try to setup an "affe::x"-style address on node B? I'm still not too familiar with IPv6 terms, but I think that those fe80:: addresses are in a local scope and therefore not forwarded by a router, while the "affe::x" addresses are global.

Node B: # ifconfig 7 add affe::3 # udp server start 8888

No, that won't work. 6lowpan expects addresses to be based on a node's eui64.

@babtiste, add address "dead::<eui64_part>" to node A 6lowpan interface. <eui64_part> must be the same as that interfaces link-local address, eg., fe80::aa:bb:cc:dd:ee:ff -> deaf::aa:bb:cc:dd:ee:ff.

Then, on linux, you have to add a route to dead::/64 via node a's affe:: address (from the tun interface).

Kaspar

@kaspar, @Daniel I'm goint to try to sum up:

Node A (border router on samr21): Iface 5: inet6 addr: fe80::585a:4b52:7476:b996

ifconfig 6 add affe::2 (Is that necessary then?) ncache add 6 affe::1 ifconfig 6 add dead::585a:4b52:7476:b996

2016-03-07 17:10:09,884 - INFO # > ifconfig 2016-03-07 17:10:09,889 - INFO # Iface 5 HWaddr: 39:96 Channel: 26 Page: 0 NID: 0x23 2016-03-07 17:10:09,894 - INFO # Long HWaddr: 5a:5a:4b:52:74:76:b9:96 2016-03-07 17:10:09,903 - INFO # TX-Power: 0dBm State: IDLE max. Retrans.: 3 CSMA Retries: 4 2016-03-07 17:10:09,913 - INFO # AUTOACK CSMA MTU:1280 HL:64 6LO RTR IPHC 2016-03-07 17:10:09,916 - INFO # Source address length: 8 2016-03-07 17:10:09,918 - INFO # Link type: wireless 2016-03-07 17:10:09,924 - INFO # inet6 addr: ff02::1/128 scope: local [multicast] 2016-03-07 17:10:09,931 - INFO # inet6 addr: fe80::585a:4b52:7476:b996/64 scope: local 2016-03-07 17:10:09,936 - INFO # inet6 addr: ff02::1:ff76:b996/128 scope: local [multicast] 2016-03-07 17:10:09,938 - INFO # Iface 6 2016-03-07 17:10:09,939 - INFO # 2016-03-07 17:10:09,943 - INFO # MTU:1280 HL:64 RTR RTR_ADV 2016-03-07 17:10:09,945 - INFO # Link type: wired 2016-03-07 17:10:09,951 - INFO # inet6 addr: ff02::1/128 scope: local [multicast] 2016-03-07 17:10:09,956 - INFO # inet6 addr: ff02::2/128 scope: local [multicast] 2016-03-07 17:10:09,962 - INFO # inet6 addr: dead::585a:4b52:7476:b996/64 scope: global 2016-03-07 17:10:09,969 - INFO # inet6 addr: ff02::1:ff00:2/128 scope: local [multicast] 2016-03-07 17:10:09,974 - INFO # inet6 addr: ff02::1:ff76:b996/128 scope: local [multicast] 2016-03-07 17:10:09,978 - INFO # inet6 addr: affe::2/64 scope: global

Node B (gnrc_networking on samr21): 2016-03-07 17:09:28,005 - INFO # > ifconfig 2016-03-07 17:09:28,010 - INFO # Iface 7 HWaddr: 52:be Channel: 26 Page: 0 NID: 0x23 2016-03-07 17:09:28,014 - INFO # Long HWaddr: 5a:5a:45:5f:0d:d7:52:be 2016-03-07 17:09:28,021 - INFO # TX-Power: 0dBm State: IDLE max. Retrans.: 3 CSMA Retries: 4 2016-03-07 17:09:28,029 - INFO # AUTOACK CSMA MTU:1280 HL:64 6LO RTR IPHC 2016-03-07 17:09:28,031 - INFO # Source address length: 8 2016-03-07 17:09:28,032 - INFO # Link type: wireless 2016-03-07 17:09:28,037 - INFO # inet6 addr: ff02::1/128 scope: local [multicast] 2016-03-07 17:09:28,043 - INFO # inet6 addr: fe80::585a:455f:dd7:52be/64 scope: local 2016-03-07 17:09:28,050 - INFO # inet6 addr: ff02::1:ffd7:52be/128 scope: local [multicast]

Linux: /RIOT/dist/tools/tunslip$ sudo ./tunslip6 affe::1/64 -t tun0 -s /dev/ttyUSB0 ********SLIP started on ``/dev/ttyUSB0'' opened tun device ``/dev/tun0'' ifconfig tun0 inet `hostname` up ifconfig tun0 add affe::1/64 ifconfig tun0 add fe80::0:0:0:1/64 ifconfig tun0

tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00           inet adr:127.0.1.1 P-t-P:127.0.1.1 Masque:255.255.255.255           adr inet6: fe80::1/64 Scope:Lien           adr inet6: affe::1/64 Scope:Global           UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1           Packets reçus:0 erreurs:0 :0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 lg file transmission:500           Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)

Instead of adding a route, I want to try to ping beforehand: ping6 -I tun0 affe::2 ACK ping6 -I tun0 affe::585a:455f:dd7:52be NACK ping6 -I tun0 dead::585a:455f:dd7:52be NACK ping6 -I tun0 fe80::585a:455f:dd7:52be NACK

Which one should be ok?

@Kaspar, @Daniel? I think I'm close to make it work but I think I miss something about bridge and network here.