1

For a past few days I have experimented with 6loWPAN technology. Now I cant continue my experiments due to lack of experience with linux and computer networking. My setup is following: network structure

I have established sensor network, which consist of nodes and router, router is connected to my Ubuntu virtual machine on PC, this PC also have connection to Internet via eth0 interface. Connection from sensor router to the PC is established throug the tunslip6 utility, which creates tun0 interface. Tunslip6 output:

********SLIP started on ``/dev/ttyACM0''
opened tun device ``/dev/tun0''
ifconfig tun0 inet `hostname` up
ifconfig tun0 add aaaa::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 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)

Starting Contiki-3.x-2924-g6cdba10
With DriverLib v0.46593
TI CC1310 DIY module rev. 0.shit.1
IEEE 802.15.4: No, Sub-GHz: Yes, BLE: No, Prop: No
 Net: sicslowpan
 MAC: CSMA
 RDC: ContikiMAC, Channel Check Interval: 16 ticks
 RF: Channel 25
 Node ID: 613
*** Address:aaaa::1 => aaaa:0000:0000:0000
Got configuration message of type P
Setting prefix aaaa::
Server IPv6 addresses:
 aaaa::212:4b00:af6:265
 fe80::212:4b00:af6:265

So I can connect to my router from web browser, as well, as to web sites. Router web interface

But when my sensor node tries to access the www.contiki-os.org, it cant even rich the DNS server. As I suppose, that happens because tun0 and eth0 interfaces are not connected somehow. Wireshark capture of tun0 traffic.

The question is following: How should I create connection between eth0 and tun0 for my nodes to have access to the Internet? ifconfig output from my Ubuntu VM:

eth0      Link encap:Ethernet  HWaddr 00:0c:29:cb:f8:95  
          inet addr:192.168.202.131  Bcast:192.168.202.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fecb:f895/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:82922 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54933 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:78915513 (78.9 MB)  TX bytes:5782093 (5.7 MB)
          Interrupt:19 Base address:0x2000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:6854 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6854 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1068353 (1.0 MB)  TX bytes:1068353 (1.0 MB)

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:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:944 (944.0 B)  TX bytes:1410 (1.4 KB)
  • A few observations: The picture shows that the SLIP router and the Ubuntu machine communicates with IPv4. Does the router do some kind of translation from IPv6 to IPv4? I don't see any useful IPv4 addresses for this, only 127.0.1.1, which is a loopback address. – Johan Myréen Nov 11 '16 at 19:59
  • The picture also shows that the Ubuntu machine is connected to the Internet via IPv6, but is doesn't have a routable public IPv6 address, only a link-local address (fe80::20c:29ff:fecb:f895). The IPv6 address prefix aaaa also looks suspicious. If you want to reach the v6 internet, you must get a prefix from your ISP or a tunnel broker. If you only need to communicate locallly, you can choose Unique Local Addresses with prefix fc00::/7, but these addresses are not reachable from the Internet. – Johan Myréen Nov 11 '16 at 20:07
  • A funny thing is that Contiki defines itself as The Open Source OS for the Internet of Things, but their website is not reachable by IPv6. I guess it is because their website is really on Github. So even if your DNS query had reached a server, you would have gotten the response "www.contiki-os.org has no AAAA record". – Johan Myréen Nov 11 '16 at 20:13
  • @JohanMyréen fixed image. Actually my PC is connected to the internet through IPv4. Anyway, I think that must be some ways to perform IPv6 to IPv4 mapping on Ubuntu. – Vadimchik Nov 12 '16 at 9:11
0

You will need to implement NAT64. NAT64 performs network address translation from IPv6 to IPv4. Tayga is an implementation for Linux.

  • Note that the idea in NAT64 is to connect an IPv6-only island to IPv4-only hosts on the Internet. IPv6 to IPv6 connections are handled normally, without translation. This, however, requires "real" IPv6 connectivity, i.e. publicly routable addresses, which your ISP provides (just like in IPv4). If you can't get IPv6 through your ISP, you can use a tunnel broker. – Johan Myréen Nov 12 '16 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.