当前位置:网站首页>Network address translation (NAT) technology
Network address translation (NAT) technology
2022-07-01 02:47:00 【_ Persisting】
Principle of network address translation
NAT The fundamentals of Technology
NAT Technology through to IP The source address or destination address in the message header , Can make a large number of private networks IP Address by sharing a small number of public networks IP Address to access the public network .
NAT Yes, it will IP In the message header IP Address translation to another IP Address process , General NAT Translation equipment maintains an address translation table , All through NAT Conversion equipment ( At the connection between the internal network and the external network , Common devices are : Router 、 Firewall, etc ) And the message that needs address conversion , Will make corresponding changes through this table . The mechanism of address translation is divided into the following two parts :
1、 Internal network host IP The address and port are converted to NAT Translate the external network address and port of the device .
2、 The external network address and port are converted to NAT Convert the internal network host of the device IP Address and port .
That is to say :
< Private address + port > And < Public address + port > Mutual conversion between .
NAT The background
- IPv4 Addresses are drying up
- IPv6 Technology cannot be replaced in large areas immediately
- Various extensions IPv4 The technology of life is constantly emerging ,NAT Is one of them .
NAT Advantages and disadvantages
- advantage :
- Realization IP Address reuse , Save valuable address resources .
- The address translation process is transparent to users .
- Provide privacy protection for intranet users .
- It can realize load balancing of internal servers .
- shortcoming :
- Network monitoring becomes more difficult .
- Limit some specific applications
NAT classification
According to the application scenario, it can be divided into :
- Source NAT(Source NAT): It is used to enable multiple private network users to access at the same time Internet.
- Address pool mode : The public address in the address pool is used for address translation for private users , Suitable for a large number of private network users Internet Scene .
- Interface address mode (Easy IP): The intranet host directly borrows the public network interface IP Address access Internet, Especially suitable for public network interface IP Address is dynamically obtained .
- Server mapping : It is used to enable Internet users to access private servers
- Static mapping (NAT Server): Public address and private address are mapped one-to-one , It is used in the scenario that public network users access private network internal servers .
- Purpose NAT: It is used to send the business traffic of mobile Internet to the right WAP gateway .
Source NAT technology
Based on the source IP Address of the NAT It means right Initiating the connection IP The source address in the message header convert . It can achieve the purpose of internal users accessing the external network . By converting the private address of the internal host to the public address , Make multiple hosts in a LAN use a few legal addresses to access external resources , Effective The host that hides the internal LAN IP Address , Played a role in security protection .
Source NAT Address pool mode
- Address pool mode without port translation
By configuring NAT Address pool ,NAT The address pool can contain multiple public network addresses . Only address is converted during conversion , Do not convert ports , Realize the private network address to the public network address One to one conversion . If all the addresses in the address pool have been allocated , The remaining intranet hosts will not access the Internet NAT transformation , Not until there are free addresses in the address pool NAT transformation . - Address pool mode with port translation
By configuring NAT Address pool ,NAT The address pool can contain one or more public network addresses . Address and port are translated at the same time , It can realize the requirement that multiple private network addresses share one or more public network addresses ( For one more ). In this way , Because the address conversion is also carried out at the same time as the port conversion , Multiple private network users can use a public network IP Address online , The firewall distinguishes different users according to ports , Therefore, the number of users who can access the Internet at the same time is more . This is a technology that uses layer 4 information to extend layer 3 addresses , One IP The address is 65535 Ports can be used . In theory , One address can be another 65535 Addresses provided NAT transformation , The firewall can also map data packets from different internal addresses to different port numbers of the same public address , So you can still share the same address , Compare one-to-one or many to many address translation . This greatly improves the address space , Added IP Address utilization . Therefore, port translation is the most commonly used method of address translation .
Without ports : Realize one-to-one IP address translation , Ports are not converted .
With port : Map different internal addresses to different port numbers of the same public address , Realize many to one address translation .
Easy IP( Interface address mode )
Directly use the public network address of the interface as the converted address , No configuration required NAT Address pool . On conversion Translate address and port at the same time , It can realize the requirement that multiple private network addresses share the public network address of the external network interface .( For one more )
NAT ALG( Application level gateway )
A conversion agent for a specific application protocol , It can complete the conversion of address and port number information carried in the application layer data .
Ordinary NAT Realized with UDP or TCP In the header IP Address and port translation function , But there's nothing you can do about the fields in the application layer data payload , In many application layer protocols , Like multimedia protocols (H.323、SIP etc. )、FTP、SQLNET etc. ,TCP/UDP There is address or port information in the load , These contents cannot be NAT Make effective conversion , Can cause problems . and NAT ALG(ApplicationLevel Gateway) Technology can analyze application layer message information and address conversion for multi-channel protocol , The address that needs to be translated in the load IP Address and port or fields requiring special processing shall be converted and processed accordingly , So as to ensure the correctness of application layer communication .
for example ,FTP Application is completed by data connection and control connection , And the establishment of the data connection is dynamically determined by the load field information in the control connection , This requires ALG To complete the conversion of load field information , To ensure the correct establishment of subsequent data connections .
Server mapping
NAT Server( Internal servers )
Use a public address to represent the external address of the internal server .
NAT It hides the structure of the internal network , have “ shielding ” The function of the internal host . But in practice , You may need to provide an external access to the internal host , If it is provided to an external one WWW
Server for , The external host has no route to the internal address , Therefore, normal access is unavailable . In this case, you can use the internal server (Nat Server) Function to implement this function application . Use NAT You can flexibly add internal servers . for example : have access to 202.202.1.1 Wait for the public address as Web The external address of the server , You can even use 202.202.1.1:8080 In this way IP Address plus slogan as Web External address of .
When an external user accesses an internal server , There are two operations as follows :
- The firewall converts the destination address of the request message of the external user into the private address of the internal server .
- The firewall will send the source address of the response message of the internal server ( Private network address ) Convert to public address .
The firewall supports internal servers based on security zones . for example , When it is necessary to provide access services to external users in multiple network segments , Firewall combined with security zone configuration internal server can configure multiple public network addresses for an internal server . Configure different levels of security zones of the firewall to correspond to external networks of different network segments , And configure different public network addresses of the same internal server according to different security zones , When an external network in different network segments accesses the same internal server , That is, access to the internal server is realized by accessing the corresponding configured public network address .
To configure NAT Server when , The device will automatically generate Server-map Table item , To hold Global Address and Inside Address mapping .
Server-map Based on triples , Used to store a mapping relationship , This mapping relationship can be the data connection relationship negotiated by the control data , It can also be configuration NAT Address mapping in , The external network can actively access the internal network through the device
User deletion NATServer when ,Server-map Synchronization is also deleted .
边栏推荐
- Pulsar 主题压缩
- 如何在智汀中实现智能锁与灯、智能窗帘电机场景联动?
- ANR问题的分析与解决思路
- Share Creators萌芽人才培养计划来了!
- Mouse over effect III
- Restcloud ETl数据通过时间戳实现增量数据同步
- Comment réaliser la liaison entre la serrure intelligente et la lampe, la scène du moteur de rideau intelligent dans le timing intelligent?
- Small program cloud development -- wechat official account article collection
- 手机上怎么开户?还有,在线开户安全么?
- Lenovo x86 server restart management controller (xclarity controller) or TSM method
猜你喜欢

How to use Jieba participle in unity

UE4渲染管线学习笔记

Find the length of the common part of two line segments

Lenovo x86 server restart management controller (xclarity controller) or TSM method

Sampling Area Lights

Zero foundation self-study SQL course | window function

最新微信ipad协议 CODE获取 公众号授权等

Evaluation of the entry-level models of 5 mainstream smart speakers: apple, Xiaomi, Huawei, tmall, Xiaodu, who is better?

Mnasnet learning notes

产业互联网中,「小」程序有「大」作为
随机推荐
MCU firmware packaging Script Software
5款主流智能音箱入门款测评:苹果小米华为天猫小度,谁的表现更胜一筹?
pycharm 软件deployment 灰色 无法点
Focusing on green and low carbon, data center cooling has entered a new era of "intelligent cooling"
Leetcode interview question 17.10 Main elements
小程序自定义顶部导航栏,uni-app微信小程序自定义顶部导航栏
Mouse over effect 9
Voici le programme de formation des talents de SHARE Creators!
The operation efficiency of the park is improved, and the application platform management of applet container technology is accelerated
鼠标悬停效果四
Codeforces Round #416 (Div. 2) C. Vladik and Memorable Trip
Complete training and verification of a neural network based on pytorch
Pychart software deployment gray unable to point
股票开账户如何优惠开户?还有,在线开户安全么?
The mobile edge browser cannot open the third-party application
VirtualBox installation enhancements
Gartner研究:在中国,混合云的采用已成为主流趋势
robots. Txt restrict search engine inclusion
php批量excel转word
Nacos configuration center tutorial