![]() |
NAT overview NAT, or network address translation is a technique used to map one IP, known publicly, to one or more IPs, known privately. This is used to provide more IP addresses when they are scarce behind a LAN, for security, and/or to share internet connections. With a NAT, all packets go to the NAT server. The NAT server has a routing table which will then relay that packet to the correct machine. When a system behind the NAT sends a packet to a system outside the NAT, the NAT will record the sending machine outgoing destination in the table. When a return packet is sent it will do a reverse lookup on this table. The problem with this for games is that it requires the machine behind the NAT to first send a packet to all machines it wants to get a packet from. This makes it impossible to accept unknown incoming connections, which is a problem for a public game server. This can be avoided if one computer is behind a NAT and another is not. The player behind the NAT must initiate the connection (the client) while the player not behind the NAT acts as the server. NAT Punchthrough Using the NatPunchthrough class Sender= system that wants to connect See the sample \Samples\NATPunchtrough
|