From Forum question, source: http://www.cnpaf.net/Forum/viewthread.php? Tid = 28012
Alvas:
When sending ICMP packets, what are the transmission paths of these packets? Where have they passed? What determines the choice of router and interface?
Kapiter:
Ping 127.0.0.1 and ping the local machine are different.
The IP output function first checks whether the address is a loop address:
1. If it is a loopback address, it is directly handed over to the loopback driver for processing and the IP input function is returned.
2. If it is not a loop back address, check whether it is a broadcast address or multicast address.
3. If it is not a broadcast or multicast address, check whether it is a local address. If it is a local address, submit it to the loop back driver for processing. The loop back Driver returns the IP address to the input function.
From the above we can see that the ping 127.0.0.1 packet is not through the NIC ping the local machine, it needs to pass through the NIC
ICMP packets are encapsulated in IP packets, so the selection process of router and interface is the same as that of IP packets.
Alvas:
Thx
Maoyinjie:
Ping 127.0.0.1 and ping the local machine are also not through the NIC, and are all processed by the loopback driver.
Dingcuipu8888:
LZ you can still Ping 127.0.0.1 by unplugging the network cable, but the IP address cannot be pinged. 2 # No problem
Liuyongq:
Support for second-floor
Jergolfer:
Ping 127.0.0.1 is to test whether the local machine has installed the TCP/IP protocol, and the selection of the router and interface is determined by the route table. In Windows, you can view the port through router print.
Ping 127.0.0.1 will not pass through the local Nic, of course, packet capture is not visible
Pinging the IP address of the local machine does not pass through the NIC of the local machine.
Richard Steven has a detailed analysis in volume 1, as kapiter said