CN101299772B - System and method for processing network address conversion preferable regulation - Google Patents
System and method for processing network address conversion preferable regulation Download PDFInfo
- Publication number
- CN101299772B CN101299772B CN2008100678029A CN200810067802A CN101299772B CN 101299772 B CN101299772 B CN 101299772B CN 2008100678029 A CN2008100678029 A CN 2008100678029A CN 200810067802 A CN200810067802 A CN 200810067802A CN 101299772 B CN101299772 B CN 101299772B
- Authority
- CN
- China
- Prior art keywords
- nat
- rule
- information
- matching
- entry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
本发明提供了一种网络地址转换优选规则转换处理的系统和方法,所述系统包括NAT匹配出接口配置模块,用于对NAT即网络地址转换匹配出接口规则进行配置,并且向NAT出接口规则表模块进行信息同步,传输;NAT出接口规则表模块,用于记录NAT出接口规则表,并进行表项组织,为NAT匹配出接口规则操作模块提供信息作为对照依据;NAT匹配出接口规则操作模块,用于对收到的数据包进行匹配查找NAT转换条目,匹配查找时以NAT出接口规则表中的信息为参考标准,如果存在匹配的NAT出接口规则,则按照数据包及规则信息生成新的NAT转换条目,并按照新的NAT转换条目进行转发。本发明同时配置匹配出接口的NAT转换规则和不匹配出接口的NAT转换规则,提高了公网地址的利用效率。
The present invention provides a system and method for converting and processing network address translation optimization rules. The system includes a NAT matching outgoing interface configuration module, which is used to configure NAT, that is, network address translation matching outgoing interface rules, and to NAT outgoing interface rules. The table module performs information synchronization and transmission; the NAT outbound interface rule table module is used to record the NAT outbound interface rule table and organize table items to provide information for the NAT matching outbound interface rule operation module as a comparison basis; NAT outbound interface rule operation The module is used to match the received data packets and search for NAT conversion entries. When matching and searching, the information in the NAT outbound interface rule table is used as a reference standard. If there is a matching NAT outbound interface rule, it is generated according to the data packet and rule information New NAT translation entry, and forward according to the new NAT translation entry. The invention simultaneously configures the NAT conversion rule matching the outgoing interface and the NAT conversion rule not matching the outgoing interface, thereby improving the utilization efficiency of the public network address.
Description
技术领域technical field
本发明涉及网络通信技术领域,尤其涉及一种在网络中私网和公网之间通信时,网络地址转换(NAT)按照优选规则进行转换处理的系统机制。The invention relates to the technical field of network communication, in particular to a system mechanism for network address translation (NAT) to perform translation processing according to optimal rules when communicating between a private network and a public network in a network.
背景技术Background technique
随着因特网的高速发展,互联网络已经逐渐成为人们日常生活中的一部分,网络技术的不断发展和人们对网络需求的不断增多,致使网络规模的不断扩大,使得网络IP地址资源变得日趋紧张。而NAT(网络地址转换)技术很好的解决了这个问题。它主要的做法是将不合法的私网地址转换成合法的公网IP地址,通过公网私网的区分建立,使得网络资源充分得到了应用。用户由私网访问公网时,可以申请公网地址和端口号进行链接,进而在互联网中进行通讯,这种方法大大的提高了公网IP地址资源的利用率,从而被广泛使用。With the rapid development of the Internet, the Internet has gradually become a part of people's daily life. The continuous development of network technology and the continuous increase of people's demand for the network have resulted in the continuous expansion of the network scale and the increasingly tight network IP address resources. And NAT (Network Address Translation) technology solves this problem very well. Its main method is to convert illegal private network addresses into legal public network IP addresses, and establish a distinction between public and private networks, so that network resources are fully utilized. When users access the public network from the private network, they can apply for the public network address and port number to connect, and then communicate in the Internet. This method greatly improves the utilization rate of public network IP address resources, and thus is widely used.
在网络使用中,根据不同的环境,网络管理员有时候会在路由器上配置针对一个数据源对应不同出接口都要作网络地址转换的NAT转换规则,且转换的公网地址池不同。因此,如果此时路由器上也配置了另一条相同数据源的并未指定出接口的地址池,这时,数据包来到时,对于不同出接口的NAT转换规则的查找,及NAT转换条目的生成就会出现匹配并不是最佳匹配的情况。虽然不会影响使用,但是会出现针对出接口有分配好的公网地址,却不使用,而占用别的未特别配置出接口的NAT公网地址池中的资源,而针对指定出接口的NAT转换规则由于指定出接口的配置,数据包要从别的出接口转发进行NAT转换时也无法使用,在网络使用高峰时,有可能会出现有的公网地址池耗尽,仍有用户无法获取公网地址进行NAT转换,而另一方面,有的地址池却仍旧有很多公网地址,没有使用,导致公网地址资源没有按设想合理地、有效地分配使用。In network use, depending on the environment, the network administrator sometimes configures NAT translation rules on the router to perform network address translation on different outgoing interfaces corresponding to a data source, and the translated public network address pools are different. Therefore, if another address pool with the same data source that does not specify an outgoing interface is configured on the router at this time, at this time, when a data packet arrives, the search for the NAT translation rules of different outgoing interfaces and the NAT translation entry Generates a situation where the match is not the best match. Although it will not affect the use, it will happen that there is a public network address allocated for the outgoing interface, but it is not used, and the resources in the NAT public network address pool that are not specially configured for the outgoing interface will be occupied, and the NAT for the specified outgoing interface will be used. Due to the configuration of the specified outgoing interface, the conversion rule cannot be used when the data packet needs to be forwarded from another outgoing interface for NAT conversion. When the network usage peaks, some public network address pools may be exhausted, and users still cannot obtain them. Public network addresses are converted by NAT. On the other hand, some address pools still have many public network addresses that are not used. As a result, public network address resources are not allocated and used reasonably and effectively as expected.
发明内容Contents of the invention
本发明的目的在于,提供一种网络地址转换优选规则转换的系统和方法,解决现有技术中公网地址不能得到有效利用的问题,实现在私网和公网之间通信时对于公网地址的使用可以完全按照网络管理员配置进行。The purpose of the present invention is to provide a system and method for network address translation optimization rule conversion, to solve the problem that the public network address cannot be effectively used in the prior art, and to realize the public network address when communicating between the private network and the public network. It can be used completely according to the configuration of the network administrator.
本发明采用以下技术方案:The present invention adopts following technical scheme:
本发明提供了一种网络地址转换优选规则转换处理的系统,包括:The present invention provides a system for converting and processing network address translation optimization rules, including:
NAT匹配出接口配置模块:用于对NAT即网络地址转换匹配出接口规则进行配置,并且向NAT出接口规则表模块进行信息同步,传输;在配置NAT转换规则时,如果是带出接口的NAT规则配置,则NAT匹配出接口配置模块会将出接口及数据包的源端口的ACL号进行提取,存储到NAT出接口规则表中;NAT matching outbound interface configuration module: used to configure NAT, that is, network address translation matching outbound interface rules, and to synchronize and transmit information to the NAT outbound interface rule table module; when configuring NAT conversion rules, if it is NAT with an outbound interface rule configuration, then the NAT matching outgoing interface configuration module will extract the outgoing interface and the ACL number of the source port of the data packet, and store it in the NAT outgoing interface rule table;
NAT出接口规则表模块:用于记录NAT出接口规则表,并进行表项组织,为NAT匹配出接口规则操作模块提供信息作为对照依据;NAT outbound interface rule table module: used to record the NAT outbound interface rule table, organize table items, and provide information for the NAT matching outbound interface rule operation module as a comparison basis;
NAT匹配出接口规则操作模块:用于对收到的数据包进行匹配查找NAT转换条目,查找时以NAT出接口规则表中的信息为参考标准,进行匹配比较,如果存在匹配的NAT出接口规则,则按照数据包及规则信息生成新的NAT转换条目,并按照新的NAT转换条目进行转发。NAT matching outgoing interface rule operation module: used to match the received data packets to search for NAT conversion entries. When searching, the information in the NAT outgoing interface rule table is used as a reference standard for matching and comparison. If there is a matching NAT outgoing interface rule , generate a new NAT translation entry according to the data packet and rule information, and forward it according to the new NAT translation entry.
本发明还提供一种利用上述系统进行网络地址转换优选规则转换处理的方法,预先进行NAT匹配出接口规则配置,所述方法包括:The present invention also provides a method for utilizing the above-mentioned system to perform network address translation optimization rule conversion processing, and performs NAT matching outbound interface rule configuration in advance, and the method includes:
步骤A.从数据包中提取信息,包括IP地址、端口号、出接口信息,查找出数据包的ACL号信息;Step A. extract information from the data packet, including IP address, port number, outgoing interface information, and find out the ACL number information of the data packet;
步骤B.根据数据包信息,包括出接口信息,匹配NAT转换条目,如有NAT转换条目,按照该条目进行转发;如没有NAT转换条目,进行步骤C;Step B. According to the data packet information, including the outgoing interface information, match the NAT conversion entry, if there is a NAT conversion entry, forward according to the entry; if there is no NAT conversion entry, proceed to step C;
步骤C.根据数据包信息,不包括出接口信息,匹配NAT转换条目,如果有NAT转换条目,进行步骤D;如没有NAT转换条目,查找NAT转换规则生成新条目,并按照此新条目转发该数据包;Step C. According to the data packet information, excluding the outgoing interface information, match the NAT translation entry, if there is a NAT translation entry, proceed to step D; if there is no NAT translation entry, find the NAT translation rule to generate a new entry, and forward the NAT entry according to this new entry data pack;
步骤D.根据数据包的ACL号信息和出接口信息,查找NAT出接口规则表,如查到匹配条目,按所属的规则生成新条目,并按照此新条目转发该数据包,否则,按照步骤C查到的NAT转换条目进行转发。Step D. According to the ACL number information and the outgoing interface information of the data packet, search the NAT outgoing interface rule table, if a matching entry is found, generate a new entry according to the rule to which it belongs, and forward the data packet according to this new entry, otherwise, follow the steps C forwards the found NAT translation entries.
进一步地,所述方法的NAT匹配出接口规则配置具体包括:Further, the NAT matching outbound interface rule configuration of the method specifically includes:
步骤a.配置带出接口的NAT转换规则;Step a. configure the NAT translation rule with the outgoing interface;
步骤b.获取NAT转换规则中的出接口信息以及ACL号信息;Step b. Obtain the outgoing interface information and ACL number information in the NAT translation rule;
步骤c.开辟新的内存空间建立NAT出接口规则表,并将出接口信息Step c. Open up a new memory space to establish a NAT outbound interface rule table, and store outbound interface information
以及ACL号信息写入NAT出接口规则表,进行保存。And the ACL number information is written into the NAT outbound interface rule table for preservation.
与现有技术相比,本发明同时配置匹配出接口的NAT转换规则和不匹配出接口的NAT转换规则,实现了地址池的清晰分开,避免了NAT转换时地址池的混乱使用,从而提高了公网地址的利用效率。Compared with the prior art, the present invention simultaneously configures the NAT conversion rule matching the outgoing interface and the NAT conversion rule not matching the outgoing interface, realizes the clear separation of the address pool, avoids the chaotic use of the address pool during NAT conversion, thereby improving the Utilization efficiency of public network addresses.
附图说明Description of drawings
图1是本发明实施例所述系统的结构示意图;Fig. 1 is a schematic structural diagram of the system described in the embodiment of the present invention;
图2是本发明实施例所述方法的NAT匹配出接口规则配置流程图;Fig. 2 is the configuration flowchart of the NAT matching outbound interface rule of the method described in the embodiment of the present invention;
图3是本发明实施例所述方法的处理流程图;Fig. 3 is the processing flowchart of the method described in the embodiment of the present invention;
具体实施方式Detailed ways
下面结合附图来具体描述本发明的优选实施例,其中,附图构成本申请一部分,并与本发明的实施例一起拥有阐释本发明的原理。Preferred embodiments of the present invention will be specifically described below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of the application and together with the embodiments of the present invention explain the principle of the present invention.
如图1所示,图1是本发明实施例所述系统的结构示意图,具体包括以下模块:As shown in Figure 1, Figure 1 is a schematic structural diagram of the system described in the embodiment of the present invention, specifically including the following modules:
NAT匹配出接口配置模块:主要是进行配置的模块,通过网络管理员配置,该模块收集配置信息,进行整理存储,为数据包的处理提供依据,可以明确地反映配置意图。在配置NAT转换规则时,如果是带出接口的NAT规则配置,则模块就会将出接口及教据包的源端口的ACL号进行提取,存储到NAT出接口规则表中。NAT matching outgoing interface configuration module: It is mainly a module for configuration. Through network administrator configuration, this module collects configuration information, organizes and stores it, provides basis for data packet processing, and can clearly reflect configuration intentions. When configuring the NAT conversion rule, if it is a NAT rule configuration with an outbound interface, the module will extract the ACL number of the outbound interface and the source port of the data packet, and store it in the NAT outbound interface rule table.
NAT出接口规则表模块,主要是用来记录相应的ACL号对应出接口的转换规则,由NAT匹配出接口配置模块进行数据收集。该表主要是在内存中开辟一块存储空间,并且进行算法组织,从而实现表项中条目的查找,添加,删除等操作。The NAT outgoing interface rule table module is mainly used to record the conversion rules of the corresponding ACL number corresponding to the outgoing interface, and the data is collected by the NAT matching outgoing interface configuration module. The table is mainly to open up a storage space in the memory, and carry out algorithmic organization, so as to realize the operations such as searching, adding, and deleting entries in the table.
NAT匹配出接口规则操作模块:是主要的操作模块,负责对收到的数据包进行信息提取,按照这些信息进行匹配查找NAT转换条目,查找时以NAT出接口规则表中的信息为参考标准,进行匹配比较,如果存在匹配的NAT出接口规则,则按照数据包及规则信息生成新的NAT转换条目,并按照新的NAT转换条目进行转发。NAT matching outbound interface rule operation module: it is the main operation module, which is responsible for extracting information from received data packets, matching and searching NAT conversion entries according to the information, using the information in the NAT outbound interface rule table as a reference standard when searching, Perform matching comparison, if there is a matching NAT outbound interface rule, generate a new NAT translation entry according to the data packet and rule information, and forward it according to the new NAT translation entry.
如图2所示,图2是本发明实施例所述方法的NAT匹配出接口规则配置流程图,具体的流程如下:As shown in Figure 2, Figure 2 is a NAT matching outbound interface rule configuration flowchart of the method described in the embodiment of the present invention, and the specific process is as follows:
步骤200:配置带出接口的NAT转换规则;Step 200: configure the NAT translation rule of the outbound interface;
步骤201:获取NAT转换规则中的出接口信息以及ACL号信息;Step 201: Obtain the outbound interface information and ACL number information in the NAT translation rule;
步骤202:开辟新的内存空间建立NAT出接口规则表,并将出接口信息以及ACL号信息写入NAT出接口规则表,进行保存。Step 202: open up a new memory space to establish a NAT outbound interface rule table, and write outbound interface information and ACL number information into the NAT outbound interface rule table for storage.
如图3所示,图3是本发明实施例所述方法的处理流程图,具体流程如下:As shown in Figure 3, Figure 3 is a processing flowchart of the method described in the embodiment of the present invention, and the specific process is as follows:
步骤300:流程开始;Step 300: the process starts;
步骤301:系统收到数据包;Step 301: the system receives the data packet;
步骤302:提取数据包中的信息,包括IP地址、端口号、VPN、出接口信息,获取数据包的ACL号信息,根据数据包信息,包括IP地址、端口号、VPN、出接口信息,进行NAT转换条目匹配查找;Step 302: Extract the information in the data packet, including IP address, port number, VPN, and outgoing interface information, obtain the ACL number information of the data packet, and carry out according to the data packet information, including IP address, port number, VPN, and outgoing interface information NAT translation entry matching lookup;
步骤303:判断是否查到对应的NAT转换条目,如果查到,执行步骤304,否则执行步骤305;Step 303: judging whether the corresponding NAT translation entry is found, if found, execute
步骤304:按照查到的NAT转换条目进行转发,流程结束。Step 304: Forward according to the found NAT translation entry, and the process ends.
步骤305:重新用数据包信息包括IP地址、端口号、VPN信息,进行NAT转换条目匹配,但是不包括出接口信息。Step 305: Reuse the data packet information including IP address, port number, and VPN information to perform NAT translation entry matching, but does not include outgoing interface information.
步骤306:判断是否查找到对应的NAT转换条目,如果没有查到,进行步骤307,如果查到,进行步骤308;Step 306: judging whether the corresponding NAT translation entry is found, if not found, proceed to step 307, if found, proceed to step 308;
步骤307:查找NAT转换规则生成新条目,并按照新条目进行NAT转发,流程结束。Step 307: Find the NAT conversion rule to generate a new entry, and perform NAT forwarding according to the new entry, and the process ends.
步骤308:获取数据包的ACL号信息,及出接口信息,查找NAT出接口规则表;Step 308: Obtain the ACL number information and outgoing interface information of the data packet, and search the NAT outgoing interface rule table;
步骤309:查找NAT出接口规则表中是否有匹配的NAT转换条目,如果没有,进行步骤310,否则进行步骤311;Step 309: Find whether there is a matching NAT translation entry in the NAT outbound interface rule table, if not, proceed to step 310, otherwise proceed to step 311;
步骤310:按照步骤305查到的NAT转换条目进行NAT转发,流程结束。Step 310: Perform NAT forwarding according to the NAT translation entry found in
步骤311:按照查到的NAT出接口规则信息,查找对应NAT转换规则,生成新的NAT转换条目,并进行NAT转发;Step 311: According to the found NAT outbound interface rule information, search for the corresponding NAT conversion rule, generate a new NAT conversion entry, and perform NAT forwarding;
步骤312:流程结束;Step 312: the process ends;
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008100678029A CN101299772B (en) | 2008-06-04 | 2008-06-04 | System and method for processing network address conversion preferable regulation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008100678029A CN101299772B (en) | 2008-06-04 | 2008-06-04 | System and method for processing network address conversion preferable regulation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101299772A CN101299772A (en) | 2008-11-05 |
CN101299772B true CN101299772B (en) | 2011-05-11 |
Family
ID=40079451
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2008100678029A Expired - Fee Related CN101299772B (en) | 2008-06-04 | 2008-06-04 | System and method for processing network address conversion preferable regulation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101299772B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8341207B2 (en) * | 2010-04-07 | 2012-12-25 | Apple Inc. | Apparatus and method for matching users for online sessions |
CN103475746B (en) * | 2013-08-09 | 2017-07-04 | 新华三技术有限公司 | A kind of terminal service method and device |
CN107547396B (en) * | 2017-05-18 | 2021-03-19 | 新华三信息安全技术有限公司 | Message forwarding method and device |
CN111770211B (en) * | 2020-06-17 | 2023-04-18 | 北京百度网讯科技有限公司 | SNAT method, SNAT device, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004114634A1 (en) * | 2003-06-19 | 2004-12-29 | Cisco Technology, Inc. | Apparatus and methods for handling shared services through virtual route forwarding (vrf) -aware-nat |
CN1960313A (en) * | 2005-11-03 | 2007-05-09 | 中兴通讯股份有限公司 | Periphery devices of service provider of combining network address conversion, and method of application |
CN101068212A (en) * | 2007-06-11 | 2007-11-07 | 中兴通讯股份有限公司 | Device and method for network address translation and forwarding |
-
2008
- 2008-06-04 CN CN2008100678029A patent/CN101299772B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004114634A1 (en) * | 2003-06-19 | 2004-12-29 | Cisco Technology, Inc. | Apparatus and methods for handling shared services through virtual route forwarding (vrf) -aware-nat |
CN1960313A (en) * | 2005-11-03 | 2007-05-09 | 中兴通讯股份有限公司 | Periphery devices of service provider of combining network address conversion, and method of application |
CN101068212A (en) * | 2007-06-11 | 2007-11-07 | 中兴通讯股份有限公司 | Device and method for network address translation and forwarding |
Also Published As
Publication number | Publication date |
---|---|
CN101299772A (en) | 2008-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101877728B (en) | Method and device for converting and forwarding network addresses | |
EP2206052B1 (en) | Methods and apparatus for managing addresses related to virtual partitions of a session exchange device | |
CN102148773B (en) | Method and system for converting IPv6 (Internet Protocol Version 6) protocol and IPv4 (Internet Protocol Version 4) protocol | |
US20150036641A1 (en) | MOBILE PHONE DOCKING STATION VPNs | |
US20070060147A1 (en) | Apparatus for transmitting data packets between wireless sensor networks over internet, wireless sensor network domain name server, and data packet transmission method using the same | |
CN102148765B (en) | Method for realizing interconnection of integrated identification network and traditional IPv4 (Internet Protocol Version 4) internet | |
EP2804440B1 (en) | Method and system for mobile terminal to access the network through cell phone | |
US9270519B2 (en) | Address translation device, address translation method, and computer product | |
CN101159657A (en) | A method, device and server for realizing private network traversal | |
JP2005027311A (en) | Method and system for providing virtual protocol interlayer | |
EP2993852A1 (en) | Method, equipment and system for forwarding packets in information centric network (icn) | |
CN101299772B (en) | System and method for processing network address conversion preferable regulation | |
CN109921995A (en) | A kind of network equipment of the method for configuration address table, the FPGA and application FPGA | |
CN104243631A (en) | Method and device for stateful conversion between IPv4 address and IPv6 address | |
CN102685262A (en) | Method, device and system for detecting network address translation (NAT) information | |
CN111654443A (en) | Method for directly accessing public network by virtual machine IPv6 address in cloud environment | |
JP2012156957A (en) | Network system, control device, computer and network device | |
CN101299773A (en) | Method, processor and system for implementing network address conversion | |
CN114866472A (en) | Method and system for realizing open source community access in multi-mode network | |
TW200409498A (en) | NAPT gateway system and method to expand the number of connections | |
CN105939398B (en) | IPv6 transition method and device | |
KR100868825B1 (en) | Method of constructing network address translation table in mobile communication system and network address translation routing system of base station using same | |
CN102546845B (en) | Business access method, device and system | |
CN101989946A (en) | Compression method of communication equipment route forwarding table | |
CN101635747B (en) | Inter-network address resolution device for non-PTDN networks and PTDN networks |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20110511 |
|
CF01 | Termination of patent right due to non-payment of annual fee |