In TCP/IP a loopback device is a virtual network interface implemented in software only and not connected to any hardware, but which is fully integrated into the computer system’s internal network infrastructure. Any traffic that a computer program sends to the loopback interface is immediately received on the same interface.
Correspondingly, the Internet Protocol (IP) specifies a loopback network. In IPv4 this is the network with the CIDR prefix 127/8 (RFC 3330). The most commonly used IP address on the loopback device is 127.0.0.1 for IPv4, although any address in the range 127.0.0.0 to 127.255.255.255 is mapped to it. IPv6 designates only a single address for this function, 0:0:0:0:0:0:0:1 (also written as ::1), having the ::1/128 prefix (RFC 3513). The standard, officially reserved, domain name for these addresses is localhost (RFC 2606).
On Unix-like systems, the loopback interface usually has the device name lo or lo0.
A loopback interface has several uses. It may be used by network client software on a computer to communicate with server software on the same computer, namely on a computer running a web server, pointing a web browser to the URLs
http://localhost/ will access that computer’s own web site. This works without any actual network connection–so it is useful for testing services without exposing them to security risks from remote network access. Likewise, pinging the loopback interface is a basic test of the functionality of the IP stack in the operating system.