How does an Internet host send data packets to a specific LAN host that shares a public IP address?

Source: Internet
Author: User

A computer on the Intranet needs port ing to open services or receive data on the Internet. Port ing is divided into dynamic and static.

Dynamic port ing: a computer in the Intranet sends packets to the NAT gateway to access the website. The packet header includes the IP address, port, and local IP address and port, the NAT gateway will replace the local IP address and port with its own public IP address and an unused port, and write down the ing relationship for future packet forwarding. Then, send the data to the website. After receiving the data, the website responds and sends the data to the unused port of the NAT Gateway. Then, the NAT Gateway forwards the data to the computer on the Intranet, implement communication between the Intranet and the Internet. when the connection is closed, the NAT Gateway releases the port allocated to the connection so that future connections can continue to be used. Dynamic port ing is actually how NAT Gateway works.

Static port ing: a fixed port is opened on the NAT gateway, and the data received by the port is set to which IP address and port to forward to the Intranet, whether or not there is a connection, this ing will always exist. In this way, the Internet can actively access a computer on the Intranet.

NAT (Network Address Translation) is the process of converting the IP address in the IP address data packet header to another IP address. In practical applications, Nat is mainly used to enable private networks to access public networks. By using a small number of public IP addresses to represent a large number of private IP addresses, this will help reduce the depletion of available IP address space. There are three Nat implementation methods: static translation static Nat, dynamic translation dynamic Nat, and port multiplexing overload.

StaticConversionIt refers to converting the private IP address of the internal network to a public IP address. The IP address pair is one-to-one and remains unchanged. A private IP address is only converted to a public IP address. Static conversions allow external networks to access certain devices (such as servers) in the internal network.

DYNAMIC CONVERSIONWhen a private IP address of an internal network is converted to a public IP address, the IP address is random and uncertain, all private IP addresses authorized to access the Internet can be randomly converted to any specified legal IP address. That is to say, dynamic conversion can be performed as long as you specify which internal addresses can be converted and which legitimate addresses can be used as external addresses. Multiple valid external address sets can be used for dynamic conversion. When the valid IP addresses provided by the ISP are slightly less than the number of computers in the network. You can use a dynamic conversion method.

Port address translation (PAT)It refers to changing the source port of the outgoing packet and performing port conversion, that is, port address translation (Pat, port addresstranslation). Port multiplexing is used. All hosts in the internal network can share a valid external IP address to access the Internet, thus saving IP Address resources to the maximum extent. At the same time, all hosts in the network can be hidden to effectively prevent attacks from the Internet. Therefore, port multiplexing is the most widely used network.

How does an Internet host send data packets to a specific LAN host that shares a public IP address?

Related Article

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.