PDA

View Full Version : IP Questions



dminches
2008-01-13, 10:42
I assume these are simple IP questions.

1 - How does slimserver "know" its IP address is 127.0.0.1?

2 - If my computer has a static IP is there any difference between loading 127.0.0.1 or the computer's IP address to access slimserver?

radish
2008-01-13, 10:53
127.0.0.1 is a special IP which always means "this machine". So Slimserver's address is only 127.0.0.1 if the browser is on the same machine, if you run a browser elsewhere you need to use the machine's actual IP, and likewise the players will use the actual IP.

gcogger
2008-01-13, 16:52
2 - If my computer has a static IP is there any difference between loading 127.0.0.1 or the computer's IP address to access slimserver?

The first question has been well answered but this is just to clarify on the second question. Prepare for more information than you really wanted :)

(The simple bit)
127.0.0.1 (which is named localhost) is always 'this machine'.
If you are on a machine with an IP address of, say, 192.168.0.1 then, from that machine, you can generally use either 192.168.0.1 or 127.0.0.1 interchangeably.

(The 'more than you wanted to know' bit)
There are 2 circumstances I can think of where the 2 addresses will give different results:

1 - This depends on how the operating system (actually the IP stack) handles the addresses. I have seen systems where using 127.0.0.1 works but the 'real' address does not - if the network cable to the machine has been unplugged.
When accessing the 'real' address, the IP stack talks to the network card, which reports that it has no connection. The call fails.
When accessing 127.0.0.1, the IP stack realises that it is local, does NOT talk to the network card, and the call succeeds.

2 - If a machine has more than one network card in use, they will have different addresses. This is called a 'multi homed host'. Say the addresses are 192.168.0.1 and 192.168.0.2. Now some software is written such that it will only respond to calls on one specific IP address - (I've no idea about Slimserver, I'm afraid). If you use one of the specific addresses, then you know that software listening on that address will respond. If you use 127.0.0.1, you have no control over which IP address this will go to, so you don't know if the software will respond.

Hope you're still awake :)

dminches
2008-01-13, 17:23
I am awake and educated. I appreciate you taking the time to explain this.