IPv6 support

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 14 Nov 2016, 10:57

CrazyKolobok wrote:Java client also works fine in TCP network, but doesn't init UDP protocol.

Can you better explain? Do you mean under the same network configuration (so TEST 3 above)?
Paolo Bax
The SmartFoxServer Team
CrazyKolobok
Posts: 4
Joined: 11 Nov 2016, 15:22

Re: IPv6 support

Postby CrazyKolobok » 14 Nov 2016, 11:39

Bax wrote:
CrazyKolobok wrote:Java client also works fine in TCP network, but doesn't init UDP protocol.

Can you better explain? Do you mean under the same network configuration (so TEST 3 above)?


Yes, under the same network configuration (as described in TEST 3 diagram) both our clients (Unity and Java) work fine by TCP and have problem with UDP.
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 14 Nov 2016, 11:42

This sounds like an issue with the test environment. Maybe the NAT is messing with UDP?
In any case we are investigating and let you know in the next hours.
Paolo Bax
The SmartFoxServer Team
CrazyKolobok
Posts: 4
Joined: 11 Nov 2016, 15:22

Re: IPv6 support

Postby CrazyKolobok » 14 Nov 2016, 12:40

I've got client log from our Unity developer. Maybe it will be usefull.

Code: Select all

[SFS - ERROR] [UDPSocketLayer] Connection error: Network is unreachable   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.DoConnect (System.Net.IPEndPoint endPoint) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.Connect (System.Net.IPEndPoint endPoint) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.Connect (System.String hostname, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.Sockets.UDPSocketLayer.Connect (System.String host, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.Initialize (System.String udpAddr, Int32 udpPort) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.InitUDP (System.String udpHost, Int32 udpPort) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventListenerDelegate.Invoke (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventDispatcher.DispatchEvent (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.ProcessEvents () [0x00000] in <filename unknown>:0
[SFS - WARN] Unexpected UDP I/O Error. Connection error: Network is unreachable   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.DoConnect (System.Net.IPEndPoint endPoint) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.Connect (System.Net.IPEndPoint endPoint) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.Connect (System.String hostname, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.Sockets.UDPSocketLayer.Connect (System.String host, Int32 port) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.Initialize (System.String udpAddr, Int32 udpPort) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.InitUDP (System.String udpHost, Int32 udpPort) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventListenerDelegate.Invoke (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventDispatcher.DispatchEvent (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.ProcessEvents () [0x00000] in <filename unknown>:0  [NetworkUnreachable]
[SFS - ERROR] [UDPSocketLayer] General error writing to socket: A null value was found where an object instance was required.   at Sfs2X.Core.Sockets.UDPSocketLayer.WriteSocket (System.Byte[] buf) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.SendInitializationRequest () [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.InitUDP (System.String udpHost, Int32 udpPort) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventListenerDelegate.Invoke (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventDispatcher.DispatchEvent (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.ProcessEvents () [0x00000] in <filename unknown>:0
[SFS - WARN] Unexpected UDP I/O Error. General error writing to socket: A null value was found where an object instance was required.   at Sfs2X.Core.Sockets.UDPSocketLayer.WriteSocket (System.Byte[] buf) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.SendInitializationRequest () [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.InitUDP (System.String udpHost, Int32 udpPort) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventListenerDelegate.Invoke (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.Core.EventDispatcher.DispatchEvent (Sfs2X.Core.BaseEvent evt) [0x00000] in <filename unknown>:0
  at Sfs2X.SmartFox.ProcessEvents () [0x00000] in <filename unknown>:0  [NotSocket]
[SFS - ERROR] [UDPSocketLayer] General error writing to socket: A null value was found where an object instance was required.   at Sfs2X.Core.Sockets.UDPSocketLayer.WriteSocket (System.Byte[] buf) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.SendInitializationRequest () [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.OnTimeout (System.Object state) [0x00000] in <filename unknown>:0
[SFS - WARN] Unexpected UDP I/O Error. General error writing to socket: A null value was found where an object instance was required.   at Sfs2X.Core.Sockets.UDPSocketLayer.WriteSocket (System.Byte[] buf) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.SendInitializationRequest () [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.OnTimeout (System.Object state) [0x00000] in <filename unknown>:0  [NotSocket]
[SFS - ERROR] [UDPSocketLayer] General error writing to socket: A null value was found where an object instance was required.   at Sfs2X.Core.Sockets.UDPSocketLayer.WriteSocket (System.Byte[] buf) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.SendInitializationRequest () [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.OnTimeout (System.Object state) [0x00000] in <filename unknown>:0
[SFS - WARN] Unexpected UDP I/O Error. General error writing to socket: A null value was found where an object instance was required.   at Sfs2X.Core.Sockets.UDPSocketLayer.WriteSocket (System.Byte[] buf) [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.SendInitializationRequest () [0x00000] in <filename unknown>:0
  at Sfs2X.Bitswarm.UDPManager.OnTimeout (System.Object state) [0x00000] in <filename unknown>:0  [NotSocket]
ERROR: MainLobbyUIManager: Failed to init UDP: UNKNOWN_ERROR
MainLobbyUIManager:OnUDPInitError(BaseEvent)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 14 Nov 2016, 16:47

I'm describing our findings with respect to the issue reported by CrazyKolobok.

1) In TEST 3 scenario, using the Unity Editor (Mac standalone build), we can't connect via UDP too, neither using the domain name nor the IPv6 address returned by the ping6 terminal command.
But the error we get is different:

Code: Select all

[SFS > ERROR] [UDPSocketLayer] Connection error: Invalid arguments   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.DoConnect (System.Net.IPEndPoint endPoint) [0x00000] in <filename unknown>:0


2) Same TEST 3 scenario, using the Java API: we can't even establish the initial TCP connection to SFS when using the domain name. If we use the IPv6 address instead, we can connect both via TCP and UDP.

3) Again, same TEST 3 scenario, using the ActionScript3 API: we can connect both via TCP and UDP using the IPv6 address (domain name doesn't work because it is not supported by the DatagramSocket class of Flash).

So we have mixed results, which additionally are different from those obtained by CrazyKolobok. Yeah!
My opinion is that something is wrong with the test scenario provided by Apple. In fact when my MacBook is connected to the iMac acting as DNS64/NAT64, Skype can't establish a connection, Telegram becomes veeeeeery slow (tens of seconds!) in sending messages and it doesn't receive them anymore, Dropbox client can't connect, etc.

Ideas?
Paolo Bax
The SmartFoxServer Team
yousuan
Posts: 5
Joined: 13 Mar 2016, 17:26

Re: IPv6 support

Postby yousuan » 17 Nov 2016, 03:18

Hi, our unity app has been rejected by Apple review team. We actually tested all the test case (1,2,3) and its all working.
Our unity version is 5.4.1, Smartfox C# API version is 1.6.6, Smartfox server is 2.11.1.

Our server environment support IPv6, we have bind Smartfox server to both IPv4 and IPv6 address. This is our <socketAddresses> settings:

Code: Select all

 
  <socketAddresses>
    <socket address="0.0.0.0" port="465" type="TCP"/>
    <socket address="127.0.0.1" port="465" type="UDP"/>
    <socket address="2401:c100:1100:504:2000::13" port="465" type="TCP"/>
    <socket address="2401:c100:1100:504:2000::13" port="465" type="UDP"/>
  </socketAddresses>
 


In the server log we can see the IP addresses are correctly bind.

Code: Select all

17 Nov 2016 | 11:03:04,014 | INFO  | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer |     | Listening Sockets: { 0.0.0.0:465, (Tcp) } { 127.0.0.1:465, (Udp) } { 2401:c100:1100:504:2000::13:465, (Udp) } { 127.0.0.1:8843 (SSL) (WebSocket) }


When the Apple team doing review / testing, we notice they do not connect to both UDP/TCP socket connection but only to Bluebox. And for unknown reason they keep creating and removing the login session as show below:

Code: Select all

17 Nov 2016 | 00:26:54,619 | INFO  | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 624, Type: BLUEBOX, Logged: No, IP: 17.200.11.44 }
17 Nov 2016 | 00:26:54,620 | INFO  | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 625, Type: BLUEBOX, Logged: No, IP: 17.200.11.44 }
17 Nov 2016 | 00:26:57,563 | INFO  | qtp1475449478-13644 | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 637, Type: BLUEBOX, Logged: No, IP: null } on Server port: 0 <---> 0
17 Nov 2016 | 00:27:00,680 | INFO  | qtp1475449478-13645 | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 638, Type: BLUEBOX, Logged: No, IP: null } on Server port: 0 <---> 0
17 Nov 2016 | 00:27:02,611 | WARN  | qtp1475449478-13643 | bluebox.v3.BlueBox |     | Invalid request, session expired. Message: { ssid: bafd6ff57865ee0830c28130339f76de, cmd: poll, data: NoData<EF><BF><BD>}
17 Nov 2016 | 00:27:03,602 | INFO  | qtp1475449478-13644 | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 639, Type: BLUEBOX, Logged: No, IP: null } on Server port: 0 <---> 0
17 Nov 2016 | 00:27:04,623 | INFO  | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 626, Type: BLUEBOX, Logged: No, IP: 17.200.11.44 }
17 Nov 2016 | 00:27:04,623 | INFO  | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 627, Type: BLUEBOX, Logged: No, IP: 17.200.11.44 }
17 Nov 2016 | 00:27:04,624 | INFO  | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager |     | Session removed: { Id: 628, Type: BLUEBOX, Logged: No, IP: 17.200.11.44 }
17 Nov 2016 | 00:27:05,425 | WARN  | qtp1475449478-13645 | bluebox.v3.BlueBox |     | Invalid request, session expired. Message: { ssid: 30319026c49472ca68869369b0374b2e, cmd: poll, data: NoData<EF><BF><BD>}
17 Nov 2016 | 00:27:06,631 | INFO  | qtp1475449478-13645 | bitswarm.sessions.DefaultSessionManager |     | Session created: { Id: 640, Type: BLUEBOX, Logged: No, IP: null } on Server port: 0 <---> 0


Is anyone encounter similar issue? Really appreciate your input. Thanks.
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 17 Nov 2016, 08:32

yousuan, if the test cases work fine, why Apple rejected your app? I think they should provide a reason.
Paolo Bax
The SmartFoxServer Team
yousuan
Posts: 5
Joined: 13 Mar 2016, 17:26

Re: IPv6 support

Postby yousuan » 17 Nov 2016, 10:00

Hi Bax, Apple review only says our app failed on iPad and iPhone running iOS 10.1 on Wi-Fi connected to an IPv6 network. The screenshot provided by Apple review team show that our app hang at Smartfox login. We do submitted Apple support ticket, we even sent them screenshot and TCPDUMP to proof that everything is working correctly in test case 3 but still no luck. The review team still reject our app. Our issue now is we do not have pure IPv6 environment to test the whole settings.

I performed external scan the server port are all opened on both IPv4 and IPv6. Inside the server it self I can telnet to all the Smartfox server ports using IPv6 public address, I know this can't proof anything but to me everything seem to be working fine.

Any idea what we can do next? or anyway I can test with pure IPv6 environment? Thanks.
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 17 Nov 2016, 13:24

First of all, I don't get why they can't connect to your server with regular TCP connection. It seems their client reverted to BlueBox. Then it is not clear why the BlueBox doesn't work either: we tested it (again a few minutes ago) and it works as expected. Something seems to be wrong with their test environment. Can you ask them to make sure they can ping your SFS server? That could be the reason they can't even connect. Speaking of which... could you provide us the connection details to your server? Domain name and IPv6 + port number. I'd like to connect from our office using the TEST 3 setup. Of course you can send the connection details by email at info AT smartfoxserver DOT com.
Paolo Bax
The SmartFoxServer Team
yousuan
Posts: 5
Joined: 13 Mar 2016, 17:26

Re: IPv6 support

Postby yousuan » 18 Nov 2016, 08:30

Bax wrote:First of all, I don't get why they can't connect to your server with regular TCP connection. It seems their client reverted to BlueBox. Then it is not clear why the BlueBox doesn't work either: we tested it (again a few minutes ago) and it works as expected. Something seems to be wrong with their test environment. Can you ask them to make sure they can ping your SFS server? That could be the reason they can't even connect. Speaking of which... could you provide us the connection details to your server? Domain name and IPv6 + port number. I'd like to connect from our office using the TEST 3 setup. Of course you can send the connection details by email at info AT smartfoxserver DOT com.


Thanks, we just dropped you an email. We just found out this Unity bug - https://issuetracker.unity3d.com/issues ... ail-on-ios. Does it has anything to do with Bluebox? FYI, we are using Unity 5.4.1.
hungkhmt2k4
Posts: 4
Joined: 18 Nov 2016, 03:46

Re: IPv6 support

Postby hungkhmt2k4 » 19 Nov 2016, 16:12

I have error with ipv6 too! Waiting for fix UDP connecting! :D :D :D
hungkhmt2k4
Posts: 4
Joined: 18 Nov 2016, 03:46

Re: IPv6 support

Postby hungkhmt2k4 » 21 Nov 2016, 03:48

Image
Please help me as soon as posible! :cry: :cry: :cry: :cry: :cry:
Problem with ipv6! Server centos 6.8, ipv6 enable!
Apple rejected!
I don't have ipv6 network to test! :(
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 21 Nov 2016, 16:44

We think we have a fix for the UDP issue in the test environment suggested by Apple.
Please drop an email at info AT smartfoxserver DOT com to request a pre-release version to test.
To make sure this works as expected, we need your help to test it in your scenarios and possibly submit to Apple to make sure everything works fine in their environment too. Thanks.
Paolo Bax
The SmartFoxServer Team
hungkhmt2k4
Posts: 4
Joined: 18 Nov 2016, 03:46

Re: IPv6 support

Postby hungkhmt2k4 » 22 Nov 2016, 02:23

Bax wrote:We think we have a fix for the UDP issue in the test environment suggested by Apple.
Please drop an email at info AT smartfoxserver DOT com to request a pre-release version to test.
To make sure this works as expected, we need your help to test it in your scenarios and possibly submit to Apple to make sure everything works fine in their environment too. Thanks.

email sent!
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: IPv6 support

Postby Bax » 28 Nov 2016, 10:02

We just released version 1.7.1 of the C# API, containing a fix for the UDP issue in the IPv6 environment.
You can get it here: http://www.smartfoxserver.com/download/sfs2x#p=client
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 48 guests