Knowledge about 127.0.0.1 and local IP Address

Source: Internet
Author: User

ArticleSource: http://blog.csdn.net/s_k_yliu/article/details/6676183

In the past two days, we need to verify the customer's changes. If we find that the change is not successful, we can find various reasons online.

The key to the problem is how the local machine processes the IP data packets sent to the local machine. One phenomenon is that Wireshark is used to capture packets and install an FTP server on both computers A and B. If a accesses the FTP server on the local machine, Wireshark does not display the corresponding data packets, when a accesses B's FTP server Wireshark, IP data packets will appear. How does one process IP data packets accessing the local machine in the system?

The first is about the difference between 127.0.0.1 and the local IP address.

For ping 127.0.0.1, this command does not pass through the network card. Ping the local loopback to test the TCP/IP protocol stack and then perform loopback at the IP layer of the protocol stack.

For Host IP Ping, Nic support is required. If the NIC is disabled or the network cable is unplugged, the Ping will be fail. It can be seen that this method can check whether the NIC or network works properly.

So how does this packet go?

1) The host sends packets that ping its own IP address;

2) The system tries to find the route in the FIB route table;

3) The found route entry type is rtn_local;

4) set the dev_out of the data packet to loopback_dev;

5) send data packets using the loopback interface;

According to this information, we can conclude that some services of TCP/IP require support from the NIC, but access from the local machine is,The NIC Driver determines whether the ring is returned.If the network interface is switched back, the network adapter will not send the IP packet to the Ethernet, and our packet capture tool will not be able to catch the packet.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.