NAT support for peer-to-peer games
Hi,
2004-09-21, k keltezéssel 10:15-kor Serguei I. Ivantsov ezt írta:
In theory, all of this is implemented by Netfilter at the moment.
Based on http://alumnus.caltech.edu/~dank/peer-nat.html, Netfilter has some code to make sure that all packets sent from a single local UDP port are mapped to the same public IP and port. Unfortunately this code is broken at the moment, but the fix should be really easy. (AFAIK Rusty already has some patches to fix this.)
PS: please don't send emails like this to the netfilter-failover list, it's really offtopic there. Use netfilter-devel instead.
Signature · 2 lines
Regards, Krisztian KOVACS
Quoted 4 lines · Serguei I. Ivantsov
Hello!
I just interesting - whether something changes in Netfilter to support peer-to-peer games.
You're definitely on the wrong mailinglist. Please re-post to netfilter-devel.
Quoted 1 line
How to implement the scheme described below using netfilter?
netfilter implements draft-ford-natp2p-00, which should address your problem.
yes, this is the draft that iptable_nat aims to implement.
Quoted 1 line
Serguei I. Ivantsov
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Quoted 8 lines · Harald Welte
Quoted 1 line
How to implement the scheme described below using netfilter?
netfilter implements draft-ford-natp2p-00, which should address your problem.
yes, this is the draft that
iptable_nataims to implement.
On reading this I see some obvious limitations of this approach. The main limitation is the port NAT capability of Netfilter.. you are not guaranteed you will get assigned the same port on all connections.
And if the change to randomize the netfilter port assignments is done then this scheme will break down completely and never succeed in making the p2p connections.
A more up to date devision of this draft seems to be draft-ford-midcom-p2p-03.txt
To sort this out it should be added to this draft that each client punching holes in NAT gateways MUST use a random source port and if connection fails retry using a new random port, and that the document is extended to mention that the common server is not only used as a directory but also active participant in mediating the connections to allow the endpoints to syncronize their state correctly when there is need to retry on a new port etc. In addition the P2P applications must be prepared to see "unexpected" traffic from uninvited clients and should therefore not only rely on the port numbers for identifying the client but also include their own unique identifiacation of the P2P participiant they want to connect to to allow proper detection of crossed connections.
Regards
Henrik