NAT and P2P networks

zhaozj2021-02-16  80

Dan Kegel Out of SunkingLang Translation

Peer-to-peer is a web form, based on it, computer in the network can communicate directly without a central server. This technology is usually applied to multi-player online games, such as Activision's battle network to avoid delays and consumption caused by server data streams, but such networked forms often encounter network address resolution issues (NAT). In this article, I will describe how to solve these problems. Products using this technology can now be able to run in some business NATs.

background

The Internet is based on 32-bit IP addresses, which means that the maximum number of computers in the Internet is about 4 trillion. Due to the invalidity of the IP address usage, the actual number will be much less. In fact, how long will the Internet can't take the IP address.

Because the available IP address is increasing, a technology called network address resolution or arrow NAT is developed, which allows a computer to represent the entire network with an IP address.

A NAT is in the common Internet and the network it serves, rewrites the IP address and port number of the IP header in the data to make all the packages look like a public IP address from a NAT device (or to It goes), not from the actual source or target.

NAT is now in a small family - office route is generally rented, and in many software, users are used by users to connect several PCs to a unique cable MODEM. It is even used by some ISPs.

(NAT is not the only possible solution, the proxy server is also commonly used, but more configurations, sometimes need to be customized. And finally, we will switch to IPv6, which will use 128-bit address, You can solve existing and all issues, but it will be popular for a long time.

Some protocols are non-NAT-friendly

Some applications hide the IP and port numbers in their packets, NAT can't rewrite them correctly, so when you want to use those programs within the NAT network, they will not run correctly.

Some NATs, due to safety, only the external address that has been sent over data is allowed to receive data. This means that two people in different NAT cannot establish a connection in a usual manner.

Solution

I hope that the NAT-friendly Peer-to-peer (point-to-point) protocol must be clear: any address of the embedded packet is invalid when passing NAT, so it is necessary to remedy. A possible way is as follows:

All of the data streams between the two points pass through a single UDP port. There is an address server that is not in any NAT. The user first is connected to the address server and sends the IP address they think that the ownership; the server tags the address and its address as seen in the UDP header. The server then sent two addresses to other points. In this way, everyone knows the address of others.

To open the point-to-point connection, all old (junction) points send a UDP package to the new (junction) point, and the new (junction) point sends a UDP package to every old (junction) point. Because no one knows if they are in the same NAT, the first package is often sent to public and private addresses.

This causes each person's NAT to open a two-way hole by opening a two-way hole. Once the first response returns from each (junction) point, the sender knows which return address is used and can stop sending data to the two addresses.

Compatibility needs

Based on and transcending basic NAT RFC, a NAT device that wants to support this technology must have the following requirements:

>> NAT does not allow for changing the UDP port number used by the data stream. If a host after NAT sends a series of packets from a single UDP port, the package after the NAT is taken must also be manifested as from the same host and UDP port. RFC blueprint

I am developing this technology RFC blueprint more detailed detail. If you are interested, please contact me.

Compatibility test results

I am testing the compatibility of several NAT communications. Here is some of the results:

Known NAT implementation compatibility

>> NAT1000: It is fully compatible. Thanks to Nevod technicians helped their compatibility testing. No things need to be changed; this technology is very stable with their NAT. Nevod no longer exists, it has been merged by Microsoft. >> WIN98 SE The network connection shared software originated from NAT1000, so it must be well run. >> Sygate: It is fully compatible. >> NAT32: The Beta beta released from January 5, 1999 is fully compatible. The release now published is also fully compatible. >> Linux IP Masquerading (Linux IP camouflage): 2.2.1 The version kernel and subsequent versions can run normally. Please come http://juanjox.linuxhq.com/? Look for early version 2.1 patches. 2.0 version of the patch to see the page of Glenn Lamb: http://home.indyRamp.com/lists/masq/msg03024.html: ftp: //ftp.netcom.com/pub/mu/mumford/loose-UDP-2.0. 36.Patch.gz; Glenn's port makes it a configuration config_ip_masq_loose_udp, which is a good initiative. >> Winnat: The current version works fine.

NAT implementation is about compatible

>> Arescom Apex 1100 ISDN Routing: Arescom In January 1999, a firmware patch was released for this issue; maybe it has been incorporated into its standard firmware, but I have not confirmed. >> Vicomsoft SoftRouter Plus: Vicom has announced a version to solve this problem, but I haven't had a chance to test it. Note: To make this implementation, you must prohibit all local TCP bindings that point the gateway device to all local TCPs outside the internal Etherimator. Read your document before using the Vicom installation assistant.

Unknown is compatible

>> Cisco iOS has a built-in NAT compatibility characteristic, perhaps it may be useful. >> We have tested all Win32 software that we have in your hand. However, NAT, which has not been tested in many small home office, nor did it test external NAT such as SonicWall.

Incompatible

>> All pure proxy server solutions, such as Wingate2 or PPPSHAR, can not run normally.

Software using this technology

The following software package is known to support in NAT: >> Civilization: Call to Power >> Hevy Gear 2

forum

I want to hear other developers for this technology idea, and how Masq is rewritten to correctly reuse UDP ports. Join NAT-Peer-Games (http://onelist.com/viewarchive.cgi?gistname=nat-peer-games) Mail list Let us discuss.

Implementation

I encountered some implementation problems when I test Sygate and recent NAT1000. When the machine running the gateway is connected through the MODEM and the Internet, all everything is normal. However, if the gateway machine is coupled to the Internet with the Internet, the client cannot access other hosts on the external Ethernet. It seems that the package sent by the gateway is completely discarded by other hosts on the external Ethernet. However, the router will not discard the data, so there is no problem with the remote host. For more information, please go to My UseNet Post (http://www.dejanews.com/getdoc.xp?an=427631763). I tend to believe this is the hardware reason, but who knows ...

link

>> Ietf Working Group on Nat: http://www.ietf.org/html.charters/nat-charter.html New RFC sketch and mailing list. One of the documents http://www.ietf.org/internet-drafts/draft-ietf-nat-protocol-issue-01.txt refers to this technology; search keyword "activision"

>> NAT page: http://www.uq.edu.au/~gadmacka/the-nat-page/ Lists some feasible NAT implementations

>> Linux IP camouflage: http://www.indyramp.com/masq/ is the Linux Masq on the NAT implementation.

>> MASQ mail list can be queried index: http://www.mail-archive.com/masq@tori.indyramp.com/

>> Linux IP NAT Forum: http://serf.csn.tu-chemnitz.de/hypernews/get/linux-ip-nat.htmlnat papers, old unsupported Linux NAT implementations and an discussion area. Most for historical interests.

history

This is a new technology relative to my knowledge. I started researching it in 1997 and used it in 1998 to complete my first work. This technology was developed in the production of Activision multi-player games.

1999 Dan Kegel All rights reserved Dank@alumni.caltech.edu recently updated: July 17, 1999 Kegel Home: http://www.kegel.com/

转载请注明原文地址:https://www.9cbs.com/read-11492.html

New Post(0)