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

User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 13 Jun 2017, 10:08

When you tested on PC, Android and iOS where you using the same network?
Lapo
--
gotoAndPlay()
...addicted to flash games
creat326
Posts: 87
Joined: 13 Jun 2010, 09:50

Re: Server dropping UDP packets

Postby creat326 » 27 Feb 2018, 15:09

i guess this was never solved right?
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 28 Feb 2018, 10:04

Apparently not. It's a rather old post (8 months ago) but it looks like the poster didn't reply.
Why are you asking?
Lapo

--

gotoAndPlay()

...addicted to flash games
creat326
Posts: 87
Joined: 13 Jun 2010, 09:50

Re: Server dropping UDP packets

Postby creat326 » 28 Feb 2018, 10:09

because it's still going on... it's been like that for years
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 28 Feb 2018, 15:37

What is going on exactly? This is an old post that spawns 7 pages...
I presume you're referring to this error?
Discard UDP packet from ..., reason: Sender UDP Port doesn't match current session port: X != Y


If that's the case we've discussed it quite a lot and it's got to do with external routers or poor mobile support, not SFS2X per se (in fact it happens with any server).

If you're running a recent version of SFS2X (2.13.x) you can manually add this setting to your SFS2X/config/server.xml

Code: Select all

<allowClientUdpPortChanges>false</allowClientUdpPortChanges>

at the bottom of the file, before the closing main tag.

This is basically telling the server to ignore client UDP port changes at the cost of reducing security (but there's no alternative).

At the moment this is still an "experimental" feature, but I think it will be official since the next update.
Other customers have tried it and reported that the issue was gone.

Let us know.
Lapo

--

gotoAndPlay()

...addicted to flash games
Zed
Posts: 40
Joined: 03 Jul 2014, 15:24

Re: Server dropping UDP packets

Postby Zed » 01 Jun 2018, 12:49

Lapo wrote:What is going on exactly? This is an old post that spawns 7 pages...
If you're running a recent version of SFS2X (2.13.x) you can manually add this setting to your SFS2X/config/server.xml

Code: Select all

<allowClientUdpPortChanges>false</allowClientUdpPortChanges>

at the bottom of the file, before the closing main tag.

This is basically telling the server to ignore client UDP port changes at the cost of reducing security (but there's no alternative).

At the moment this is still an "experimental" feature, but I think it will be official since the next update.
Other customers have tried it and reported that the issue was gone.

Let us know.


Your fix is not working! We still receive error "UDP port change'
We have turned off Windows firewall on the dedicated server machine.

We face this issue in our brawler game.
To reproduce: we login to the game (at login phase we initialize UDP), then wait ~10 minutes and click "Go to battle" (after this, on server side creating game room) - when battle starts player can't move, because for movement we use UDP.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 01 Jun 2018, 13:36

What version of SFS2X are you running?
The allowClientUdpPortChanges flag was added in SFS2X 2.13.1

Also, does the problem appear mobile? PC? Both?
What client type?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Zed
Posts: 40
Joined: 03 Jul 2014, 15:24

Re: Server dropping UDP packets

Postby Zed » 01 Jun 2018, 13:45

Lapo wrote:What version of SFS2X are you running?
The allowClientUdpPortChanges flag was added in SFS2X 2.13.1

2.13.2

Lapo wrote:Also, does the problem appear mobile? PC? Both?

Mobile (Android)

Lapo wrote:What client type?

Unity 2018.1.1

Thanks for quick response
Zed
Posts: 40
Joined: 03 Jul 2014, 15:24

Re: Server dropping UDP packets

Postby Zed » 01 Jun 2018, 14:38

Lapo wrote:What version of SFS2X are you running?
The allowClientUdpPortChanges flag was added in SFS2X 2.13.1

Also, does the problem appear mobile? PC? Both?
What client type?

Thanks


Sorry, there is misunderstanding with the flag allowClientUdpPortChanges.

How it should be to fix the error?
True or false?
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 04 Jun 2018, 07:58

Hi,
Zed wrote:
Sorry, there is misunderstanding with the flag allowClientUdpPortChanges.
How it should be to fix the error?

What misunderstanding?
The parameter must be added manually to the config server.xml file, under the <serverSettings> node.
Like this:

Code: Select all

<serverSettings>
   ...
   ...
   <allowClientUdpPortChanges>false</allowClientUdpPortChanges>
</serverSettings>


True or false?

What are you referring to?

Once you have applied the change to config file you need to restart the server. If you keep seeing those UDP errors then please send us the zipped logs so we can take a look. You can send them to our support@... email box with a reference to this discussion.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
qazokmijn01
Posts: 21
Joined: 15 May 2018, 08:34

Re: Server dropping UDP packets

Postby qazokmijn01 » 18 Feb 2020, 22:36

I try add config <allowClientUdpPortChanges>false</allowClientUdpPortChanges>
But it not working . I used version smartfox 2.14

Code: Select all

18 Feb 2020 | 06:46:46,975 | WARN  | SFSWorker:Sys:4 | v2.protocol.SFSIoHandler |     | Discard UDP packet from 125.214.51.209:54133, reason: Sender UDP Port doesn't match current session port: 54133 != 9225
18 Feb 2020 | 06:46:47,012 | WARN  | SFSWorker:Sys:2 | v2.protocol.SFSIoHandler |     | Discard UDP packet from 125.214.51.209:54133, reason: Sender UDP Port doesn't match current session port: 54133 != 9225
18 Feb 2020 | 06:46:47,027 | WARN  | SFSWorker:Sys:3 | v2.protocol.SFSIoHandler |     | Discard UDP packet from 125.214.51.209:54133, reason: Sender UDP Port doesn't match current session port: 54133 != 9225
18 Feb 2020 | 06:46:47,043 | WARN  | SFSWorker:Sys:4 | v2.protocol.SFSIoHandler |     | Discard UDP packet from 125.214.51.209:54133, reason: Sender UDP Port doesn't match current session port: 54133 != 9225
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 19 Feb 2020, 12:09

Hi,
you need the allowClientUdpPortChanges setting to be set to true:

Code: Select all

<allowClientUdpPortChanges>true</allowClientUdpPortChanges>

Then restart the server.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
qazokmijn01
Posts: 21
Joined: 15 May 2018, 08:34

Re: Server dropping UDP packets

Postby qazokmijn01 » 26 Feb 2020, 03:22

Lapo wrote:Hi,
you need the allowClientUdpPortChanges setting to be set to true:

Code: Select all

<allowClientUdpPortChanges>true</allowClientUdpPortChanges>

Then restart the server.

Thanks


I will try if it works well or not I will answer.
Sorry my english not good
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: Server dropping UDP packets

Postby Mrm83 » 25 Mar 2020, 16:55

We are experiencing 100% UDP packet missing issue. SFS2.15.

This does not happen all the time, but from time to time, the session's UDP packets will not be received by client. No errors observed on either side. Don't know how to reproduce or under what condition this issue happens. TCP packets works with no drops but UDP are all missing.

Any ideas what could be causing this?
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 25 Mar 2020, 17:35

Can you give us more details?
100% packets missing after the initial initUDP call?
Or after a certain amount of activity?

Are there long pauses during which the client is not sending or receiving any UDP packets? If that's the case it could be a matter of adding a small keep alive call between client and server to avoid the client silently recycle the ephemeral port (if no transmission is seen for a while).

Let us know
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 41 guests