Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis on the principle of NAT

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

1、NAT

NAT (Network Address Translation). NAT can be used when hosts inside a private network that have been assigned local IP addresses (i.e., private addresses used only within the private network) want to communicate with hosts on the Internet (without encryption).

This approach requires NAT software installed on routers that connect private networks to the Internet. A router with NAT software is called a NAT router and has at least one valid external global IP address. In this way, all hosts using local addresses must translate their local addresses to global IP addresses on NAT routers before they can connect to the Internet when communicating with the outside world.

2. NAT function

1) Broadband sharing: This is the biggest feature of NAT hosts.

2) Security protection: When the PC inside NAT connects to the Internet, the IP it displays is the public IP of the NAT host, so the Client PC certainly has a certain degree of security. When the outside world scans the port, the source client PC cannot be detected.

3. NAT implementation

Static translation, dynamic translation, port multiplexing

4. NAT works

In the figure, the IP addresses of all hosts in the private network 192.168.0.0 are the local IP address 192.168.x.x. NAT routers must have at least one global IP address in order to connect to the Internet. The NAT router in the figure has a global IP address of 172.38.1.5 (NAT routers can have multiple global IP addresses).

The NAT router receives IP datagrams from host A inside the private network to host B on the Internet: the source IP address is 192.168.0.3 and the destination address is 213.18.2.4. NAT router converts the source IP address into a new IP address, i.e. NAT global IP address 172.38.1.5, and then forwards it out. Host B thinks that the source IP address is 172.38.1.5 when receiving it. Host B sends the IP datagram to NAT router. NAT router receives the IP datagram and performs IP address translation again. Through NAT address translation table, Transforms the IP datagram's old destination IP address (172.38.1.5) to the new destination IP address (Host A's local IP address).

5. Disadvantages of NAT

Hosts under a NAT-enabled router do not establish true end-to-end connections and cannot participate in some Internet protocols. Some TCP connections that need to be initialized from external networks and services using stateless protocols such as UDP will be interrupted. Unless the NAT router makes some specific effort, incoming packets will not reach the correct destination address. (Some protocols can sometimes accommodate an instance of NAT between hosts participating in NAT with the assistance of an application-layer gateway, such as FTP.) NAT also complicates security protocols.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report