IP Loopback Address


In TCP/IP, when data is sent by an application, it travels through the TCP/IP protocol stack to IP (Internet Protocol) layer where it is encapsulated in an IP datagram. The datagram then passes down to the data link layer of the device's physical network for transmission to the next hop, on the way to the IP destination.

However, one special range of addresses is set aside for loopback functionality. This is the range 127.0.0.0 to 127.255.255.255. Using the loopback interface bypasses local network interface hardware. Unlike the general TCP/IP implementation, IP datagrams with destination address set to a 127.x.x.x loopback address are not passed down to the data link layer for transmission. Instead, they “loop back” to the source device at the IP level.

For IPv4 communications, the virtual loopback interface of a computer system is normally assigned the address 127.0.0.1 with subnet mask 255.0.0.0. In computer networking, localhost (meaning this computer) is the standard hostname given to the address of the loopback network interface. Any communications to that 127.0.0.1 or localhost effectively never leave the network interface card. As such, messages sent to 127.0.0.1 do not appear in the network. The loopback adapter is completely contained within the system.

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://127.0.0.1/ or 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. Any services listening only to the loopback address will not be reachable directly from any external machines. This improves security of services which do not need to be reachable from the network. Likewise, pinging the loopback interface is a basic test of the functionality of the IP stack in the operating system.

Any IP datagram with a source or destination address set to a loopback address must not appear outside of a computing system, or be routed by any routing device. Packets received on an interface with a loopback destination address will be dropped.

Comments

Popular Posts