Talking about localhost

Source: Internet
Author: User

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

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.