Issue with commit 9ff205dd?

If you compile the Snowflake proxy with commit 1085d048 and run it with

proxy -verbose -ephemeral-ports-range 33331:33343 -capacity 5 -poll-interval 10s

all is fine, no noticeable problems in the log output.

Notes:

  • in the above command ephemeral-ports-range is set to ceil(capacity * 2.5).
  • proxy reports ‘NAT type: unrestricted’

With the newer commit 9ff205dd and the same run command, after a short time (few minutes) there are a lot of

error sending answer to client through broker: error sending answer to broker: remote returned status code 400

Can someone reproduce this?

1 Like

The problem is probably that your port range is still too narrow. In case of TCP it is sufficient to bind a listener to one specific port to be able to handle many clients. TCP is reliable. That means a message sent from one side will arrive the opposite side. In case of UDP that’s not guaranteed. There is no such listener. A message is being sent directly to a specific port. A UDP session is defined by IP address/port combo and a timeout.
If a response arrives before the timeout is reached, the session is being closed and the port gets available for further communication. If a response doesn’t arrive, the port stays busy for the period defined by the timeout. If you get such a situation on say 5 ports at the same time, you run out of ports available for communication.

1 Like

The error does not occur for me if the proxy is started with the additional parameter

… -stun stun:stun.l.google.com:19302

As was discussed in Remote returned status code 400, ICE usually needs a bit more ports than the amount of P2P connections you want to have. What that commit does is it adds another STUN server, thus (roughly?) doubling the amount of STUN binding requests your proxy does.

So I suspect what’s happening is you run out of ports and stop being able to make STUN requests, making the amount of candidates you send in the answer 0, and the broker currently rejects answers with 0 ICE candidates.

To “revert” that commit, try adding -stun=stun:stun.l.google.com:19302 to only use one STUN server again, or try increasing the ephemeral ports range again.

And I could sort of reproduce it with the same CLI arguments on my VPS, where at some point it stopped including server-reflexive candidates in the answer and only sending host candidates.

2 Likes

None of this would be a problem and would be comprehensible to the user if the application would display the corresponding information :wink:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.