Opened 10 years ago

Last modified 5 years ago

#2305 closed enhancement

UDP Hole Punching / NAT Traversal — at Version 14

Reported by: Josh Owned by:
Priority: Must Have Milestone: Alpha 22
Component: Multiplayer lobby Keywords: patch, beta
Cc: fcxSanya@… Patch:

Description (last modified by fcxSanya)

Details

Right now in 0 A.D. we use a primitive UPnP system to implement NAT transversal, but this system is unreliable. We would like to see a better method using UDP Hole Punching instead. The solution would involve interacting with the lobby server to get transversal information. The recommended implementation would use STUN with ICE. It may be possible to (ab)use XEP-0176: Jingle ICE-UDP Transport Method for the desired result. Ejabberd has a built-in STUN server (Manual Entry). Both Ejabberd and Gloox support XEP-0176.

Expected Result

Enabling 0 A.D. clients to connect to a host behind any type of NAT.

Required Prerequisites

Fluency in C++ and understanding of NAT transversal. JavaScript knowledge would also be recommended. (Ability to learn/familiarity with erlang would also be required when dealing with the lobby server)

Incomplete/failed try at implementation

Change History (14)

comment:1 by Josh, 10 years ago

Component: Core engineMultiplayer lobby

comment:2 by leper, 10 years ago

Priority: Release BlockerMust Have

comment:3 by leper, 10 years ago

Milestone: Alpha 15Alpha 16

comment:4 by JoshuaJB, 10 years ago

In 14332:

UPnP-based automatic port-forwarding using miniupnpc. Breaks windows build at the moment. Refs #2305

comment:5 by Josh, 10 years ago

Description: modified (diff)
Priority: Must HaveShould Have

Because we now have UPnP-based automatic port forwarding (which serves nearly the same purpose), I'm dropping this ticket's priority.

comment:6 by ben, 10 years ago

In 14352:

Fixes Windows build.
Fixes UPnP error handling to be more correct and conventional, refs #2305

comment:7 by Josh, 10 years ago

Description: modified (diff)
Owner: Josh removed
Priority: Should HaveMust Have

I'm not really working on this anymore as I have not been able to fully understand what implementing this would require.

comment:8 by Stan, 10 years ago

Milestone: Alpha 16Alpha 17

comment:9 by mimo, 10 years ago

Milestone: Alpha 17Alpha 18

comment:10 by historic_bruno, 10 years ago

Milestone: Alpha 18Backlog

Backlogging this due to lack of activity.

comment:11 by scythetwirler, 9 years ago

Summary: UDP Hole Punching / NAT TransversalUDP Hole Punching / NAT Traversal

comment:12 by Josh, 8 years ago

Description: modified (diff)

Added a few bits of information to the description from my recent research.

comment:13 by fcxSanya, 8 years ago

Cc: fcxSanya@… added

comment:14 by fcxSanya, 8 years ago

Description: modified (diff)

It seems gloox has only data structures representing Jingle transport, but doesn't have any ICE logic (candidates gathering, exchange; connectivity checks; keeping connection alive etc.). libnice on the contrary is providing ICE logic, but as far as I understand it doesn't have signaling. I'm planning to write a proof-of-concept test application with gloox and libnice (essentially it requires only to combine sample apps for both libraries; also googling "gloox libnice" returns at least one application with available source which uses this combination of libraries (https://github.com/yokto/xicecat)).

Note: See TracTickets for help on using tickets.