Why is Localhost's IP address 127.0.0.1?

127 is the last network number (network number) in Network class A with Subnet Mask 255.0.0.0. Address 127.0.0.1 is the first transfer address in the subnet. Address 127.0.0.0 is not used because this is the address of the wired network.

IP address 127.0.0.1 is a special purpose IPv4 address called localhost or loopback address. All computers use this address, but they are not allowed to communicate with other devices such as real IP addresses.

Your computer can be assigned a Private IP address 192.168.1.115 to communicate with a router and other network-connected devices. However, it is still associated with this particular 127.0.0.1 address, meaning "this computer" or the address you are using.

The loopback address is only used by the computer you are accessing and only for special cases. This is not like a normal IP address, used to transfer files to and from other networked devices.

For example, a web server running on a computer can point to 127.0.0.1 to run and locally check pages before it is deployed.

Picture 1 of Why is Localhost's IP address 127.0.0.1?

Ask:

I have a question to ask if the localhost IP address is 127.0.0.1. And what does 127 mean? What does 0.0.1 mean?

Answer 1:

127 is the last network number (network number) in Network class A with Subnet Mask 255.0.0.0. Address 127.0.0.1 is the first transfer address in the subnet. Address 127.0.0.0 is not used because this is the address of the wired network.

However, when using any other IP address, the Host portion works better and you should switch back to using the IP address 127.0.0.1. You can try it by pinging the address 127.0.0.1 if you want.

Answer 2:

You can search for additional information regarding the transfer of IP 127 addresses as a Loopback network in the RFC 990 document of the authors, Reynolds and Postel, published in November 1986:

"The address is not explained in this sense, in this network."

For example, the address 0.0.0.37 can be interpreted as server 37 on this network.

The network number 127 in the Network A layer is assigned a Loopback function, which is a datagram packet sent by a higher Protocol protocol to a network with address 127 with Loopback in the server. And the datagram package sent to address 127 will not appear anywhere else on the network.

According to RFC 790, published in September 1981, 0 and 127 are pre-assigned addresses in network class A. 0 is used to focus on a specific server, and 127 is for loopback.

Additional information

Datagram

Datagrams are packets of data that transmit data between source and destination by non-connection methods. IPX (Internetwork Packet Exchange) and IP (Internet Protocol) are datagram services. Datagrams contain destination addresses and can traverse the borders of networks connected by routers.

How IP addresses work 127.0.0.1

Picture 2 of Why is Localhost's IP address 127.0.0.1?

All notifications are generated by TCP / IP application software containing IP addresses for their intended recipients. TCP / IP considers 127.0.0.1 a special IP address. The protocol checks each message before sending it to the physical network and automatically reroutes any message that has a destination to 127.0.0.1 back to the receiving TCP / IP stack.

To improve network security, TCP / IP also checks incoming messages from routers or other network ports, and removes any messages that contain repeating IP addresses. This prevents network attackers from hiding malicious network traffic from the loopback address.

Application software often uses this repeat feature for local testing purposes. Messages sent to loopback IP addresses like 127.0.0.1 cannot go beyond the local area network (LAN) but instead are sent directly to TCP / IP and receive queues as if they came from a source outside.

The loopback messages contain the destination port number with the address. The application can use these port numbers to split test messages into multiple categories.

Localhost and IPv6 address loopback

The name localhost also has a special meaning in the computer network used in conjunction with 127.0.0.1. The computer operating system maintains an entry in the host name file associated with the loopback address, allowing the application to create a repeat message by name rather than a hard-coded number.

Internet v6 (IPv6) applies the same concept of loopback addresses as IPv4. Instead of 127.0.0.01, IPv6 represents its loopback address, simply :: 1 (0000: 0000: 0000: 0000: 0000: 0000: 0001). And unlike IPv4, IPv6 does not allocate a range of addresses for this purpose.

127.0.0.1 compared to other special IP addresses

IPv4 stores all addresses in the range from 127.0.0.0 to 127.255.255.255 to use during loopback testing, although 127.0.0.1 (according to historical convention) is the loopback address used in almost all cases.

127.0.0.1 and other 127.0.0.0 network addresses do not belong to any Private IP address range defined in IPv4. Individual addresses in these ranges can be reserved for local network devices and used for communication between devices, while 127.0.0.1 is not possible.

People who study computer networks sometimes confuse 127.0.0.1 with 0.0.0.0. Although both of these addresses have special meanings in IPv4, 0.0.0.0 does not provide any loopback functionality.

Refer to some of the following articles:

  1. Disable IPv6 to troubleshoot Internet connectivity issues on Windows computers
  2. Here's how to check if your IP address is static or dynamic
  3. Conflict of IP address error when connecting to Wifi on iPhone, iPad, this is a fix

Good luck!

Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile