I have the following set-up:
I use 6LOWPAN (IPv6 implementation in IEEE 802.15.4) on my sensor link that have IPv6 addresses (stateless) as aaaa::xx/64
It uses RaspberryPi (RPI) as an edge router (called 6lbr) that is both connected to IEEE 802.15.4 and IEEE 802.11 (it does translation between two standard and routes the packets). RPI runs Debian.
My network doesn't support IPv6 advertisements (RA), so it only assigns a public IPv4 to RPI.
Finally, I store my server code (UDP server/client) on a Debian server that has both public IPv4 and IPv6 addresses.
I couldn't figure out how to access sensor nodes from the server side. As an example, What destination address do I need to type in
SERVADDR below to send a UDP unicast?
inet_pton(AF_INET6, SERVADDR, &server_addr.sin6_addr);
Does it suppose to be an IPv4 or IPv6 UDP unicast?
I tried to use NAT64 (an open source project called wrapsix) but couldn't manage to access it. What kind of tunneling solution do I need to use? Could you also state an open source project name that I can use for the tunneling or as a broker?
As a second question How would I need to access to the sensor network (aaaa::xx) if my Access Point was allocating a private IPv4 address (192.168.x.x) to wlan0 interface of the RPI? In that case, what kind of solution do I need to use?
EDIT 1 referring @kasperd's comments, I did a better search on IPV6 tunelling. I can't use NAT64 because it requires an unique IPv6 network prefix which I don't have it in my case.
I can't use 6to4 that requires a public IPv4 (considering my second question).
as @kasperd suggested, I should use 6in4 that requires a broker. As I see on the web suggestions, I can use Hurricane Electric or SixXS. They both claim to be free, but couldn't understand what is the main difference. As I understand, I can't use Hurricane Electric's solution behind an IPv4 NAT, but SixXS has a protocol called AYIYA that can be used behind an IPv4 NAT. A disadvantage of this solution is that if I have multiple of similar connectivity issue, I need to configure them individually. Secondly, SixXS allows to use it commercial purpose, however, since it is free, they relay on other organizations that may stop providing to use of the IPv6 addr that one use on his/her project. It creates a reliability consideration. Another consideration is that it might be an issue that some firewalls may not allow 6in4 tunneling.
In addition, Ubuntu/Debian has a packet called Miredo based on Teredo tunneling (based on UDP packets). This solution can be used behind an IPv4 NAT. Furthermore, since it is an UDP based communication, almost all firewalls would allow the tunneling. However, it is said that Teredo is a temporarily solution and should be deactivated (Teredo relays) when IPv6 is more mature to encourage all to use native IPv6.
EDIT 2 SixXS.net don't accept any new sign-ups. I created an account on HE, but it has 5 tunnel limitation. If one needs more than 5 tunnelling, I guess Miredo should be a better option. I tried both HE broker and Miredo that receives the IPv6, but I guess I have a problem with the routing rules that I can't ping that IPv6 from a remote PC.