In a computer network, localhost represents the host and can access its own host's network services by using localhost. Note that when using localhost, a loopback network interface is used, which bypasses the local network interface hardware and is independent of any network configuration (not limited by network firewalls and Nic-related).
In the Hosts file of the Windows7 system, you can see:
# localhost name resolution is handled within DNS itself.# 127.0.0.1 localhost# :: 1 localhost
windows resolves localhost to 127.0.0.1 (IPV4) or:: 1 (IPV6)
Some articles on the Internet mention the difference between localhost and 127.0.0.1, said: Localhot (local) is not transmitted through the network card, 127.0.0.1 is transmitted through the network card. Is that really the case?
Let's start with a trial to see:
First, execute the command: Ping localhost-t
Next, try grabbing the message with Wireshark. You will find that no related messages have been crawled. What is this for?
The reason for this is that the local loopback address does not belong to any one of the class address classes, which represents the local virtual interface of the device. Any packets sent to the loopback address are executed at the link layer of the TCP/IP stack, and these packets are not delivered to any network interface Controller (NIC) and device drivers, i.e. the data stream is not sent to a true network interface. This way, you can't see these packets when you're grabbing a bag.
What if we must catch the packets on the loopback address? Window operating system is cumbersome (at least winpcap is not likely to sniff this network traffic). But there are some other configurations that you can try out, for specific reference: Https://wiki.wireshark.org/CaptureSetup/Loopback or http://www.hsc.fr/ressources/ Articles/win_net_srv/missing_loopback.html
Talking about localhost