Server dropping UDP packets

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

Moderators: Lapo, Bax

shanti
Posts: 45
Joined: 19 Jul 2011, 10:19

Postby shanti » 17 Jan 2012, 10:20

Lapo wrote:Why do you need to login and logout to change room, can you explain?
Normally it's just a matter of joining Rooms. Login and Logout allow you to switch Zones. Maybe the problem is there.


Ok will modify the code and check if this is fixing the issue.
shanti
Posts: 45
Joined: 19 Jul 2011, 10:19

Postby shanti » 18 Jan 2012, 13:02

shanti wrote:
Lapo wrote:Why do you need to login and logout to change room, can you explain?
Normally it's just a matter of joining Rooms. Login and Logout allow you to switch Zones. Maybe the problem is there.


Ok will modify the code and check if this is fixing the issue.


Hello,

I modified the code as per your suggestion, removed logout every time when jump from one room to another room.
No luck the issue still exists. ï
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Jan 2012, 14:45

No this should not really happen.
Among our Unity examples we have a first person shooter that uses UDP for sending transforms ( see at the bottom of this page: http://www.smartfoxserver.com/2X/download.php )
We have never experienced a problem like this, nor it has been notified by other users. Are you sure you are using the latest Unity API? They can be downloaded from here
Lapo
--
gotoAndPlay()
...addicted to flash games
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 06 Feb 2012, 11:50

We have this on one development environment 100% reproducible. The problem is that it seems to be a firewall/router configuration or hardware issue and not a SFS software one that is fixable.

The exact same code will start doing this on a DLink DIR-300, but work perfectly fine through a different router.

So best guess is that the NAT configuration does something weird in some routers and resends packets when using UDP to different ports.

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
shanti
Posts: 45
Joined: 19 Jul 2011, 10:19

Postby shanti » 09 Feb 2012, 06:45

ThomasLund wrote:We have this on one development environment 100% reproducible. The problem is that it seems to be a firewall/router configuration or hardware issue and not a SFS software one that is fixable.

The exact same code will start doing this on a DLink DIR-300, but work perfectly fine through a different router.

So best guess is that the NAT configuration does something weird in some routers and resends packets when using UDP to different ports.

/Thomas



Thanks for responding Thomas. Do you have any suggestions, how we can resolve this.
If NAT is doing something then it should be consistent right? Sometimes it works fine and sometimes it doesn't.
vmnikulin
Posts: 26
Joined: 17 Feb 2012, 12:48

Re: Server dropping UDP packets

Postby vmnikulin » 17 Feb 2012, 13:13

Hello!

We are using SFS2x version 2.0.1 with Unity client and getting same error:

Code: Select all

17 фев 2012 | 13:18:50,424 | WARN | SocketReader | v2.protocol.SFSIoHandler | Discard UDP packet from 94.159.40.82:3164, reason: Sender UDP Port doesn't match current session port: 3164 != 58030
17 фев 2012 | 13:18:50,444 | WARN | SocketReader | v2.protocol.SFSIoHandler | Discard UDP packet from 94.159.40.82:3165, reason: Sender UDP Port doesn't match current session port: 3165 != 52882
17 фев 2012 | 13:18:50,548 | WARN | SocketReader | v2.protocol.SFSIoHandler | Discard UDP packet from 94.159.40.82:3164, reason: Sender UDP Port doesn't match current session port: 3164 != 58030


We noticed when two clients are working, the error appears occasionally. In general, than more clients we are running, then probability of the error is higher.

How we can fix this?

For representatives of the gotoAndPlay() we can provide access to the our test server and give the Unity client to reproduce the situation.

Thanks in advance.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 17 Feb 2012, 14:26

As Thomas explained I don't think this is fixable from our side. It is a very specific issue related to your network architecture and how packets get routed to your server. Sorry
Lapo

--

gotoAndPlay()

...addicted to flash games
vmnikulin
Posts: 26
Joined: 17 Feb 2012, 12:48

Re: Server dropping UDP packets

Postby vmnikulin » 17 Feb 2012, 16:30

Our experiments showed that the issue is not in the architecture of our network, but that the SFS2X does not work with NAT properly. The cause of the problem is that NAT modifies ports during transiting of IP packets across router. So, during one user session UDP packets from one client may contains different ports. Thus, when the SFS2X validates port of user, it discovers that they are not equal.

As soon as 90% of users are behind NAT, it means that they will not be able to work with the SFS2X over UDP. So, it is important to you as soon as possible to fix the problem, for example, by providing the ability to disable check of ports equality.
shanti
Posts: 45
Joined: 19 Jul 2011, 10:19

Re: Server dropping UDP packets

Postby shanti » 12 Jun 2012, 12:00

Hello,

Is this issue addressed ? we still facing this problem
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 12 Jun 2012, 12:46

DId you read this? viewtopic.php?p=54191#p54191
If its not the same case then please provide the details of your issue.
Lapo

--

gotoAndPlay()

...addicted to flash games
sudhir
Posts: 4
Joined: 03 Mar 2012, 00:54

Re: Server dropping UDP packets

Postby sudhir » 07 Jul 2012, 01:04

It's possible that this is our scenario... we get thousands of warning messages in the log files. That said, since NAT is a fairly common network setup (even with home users on off-the-shelf Wi-fi routers), and we really have no control over how clients set up their configs, is there a way to turn off this particular check?
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: Server dropping UDP packets

Postby janheuninck » 10 Aug 2012, 22:07

Recently we are experiencing the same problem. It's not predictable when the error will occur: sometimes everything works as expected, sometimes the server starts discarding the UDP packages.

10 Aug 2012 | 21:53:19,624 | WARN | SocketReader | v2.protocol.SFSIoHandler | | Discard UDP packet from 184.71.175.150:59908, reason: Sender UDP Port doesn't match current session port: 59908 != 11827


Nothing fancy is going on: Player connects to the server, joins a zone, joins a room, starts playing. And the connection does not get lost on the client...

EDIT: Apparently this occurs as a result of a time-out. If the client doesn't send UDP-packages for 30-60 seconds, his session port changes somehow.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 11 Aug 2012, 09:07

I recall discussing a similar issue a few months ago. It turned out that the client's firewall was part of the problem because it would get in the way and change the port used to send UDP data.
SFS2X uses accepts UDP data only from one port, the first value used by the client. If this port is changed during the same session packets are discarded in order to avoid cheating.
Lapo

--

gotoAndPlay()

...addicted to flash games
Ferz
Posts: 21
Joined: 27 Aug 2011, 08:17

Re: Server dropping UDP packets

Postby Ferz » 28 Sep 2012, 11:44

Lapo wrote:It turned out that the client's firewall was part of the problem because it would get in the way and change the port used to send UDP data.
SFS2X uses accepts UDP data only from one port, the first value used by the client.


What should we do? Should we tell to all our users to close firewalls, when they want to play in our game?

Lapo wrote:If this port is changed during the same session packets are discarded in order to avoid cheating.

Can we have this port check for udp packets - as optional feature?
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: Server dropping UDP packets

Postby janheuninck » 07 Mar 2013, 00:12

Bump.

Is it possible to have this security check as an optional feature in the SmartFox Administration Tool? We are QC'ing our application and this error is happening occasionally. As a result of this error the player is unable to play the game anymore (he still gets all the TCP and UDP messages, but is unable to send requests to the server over UDP...).


Cheers

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 58 guests