Author Topic: NAT 64 Network Connection Problems  (Read 3958 times)

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
NAT 64 Network Connection Problems
« on: November 14, 2016, 09:40:45 PM »
My IPv6 woes continue as Apple has rejected my new game because of connectivity issues. I made a grave mistake of making another project without being 100% sure that this worked.

I spent the last 5 months on this project and could use some assistance. Every time I attempt to connect in with iPv6 on a NAT 64 network in any capacity it says "unable to connect". I've played with TNet's example scene considerably trying to make this work to no avail.

Here is how my iPhone reads on a basic router.



Here is how my iPhone reads on a simulated iPv6 network. The IP is likely the MacBook IP address that is synthesizing the iPv6 network. I am guessing that somehow that DNS is key to my connectivity on this issue.



Other research I have been looking at:
This eskimo guy is apparently Apple's network guru.





A bit frustrated, I toyed with UNet and Photon. They connect painstakingly easy in their example scenes without any setup at all. I can connect to anything on the web with this iPv6 network except my TNserver.exe. It will take too long to rewrite my project with another library and as a 2+ year TNet user, I want to stay with TNet.

Please help.

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: NAT 64 Network Connection Problems
« Reply #1 on: November 15, 2016, 12:52:36 AM »
Unity itself doesn't support simultaneous ipv4 and ipv6 connections. This is a limitation of the mono library they're using. .NET 4.5 introduced dual-mode sockets, but I'm not sure if even the latest version of mono supports this.

Due to this limitation, you must "toggle" modes between ipv4 and ipv6. On the server, you add the -ipv6 switch to the commandline. On the client, I believe Aren added a "Use IPv6" checkbox to TNManager or something? Perhaps the client is intelligent enough to make the switch automatically (without a checkbox), not sure.
Changelog here:
http://www.tasharen.com/forum/index.php?topic=2650.msg64469#msg64469

Unity addresses the Apple store requirements here:
https://forum.unity3d.com/threads/unity-ios-and-ipv6-support.404938/
Follow the guides to make sure your network is set up correctly. If TNet still doesn't work, then something is borked ;)

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: NAT 64 Network Connection Problems
« Reply #2 on: November 15, 2016, 02:39:55 AM »
Hi cmifwdll,

Thanks for the response. I remember you and Aren were able to connect to the  server from the example scene in a post I made a several months ago. I was never able to connect to that server in any way with the example scenes from TNet.

If I can make the connection on this iPv6 testing environment that they use, even in the example scenes:

https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1

I would just attempt to connect with iPv6 first several times with the appropriate IP address/port and then fallback to iPv4 with other IP addresses/port if it continues to fail. The problem is I cannot connect with iPv6 at all. There are only four possible combinations to use between TNserver.exe and the client and I've tried them all:

client side addressFamily = IPType.IP_v_4/IPType.IP_v_6  to TNServer.exe -iPv6/ no ipv6

I cannot figure out what I am doing wrong here. I am almost tempted to suggest that TNet is not able to pass Apples NAT64 Network requirements.

cmifwdll, When you connected to that server several months ago, what type of network were you on when you connected?

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: NAT 64 Network Connection Problems
« Reply #3 on: November 15, 2016, 05:09:12 AM »
I'm on a 6rd connection I believe. Or Teredo, I don't know. I don't believe my ISP is ipv6-only, though.

That document from Apple assumes ISPs are dropping ipv4 and going ipv6-only, providing ipv4 backwards compatibility through this DNS64 system that wraps ipv4 addresses inside special ipv6 addresses. I'm not sure if these special ipv6 addresses are supported globally or if they're only supported on ISPs running ipv6-only and DNS64.

This whole transition period is so confusing. I feel so far behind on networking knowledge.

I think this can be solved by doing away with addresses and relying solely on hostnames. If that doesn't work then perhaps TNet will have to manually construct this special ipv6 address.
The example of this special ipv6 given on that page is: 64:ff9b::192.0.2.1
Dunno if it'll be the same format always, but it probably will be?
From what I read on that page, it seems Apple wants every single ipv4 address to be encoded in that manner regardless of ISP (and interface?) support.

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: NAT 64 Network Connection Problems
« Reply #4 on: November 15, 2016, 06:56:26 AM »
Thanks for your continued help cmifwdll.

I am not sure what to do at this point.

While trying the latest TNet version in an empty project, TNServer.exe doesn't even seem to work with iPv6.  Using this on the server: TNserver.exe -ipv6. It just shows a list of IP addresses and goes straight to "press q followed by enter to quit."  And the port says its filtered.

Using this on the server: TNserver.exe. without -ipv6 it shows list ips, admin, bans, gameserver, etc.  The port shows open.

http://www.subnetonline.com/pages/ipv6-network-tools/online-ipv6-port-scanner.php

Again, hopefully Aren chimes in. Because its not working.

Also, it doesn't seem like I can modify/delete my posts anymore. Hence, I double posted.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NAT 64 Network Connection Problems
« Reply #5 on: November 15, 2016, 08:57:19 AM »
You need to specify more than just "-ipv6" when starting TNServer. If you don't specify any arguments, TNet assumes a bunch of default ones. If you specify at least one, TNet will only use what you specified. In your case you enable IPv6, but don't actually specify any ports to listen to.

Start with the TNet's example menu scene. You can change it to use IPv6 via inspector. When you hit Play, you should be able to see your IPv6 address. When you start the server from the menu there, it will be an IPv6 server, and you will connect to it. If you click the disconnect button, you will still see the servers as active -- and showing its IPv6 address.

Once you verified that it's working, launch the TNServer with -tcp 5127 and -ipv6 flags. That's the minimum you need to allow incoming connections on IPv6. At this point you should be able to connect to it via the same TNet's example menu.

As we talked about in the previous topic, wherever you're hosting the server needs to actually support IPv6. The pic you posted of your router clearly shows that it's an IPv4 router, not 6. I had to explicitly enable IPv6 on my router before it started working as expected. IPv6 addresses that begin with 2001 are basically fake, kind of like your 192.168.*.* ones.  Visiting http://ipv6.icanhazip.com/ should show you your actual IPv6 address if you've configured it properly. For me, mine begins with 2607 for example.