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: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 28 Aug 2014, 15:27

All I can say is that there's nothing you can do via Extension code that could generate that effect directly.
Maybe it does it indirectly for some very obscure reason (e.g. trigger the firewall port change). I can only guess, since I don't have any data to rely upon.

In any case if you try the code that apparently causes the problem in a local environment (with not firewalls) you will notice that error won't show up as well.
Lapo
--
gotoAndPlay()
...addicted to flash games
shlapkoff
Posts: 8
Joined: 24 Nov 2014, 11:02

Re: Server dropping UDP packets

Postby shlapkoff » 01 Dec 2014, 12:41

11:41:42,379 WARN [SFSWorker:Sys:1] protocol.SFSIoHandler - Discard UDP packet from 185.6.25.36:52286, reason: Sender UDP Port doesn't match current session port: 52286 != 1025

We have the same problem. It appears randomly. Maybe there was some additional information that is not in this topic?

UPDATE:
I looked example FPS.
I found this problem and there. You need to go to the game, wait for 2-5 minutes in the lobby and get into the game. Then we get the message
12:01:33,674 WARN [SFSWorker:Sys:3] protocol.SFSIoHandler - Discard UDP packet from 185.6.25.36:52899, reason: Sender UDP Port doesn't match current session port: 52899 != 1049


If you go directly to the game, then there is no problem.
So, after initialization UDP connection is required to send an empty UDP packets to the server?
Could there be a problem that I use for hosting Microsoft Azure?

thanks
creat326
Posts: 87
Joined: 13 Jun 2010, 09:50

Re: Server dropping UDP packets

Postby creat326 » 17 Apr 2017, 12:36

it happens in any hosting, not only azure. It's been driving me nuts for years and i'm already rewriting all my network code to move to a different server type that doesn't this issue. I supported smartfoxserver for way too long and I finally got real and realized that if something is not fixed in 2 years that's not the way to work with any server provider.
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Server dropping UDP packets

Postby meanvel » 17 Apr 2017, 16:24

Here is a interesting way that this could be solved. UDP with fallback! Kinda like Bluebox for TCP.

A option could be provided for the SmartFox client to send UDP packets with the users SmartFox ID. If a UDP packet isn't recognized, SmartFox alerts that client with a UDP failure event over the clients TCP connection so they can fallback to TCP only.

It adds a little data, so it should be a optional configuration setting, but it's a idea... Thoughts, Lapo? I don't use UDP yet, but I thought I would give my two cents on this.


To lower the data usage of this, it could be enabled on a per message basis... Eg, one could just send SmartFox id's with the UDP packets for location updates, and not with UDP projectile update messages. Insuring the more important projectile UDP messages are as fast as possible.
Last edited by meanvel on 17 Apr 2017, 16:45, edited 1 time in total.
creat326
Posts: 87
Joined: 13 Jun 2010, 09:50

Re: Server dropping UDP packets

Postby creat326 » 17 Apr 2017, 16:43

of course, it's a piece of cake to solve it, smartfox is the only server that has this problem which is fine because everyone has bugs, but come on... checked the dates? that's my point, it's a known issue for years, causing countless hours of work lost for people that encounter it the first time, going through firewall settings, router, the code, etc... just to find out that it's known issue for years and still not fixed.
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Server dropping UDP packets

Postby meanvel » 17 Apr 2017, 16:57

creat326 wrote:of course, it's a piece of cake to solve it, smartfox is the only server that has this problem which is fine because everyone has bugs, but come on... checked the dates? that's my point, it's a known issue for years, causing countless hours of work lost for people that encounter it the first time, going through firewall settings, router, the code, etc... just to find out that it's known issue for years and still not fixed.


Well, I would actually argue that it isn't technically "fixable". I have had constant problems in the past with getting UDP working for just playing normal AAA PC games, and getting certain programs to work properly which require UDP.

However, creating a workaround like I mentioned above to create a frictionless fallback for users... That is something they probably should do. Even though it's not the fault of goToAndPlay(), the problems with UDP ports are so widespread across networks and the internet that adding a dynamic fallback option would be smart...

It could also be done as a UDP 5-10 second ping which sends a users ID to the server and back... Many different ways this could be fixed... Wouldn't take a programmer more than an hour to integrate that workaround if SFS was open source. The client could also be told by the server to re-negotiate a new UDP port when pinged with a incorrect UDP port for the sfs user id... And not fallback to TCP.

Edit: Wow... I just realized this thread has 13,000 views... They should definitely integrate a option for dynamic fallback on UDP failure. The ping method I mentioned here is very easy to implement and not very costly on server resources. Also, nearly every realtime game you need to monitor ping times anyway...
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Server dropping UDP packets

Postby meanvel » 18 Apr 2017, 10:11

I just realized, all that's needed to notify the client of UDP failure is already there...
"Discard UDP packet from 185.6.25.36:52899, reason: Sender UDP Port doesn't match current session port: 52899 != 1049"

SmartFox would just need to match the IP address to the currently logged in client serverside, then send a message to the client notifying it of UDP port failure over the TCP connection... And, you could handle the problem in the client however you want.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 18 Apr 2017, 10:19

We have discussed this issue at length, both in public and privately with several companies.

To say that we don't care or we have forgotten about this issue is simply not true.
For starters this issue is prevalent on mobile devices and the relative bad support for UDP that is still widespread.
From an hosting point of view we have never been able to reproduce it on any of the hosting services we use for testing (amazon, rackspace, jelastic and bunch more)

The bottom line is that most customer who had this issue had more general problems with UDP on mobile, which at the end of the day would make their application not very stable. So that's more of a symptom of a larger issue than anything else.

@creat326
it happens in any hosting, not only azure.

No, I am sorry this is inaccurate to say the least.
For starters it's got very little to do with hosting companies. We have yet to find a hosting that causes issues like these, if you can point out one that can please, by all means, provide the details.

We have worked with all major cloud providers (Azure included) and there is no such problem. You will not see any such issue until you use a mobile connection from client side. Mobile phones depend on their carriers and that's where the problem lies: support for UDP is still pretty bad and inconsistent.

Case in point, we've never been able to reproduce this particular issue once. We have tested a bunch of mobile providers here in Italy and no one has such issues with UDP.
This is no small potato, without a reliable way to reproduce the problem we can't and make a complete analysis, test different solutions and see which one offers the best workaround minimizing security issues.

Finally we just had a similar conversation with a customer in February (this year) who was reporting the same issues with mobile clients. By digging into the problem further it also turned out many clients had issues even initializing UDP and the overall stability of UDP connections was pretty bad.

We suggested to switch to TCP given the unreliable state of UDP over mobile networks. Two weeks later the customer gets back to us after having attended the GDC. He had just spoken with a number of developers from large mobile companies and they told him exactly the same: UDP is still a crapshoot and you're better off with TCP for the time being.

Hope this clarifies the situation.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Server dropping UDP packets

Postby meanvel » 18 Apr 2017, 10:35

Lapo wrote:We suggested to switch to TCP given the unreliable state of UDP over mobile networks. Two weeks later the customer gets back to us after having attended the GDC. He had just spoken with a number of developers from large mobile companies and they told him exactly the same: UDP is still a crapshoot and you're better off with TCP for the time being.

Hope this clarifies the situation.


I still think a optionally activated dynamic fallback method kinda like how BlueBox work for TCP would still work to make things seamless for users using iPads and similar devices, as many people... Including me, mostly only use these types of devices over WiFi and don't use them much over cell networks because of the cost of data.

Perhaps the solution is for iOS and Android developers to set the connection to UDP or TCP based upon the connection type the device is currently using? Wifi vs Cellular.

Where there is a will, there is a way... Even if say 50% of people's devices work seamlessly with UDP... And 50% have to fallback to TCP, that is still half your users which have a much better gameplay experience!
Last edited by meanvel on 18 Apr 2017, 10:47, edited 3 times in total.
creat326
Posts: 87
Joined: 13 Jun 2010, 09:50

Re: Server dropping UDP packets

Postby creat326 » 18 Apr 2017, 10:36

I've run into this issue on Google Cloud, Azure and AWS. Also on other companies like Rackspace, 1and1 and Ovh. Also I've seen it happening on my own testing machines on my own computers.

In short, I've found this issue in every single host provider I've tried. It's clearly not limited to a host provider.

I'm not saying you don't care (although this is a thread from 2011 isn't it?), I'm saying that you can solve it and nothing has been done. It's like the issue with ipv6 that was reported long long long ago and denied and finally acknowledged and fixed with the .12 or .14 patch. Things just take forever to be taken care on smartfox and I don't see a way to prove me wrong when these UDP error threads are all several years old.

I understand UDP has limitations, but hey, since I migrated to photon some of my games using UDP I've never ever had this issue. So clearly something can be done.
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Server dropping UDP packets

Postby meanvel » 18 Apr 2017, 11:06

creat326 wrote:I understand UDP has limitations, but hey, since I migrated to photon some of my games using UDP I've never ever had this issue. So clearly something can be done.


Are your games PC/Mac only(Flash + Adobe Air), or are some users accessing them on iOS/Android(HTML5)? Or, maybe your games are native iOS/Android?

Curious what type of games your having this issue with...
Last edited by meanvel on 18 Apr 2017, 11:17, edited 2 times in total.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 18 Apr 2017, 11:07

creat326 wrote:I've run into this issue on Google Cloud, Azure and AWS. Also on other companies like Rackspace, 1and1 and Ovh. Also I've seen it happening on my own testing machines on my own computers.

In short, I've found this issue in every single host provider I've tried. It's clearly not limited to a host provider.

Can you please give me an example of how to reproduce this?
Since you say you're able to reproduce it on your testing machine I'd expect it to be fairly simple to show us a proof of concept so that we can finally see this at work.

It would be highly appreciated.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 18 Apr 2017, 11:14

creat326 wrote:I'm not saying you don't care (although this is a thread from 2011 isn't it?), I'm saying that you can solve it and nothing has been done. It's like the issue with ipv6 that was reported long long long ago and denied and finally acknowledged and fixed with the .12 or .14 patch. .

All we ask when a new issue is reported is to be able to reproduce it via a repro case.
On a slightly related note you have never reported any specific issues with IPv6 on this forum... so I am not sure what you're complaining about... :shock:

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Server dropping UDP packets

Postby Lapo » 25 Apr 2017, 07:01

Lapo wrote:
creat326 wrote:I've run into this issue on Google Cloud, Azure and AWS. Also on other companies like Rackspace, 1and1 and Ovh. Also I've seen it happening on my own testing machines on my own computers.

In short, I've found this issue in every single host provider I've tried. It's clearly not limited to a host provider.

Can you please give me an example of how to reproduce this?
Since you say you're able to reproduce it on your testing machine I'd expect it to be fairly simple to show us a proof of concept so that we can finally see this at work.

It would be highly appreciated.

@creat326
We would really be glad if you could help us reproduce the issue, since you claim you can replicate it everywhere...
What is your server and client setup?
Lapo

--

gotoAndPlay()

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

Re: Server dropping UDP packets

Postby Zed » 08 Jun 2017, 10:04

HI!
I have made tests projects (zone, room and client (Unity)) in which you can try to reproduce the issue.

How to reproduce error:
Discard UDP packet from [HIDE]:2774, reason: Sender UDP Port doesn't match current session port: 2774 != 63983

1) Run server on remove machine (trying on amazon and hetzner servers)
2) Run 10-15 client instances on other machine (behind router) and wait their connecting, logginig and "find game".
When client sends "find game" they are added to list of waitining players. After 10 players joined to "the lobby" - on the server side i
create room with "battle" extension and start loadind "battle scene" on the clients. After clients loaded the scene, they send
join battle request. After they have joined the battle, all clients send "Attack request" and almost always i get this error.


Used OS: Win 7 x64.
Smartfox veriosn: 2.12
Client library version: 1.5.7.0
Unity: 5.6.03f
Tryed turn off firewall on remote machine.
Attachments
TestUdpZone.rar
Zone Extension
(12.03 KiB) Downloaded 802 times
TestUdpRoom.rar
Room Extension
(9.72 KiB) Downloaded 807 times
TestUdpClient.rar
Unity Project
(134.35 KiB) Downloaded 788 times
Last edited by Zed on 08 Jun 2017, 10:11, edited 1 time in total.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 55 guests