Imagine that you need to test your client-server or peer-to-peer application with yourself, your machine is not connected on the Internet, nor does it have a real IP, and the network protocol is TCP/IP. What address would you use to connect to yourself?
Well, the IETF wrote long ago RFC 5735, which, among other things, defines special IP addresses, like this, the 127.0.0.1
, called loopback. It is a fixed address that always points to the machine itself. Using the domain localhost
results in the same, because in the hosts
of the operating system localhost
is mapped to 127.0.0.1
.
The application never takes care of the network. It makes no difference whether you are running the client and the server on the same machine or on different machines. It will only get the IP and port configuration that is passed to it and ask the operating system to send the communication. But when you send something to 127.0.0.1
, the operating system does not even bother to send beyond the network card. The TCP/IP network driver passes directly to the application port.
There are other minor utilities at this address. Such as testing if the installed network communication protocol is the TCP/IP version Ipv4, with the command $ ping 127.0.0.1
. The operating system needs to understand this address.
For your question not to be vague, it would be interesting to add print of this command that you say present internal connections.
– user28595
I put the image...
– Lucas Pletsch