R2Northstar / Northstar

Repo for packaged Northstar releases
https://northstar.tf/
MIT License
1.69k stars 131 forks source link

Re-adding IPv6 support #175

Open GeckoEidechse opened 2 years ago

GeckoEidechse commented 2 years ago

Intro

With v1.4.0 all connections are now IPv4 forced due to issues with IPv6. This issue is to discuss re-adding IPv6 support and track the progress of doing so.

Goal

The goal would be to allow both IPv4 and IPv6 connections when connecting to a server falling back to the other one if one of the two does not work.

Benefits

Due to it's way larger address space, IPv6 does not suffer from CGNAT issues, allowing more players to host servers. Further IPv6 will only become more widespread and as such making sure we support it will help future proofing the project.

Due to the scarcity of IPv4 addresses cloud providers also started charging for any/additional IPv4 addresses, increasing costs for server hosters.

Additionally there could also be players that are limited to IPv6 who would be unable to play without IPv6 support but I'm not aware of such cases.

Drawbacks

A significant portion of users in Northstar might be limited to IPv4 only (speaking of myself here as well). As such when re-adding IPv6 support we will have to fully support both IPv4 and IPv6 on all layers, resulting in additional complexity in the codebase.

Further issues will arise if a server or client only supports one of the two, especially when IPv4 is not supported for some reason. In particular an IPv4-only client won't be able to connect to an IPv6-only server and as such measures need to be taken to properly inform a player why they are not able to connect to a particular server.

Implementation details

Dropping IPv4 in favour of IPv6 would be complete non-sense and as such the only solution is to add support for both.

This means:

During initial roll-out it may be wise to still require servers to be accessible via IPv4 but allowing them to additionally offer a IPv6 connection.

Pitfalls and potential problems

Closing words

IPv6 support would be a long term goal that requires a decent amount of effort with currently very little reward. This might however change in the future. For now, any changes made to the networking code used to interact between client, game server, and master server should be made with eventual IPv6 support in the future in mind.

pg9182 commented 2 years ago

Another benefit: People will be able to host servers through IPv6 tunnels even if they can't port forward. The only problem is this won't work for IPv4.

GeckoEidechse commented 2 years ago

Marking a server as IPv6-only could also be done with some sort of "tag", if #131 is considered :3