4

I run/develop an online game where many of our users are in southeast asia.

I recently went to southeast asia and made an alarming discovery. Anywhere I got internet access, whether it was via 3G, a LAN in a hotel, or wifi in a cafe, both in Singapore and the Philippines, I noticed that my IP address was changing CONSTANTLY. I mean the public IP address, not the private one. I could load a page like whatismyip.com and just hit reload and see a new IP address show up every 5-10 seconds!

This has lots of consequences for my online game, as many things "break" if the IP address changes for a given user. Basically, I would like to know more about this. Is there a name for the kind of network or router or paradigm that causes this, so I can read up on it? I don't understand WHY a network would function this way. Does it do this on purpose? Is it for security reasons? Is it to anonymize and protect the identity of the users? Or is it just an "old" method that is mostly obsolete in the rest of the world? Thanks for any info that will help me to understand.

DivideByHero
  • 371
  • 1
  • 3
  • 8

2 Answers2

1

Usually you will see this when there is some form of content caching/filtering/nat on a large network where the cache/filtering cannot be handled by a single device.

Each individual request is distributed and handled by the cluster cache/filter/nat devices based on some set of rules set by the administrator of the network.

This has lots of consequences for my online game, as many things "break" if the IP address changes for a given user.

It sounds like you have made some assumptions about IP addresses that don't fit common practice. Unfortunately in the current world where IPv4 address space is nearly exhausted you cannot depend on the IP address of a client being consistent between multiple tcp connections.

It is not 'old' it is somewhat common. Frequently you'll see this behavior in large business networks. It is not uncommon to see this behavior at hotels, schools, government networks, etc.

Given that IPv4 address space is becoming more difficult to come by this behavior is probably going to become even more common.

Zoredache
  • 130,897
  • 41
  • 276
  • 420
  • This is very helpful! You are correct that my assumptions were wrong. Now I can update my code to correct the problem. Thanks! – DivideByHero Mar 08 '10 at 22:43
1

If you think about the way Network Address Translation works, it gets easier to understand. Basically, every NAT device is able to handle around 65000 concurrent TCP connections, as it allocates its own TCP port for every outgoing connection. In the YouTube era our connections are sometimes quite long; therefore, ISPs distribute the traffic between many NAT boxes (or use boxes with many external IP addresses), resulting in a different IP address every time you make an outgoing TCP connection.

I don't understand why it affects your game though. If it's a browser-based game, you would store session information on a server, and use a cookie to match a client to a session. If it's a standalone game, you just keep a TCP/UDP connection and the IP address of the client stays the same as long as the connection is active. There's really no reason to rely on client's IP address unless I'm missing something.

  • Well, I simply had been making wrong assumptions about the "stability" of an IP address. Now that I understand WHY this can happen, I can adjust my code accordingly. Thanks! – DivideByHero Mar 08 '10 at 22:42