cetic / 6lbr

A deployment-ready 6LoWPAN Border Router solution based on Contiki
github.com/cetic/6lbr/wiki
Other
337 stars 194 forks source link

Use two BRs as 6lowPAN link #316

Closed michelesponchiado closed 7 years ago

michelesponchiado commented 7 years ago

Hi, I am currently stuck with a problem similar to the one discussed in #153 and a little help would be a real godsend! I am using a couple of SmartRF modules plugged via USB on two different Linux Ubuntu PCs, and I wanted to use the radio modules to give network connectivity between the PCs through 6lowPAN using the traditional IP methods the likes of TCP/UDP etc. The final goal would be to use 6lowPAN to give to an Android hand held unit (HHU) -equipped with a CC2650- seamless network connectivity through an OpenWRT board -also equipped with a CC2650-working as the real border router.

I have configured both the 6lbr daemons as a NDP-ROUTER, here the 6lbr.conf file: on both PCs

CREATE_BRIDGE=6LBR
MODE=NDP-ROUTER
DEV_TAP=tap0
DEV_ETH=wlan0
DEV_BRIDGE=my6b
RAW_ETH=0
BRIDGE=1
ETH_JOIN_BRIDGE=0
DEV_RADIO=/dev/ttyUSB1
BAUDRATE=115200
LOG_LEVEL=3
LOG_SERVICES=-1

I set the WSN/Ethernet addresses to

    aaaa::1/bbbb::100 on PC1
    aaaa::2/cccc::100 on PC2

I added the routing on nvm.conf files: on PC1:

    [network.route]
    dest=cccc::/64
    via=aaaa::2

on PC2:

    [network.route]
    dest=bbbb::/64
    via=aaaa::1

the nvm file is:

/usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat
Reading nvm file '/etc/6lbr/nvm.dat'
Channel : 25
PAN ID : abcd

WSN network prefix : aaaa::
WSN network prefix length : 64
WSN IP address : aaaa::2
WSN accept RA : True
WSN IP address autoconf : False
WSN 6LoWPAN context 0 : aaaa::
DNS server : ::

Eth network prefix : cccc::
Eth network prefix length : 64
Eth IP address : cccc::100
Eth default router : ::
Eth IP address autoconf : False

RA daemon : True
RA router lifetime : 1000
RA maximum interval : 600
RA minimum interval : 200
RA minimum delay : 3
RA PIO enabled : True
RA prefix valid lifetime : 86400
RA prefix preferred lifetime : 14400
RA RIO enabled : True
RA RIO lifetime : 1800

RPL instance ID : 30
RPL DODAG ID manual : False
RPL DODAG ID : aaaa::2
RPL DODAG ID global : True
RPL Preference : 0
RPL version ID :  : 45
RPL DIO interval doubling : 8
RPL DIO minimum interval : 12
RPL DIO redundancy : 10
RPL default lifetime : 30
RPL maximum rank increase : 1792
RPL minimum rank increment : 256
RPL lifetime unit : 256

RPL Non Storing : False
RPL DAO ACK : True
RPL DAO ACK local repair : False
DIO triggers route refresh : False
MAC layer : 1
Security layer : 0
Security level : 6
Network key : 0:1:2:3:4:5:6:7:8:9:a:b:c:d:e:f
Noncoresec anti-replay enabled (Legacy) : False
Noncoresec anti-replay workaround (Legacy) : False
Filter unknown nodes : False
Disable NUD : True

NAT 64 Enabled : False
NAT 64 DHCP Enabled : False
NAT 64 static port mapping Enabled : False
NAT 64 RFC-6052 prefix : False
NAT 64 address : 172.16.0.2
NAT 64 netmask : 255.255.255.0
NAT 64 gateway : 172.16.0.1

Local address rewrite : True
Smart Multi BR : False
Webserver configuration page disabled : False
Webserver port : 80

and this is the route setting on PC2 (PC1 has mirrored settings):

        sudo route -A inet6 add aaaa::/64 gw cccc::100
    sudo ip -6 addr add cccc::1/64 dev my6b 
    sudo route -A inet6 add bbbb::/64 gw cccc::100 

from the 6lbr.log I see the boot works OK and I can browse the webserver on both PCs

But still, as you can imagine, I am not able to ping6 cccc::100 from PC1/bbbb::100 from PC2! I tried using 6LR mode too with no luck.

Have you any suggestions? Many thanks for your help!

michelesponchiado commented 7 years ago

To anyone interested, here how to get a working ping6 between two BR configured as NDP-ROUTER. I have used the 6LBR mode and named my bridge my6b to avoid messing with an existing bridge in my setup.

MODE=ROUTER

MODE=NDP-ROUTER DEV_TAP=tap0 DEV_ETH=eth0 DEV_BRIDGE=my6b

BRIDGE=1 CREATE_BRIDGE=6LBR ETH_JOIN_BRIDGE=0

DEV_RADIO=/dev/ttyUSB1

SOCK_RADIO=localhost

BAUDRATE=115200

LOG_LEVEL=3 LOG_SERVICES=-1


- 6lbr.conf second PC

MODE=ROUTER

CREATE_BRIDGE=6LBR

MODE=6LR

CREATE_BRIDGE=6LBR

MODE=NDP-ROUTER

CREATE_BRIDGE=6LBR

DEV_TAP=tap0 DEV_ETH=wlan0 DEV_BRIDGE=my6b

RAW_ETH=0

RAW_ETH_FCS=1

BRIDGE=1 ETH_JOIN_BRIDGE=0

DEV_RADIO=/dev/ttyUSB1 BAUDRATE=115200

LOG_LEVEL=3 LOG_SERVICES=-1


And finally the ping6 command output from the console of the second PC:
...: ping6 fd00::1

PING fd00::1(fd00::1) 56 data bytes 64 bytes from fd00::1: icmp_seq=1 ttl=63 time=483 ms 64 bytes from fd00::1: icmp_seq=2 ttl=63 time=74.9 ms 64 bytes from fd00::1: icmp_seq=3 ttl=63 time=65.9 ms 64 bytes from fd00::1: icmp_seq=4 ttl=63 time=72.9 ms 64 bytes from fd00::1: icmp_seq=5 ttl=63 time=63.8 ms 64 bytes from fd00::1: icmp_seq=6 ttl=63 time=70.7 ms ^C --- fd00::1 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5004ms rtt min/avg/max/mdev = 63.865/138.712/483.760/154.357 ms

...:ping6 bbbb::1

PING bbbb::1(bbbb::1) 56 data bytes 64 bytes from bbbb::1: icmp_seq=1 ttl=62 time=72.7 ms 64 bytes from bbbb::1: icmp_seq=2 ttl=62 time=79.2 ms 64 bytes from bbbb::1: icmp_seq=3 ttl=62 time=70.5 ms 64 bytes from bbbb::1: icmp_seq=4 ttl=62 time=76.5 ms 64 bytes from bbbb::1: icmp_seq=5 ttl=62 time=67.3 ms 64 bytes from bbbb::1: icmp_seq=6 ttl=62 time=201 ms 64 bytes from bbbb::1: icmp_seq=7 ttl=62 time=80.2 ms ^C --- bbbb::1 ping statistics --- 7 packets transmitted, 7 received, 0% packet loss, time 6008ms rtt min/avg/max/mdev = 67.371/92.663/201.931/44.816 ms