PaperMC / Waterfall

BungeeCord fork that aims to improve performance and stability.
https://papermc.io
MIT License
736 stars 295 forks source link

Add tcp fast open #825

Closed xism4 closed 8 months ago

xism4 commented 9 months ago

It was implemented because Velocity comes with this system, and it should speed up the opening of connections between server-backend at level 3 for systems that support Netty's epoll

Minecraft clients support this feature.

https://en.wikipedia.org/wiki/TCP_Fast_Open

BoomEaro commented 8 months ago

I decided to look into this more and came to the conclusion that it makes no sense:

  1. The ChannelOption.TCP_FASTOPEN constant has nothing to do with setting the TFO mode. The value set there configures the maximum number of outstanding (waiting to be accepted) TFO connections. (https://netty.io/4.1/api/io/netty/channel/ChannelOption.html#TCP_FASTOPEN)
  2. The game client never sets the TCP_FASTOPEN_CONNECT constant to enable TFO. (proxy also should do this for downstream to enable this feature)
  3. Spigot and paper does not support TFO by default.
  4. TFO mode should be configured only here on linux systems: /proc/net/ipv4/tcp_fastopen
  5. Client and server should support this at the system level and at the application level. Windows does not support this (most minecraft users are windows users)

It’s just not clear to me why velocity has this support, while neither paper nor windows users will be able to use it. In addition, for TFO to work, you need to explicitly configure the BOTH mode (for proxy) in the system configuration. (by default enabled only CLIENT mode)

xism4 commented 8 months ago

I will close this since this needs backend impl for Spigot and forks