How the extranet host sends packets to a local area network with a common IP address on a specific host

Source: Internet
Author: User
Tags website ip

Recently, to do a project, need to accept GPRS data, public network Server A need to transfer the specified port (PORT1) received data to the intranet Server B, the public server designated port (PORT1) to receive the data mapped to the network server B IP and port (PORT2), In practice, it is found that Port1 can be the same as Port2. Original: http://blog.csdn.net/guo8113/article/details/40052575

A computer in the intranet needs port mapping to open the Internet service or receive data. Port mappings are divided into dynamic and static.

Dynamic port mapping: A computer in the intranet to access the Web site, will send a packet to the Nat gateway, including the other side of the website IP, port and native IP, port, Nat Gateway will be the local IP, Port replaced with its own public IP, an unused port, and will note this mapping relationship, Used for forwarding packets later. Then send the data to the website, the website responds after receiving the data, sends the data to the unused port of the Nat gateway, and then the Nat gateway forwards the data to the computer in the intranet, Realize the communication between intranet and public network. When the connection is closed, the Nat Gateway frees the port assigned to the connection so that subsequent connections can continue to be used. Dynamic port mapping is actually how the Nat gateway works.

Static port mapping: is to open a fixed port on the Nat gateway, and then set the data received by this port to be forwarded to the intranet which IP and port, whether or not connected, this mapping relationship will always exist. You can let the public network to actively access a computer in the intranet.

NAT, network address translation, is the process of translating an IP address in the IP header into another IP address. In real-world applications, NAT is primarily used to implement private network access to public network functions. This way of representing more private IP addresses by using a small number of public IP addresses will help to slow down the exhaustion of the available IP address space. There are three ways to implement NAT, namely static translation of the statically NAT, dynamic translation of the dynamically Nat, and Port multiplexing overload.

conversion refers to the conversion of the private IP address of the internal network to a public IP address, the IP address pair is one-to-one, is immutable, a private IP address is only converted to a public IP address. With static transformations, external networks can access certain devices (such as servers) in the internal network.

Dynamic conversion means that when the private IP address of the internal network is converted to a public IP address, the IP address is indeterminate and is random, and all private IP addresses that are authorized to access the Internet can be randomly converted to any of the specified legitimate IP addresses. That is, you can convert dynamically whenever you specify which internal addresses can be converted, and which legal addresses are used as external addresses. Dynamic transformations can use multiple legitimate sets of external addresses. When the ISP provides a legitimate IP address that is slightly less than the number of computers inside the network. You can use the dynamic conversion method.

Ports Multiplexing (port address Translation,pat) Refers to changing the source port of an out-of-Office packet and port translation, which is Port address translation (PAT, Port addresstranslation). The port multiplexing method is used. All hosts on the internal network can share a legitimate external IP address to enable access to the Internet, thereby maximizing the savings in IP address resources. At the same time, can hide all the hosts inside the network, effectively avoid attacks from the Internet. Therefore, the most application in the network is the port multiplexing method.

How the extranet host sends packets to a local area network with a common IP address on a specific host

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.