What's a loopback-address? I.e. 127.0.0.1

A loopback address is "connected" to a virtual network card in your machine called the loopback adapter.

Anything sent to the virtual loopback adapter comes right back out of it. It's like it's "connected to itself."

For example, if I make a web request by typing "http://127.0.0.1/somesite.html" in my browser, that request goes through the (virtual) loopback adapter and then right back out of it.

So, if you have web server running on your system, and it's listening on 127.0.0.1, it will receive the request from your browser, and also be able to communicate with your browser by sending its response back to 127.0.0.1.

This is excellent for testing purposes, as you can see.

Nothing going through the loopback adapter goes out to the Internet, or leaves your system. The loopback adapter is completely contained within your system.


The Wikipedia article on loopback puts it better than I could:

The term loopback (sometimes spelled loop-back) is generally used to describe methods or procedures of routing electronic signals, digital data streams, or other flows of items, from their originating facility quickly back to the same source entity without intentional processing or modification. This is primarily intended as a means of testing the transmission or transportation infrastructure.

In terms of IP addresses this means that any communications to that address effectively never leave or perhaps never actually enter your network interface card so that you always have a "connection".

This allows you to test client/server software (for example) with both parts running on the same machine.

Tags:

Ip

Networking