Skip to contentSkip to conversation

NAT support for peer-to-peer games

nf-failover KOVACS Krisztian 3 participants 3 messages Sep 22, 2004 – Sep 25, 2004 1 message not in the archive netfilter

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 00d901c49fb3$2dea51f0$e310f43e@manowar

#1 lore raw

Hi,

2004-09-21, k keltezéssel 10:15-kor Serguei I. Ivantsov ezt írta:

Quoted 1 line

http://www.hasenstein.com/HyperNews/get/linux-ip-nat/97.html

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
#2 lore raw
In reply to a message not in the archive
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.

Quoted 1 line

http://www.hasenstein.com/HyperNews/get/linux-ip-nat/97.html

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
#3 lore raw
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.

Quoted 1 line

http://www.hasenstein.com/HyperNews/get/linux-ip-nat/97.html

yes, this is the draft that iptable_nat aims 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