Strange UDP Issue

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

Moderators: Lapo, Bax

Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Strange UDP Issue

Postby Vcrn » 26 May 2017, 14:54

For the last couple of months our users have been able to connect to the server without any issues. We recently changed the connector to use a domain name with A and AAAA records to support IPv6 connections instead of using an IPv4 address. The majority of users, including IPv6 users are able to connect without any issues. However, ever since changing to a domain name, some users are failing to initialize the UDP connection despite it working fine before changing. We have bound both IPv4 and IPv6 address with UDP and TCP in the Admin Tool.

When searching the logs for their IP addresses there is no record of any sessions being created/removed. We use the most recent Unity API and SFS2X 2.12.5.

Any ideas why this happens with the domain but not the IP?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Strange UDP Issue

Postby Lapo » 26 May 2017, 15:11

Hi,
When searching the logs for their IP addresses there is no record of any sessions being created/removed. We use the most recent Unity API and SFS2X 2.12.5.

If that's the case then it's not only an UDP issue but also a TCP one. Maybe a DNS issue from the client side?

It would probably be best to get in touch with a couple of these users who experienced the problem and see if they can tell you more about which error they're getting exactly (if such errors are shown by the app, somewhere).

Is that a possibility?
Lapo
--
gotoAndPlay()
...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Strange UDP Issue

Postby Vcrn » 26 May 2017, 15:27

Lapo wrote:Hi,
When searching the logs for their IP addresses there is no record of any sessions being created/removed. We use the most recent Unity API and SFS2X 2.12.5.

If that's the case then it's not only an UDP issue but also a TCP one. Maybe a DNS issue from the client side?

It would probably be best to get in touch with a couple of these users who experienced the problem and see if they can tell you more about which error they're getting exactly (if such errors are shown by the app, somewhere).

Is that a possibility?


We're currently in contact with several users who have this problem. The error they're receiving is sent from both the OnConnection and OnUDPInit listener when the parameter "success" is false, so it could very well be a TCP issue since we can't know without the internal debugging messages.

Since the server address is loaded remotely in the client, I just changed the address back to the IPv4 address and asked one of the users to try to connect. He was able to successfully connect to the IPv4 address.

After searching the logs for the IP of a different user having the same issue, I found that the session creation and user login was logged. 9 seconds after, the session is removed and no room is joined. In our client code the UDP attempts to init after login, and then joins a room after the UDP init. This leads me to believe it is a UDP issue.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Strange UDP Issue

Postby Lapo » 26 May 2017, 16:38

Vcrn wrote:We're currently in contact with several users who have this problem. The error they're receiving is sent from both the OnConnection and OnUDPInit listener when the parameter "success" is false, so it could very well be a TCP issue since we can't know without the internal debugging messages.

Yes, if they problem shows up in the OnConnection handler then it's definitely TCP and therefore sounds like a generic connection issue, rather than a protocol specific one.

Since the server address is loaded remotely in the client, I just changed the address back to the IPv4 address and asked one of the users to try to connect. He was able to successfully connect to the IPv4 address.

Maybe some issues with the connection provider on the client's end.

After searching the logs for the IP of a different user having the same issue, I found that the session creation and user login was logged. 9 seconds after, the session is removed and no room is joined. In our client code the UDP attempts to init after login, and then joins a room after the UDP init. This leads me to believe it is a UDP issue.

In this case, I'd agree. Definitely sounds like it.

To gather more debug info you may want to look into some remote solution such as this:
https://try.crashlytics.com/

To be honest I am not totally familiar with it, but I've seen several of our customers using it and it can be helpful.

Unfortunately I don't have much more help to provide at this stage, other than pointing to some client issues at network level. Mobile devices are infamous for UDP connectivity issues.

If there's anything else let us know
Lapo

--

gotoAndPlay()

...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Strange UDP Issue

Postby Vcrn » 26 May 2017, 17:22

Lapo wrote:Unfortunately I don't have much more help to provide at this stage, other than pointing to some client issues at network level. Mobile devices are infamous for UDP connectivity issues.

If there's anything else let us know


I wonder if there is an issue with the formatting of the IPv6 address. The IPv6 address which is made available in the Admin Tool looks like this:

Code: Select all

xxxx:xxxx:60:xxxx:0:0:0:0%eth0

However the DNS record on our domain is formatted like this

Code: Select all

xxxx:xxxx:60:xxxx::64


Further I wasn't able to connect to the Admin Tool through the IPv6 address on an IPv6 compatible connection.

When we first setup the IPv6 address in the Admin Tool we tried to use the same formatting that's used in the DNS record but the boot log showed an error saying it couldn't bind the address.

Does the formatting look correct?

EDIT: We also tried using "::" but that also failed to bind.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Strange UDP Issue

Postby Lapo » 26 May 2017, 18:34

Both addresses formats look correct, only the DNS version uses the shortened version.

EDIT: We also tried using "::" but that also failed to bind.

Can you tell me what error do you get exactly?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Strange UDP Issue

Postby Vcrn » 26 May 2017, 19:34

Lapo wrote:Both addresses formats look correct, only the DNS version uses the shortened version.

EDIT: We also tried using "::" but that also failed to bind.

Can you tell me what error do you get exactly?

Thanks

Code: Select all

25 May 2017 | 19:18:03,356 | INFO  | main | bootLogger |     | Session manager ready: com.smartfoxserver.bitswarm.sessions.DefaultSessionManager@7ec3394b
25 May 2017 | 19:18:03,360 | INFO  | main | bootLogger |     | TCP Selector opened
25 May 2017 | 19:18:03,362 | INFO  | main | bootLogger |     | UDP Selector opened
25 May 2017 | 19:18:03,363 | INFO  | main | bootLogger |     | AcceptSelector opened
25 May 2017 | 19:18:03,366 | INFO  | main | bootLogger |     | Added bound tcp socket --> xxx.xxx.xxx.xxx:9933
25 May 2017 | 19:18:03,368 | INFO  | main | bootLogger |     | Added bound udp socket --> xxx.xxx.xxx.xxx:9933
25 May 2017 | 19:18:03,368 | WARN  | main | bootLogger |     | Was not able to bind socket: { :::9933, (Tcp) }
25 May 2017 | 19:18:03,368 | WARN  | main | bootLogger |     | Was not able to bind socket: { :::9933, (Udp) }
25 May 2017 | 19:18:03,369 | INFO  | Scheduler1-thread-1 | bootLogger |     | Scheduler started: scheduler
25 May 2017 | 19:18:03,369 | INFO  | main | bootLogger |     | Controller started: com.smartfoxserver.v2.controllers.v290.SystemReqController
25 May 2017 | 19:18:03,369 | INFO  | main | bootLogger |     | Controller started: com.smartfoxserver.v2.controllers.v290.ExtensionReqController
25 May 2017 | 19:18:03,369 | INFO  | main | bootLogger |     | Controller started: com.smartfoxserver.v2.controllers.v290.SmasherReqController
25 May 2017 | 19:18:03,370 | INFO  | main | bootLogger |     | Socket Writer started (pool size:3)
25 May 2017 | 19:18:03,370 | INFO  | main | bootLogger |     | Security Manager started
25 May 2017 | 19:18:03,371 | INFO  | main | bootLogger |     | DatagramReader started
25 May 2017 | 19:18:03,372 | INFO  | main | bootLogger |     | IOHandler: com.smartfoxserver.v2.protocol.SFSIoHandler@62f4ff3b
25 May 2017 | 19:18:03,372 | INFO  | main | bootLogger |     | SocketReader started
25 May 2017 | 19:18:03,372 | INFO  | main | bootLogger |     | SocketAcceptor initialized
25 May 2017 | 19:18:03,372 | INFO  | main | bootLogger |     | [[[ ===--- Boot sequence complete ---=== ]]]
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Strange UDP Issue

Postby Lapo » 27 May 2017, 07:29

I am not sure why you wouldn't be able to bind the :: IPv6 address other than some specific config issue in your OS. (What OS is it?)
That error literally means that there are no available IPv6 addresses to bind, at least on port 9933.

So it's either a port conflict (something else is already running on 9933) or definitely an OS level issue.

What happens if you try to bind the equivalent IPv4 0.0.0.0?
Does it work? If so then you can restrict the investigation to your OS/nic IPv6 setup.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Strange UDP Issue

Postby Vcrn » 27 May 2017, 14:43

Lapo wrote:I am not sure why you wouldn't be able to bind the :: IPv6 address other than some specific config issue in your OS. (What OS is it?)
That error literally means that there are no available IPv6 addresses to bind, at least on port 9933.

So it's either a port conflict (something else is already running on 9933) or definitely an OS level issue.

What happens if you try to bind the equivalent IPv4 0.0.0.0?
Does it work? If so then you can restrict the investigation to your OS/nic IPv6 setup.

cheers


We're running it on CentOS 6.

We are able to bind to both "0.0.0.0" and "127.0.0.1"
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Strange UDP Issue

Postby Lapo » 27 May 2017, 16:42

I'd recommend investigating what might be going on.
First of all make sure no other services are using the ports you've configured for SFS.

We've used CentOS 6 a lot for stress testing and I can assure you this should not be a problem.
Lapo

--

gotoAndPlay()

...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Strange UDP Issue

Postby Vcrn » 21 Jun 2017, 22:17

Lapo wrote:I'd recommend investigating what might be going on.
First of all make sure no other services are using the ports you've configured for SFS.

We've used CentOS 6 a lot for stress testing and I can assure you this should not be a problem.


We have switched to a different provider with a new setup. The server successfully binds to IPv4 and IPv6 addresses, and we can see the port 9933 is open on both the IPv4 and IPv6 addresses with this tool http://www.subnetonline.com/pages/ipv6- ... canner.php.

We've got the server running as before with clients(Unity) able to connect through the IPv4 address. However when we change address clients use to connect to a domain name instead of the IPv4 address, many users are unable to connect. The domain has the correct A and AAAA records configured.

Any idea why it still doesn't work?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Strange UDP Issue

Postby Lapo » 22 Jun 2017, 08:41

Vcrn wrote:However when we change address clients use to connect to a domain name instead of the IPv4 address, many users are unable to connect. The domain has the correct A and AAAA records configured.

Sorry it's not clear.
It works if you point the client to the IPv4 address but it doesn't if you point it to the domain?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Strange UDP Issue

Postby Vcrn » 22 Jun 2017, 11:36

Lapo wrote:
Vcrn wrote:However when we change address clients use to connect to a domain name instead of the IPv4 address, many users are unable to connect. The domain has the correct A and AAAA records configured.

Sorry it's not clear.
It works if you point the client to the IPv4 address but it doesn't if you point it to the domain?

Thanks


Yes. When we make the clients connect using the IPv4 address, all of them can connect. When we change the address they connect with to the domain name, many of them are not able to connect.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Strange UDP Issue

Postby Lapo » 22 Jun 2017, 13:41

Can you give us the domain name and port so we can try?
Send it via private message, if you prefer.

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Vcrn
Posts: 29
Joined: 11 Apr 2017, 00:31

Re: Strange UDP Issue

Postby Vcrn » 22 Jun 2017, 14:13

Lapo wrote:Can you give us the domain name and port so we can try?
Send it via private message, if you prefer.

thanks


Sent

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 59 guests