62 Networking and Online Games: Understanding and Engineering
Basic Internet Architecture Imagine that both hosts are engaged in separate TCP connections with other, unrelated hosts on the Internet. The host TCP connections originate from addr=192.168.0.12, port=W. and addr=192.168.0.13, port=X. respectively. Because there is no coordination between hosts when they choose their TCP source ports, there is no guarantee that W and Xare different. NAPT remaps both the source port and source address fields to ensure that the individual TCP connections appear unique on the public side of the router. In this example, outbound packets from addr=192.168.0.12, port=W. are modified to appear as packets from addr=128.80.6.200, port=Y. and forwarded to the ISP. Likewise, packets from addr=192.168.0.13, port=X. are modified to appear as packets from addr=128.80.6.200, port=Z , where Z and Y are guaranteed to be different. Packets coming back in from the Internet are modified with the reverse mappings before being forwarded onto the private network. 4.3.2.3 Convenience and Limitations Both NAT and NAPT provide independence from the need to renumber when your public IP address(es) change. Only the NAT-enabled router needs to be aware of any change in the range of public IP addresses assigned to the company s network the hosts remain unchanged. This makes it easy for small companies to change ISPs with minimal disruption of internal network operations. NAPT also allows multiple hosts on a home LAN to access the Internet while avoiding additional charges for more than one IP address. Naturally, all this convenience comes with caveats [RFC2993]. NAT and NAPT break the transparency of TCP and UDP communication between hosts, and require special-case coding to handle other protocols. While hosts on the private network may initiate communication with anyone else on the Internet, the reverse is far more complex. Additional functionality is required in your NAT/NAPT router to enable hosts inside the private network to support well-known servers visible to the rest of the Internet. For example, imagine you have a small corporate site with 200 hosts and three of them want to run publicly accessible web servers. The default http://www.companyname.com web address format actually implies that the web server is listening for HTTP traffic on TCP port 80. However, if you only have one public IP address, the NAPT router can only map inbound dst addr, port=80. traffic to one of your internal hosts, not three. The second and third would-be web servers will either need to give up on their plans, merge with first machine, or configure the NAPT router to utilise nonstandard mappings (for example, mapping ports 8080 and 8081 to the second and third internal machines respectively, and giving external web addresses of the form http://www.companyname.com:8080 and http://www.companyname.com:8081 respectively). Running game servers behind NAT/NAPT is similarly problematic. Many games require the server to register its IP address and port number with a master server (through which potential players find available game servers). But when sitting behind NAT/NAPT, inbound connections (e.g. from new players) are typically only allowed by the NAT/NAPT router if they correspond to a recently initiated outbound connection. But since players initiate contact with the game server, not the other way round, we have a dilemma. (For example, consider Figure 4.17 with a Quake III Arena server running on host 192.168.0.13 at port 27960. Further, assume the NAPT router is
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Inexpensive Web Hosting services