forked from foxssake/natty
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Background
Needs investigation, but would be a huge boost for a.) not having to allocate and poll thousands of ports, b.) not having a hard cap of 65k relays per physical device, c.) making noray easy to run from Docker.
The idea is to shift creating new connections to the host. Instead of noray having multiple sockets where hosts can send data, every time someone wants to connect to a host, the target host establishes an extra connection to noray, which then noray uses to relay the data.
Example flow
- Registration
- Host A connects to noray
- Host B connects to noray
- Host C connects to noray
- Game setup
- A starts its game server
- B asks noray to connect over relay to A
- noray asks A to establish a connection
- A does a UDP handshake to noray over a new connection
- noray saves the address of the new connection and associates it with A
- noray asks B to establish a connection
- B does a UDP handshake to noray
- noray lets A and B know that the connection was successful
- noray now relays between the new connections
- e.g. everything that arrives on A's new connection is sent to B's new connection
- everything that arrives on B's new connection is sent to A's new connection
- A and B are now connected, granted they use the same local ports as previously
Notes
- Huge win with not having to have so many sockets
- At the expense of slightly more complex connection process
- Could look into some low-level solution to pipe between sockets, like slice
- Should be implemented as a new feature, to keep backwards compatibility
- If someone doesn't want to mess with the new connection sequence, they can just use that
- For those who mind the port allocations, they can use the new sequence
- Similar PR: feat: Autoconnect with network conditions simulation netfox#481
Metadata
Metadata
Assignees
Labels
No labels