WO2016180142A1 - 地址转换方法及装置 - Google Patents

地址转换方法及装置 Download PDF

Info

Publication number
WO2016180142A1
WO2016180142A1 PCT/CN2016/079193 CN2016079193W WO2016180142A1 WO 2016180142 A1 WO2016180142 A1 WO 2016180142A1 CN 2016079193 W CN2016079193 W CN 2016079193W WO 2016180142 A1 WO2016180142 A1 WO 2016180142A1
Authority
WO
WIPO (PCT)
Prior art keywords
network address
conversion
public
information
module
Prior art date
Application number
PCT/CN2016/079193
Other languages
English (en)
French (fr)
Inventor
洪创业
施玮
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016180142A1 publication Critical patent/WO2016180142A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming

Definitions

  • the present invention relates to the field of communications, and in particular to an address translation method and apparatus.
  • IP Internet Protocol
  • IPv4 Internet Protocol Version 4
  • IPv6 Next Generation Internet Protocol Version 4
  • NAT/PAT network address translation
  • FIG. 1 is a schematic diagram of a networking structure of a public-private network traversal required for a DHCP message according to the related art.
  • a dynamic host configuration protocol-relay (referred to as DHCP) is used.
  • the DHCP-relay device In the carrier network that is connected to the -Relay mode, the DHCP-relay device is on the private network, and the DHCP server (DHCP-server) is set on the public network.
  • the NAT device is used to perform public and private network address translation. Net crossing.
  • NAT Network Address Translation
  • PAT Port Address Translation
  • NAT mode 1:1 conversion, failing to achieve the goal of saving public network IP
  • PAT mode In the process of performing IP address and port translation on the NAT device, the source IP address of the dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP for short) packets forwarded by the DCHP-Relay device is converted to the public network IP address. And successfully arrived at the DHCP server. However, the port segment (67, 68) of the user datagram protocol (DNS) of the DHCP protocol packet cannot be accurately converted. As a result, DHCP packets cannot be correctly identified by the DHCP server. If the subsequent interaction is not completed and the IP address cannot be obtained, the carrier network cannot be accessed.
  • DNS user datagram protocol
  • the embodiment of the invention provides an address translation method and device, so as to at least solve the problem that the related technology cannot guarantee the accurate conversion of the port segment.
  • an address translation method including: identifying first message information that needs to be translated by public and private network addresses; and detecting whether there is a first reserved port segment corresponding to the first message information. If the detection result is yes, the first message port segment is used to perform PAT conversion on the first message information.
  • the method further includes: determining whether there is an unassigned first public network address; and if the determination result is yes, saving the port of the first public network address And obtaining a second reserved port segment; performing PAT conversion on the first packet information by using the first public network address and the second reserved port segment.
  • the method further includes: outputting alarm information, where the alarm information is set to indicate that the first message information conversion fails.
  • the method further includes: acquiring a second public network address obtained by PAT conversion; and filling the second public network address to the first packet information.
  • the method further includes: receiving the second packet information, and determining whether the second packet information is required to perform public and private network address translation, before identifying the first packet information that needs to be converted by the public and private network addresses.
  • the message information is not limited to: receiving the second packet information, and determining whether the second packet information is required to perform public and private network address translation, before identifying the first packet information that needs to be converted by the public and private network addresses.
  • an address conversion apparatus including: an identification module, configured to identify first message information that needs to perform public-private network address translation; and a detecting module configured to detect whether the presence and the a first reserved port segment corresponding to the first packet information; the first converting module is configured to perform PAT conversion on the first packet information by using the first reserved port segment if the detection result is yes.
  • the device further includes: a first determining module, configured to determine whether there is an unallocated first public network address; and a saving module, configured to be in a case that the determination result is yes And storing the port segment of the first public network address to obtain a second reserved port segment; and the second converting module is configured to use the first public network address and the second reserved port segment to the first report
  • the text information is PAT converted.
  • the device further includes: an alarm module, configured to output alarm information, where the alarm information is set to indicate that the first message information fails to be converted.
  • the apparatus further includes: an obtaining module, configured to acquire a second public network address obtained by PAT conversion; and a filling module configured to fill the second public network address to the The first message information is described.
  • the device further includes: a receiving module, configured to receive the second packet information, and a second determining module, configured to determine the second, before the first message information that needs to be converted by the public and private network addresses is determined. Whether the message information is the message information that needs to be translated by the public and private network.
  • the first packet information that needs to be translated by the public and private network is identified; the first reserved port segment corresponding to the first packet information is detected; and if the detection result is yes, the first packet is used.
  • Reserved port segment pair The method of performing PAT conversion on the first packet information solves the problem that the port segment cannot be accurately converted, and improves the port segment conversion accuracy.
  • FIG. 1 is a schematic structural diagram of a networking for performing public-private network traversal according to a DHCP message of the related art
  • FIG. 2 is a flow chart of an address translation method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an address conversion apparatus according to an embodiment of the present invention.
  • FIG. 4 is a first schematic structural diagram 1 of an address translation apparatus according to an embodiment of the present invention.
  • FIG. 5 is a second schematic structural diagram of an address translation apparatus according to an embodiment of the present invention.
  • FIG. 6 is a third schematic structural diagram of an address translation apparatus according to an embodiment of the present invention.
  • FIG. 7 is a fourth schematic diagram of a preferred structure of an address translation apparatus according to an embodiment of the present invention.
  • FIG. 8 is a flow chart of an address translation method in accordance with a preferred embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a protocol message field to be modified in the inbound and outbound directions of an address translation method according to a preferred embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a network address translation apparatus according to a preferred embodiment of the present invention.
  • FIG. 2 is a flowchart of an address translation method according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps:
  • Step S202 identifying first message information that needs to be converted by public and private network addresses
  • Step S204 detecting whether there is a first reserved port segment corresponding to the first packet information
  • Step S206 if the detection result is yes, the first message port segment is used for PAT conversion using the first reserved port segment.
  • the first packet port segment corresponding to the first packet information is PAT-converted by using the foregoing steps. Message information can be correctly identified by the DHCP server. It can be seen that through the above steps, the problem that the port segment cannot be accurately converted cannot be solved, and the port segment conversion accuracy is improved.
  • the above steps may be implemented by DHCP-Relay.
  • the first reserved port segment may be stored in a NAT public network address pool.
  • the port segment corresponding to the first packet information may not be in the range of the first reserved port segment, and if the detection result is negative, it may be determined whether there is an unassigned first public network address; If the result is yes, the port segment of the first public network address is saved, and the second reserved port segment is obtained; and the first packet information is PAT-converted by using the first public network address and the second reserved port segment.
  • the first method can be used to allocate the first public network address to the first packet, and the port segment of the first public network address is saved as the second reserved port segment to ensure accurate conversion of the first packet information.
  • the second reserved port segment can be stored on the non-volatile storage medium, preferably in the NAT public network address pool.
  • the alarm information may be output, where the alarm information is set to indicate that the first message information conversion fails.
  • the second public network address obtained by the PAT conversion may be obtained; and the second public network address is filled to the first packet information.
  • the second public network address can be filled in the GIADDR field of the first message information.
  • the second packet information may be received; and the second packet information is determined to be packet information that needs to perform public address translation.
  • the received packet information can be directly transmitted to the DHCP server without the need to perform public-private network traversal conversion.
  • the aging detection may be performed on the first reserved port segment, the second reserved port segment, and the first public network address, and the port segment information and the public network address resource information are modified, added, or deleted according to the network condition.
  • an address conversion device is provided, which is configured to implement the above-mentioned embodiments and preferred embodiments.
  • the descriptions of the modules involved in the device will be described below.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 3 is a schematic structural diagram of an address translation apparatus according to an embodiment of the present invention.
  • the apparatus may include: The identification module 32, the detection module 34, and the first conversion module 36, wherein the identification module 32 is configured to identify the first message information that needs to be converted into a public-private network address; the detection module 34 is coupled to the identification module 32, and is configured to detect whether There is a first reserved port segment corresponding to the first packet information; the first converting module 36 is coupled to the detecting module 34, and configured to use the first reserved port segment to use the first packet information if the detection result is yes. Perform PAT conversion.
  • the apparatus further includes: a first determining module 42, a saving module 44, and a second converting module 46, wherein The first determining module 42 is coupled to the detecting module 34 and configured to determine whether there is an unallocated first public network address.
  • the saving module 44 is coupled to the first determining module 42 and configured to save when the determination result is yes.
  • the port segment of the first public network address obtains the second reserved port segment; the second conversion module 46 is coupled to the saving module 44, and configured to perform PAT on the first packet information by using the first public network address and the second reserved port segment. Conversion.
  • FIG. 5 is a schematic diagram of a preferred structure of an address translation apparatus according to an embodiment of the present invention. As shown in FIG. 5, the apparatus further includes: an alarm module 52 coupled to the first determining module 42 and configured to output alarm information. The alarm information is set to indicate that the first packet information conversion fails.
  • FIG. 6 is a schematic diagram of a preferred structure of an address translation apparatus according to an embodiment of the present invention.
  • the apparatus further includes: an obtaining module 62 and a filling module 64, wherein the obtaining module 62 is coupled to the first
  • the conversion module 36 is configured to obtain a second public network address obtained by PAT conversion; the filling module 64 is coupled to the obtaining module 62, and configured to fill the second public network address to the first message information.
  • FIG. 7 is a schematic diagram of a preferred structure of an address translation apparatus according to an embodiment of the present invention.
  • the apparatus further includes: a receiving module 72 and a second determining module 74, wherein the receiving module 72 is configured to Receiving the second message information; the second determining module 74 is coupled to the receiving module 72 and the identifying module 32, and is configured to determine whether the second message information is message information that needs to be converted by the public and private network.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the preferred embodiment of the present invention provides a technology for accessing a client host by using a DHCP-Relay method in a communication network with public-private network conversion.
  • the preferred embodiment of the present invention further provides a method and a device for network address translation.
  • the DHCP packet can be successfully and accurately traversed through the public and private networks to meet the requirements of the network deployed by the operator. Good practical application value.
  • the preferred embodiment of the present invention further provides a method for network address translation, so that the NAT device can correctly process the DHCP message that needs to be traversed by the downstream DHCP-Relay device and needs to traverse the public and private network.
  • the steps of the method are as follows:
  • Step 1 Receive and identify a DHCP message (corresponding to the first message information) that needs to be converted by the public network.
  • Step 2 Check whether there is a corresponding reserved port segment in the NAT public network address pool (corresponding to the first reserved port segment);
  • Step 3 In the case that there is a corresponding reserved port segment, the NAT address selection policy selects the address in the address pool and the corresponding port to perform PAT conversion, and simultaneously converts the converted public network IP (corresponding to the second public network address), and fills Go to the GIADDR field in the DHCP protocol packet and forward it to the DHCP server.
  • Step 4 If there is no corresponding reserved port segment, check whether there is any unused IP resource in the NAT public network address pool (corresponding to the first public network address);
  • Step 5 When there are unused IP resources, the IP port segment (equivalent to the second reserved port segment) is automatically reserved, and the IP and the corresponding port are used for PAT conversion, and the converted public network IP is simultaneously Fill in the GIADDR field in the DHCP protocol packet and forward it to the DHCP server.
  • Step 6 Output an alarm if there are no unused IP resources.
  • the preferred embodiment of the present invention further provides a device for network address translation, where the device includes:
  • the resource detecting unit is configured to detect whether a corresponding reserved port segment exists in the NAT public network address
  • the data processing unit is configured to automatically reserve the corresponding port segment for the IP resource that is not used in the NAT public network address and does not retain the corresponding port segment; and processes and fills the GIADDR field in the DHCP packet.
  • the aging detection unit is configured to synchronize the NAT aging policy. After the aging time of the DHCP-specific mapping table expires, the IP resource and the corresponding port segment that is reserved are released.
  • the alarm unit is set to output an alarm, prompting the device or network administrator to process.
  • the network address translation method and device provided by the preferred embodiment of the present invention can use the dynamic PAT mode to perform correct address translation and packet interaction processing, and avoid NAT when the NAT device receives the DHCP message that needs to be converted to the public and private network address requirements.
  • the deficiencies of the mode and the original PAT mode have no change to the network environment.
  • a preferred embodiment of the present invention provides a method for applying to a NAT device in the PAT mode of the current NAT technology.
  • the IP address and the IP address in the NAT public address pool are used in advance.
  • the corresponding well-known protocol port segments are reserved to further optimize the processing of DCHP packets that need to traverse the public and private networks in the PAT mode.
  • FIG. 8 is a flowchart of an address translation method according to a preferred embodiment of the present invention. As shown in FIG. 8, the process includes the following steps:
  • step S802 the device detects that the DHCP message needs to be translated into the public and private network address, and initiates the conversion mechanism, step S804 is performed; if the detected DHCP message does not need to be translated, and there is a forwarding route, step S816 is performed;
  • Step S804 the device detecting unit starts detecting the NAT public network address pool
  • the NAT public network address pool has a pre-reserved corresponding well-known protocol port segment (corresponding to the first reserved port segment), for example, 1-2048 is reserved, and the well-known port number corresponding to the DHCP packet is 67, 68. There are reserved port segments. In the case that there is a reserved port segment, step S808 is performed; in the case where there is no reserved port segment, step S812 is performed;
  • Step S808 Selecting an address policy according to the NAT to select a public network address in the address pool (corresponding to the second public network address), and performing PAT conversion on the ports 67 and 68 of the reserved port number to ensure that the packet reaches the public network DHCP server, and the original The port number of the UDP packet on the private network is not translated into a protocol port number that is not recognized by other DHCP servers, so that the DHCP server can correctly process the packet and reply to subsequent exchange packets.
  • Step S810 after the conversion list is generated in step S808, the converted public network address (corresponding to the second public network address) is obtained, and the GIADDR field of the DHCP message is modified to ensure that the DHCP server correctly performs subsequent interaction packets. Forward it back.
  • the NAT device receives the subsequent exchange message forwarded by the DHCP server.
  • the GIADDR field of the interaction message is changed back to the original private network address, so that the message can be correctly returned to the Relay device for processing.
  • FIG. 9 is based on A schematic diagram of a protocol message field structure to be modified in the inbound and outbound directions of the address translation method according to the preferred embodiment of the present invention, as shown in FIG. 9, SRC represents the source host, DST represents the target host, and GIADDR represents the IP address of the DHCP relay device. ;
  • step S812 when there is no reserved port segment in the NAT public address pool, the device detecting unit needs to further detect whether there is an unallocated public network address resource (equivalent to the first public network address) in the address pool.
  • step S814 is performed; if the available address resource is not detected, step S818 is performed;
  • Step S814 the public network address resource (equivalent to the first public network address) is automatically reserved for the corresponding port number segment operation, step S808;
  • Step S816 Perform common route lookup and forwarding on the public network address DHCP message.
  • step S818 an alarm is output, prompting the network administrator to process.
  • FIG. 10 is a schematic structural diagram of a network address translation apparatus according to a preferred embodiment of the present invention. As shown in FIG. 10, a preferred embodiment of the present invention provides a network address translation apparatus, which may be independently configured or integrated in a NAT function. , the device includes:
  • the resource detecting unit 1002 is configured to detect a NAT public network address pool resource.
  • the conversion recording unit 1004 is configured to generate and record a DHCP message conversion mapping table.
  • the data processing unit 1006 is configured to modify the DHCP message field and the corresponding port segment of the automatic reservation protocol.
  • the aging detecting unit 1008 is configured to synchronize the NAT aging policy, release the IP resource, and automatically retain the port segment.
  • the alarm unit 1010 is configured to generate a notification alarm, prompting the device or the network administrator to process.
  • the original PAT processing mode is optimized compared to the prior art, and
  • the NAT mode saves the public network IP resources of the carrier.
  • the NAT device configuration can be changed to zero.
  • the deployment is flexible. No hardware device is required to support other special control policies. No additional devices need to be added.
  • the implementation is simple and feasible, does not affect the normal operation of the device, and discovers new applications of the NAT technology without additional investment, which improves the accuracy of implementing DHCP packets through the public and private networks in the current NAT environment.
  • a software is provided that is configured to perform the technical solutions described in the above embodiments and preferred embodiments.
  • a storage medium is further provided, wherein the software includes the above-mentioned software, including but not limited to: an optical disk, a floppy disk, a hard disk, an erasable memory, and the like.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • an address translation method and apparatus provided by an embodiment of the present invention have the following beneficial effects: the first message information that needs to be used for public-private network address translation is detected; and whether the first message corresponding to the first message information is detected A reserved port segment is used. When the detection result is YES, the first reserved port segment is used to perform PAT conversion on the first packet information, which solves the problem that the port segment cannot be accurately converted, and improves the port segment conversion accuracy. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明提供了一种地址转换方法及装置,其中,该方法包括:识别需要进行公私网地址转换的第一报文信息;检测是否存在与第一报文信息对应的第一保留端口段;在检测结果为是的情况下,使用第一保留端口段对第一报文信息进行PAT转换。通过本发明,解决了无法保证端口段准确转换的问题,提高了端口段转换准确性。

Description

地址转换方法及装置 技术领域
本发明涉及通信领域,具体而言,涉及一种地址转换方法及装置。
背景技术
随着互联网技术的发展,可用的网络地址已越来越少。2011年2月3日,互联网名称与数字地址分配机构(The Internet Corporation for Assigned Names and Numbers,简称为ICANN)发布公告称最后五组网络协议(Internet Protocol,简称为IP)地址已分配完毕,已无网络协议版本4(Internet Protocol Version 4,简称为IPv4)地址可分配,而下一代网络协议版本6(Internet Protocol Version 4,简称为IPv6)网络还没有建成。为缓解公网IP地址耗尽的问题,运营商利用丰富的私有网络地址资源搭建的网络越来越多。在私有地址网络接入公用互联网络的连接处,使用网络地址转换(NAT/PAT)技术,将私网IP地址转换为公网IP接入互联网,节省了大量的公网IP地址。
然而在网络地址转换技术的实际应用过程中,NAT/PAT仅对网络层报文的报文头进行IP地址和报文端口的识别和转换,对于应用层协议协商过程中报文载荷携带的地址信息则无法进行识别和正确转换。图1是根据相关技术的现有需要DHCP报文进行公私网穿越的组网结构示意图,如图1所示,一个使用动态主机配置协议及中继服务器(Dynamic Host Configuration Protocol–Relay,简称为DHCP-Relay)方式接入的运营商网络中,DHCP-relay设备在私网,DHCP服务器(DHCP-server)设置在公网,中间通过NAT设备进行公私网网络地址转换,要求实现DHCP报文的公私网穿越。
为达到节约公网IP的目的,并且实现组网,通常情况下运营商会采用:1、网络地址转换(Network Address Translation,简称为NAT)方式,即一个内部私网地址和一个公网地址之间建立一对一的动态映射实现公私网转换。2、端口地址转换(Port Address Translation,简称为PAT)方式,即用一个公网IP地址和端口号的组合来映射内部不同主机地址的方式来实现地址转换。
本发明的发明人在研究过程中发现,以上两种方式都不能完全实现运营商实施该组网的需求:1、NAT方式,1:1转换,没有达到节约公网IP目的;2、PAT方式:在NAT设备执行IP地址和端口转换的过程中,虽然能保证DCHP-Relay设备转发的动态主机配置协议(Dynamic Host Configuration Protocol,简称为DHCP)报文私网源IP被转换为公网IP,并顺利到达DHCP服务器。但对于DHCP协议报文用户数据报协议(User Datagram Protocol,简称为UDP)专有的端口段(67、68)无法保证准确转换,导致DHCP报文无法被DHCP服务器正确识别,下游客户端设备因未完成后续交互而无法获取到IP地址,不能接入运营商网络。
针对相关技术无法保证端口段准确转换的问题,目前没有提出有效的解决方案。
发明内容
本发明实施例提供了一种地址转换方法及装置,以至少解决相关技术无法保证端口段准确转换的问题。
根据本发明的一个实施例,提供了一种地址转换方法,包括:识别需要进行公私网地址转换的第一报文信息;检测是否存在与所述第一报文信息对应的第一保留端口段;在检测结果为是的情况下,使用所述第一保留端口段对所述第一报文信息进行PAT转换。
可选地,在检测结果为否的情况下,所述方法还包括:判断是否有未分配的第一公网地址;在判断结果为是的情况下,保存所述第一公网地址的端口段,得到第二保留端口段;使用所述第一公网地址和所述第二保留端口段对所述第一报文信息进行PAT转换。
可选地,在判断结果为否的情况下,所述方法还包括:输出告警信息,其中,所述告警信息设置为指示所述第一报文信息转换失败。
可选地,在进行所述PAT转换之后,所述方法还包括:获取通过PAT转换得到的第二公网地址;填充所述第二公网地址到所述第一报文信息。
可选地,在识别需要进行公私网地址转换的第一报文信息之前,所述方法还包括:接收第二报文信息;判断所述第二报文信息是否为需要进行公私网地址转换的所述报文信息。
根据本发明的另一个实施例,还提供了一种地址转换装置,包括:识别模块,设置为识别需要进行公私网地址转换的第一报文信息;检测模块,设置为检测是否存在与所述第一报文信息对应的第一保留端口段;第一转换模块,设置为在检测结果为是的情况下,使用所述第一保留端口段对所述第一报文信息进行PAT转换。
可选地,在检测结果为否的情况下,所述装置还包括:第一判断模块,设置为判断是否有未分配的第一公网地址;保存模块,设置为在判断结果为是的情况下,保存所述第一公网地址的端口段,得到第二保留端口段;第二转换模块,设置为使用所述第一公网地址和所述第二保留端口段对所述第一报文信息进行PAT转换。
可选地,在判断结果为否的情况下,所述装置还包括:告警模块,设置为输出告警信息,其中,所述告警信息设置为指示所述第一报文信息转换失败。
可选地,在进行所述PAT转换之后,所述装置还包括:获取模块,设置为获取通过PAT转换得到的第二公网地址;填充模块,设置为填充所述第二公网地址到所述第一报文信息。
可选地,在识别需要进行公私网地址转换的第一报文信息之前,所述装置还包括:接收模块,设置为接收第二报文信息;第二判断模块,设置为判断所述第二报文信息是否为需要进行公私网地址转换的所述报文信息。
通过本发明实施例,采用识别需要进行公私网地址转换的第一报文信息;检测是否存在与第一报文信息对应的第一保留端口段;在检测结果为是的情况下,使用第一保留端口段对 第一报文信息进行PAT转换的方式,解决了无法保证端口段准确转换的问题,提高了端口段转换准确性。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据相关技术的DHCP报文进行公私网穿越的组网结构示意图;
图2是根据本发明实施例的地址转换方法的流程图;
图3是根据本发明实施例的地址转换装置的结构示意图;
图4是根据本发明实施例的地址转换装置的优选结构示意图一;
图5是根据本发明实施例的地址转换装置的优选结构示意图二;
图6是根据本发明实施例的地址转换装置的优选结构示意图三;
图7是根据本发明实施例的地址转换装置的优选结构示意图四;
图8是根据本发明优选实施例的地址转换方法流程图;
图9是根据本发明优选实施例的地址转换方法的出、入方向上需修改的协议报文字段结构示意图;
图10是根据本发明优选实施例的网络地址转换装置结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
本发明实施例提供了一种地址转换方法,图2是根据本发明实施例的地址转换方法的流程图,如图2所示,该流程包括如下步骤:
步骤S202,识别需要进行公私网地址转换的第一报文信息;
步骤S204,检测是否存在与第一报文信息对应的第一保留端口段;
步骤S206,在检测结果为是的情况下,使用第一保留端口段对第一报文信息进行PAT转换。
通过上述步骤,在检测到存在与第一报文信息对应的第一保留端口段的情况下,使用与第一报文信息对应的第一保留端口段对第一报文信息进行PAT转换,使报文信息能够被DHCP服务器正确识别。可见,通过上述步骤,解决了无法保证端口段准确转换的问题,提高了端口段转换准确性。
可选地,上述步骤可以由DHCP-Relay实现。
可选地,上述第一保留端口段可以存储于NAT公网地址池。在上述步骤步骤S204中,可以检测NAT公网地址池中是否存在与第一报文信息对应的第一保留端口段。
可选地,上述第一报文信息对应的端口段可能不在第一保留端口段的范围内,在上述检测结果为否的情况下,可以判断是否有未分配的第一公网地址;在判断结果为是的情况下,保存第一公网地址的端口段,得到第二保留端口段;使用第一公网地址和第二保留端口段对第一报文信息进行PAT转换。通过上述方法,可以为第一报文信息分配未被使用的第一公网地址,同时将第一公网地址的端口段保存为第二保留端口段,保证了第一报文信息的准确转换与传输,同时,第二保留端口段可以存储在非易失存储介质上,优选存储于NAT公网地址池。
可选地,在判断到不存在未分配的公网地址的情况下,可以输出告警信息,其中,告警信息设置为指示第一报文信息转换失败。
可选地,在进行PAT转换之后,可以获取通过PAT转换得到的第二公网地址;填充第二公网地址到第一报文信息。通过上述方法,可以保证后续的报文信息能够进行准确的交互。较优地,可以将第二公网地址填充到第一报文信息的GIADDR字段。
可选地,在上述步骤S202之前,可以接收第二报文信息;判断第二报文信息是否为需要进行公私网地址转换的报文信息。接收到的报文信息可以无需进行公私网穿越转换,在接收到的报文信息无需进行公私网穿越转换的情况下,可以直接将报文信息发送给DHCP服务器。
可选地,可以对第一保留端口段、第二保留端口段、第一公网地址进行老化检测,根据网络情况修改、添加或删除端口段信息和公网地址资源信息。
在本实施例中还提供了一种地址转换装置,设置为实现上述实施例及优选实施方式,已经进行过说明的不再赘述,下面对该装置中涉及到的模块进行说明。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图3是根据本发明实施例的地址转换装置的结构示意图,如图3所示,该装置可以包括: 识别模块32、检测模块34、第一转换模块36,其中,识别模块32,设置为识别需要进行公私网地址转换的第一报文信息;检测模块34,耦合至识别模块32,设置为检测是否存在与第一报文信息对应的第一保留端口段;第一转换模块36,耦合至检测模块34,设置为在检测结果为是的情况下,使用第一保留端口段对第一报文信息进行PAT转换。
图4是根据本发明实施例的地址转换装置的优选结构示意图一,如图4所示,优选地,上述装置还包括:第一判断模块42、保存模块44、第二转换模块46,其中,第一判断模块42,耦合至检测模块34,设置为判断是否有未分配的第一公网地址;保存模块44,耦合至第一判断模块42,设置为在判断结果为是的情况下,保存第一公网地址的端口段,得到第二保留端口段;第二转换模块46,耦合至保存模块44,设置为使用第一公网地址和第二保留端口段对第一报文信息进行PAT转换。
图5是根据本发明实施例的地址转换装置的优选结构示意图二,如图5所示,优选地,上述装置还包括:告警模块52,耦合至第一判断模块42,设置为输出告警信息,其中,告警信息设置为指示第一报文信息转换失败。
图6是根据本发明实施例的地址转换装置的优选结构示意图三,如图6所示,优选地,上述装置还包括:获取模块62、填充模块64,其中,获取模块62,耦合至第一转换模块36,设置为获取通过PAT转换得到的第二公网地址;填充模块64,耦合至获取模块62,设置为填充第二公网地址到第一报文信息。
图7是根据本发明实施例的地址转换装置的优选结构示意图四,如图7所示,优选地,上述装置还包括:接收模块72、第二判断模块74,其中,接收模块72,设置为接收第二报文信息;第二判断模块74,耦合至接收模块72和识别模块32,设置为判断第二报文信息是否为需要进行公私网地址转换的报文信息。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
为了使本发明实施例的描述更加清楚,下面结合优选实施例进行描述和说明。
本发明优选实施例提供了一种存在公私网转换的通讯网络中,使用DHCP-Relay方式接入客户端主机的技术。
本发明优选实施例还提供了一种网络地址转换的方法和装置,在运营商NAT组网环境下,可以保证DHCP报文能顺利、准确的穿越公私网,满足运营商部署网络的需求,具有良好的实际应用价值。
本发明优选实施例还提供了一种网络地址转换的方法,使NAT设备能正确处理下游DHCP-Relay设备转发的需要穿越公私网的DHCP报文,该方法的步骤如下:
步骤一,接收并识别需要进行公私网穿越转换的DHCP报文(相当于上述第一报文信息);
步骤二,检测NAT公网地址池是否存在对应的保留端口段(相当于上述第一保留端口段);
步骤三,在存在对应的保留端口段的情况下,按NAT选取地址策略选取地址池内地址和对应端口进行PAT转换,同时将转换后的公网IP(相当于上述第二公网地址),填充至DHCP协议报文中GIADDR字段,转发给DHCP服务器;
步骤四,在不存在对应的保留端口段的情况下,检测NAT公网地址池内是否有未使用的IP资源(相当于上述第一公网地址);
步骤五,在有未使用的IP资源的情况下,自动保留该IP端口段(相当于上述第二保留端口段),并使用该IP和对应端口进行PAT转换,同时将转换后的公网IP,填充至DHCP协议报文中GIADDR字段,转发给DHCP服务器;
步骤六,在没有未使用的IP资源的情况下,输出告警。
可选地,本发明优选实施例还提供了一种网络地址转换的装置,该装置包括:
资源检测单元,设置为检测NAT公网地址中是否存在对应的保留端口段;
转换记录单元,设置为生成、记录特定的转换映射表;
数据处理单元,设置为对NAT公网地址中未使用、未保留对应端口段的IP资源进行自动保留对应端口段操作;并处理修改、填充DHCP报文中GIADDR字段;
老化检测单元,设置为同步NAT老化策略,DHCP特定映射表老化时间到期后,释放IP资源及被保留的对应端口段。
告警单元,设置为输出告警,提示设备或网络管理员处理。
采用本发明优选实施例提供的网络地址转换方法及装置,当NAT设备接收到需要转换公私网地址需求的DHCP报文,能采用动态PAT方式进行正确的地址转换和报文交互处理,避免了NAT方式和原PAT方式的不足之处,对网络环境无更改。
针对目前NAT技术中PAT方式对DHCP报文穿越公私网处理存在的不足和问题,本发明优选实施例提供了一种方法,应用于NAT设备中;借助NAT公网地址池中的IP资源和预先保留的对应知名协议端口段,来进一步优化PAT方式对需要穿越公私网的DCHP报文处理过程。
下面结合附图对本发明优选实施例进行描述和说明。
图8是根据本发明优选实施例的地址转换方法流程图,如图8所示,该流程包括如下步骤:
步骤S802,设备检测匹配到需要做公私网地址转换的DHCP报文,启动转换机制,执行步骤S804;在检测到的DHCP报文无需做地址转换,并且存在转发路由的情况下,执行步骤S816;
步骤S804,设备检测单元开始检测NAT公网地址池;
步骤S806,NAT公网地址池是否存在预先保留的对应知名协议端口段(相当于上述第一保留端口段),例如,保留1-2048,其中DHCP报文对应的知名端口号为67、68,存在保留端口段。在存在保留的端口段的情况下,执行步骤S808;在不存在保留的端口段的情况下,执行步骤S812;
步骤S808,按NAT选取地址策略选取地址池中公网地址(相当于上述第二公网地址),使用保留端口号的67、68端口做PAT转换,以保证报文到达公网DHCP服务器,并且原私网UDP报文端口号不会被转换成其它DHCP服务器无法识别的协议端口号,以便DHCP服务器正确处理该报文并回复后续交互报文;
步骤S810,在步骤S808生成转换列表后,获得转换后的公网地址(相当于上述第二公网地址),修改填入DHCP报文的GIADDR字段,以保证DHCP服务器正确的将后续交互报文转发回来。同时,NAT设备在收到DHCP服务器转发回来的后续交互报文,步骤S810需将该交互报文GIADDR字段改回原私网地址,保证该报文能正确回复给Relay设备处理,图9是根据本发明优选实施例的地址转换方法的出、入方向上需修改的协议报文字段结构示意图,如图9所示,SRC表示来源主机,DST表示目标主机,GIADDR表示DHCP中继器的IP地址;
步骤S812,当NAT公网地址池不存在保留的端口段,设备检测单元则需要进一步检测该地址池中是否存在未被分配的公网地址资源(相当于上述第一公网地址),在检测到未被分配的公网地址资源的情况下,执行步骤S814;在未检测到可用地址资源的情况下,执行步骤S818;
步骤S814,对可用公网地址资源(相当于上述第一公网地址)作自动保留对应端口号段操作,执行步骤S808;
步骤S816,对公网地址DHCP报文,进行普通路由查找转发;
步骤S818,输出告警,提示网络管理员处理。
图10是根据本发明优选实施例的网络地址转换装置结构示意图,如图10所示,本发明优选实施例提供了一种网络地址转换装置,该装置可独立设置,也可以集成在NAT功能中,该装置包括:
资源检测单元1002,设置为检测NAT公网地址池资源。
转换记录单元1004,设置为生成、记录DHCP报文转换映射表。
数据处理单元1006,设置为修改DHCP报文字段及自动保留协议对应端口段。
老化检测单元1008,设置为同步NAT老化策略,释放IP资源及被自动保留端口段。
告警单元1010,设置为产生通知告警,提示设备或网络管理员处理。
采用本发明优选实施例的方法和装置,与现有技术相比,优化了原PAT处理方式,相对 NAT方式,节省了运营商公网IP资源,相对PAT方式,在新增Relay设备时,能做到NAT设备配置零变动,部署灵活,不需要硬件设备支持其它的特殊控制策略,无需增加其它设备,实现简单可行,不影响设备正常运行,发掘了NAT技术的新应用,而无需额外投入,提高了目前NAT环境下实现DHCP报文穿越公私网的准确性。
在另外一个实施例中,还提供了一种软件,该软件设置为执行上述实施例及优选实施方式中描述的技术方案。
在另外一个实施例中,还提供了一种存储介质,该存储介质中存储有上述软件,该存储介质包括但不限于:光盘、软盘、硬盘、可擦写存储器等。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的对象在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
如上所述,本发明实施例提供的一种地址转换方法及装置,具有以下有益效果:采用识别需要进行公私网地址转换的第一报文信息;检测是否存在与第一报文信息对应的第一保留端口段;在检测结果为是的情况下,使用第一保留端口段对第一报文信息进行PAT转换的方式,解决了无法保证端口段准确转换的问题,提高了端口段转换准确性。

Claims (10)

  1. 一种地址转换方法,包括:
    识别需要进行公私网地址转换的第一报文信息;
    检测是否存在与所述第一报文信息对应的第一保留端口段;
    在检测结果为是的情况下,使用所述第一保留端口段对所述第一报文信息进行PAT转换。
  2. 根据权利要求1所述的方法,其中,在检测结果为否的情况下,所述方法还包括:
    判断是否有未分配的第一公网地址;
    在判断结果为是的情况下,保存所述第一公网地址的端口段,得到第二保留端口段;
    使用所述第一公网地址和所述第二保留端口段对所述第一报文信息进行PAT转换。
  3. 根据权利要求2所述的方法,其中,在判断结果为否的情况下,所述方法还包括:
    输出告警信息,其中,所述告警信息设置为指示所述第一报文信息转换失败。
  4. 根据权利要求1至2中任一项所述的方法,其中,在进行所述PAT转换之后,所述方法还包括:
    获取通过PAT转换得到的第二公网地址;
    填充所述第二公网地址到所述第一报文信息。
  5. 根据权利要求1所述的方法,其中,在识别需要进行公私网地址转换的第一报文信息之前,所述方法还包括:
    接收第二报文信息;
    判断所述第二报文信息是否为需要进行公私网地址转换的所述报文信息。
  6. 一种地址转换装置,包括:
    识别模块,设置为识别需要进行公私网地址转换的第一报文信息;
    检测模块,设置为检测是否存在与所述第一报文信息对应的第一保留端口段;
    第一转换模块,设置为在检测结果为是的情况下,使用所述第一保留端口段对所述第一报文信息进行PAT转换。
  7. 根据权利要求6所述的装置,其中,在检测结果为否的情况下,所述装置还包括:
    第一判断模块,设置为判断是否有未分配的第一公网地址;
    保存模块,设置为在判断结果为是的情况下,保存所述第一公网地址的端口段,得 到第二保留端口段;
    第二转换模块,设置为使用所述第一公网地址和所述第二保留端口段对所述第一报文信息进行PAT转换。
  8. 根据权利要求7所述的装置,其中,在判断结果为否的情况下,所述装置还包括:
    告警模块,设置为输出告警信息,其中,所述告警信息设置为指示所述第一报文信息转换失败。
  9. 根据权利要求6至7中任一项所述的装置,其中,在进行所述PAT转换之后,所述装置还包括:
    获取模块,设置为获取通过PAT转换得到的第二公网地址;
    填充模块,设置为填充所述第二公网地址到所述第一报文信息。
  10. 根据权利要求6所述的装置,其中,在识别需要进行公私网地址转换的第一报文信息之前,所述装置还包括:
    接收模块,设置为接收第二报文信息;
    第二判断模块,设置为判断所述第二报文信息是否为需要进行公私网地址转换的所述报文信息。
PCT/CN2016/079193 2015-07-27 2016-04-13 地址转换方法及装置 WO2016180142A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510447575.2A CN106713517A (zh) 2015-07-27 2015-07-27 地址转换方法及装置
CN201510447575.2 2015-07-27

Publications (1)

Publication Number Publication Date
WO2016180142A1 true WO2016180142A1 (zh) 2016-11-17

Family

ID=57248837

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/079193 WO2016180142A1 (zh) 2015-07-27 2016-04-13 地址转换方法及装置

Country Status (2)

Country Link
CN (1) CN106713517A (zh)
WO (1) WO2016180142A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656596A (zh) * 2016-12-21 2017-05-10 瑞斯康达科技发展股份有限公司 基于dhcp服务器的snmp网络管理方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140325637A1 (en) * 2013-04-30 2014-10-30 Futurewei Technologies, Inc Supporting IP Address Overlapping Among Different Virtual Networks
CN104333612A (zh) * 2014-10-29 2015-02-04 中国联合网络通信集团有限公司 转换网络地址的方法和装置
CN104753867A (zh) * 2013-12-27 2015-07-01 中国移动通信集团公司 一种网络数据访问方法、设备及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8755370B1 (en) * 2007-09-28 2014-06-17 Cisco Technology, Inc. Mechanisms for session border control of VOIP communication from non-symmetric port address translation device
CN104519150B (zh) * 2014-12-31 2018-03-02 迈普通信技术股份有限公司 网络地址转换端口分配方法及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140325637A1 (en) * 2013-04-30 2014-10-30 Futurewei Technologies, Inc Supporting IP Address Overlapping Among Different Virtual Networks
CN104753867A (zh) * 2013-12-27 2015-07-01 中国移动通信集团公司 一种网络数据访问方法、设备及系统
CN104333612A (zh) * 2014-10-29 2015-02-04 中国联合网络通信集团有限公司 转换网络地址的方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656596A (zh) * 2016-12-21 2017-05-10 瑞斯康达科技发展股份有限公司 基于dhcp服务器的snmp网络管理方法及装置
CN106656596B (zh) * 2016-12-21 2019-11-01 瑞斯康达科技发展股份有限公司 基于dhcp服务器的snmp网络管理方法及装置

Also Published As

Publication number Publication date
CN106713517A (zh) 2017-05-24

Similar Documents

Publication Publication Date Title
US9258699B2 (en) Method for route transmission based on single IPv6 address prefix, and wireless device
EP2253124B1 (en) Method and apparatus for communication of data packets between local networks
JP5711754B2 (ja) スマートクライアントルーティング
WO2011147353A1 (zh) 一种报文发送方法及装置
JP2018518867A5 (zh)
US20120324063A1 (en) Method, network device, and system for automatically configuring network device in ipv6 network
CN114556868B (zh) 虚拟专用网络vpn客户端的专用子网络
JP2019176511A (ja) ネットワーク機器
JP2017528052A5 (zh)
US8194683B2 (en) Teredo connectivity between clients behind symmetric NATs
WO2018019216A1 (zh) Ap接入控制
EP2896160A1 (en) Bandwidth probing messages
US9923814B2 (en) Media access control address resolution using internet protocol addresses
TWI469605B (zh) 網路位址轉換系統及方法
CN111711705B (zh) 基于代理节点作双向nat实现网络连接的方法和装置
JP2015522880A (ja) データ対話方法、装置、およびシステム
EP2690832B1 (en) Communication device, communication system, and communication method
CN102137172B (zh) 一种dns服务器访问方法及一种访问设备
US7693091B2 (en) Teredo connectivity between clients behind symmetric NATs
WO2016180142A1 (zh) 地址转换方法及装置
US10033690B2 (en) Communication method, wireless access point, wireless controller and communication system
WO2014156143A1 (ja) ホームゲートウェイ装置およびパケット転送方法
WO2016177185A1 (zh) 媒体访问控制mac地址的处理方法及装置
WO2017219777A1 (zh) 一种报文处理方法及装置
JP5054666B2 (ja) Vpn接続装置、パケット制御方法、及びプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16791992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16791992

Country of ref document: EP

Kind code of ref document: A1