WO2016095561A1 - 一种地址分配方法、cgn设备及cgn双主系统 - Google Patents

一种地址分配方法、cgn设备及cgn双主系统 Download PDF

Info

Publication number
WO2016095561A1
WO2016095561A1 PCT/CN2015/088137 CN2015088137W WO2016095561A1 WO 2016095561 A1 WO2016095561 A1 WO 2016095561A1 CN 2015088137 W CN2015088137 W CN 2015088137W WO 2016095561 A1 WO2016095561 A1 WO 2016095561A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
network address
address
segment
cgn device
Prior art date
Application number
PCT/CN2015/088137
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 华为技术有限公司
Priority to EP15869072.7A priority Critical patent/EP3169044B1/en
Publication of WO2016095561A1 publication Critical patent/WO2016095561A1/zh
Priority to US15/596,716 priority patent/US10320738B2/en

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
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/741Routing in networks with a plurality of addressing schemes, e.g. with both IPv4 and IPv6
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/253Routing or path finding in a switch fabric using establishment or release of connections between ports
    • H04L49/254Centralised controller, i.e. arbitration or scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2517Translation of Internet protocol [IP] addresses using port numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2532Clique of NAT servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2535Multiple local networks, e.g. resolving potential IP address conflicts

Definitions

  • the present invention relates to the field of mobile communications technologies, and in particular, to an address allocation method, a carrier-grade NAT (CGN, Carrie Grade Network Address Translation) device, and a CGN dual-master system.
  • CGN Carrie Grade Network Address Translation
  • IPv6 Internet Protocol version 4
  • IPC Internet Content Provider
  • a stand-alone CGN device such as a firewall, uses only Network Address Translation (NAT) technology.
  • NAT Network Address Translation
  • a distributed scenario refers to a scenario in which multiple CGN devices perform address translation.
  • both CGN devices have the function of assigning a public network address and a port segment to the private network address.
  • two CGN devices receive different data from the same private network address. Packets, two CGN devices each assign a public network address and a port segment to the private network address. Then, the private network address can obtain two different public network addresses and port segments.
  • the CGN device requires that the data stream with the same source private network address be diverted to which CGN device in the CGN dual-master scenario, and the source private network address is obtained.
  • the public network address and port segment must be the same.
  • the embodiment of the present invention provides an address allocation method, a CGN device, and a CGN dual-master system, which are used to solve the problem that the CGN device in the prior art dual-main scene cannot meet the requirements of traceability consistency.
  • an address allocation method including:
  • the first carrier-level network address translation CGN device receives an address allocation request sent by the second CGN device, where the address allocation request carries the first private network address;
  • the first CGN device searches for the presence of the first private network address in the corresponding relationship between the recorded private network address, the public network address, and the port segment;
  • the first CGN device allocates a public network address and a port segment to the first private network address, and records the first private network address, based on the search result that the first private network address does not exist in the corresponding relationship. Correspondence with the assigned public network address and port segment;
  • the first CGN device is a device preset for assigning a public network address and a port segment to a private network address in a CGN dual-master scenario, where the second CGN device is preset in a CGN dual-master scenario.
  • the method further includes: the first CGN device obtains a first to-be-transmitted message;
  • the source address of the first to-be-sent packet corresponds to the allocated public network address and the port segment; and the public network address and the port segment corresponding to the source address of the first to-be-sent packet are correspondingly found in the corresponding relationship.
  • the first CGN device determines the unallocated port from the first port set of the found port segment; and replaces the source address of the first to-be-sent packet with the found public network address, and The source port of the first to-be-sent packet is replaced with the determined port, and the modified packet is generated, and the modified packet is sent; wherein the port segment is divided into the second port according to a preset division rule.
  • the first port set, the first port set is a port set for port allocation by the first CGN device
  • the second port set is a port set for port allocation by the second CGN device , said A set of ports and the second port set port identification are not duplicated.
  • the first private network address and the corresponding public network address and the corresponding relationship of the port segment are synchronized to the second CGN device, and specifically includes: Determining, from a port segment allocated for the first private network address, a first port set and a second port set, wherein the first port set is a port set for port allocation by the first CGN device, The second port set is a port set for the second CGN device to perform port allocation, and the port identifiers of the first port set and the second port set are not mutually exclusive; and the second CGN device is synchronized with the first A correspondence between a private network address and an assigned public network address and a port segment, and the second port set.
  • the method further includes: receiving, by the first CGN device, a network address translation NAT translation device Sending a second to-be-sent packet; in the corresponding relationship, searching for a public network address and a port segment corresponding to the source address of the second to-be-sent packet;
  • the source address of the second to-be-sent packet corresponds to the allocated public network address and the search result of the port segment, and the public network address and the port segment are allocated to the source address of the second to-be-sent packet; Determining a first port set and a second port set in the port segment to which the source address of the packet is to be sent; synchronizing the source address of the second to-be-sent packet with the allocated public network address and the port segment to the second CGN device Correspondence relationship, and the second port set.
  • the public information corresponding to the source address of the second to-be-sent packet is The network address and the search result of the port segment
  • the method further includes: determining, from the first port set of the discovered port segment, the port that has not been allocated; replacing the source address of the second to-be-sent packet with the found public And replacing the source port of the second to-be-sent packet with the determined port, generating the modified packet, and sending the modified packet.
  • an address allocation method including:
  • the second carrier-grade network address translation CGN device receives the first to-be-sent packet sent by the network address translation NAT translation device;
  • the second CGN device sends an address allocation request to the first CGN device, based on the public network address and the search result of the port segment corresponding to the source address of the first to-be-sent packet.
  • the address allocation request carries a source address of the first to-be-sent packet;
  • the first CGN device is a pre-agreed device for assigning a public network address and a port segment to a private network address in a CGN dual-master scenario, where the second CGN device is a pre-agreed in the CGN dual-master scenario.
  • the public network address and the search result of the port segment corresponding to the source address of the first to-be-sent packet are corresponding to the corresponding relationship.
  • the method further includes: determining, by the second CGN device, the unallocated port from the second port set of the found port segment; and replacing the source address of the first to-be-sent packet with the found public network Addressing, and replacing the source port of the first to-be-sent packet with the determined port, generating the modified packet, and transmitting the modified packet; wherein the port segment is configured according to a preset division rule Dividing into a first port set, which is a port set for port allocation by the first CGN device, and a second port set, where the second port set is for port allocation by the second CGN device The port set, the port identifier of the first port set and the second port set are not duplicated.
  • the source address of the first to-be-sent packet sent by the first CGN device, the allocated public network address, and the correspondence of the port segment are received.
  • the relationship includes: receiving a source address of the first to-be-sent packet sent by the first CGN device, a correspondence between a public network address and a port segment, and determining, by the first CGN device, from the port segment a second port set, wherein the first CGN device divides the port segment into a first port set and a second port set, the first port set being a port for port allocation by the first CGN device
  • the second port set is a port set for the second CGN device to perform port allocation, and the port identifiers in the first port set and the second port set are not duplicated.
  • the method further includes: receiving another private network address and a public network address sent by the first CGN device Corresponding relationship between the port segment and the second port set determined by the first CGN device from the port segment, wherein the other private network address is a report sent by the NAT translation device received by the first CGN device The source address of the text.
  • a fourth possible implementation of the second aspect based on the correspondence There is a public network address and a search result of the port segment corresponding to the source address of the first to-be-sent packet, where the method further includes: the second CGN device is concentrated from the second port of the found port segment Determining the port that has not been allocated; replacing the source address of the first to-be-sent packet with the public network address that is found, and replacing the source port of the first to-be-sent packet with the determined port, and generating the modified The message is sent and the modified message is sent.
  • a CGN device is provided as the first CGN device, including:
  • a receiving module configured to receive an address allocation request sent by the second CGN device, where the address allocation request carries a first private network address
  • a search module configured to search for a first private network address received by the receiving module, in a correspondence between the recorded private network address, the public network address, and the port segment;
  • An allocating module configured to allocate a public network address and a port segment to the first private network address, and record the foregoing, according to the search result that the first private network address does not exist in the corresponding relationship obtained by the searching module Corresponding relationship between the first private network address and the assigned public network address and the port segment;
  • a sending module configured to synchronize, to the second CGN device, the first private network address and a public network address and a port segment corresponding to the allocation module
  • the CGN device is a device that is configured to allocate a public network address and a port segment for a private network address, and the second CGN device is not pre-set in the CGN dual-master scenario.
  • the method further includes: obtaining a module and a port determining module; the obtaining module, configured to obtain a first to-be-sent packet; the searching module, further And determining, by using the corresponding relationship, a public network address and a port segment corresponding to a source address of the first to-be-sent packet obtained by the obtaining module, where the port determining module is configured to be based on the searching module
  • the public network address and the search result of the port segment corresponding to the source address of the first to-be-sent packet are obtained in the corresponding relationship, and the first port set of the port segment searched by the search module is determined yet.
  • the sending module is further configured to replace the source address of the first to-be-sent packet with a public network address that is found by the searching module, and the source of the first to-be-sent packet
  • the port is replaced with the port determined by the port determining module, and the modified packet is generated, and the modified packet is sent; wherein the port segment is divided into Two-port set and the first set of ports, the first port is set for the present set CGN device port assigned ports, the second port is set for the second sub-port device CGN The port set of the first port set and the port set of the second port set are not duplicated.
  • the allocating module is further configured to determine, by using a port segment allocated for the first private network address, a first port set and a second port The set, wherein the first port set is a port set for port allocation by the CGN device, the second port set is a port set for port allocation by the second CGN device, the first port set and The port identifiers of the second port set are not mutually exclusive; the sending module is specifically configured to synchronize the first private network address and the public network address and the port segment allocated by the allocation module to the second CGN device. Correspondence relationship, and the determined second port set.
  • the receiving module is further configured to receive, by using a network address translation NAT translation device, And a second to-be-sent packet;
  • the searching module is further configured to: in the corresponding relationship, search for a public network address and a port segment corresponding to a source address of the second to-be-sent packet received by the receiving module;
  • the allocation module is further configured to: according to the public network address and the search result of the port segment that are not corresponding to the source address of the second to-be-sent packet, the search result obtained by the searching module is And determining, by the source address of the second to-be-sent packet, a public network address and a port segment; and determining, by the port segment allocated for the source address of the second to-be-sent packet, the first port set and the second port set;
  • the module is further configured to synchronize, to the second CGN device, a source address of the second to-be-sent packet
  • the method further includes: a port determining module, where the port determining module is configured to obtain the The public network address and the search result of the port segment corresponding to the source address of the second to-be-sent packet are in the corresponding relationship, and the unassigned port is determined from the first port set of the port segment found by the searching module.
  • the sending module is further configured to replace the source address of the second to-be-sent packet with the public network address that is found by the searching module, and replace the source port of the second to-be-sent packet with the The port determined by the port determining module generates a modified packet and sends the modified packet.
  • a CGN device is provided as the second CGN device, including:
  • a receiving module configured to receive a first to-be-sent packet sent by the network address translation NAT translation device
  • the search module is used to correspond to the recorded private network address, public network address, and port segment. Querying, in the relationship, whether there is a public network address and a port segment corresponding to the source address of the first to-be-sent packet received by the receiving module;
  • a sending module configured to send, according to the public network address corresponding to the source address of the first to-be-sent packet and the search result of the port segment, the first CGN device to the first CGN device An address allocation request, where the address allocation request carries a source address of the first to-be-sent packet;
  • the receiving module is further configured to receive a source address, a public network address, and a correspondence between the port segments of the first to-be-sent packet sent by the first CGN device for the address allocation request sent by the sending module. ;
  • the first CGN device is a pre-agreed device for allocating a public network address and a port segment for the private network address in the CGN dual-master scenario.
  • the CGN device is a non-private network address pre-agreed in the CGN dual-master scenario.
  • the method further includes: a port determining module, where the port determining module is configured to be based on the corresponding relationship obtained by the searching module
  • the source address of the first to-be-sent packet corresponds to the allocated public network address and the search result of the port segment, and the second port of the port segment found by the searching module determines the port that has not been allocated
  • the sending module also uses And replacing the source address of the first to-be-sent packet with the public network address that is found by the searching module, and replacing the source port of the first to-be-sent packet with the port determined by the port determining module, And generating the modified packet, and sending the modified packet, where the port segment is divided into a first port set and a second port set according to a preset dividing rule, where the first port set is a supply port a port set for port allocation by the first CGN device, the second port set is a port set for port allocation by the CGN device, and the port identifiers of the first
  • the receiving module is configured to receive a source address of the first to-be-sent packet sent by the first CGN device, and a public network a correspondence between the address and the port segment, and a second port set determined by the first CGN device from the port segment, wherein the first CGN device divides the port segment into a first port set and a second port set a port set, the first port set is a port set for port allocation by the first CGN device, and the second port set is a port set for port allocation by the CGN device, the first port set and the port set The port identifiers in the second port set are not duplicated.
  • the receiving module is further configured to receive another private network address and a public network sent by the first CGN device Corresponding relationship between the address and the port segment, and the second port set determined by the first CGN device from the port segment, wherein the other private network address is sent by the NAT translation device received by the first CGN device The source address of the message.
  • the method further includes: a port determining module; a determining module, configured to search for a public network address corresponding to a source address of the first to-be-sent packet and a search result of the port segment in the corresponding relationship obtained by the searching module, and obtain the search result from the searching module
  • the second port of the port segment is configured to determine the port that has not been allocated
  • the sending module is further configured to replace the source address of the first to-be-sent packet with the public network address that is found by the searching module, and The source port of the first to-be-sent packet is replaced with the port determined by the port determining module, and the modified packet is generated, and the modified packet is sent.
  • a fifth aspect of the present invention provides a CGN dual-master system, comprising: the CGN device according to any one of the possible implementations of the third aspect or the third aspect, and any possible implementation of the fourth aspect or the fourth aspect The CGN device described in the manner.
  • a CGN device is provided as the first CGN device, including:
  • a network interface configured to receive an address allocation request sent by the second CGN device, where the address allocation request carries a first private network address
  • a processor configured to search for a first private network address received by the network interface, in a correspondence between the recorded private network address, the public network address, and the port segment, where the first private network address is not included in the correspondence relationship;
  • the first private network address is searched for, and the public network address and the port segment are allocated to the first private network address, and the corresponding relationship between the first private network address and the assigned public network address and the port segment is recorded;
  • the network interface is further configured to synchronize, to the second CGN device, the correspondence between the first private network address and the public network address and the port segment allocated by the processor;
  • the CGN device is a device that is configured to allocate a public network address and a port segment for a private network address, and the second CGN device is not pre-set in the CGN dual-master scenario.
  • the processor is further configured to: in the corresponding relationship, look for whether there is a public network address corresponding to a source address of the first to-be-sent packet obtained by the network interface.
  • the network interface is further configured to replace the source address of the first to-be-sent packet with a public network address that is searched by the processor, and replace the source port of the first to-be-sent packet with the processing
  • the port determined by the device, the modified packet is sent, and the modified packet is sent; wherein the port segment is divided into a second port set and the first port set according to a preset dividing rule,
  • the first port set is a port set for port allocation by the CGN device
  • the second port set is a port set for port allocation by the second CGN device
  • the first port set and the second port set are End Identification are not duplicated.
  • the processor is further configured to determine a first port set and a second port from a port segment allocated for the first private network address The set, wherein the first port set is a port set for port allocation by the CGN device, the second port set is a port set for port allocation by the second CGN device, the first port set and The port identifiers of the second port set are not duplicated; the network interface is specifically configured to synchronize the first private network address with the public network address and the port segment allocated by the processor to the second CGN device. Correspondence relationship, and the determined second port set.
  • the network interface is further configured to receive a network address translation NAT translation device And a second to-be-sent packet;
  • the processor is further configured to: in the corresponding relationship, search for a public network address and a port segment corresponding to a source address of the second to-be-sent packet received by the network interface; And a public network address is allocated to the source address of the second to-be-sent packet, and the public network address and the port segment search result corresponding to the source address of the second to-be-sent packet are not included in the corresponding relationship.
  • a first port set and a second port set are determined from a port segment allocated for a source address of the second to-be-sent packet; the network interface is further configured to synchronize with the second CGN device Determining, by the source address of the second to-be-sent packet, a correspondence between the public network address and the port segment allocated by the processor, and the second port set.
  • the processor is further configured to: The source address of the packet corresponds to the allocated public network address and the search result of the port segment, and the port that has not been allocated is determined from the first port of the discovered port segment; the network interface is further configured to send the second to be sent The source address of the packet is replaced with the public network address that is found by the processor, and the source port of the second to-be-sent packet is replaced with the port determined by the processor, and the modified packet is generated and sent. The modified message.
  • a CGN device is provided as the second CGN device, including:
  • a network interface configured to receive a first to-be-sent packet sent by the network address translation NAT translation device
  • a processor configured to search for a public network address corresponding to a source address of the first to-be-sent packet received by the network interface, in a correspondence between the recorded private network address, the public network address, and the port segment And port segments;
  • the network interface is further configured to: according to the public network address corresponding to the source address of the first to-be-sent packet and the search result of the port segment, the first CGN device is not present in the corresponding relationship obtained by the processor Sending an address allocation request, where the address allocation request carries a source address of the first to-be-sent packet;
  • the network interface is further configured to receive, by the first CGN device, the source address, the public network address, and the port segment of the first to-be-sent packet sent by the address allocation request sent by the network interface.
  • the first CGN device is a pre-agreed device for allocating a public network address and a port segment for the private network address in the CGN dual-master scenario.
  • the CGN device is a non-private network address pre-agreed in the CGN dual-master scenario.
  • the processor is further configured to: based on the corresponding relationship, a public address corresponding to a source address of the first to-be-sent packet The network address and the port segment search result, the second port of the discovered port segment is determined to be the unallocated port; the network interface is further configured to replace the source address of the first to-be-sent packet with the The public network address that is found by the processor, and the source port of the first to-be-sent packet is replaced with the port determined by the processor, the modified packet is generated, and the modified packet is sent; And dividing the port segment into a first port set and a second port set according to a preset dividing rule, where the first port set is a port set for port allocation by the first CGN device, and the second port set It is a port set for port allocation by the CGN device, and the port identifiers of the first port set and the second port set are not duplicated.
  • the network interface is configured to receive a source address of the first to-be-sent packet sent by the first CGN device, and a public network a correspondence between the address and the port segment, and a second port set determined by the first CGN device from the port segment, wherein the first CGN device divides the port segment into a first port set and a second port set a port set, the first port set is a port set for port allocation by the first CGN device, and the second port set is a port set for port allocation by the CGN device, the first port set and the port set The port identifiers in the second port set are not duplicated.
  • the network interface is further configured to receive another private network address and a public network sent by the first CGN device Corresponding relationship between the address and the port segment, and the second port set determined by the first CGN device from the port segment, wherein the other private network address is sent by the NAT translation device received by the first CGN device The source address of the message.
  • the processor is further used to The public network address and the search result of the port segment corresponding to the source address of the first to-be-sent packet are in the corresponding relationship, and the port that has not been allocated is determined from the second port of the port segment that is found by the searching module.
  • the network interface is further configured to replace the source address of the first to-be-sent packet with a public network address that is searched by the processor, and replace the source port of the first to-be-sent packet with the The port determined by the processor generates a modified packet and sends the modified packet.
  • the eighth aspect provides a CGN dual-master system, including: the CGN device according to any one of the sixth aspect or the sixth aspect, and any one of the foregoing seventh or seventh aspect The CGN device described in the implementation.
  • An address allocation method, a CGN device, and a CGN dual-master system provided by the embodiment of the present invention include: in a CGN dual-master scenario, pre-agreed to determine that the first CGN device is used to perform a public network address and a port for a private network address.
  • the device assigned by the segment determines the second CGN device as a device that does not perform public network address and port segment allocation for the private network address.
  • the second CGN device receives the first to-be-sent packet sent by the NAT device, it searches for the first packet to be sent in the corresponding relationship between the recorded private network address, the public network address, and the port segment.
  • the first CGN device is the first CGN device. Assigning a public network address and a port segment to a private network address, and recording a correspondence between the first private network address and the assigned public network address and the port segment; and synchronizing the first private network address and the assigned public network address with the second CGN device; Correspondence of port segments.
  • the address allocation method provided by the embodiment of the present invention determines that one CGN device (the first CGN device) is configured to perform public network address and port segment allocation for a private address, and another CGN in two CGN devices in a CGN dual-master scenario.
  • the device (the second CGN device) does not allocate the public network address and the port segment for the private address. This prevents the two CGN devices from assigning different public network addresses and port segments to the same private network address without having to synchronize.
  • a private network address can be assigned only one public network address and one port segment to ensure traceability consistency and avoid waste of public address resources and port resources.
  • FIG. 1 is a schematic diagram of a scenario in which a CGN device uses NAT 444 in a CGN dual-main scene according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of an address allocation method applied to a first CGN device side according to an embodiment of the present invention
  • FIG. 3 is a flowchart of an address allocation method applied to a second CGN device side according to an embodiment of the present disclosure
  • FIG. 4 is a flowchart of an address allocation method according to Embodiment 1 of the present invention, applied to a first CGN device side;
  • FIG. 5 is a flowchart of an address allocation method according to Embodiment 2 of the present invention, applied to a second CGN device side;
  • FIG. 6 is a flowchart of an address allocation method according to Embodiment 3 of the present invention, applied to a first CGN device side;
  • FIG. 7 is a flowchart of an address allocation method according to Embodiment 4 of the present invention, applied to a second CGN device side;
  • FIG. 8 is a schematic diagram of data flow of an address allocation method according to an embodiment of the present invention.
  • FIG. 9 is a second schematic diagram of a data flow of an address allocation method according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of one of CGN devices according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a second CGN device according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of a third CGN device according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic structural diagram of a fourth CGN device according to an embodiment of the present invention.
  • the embodiments of the present invention provide an address allocation method, a CGN device, and a CGN dual-master system.
  • the preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only for illustration and explanation. The present invention is not intended to limit the invention. And in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
  • FIG. 1 is a schematic diagram of a technical scenario in which a CGN device uses NAT 444 in a dual-main scene of a CGN in the prior art.
  • the terminal device 1 and the terminal device 2 access the network through the routing device 1
  • the terminal device 3 and the terminal device 4 access the network through the routing device 2
  • the terminal device 1 and the terminal device 2 access through the user.
  • the device (CPE, Customer Premises Equipment) uses the NAT44 technology to complete the conversion of the first layer IP address.
  • the terminal device 3 and the terminal device 4 use the NAT44 technology to complete the conversion of the first layer IP address through the CPE2, that is, the addresses of the multiple terminals are converted into A private network address, and the packet with the private network address as the source address is transmitted to the CGN device A or the CGN device B.
  • the CGN device A and the CGN device B can allocate a public network address and a port segment to the private network address in the following manner: after the CGN device A or the CGN device B receives the packet with the private network address as the source address,
  • the stored user table is configured to store the private network address and the corresponding public network address and the port segment allocated for the private network address, and determine whether the public network address has been assigned to the private network address. If the related entry is found, the source address of the packet is replaced with the public network address assigned to the private network address, and the source port of the packet is replaced with the private address.
  • the address and the assigned public network address and the port segment are stored in the user table, so that when a packet with the private address as the source address needs to be sent, the port that has not been allocated is determined from the port segment allocated for the private address, and Replace the source address of the packet with the assigned public network address. And replacing the source port of the packet with the determined port, and sending the packet obtained after the replacement.
  • the embodiment of the present invention provides an address allocation method, which is applied to the first CGN device side, as shown in FIG. 2, and includes:
  • the first CGN device receives an address allocation request sent by the second CGN device, where
  • the address allocation request carries the first private network address.
  • the first CGN device searches for the first private network address received in S201 in the corresponding relationship between the recorded private network address, the public network address, and the port segment.
  • the first CGN device allocates a public network address and a port segment to the first private network address according to the search result of the first private network address, and records the first private network address and the allocated public network address. Correspondence of port segments.
  • the embodiment of the present invention further provides an address allocation method, which is applied to the second CGN device side, as shown in FIG. 3, and includes:
  • the second CGN device receives the first to-be-sent packet sent by the NAT translation device.
  • the second CGN device sends an address allocation request to the first CGN device according to the public network address and the search result of the port segment corresponding to the source address of the first to-be-sent packet.
  • the address allocation request is used to request a public network address and a port segment corresponding to the source address of the first to-be-sent packet.
  • S304 Receive a correspondence between a source address of the first to-be-sent packet sent by the first CGN device, an allocated public network address, and a port segment.
  • the address allocation process of the CGN device in the embodiment of the present application is similar to the triggering time of the address allocation process in the prior art.
  • the address allocation process determines that the packet is a new session according to the session table in which the session quintuple ⁇ source address, source port, destination address, destination port, protocol type> is established. Executed after the first message.
  • the first CGN device is a pre-agreed device for allocating a public network address and a port segment for the private network address in the CGN dual-master scenario
  • the second CGN device is a non-private network address pre-agreed in the CGN dual-master scenario.
  • the CGN device A and the CGN device B have no difference in function, and both have the function of assigning a public network address and an address segment to a private network address.
  • the CGN device A is a device for allocating a public network address and a port segment for a private network address
  • the CGN device B is not a device for allocating a public network address and a port segment for the private network address.
  • the CGN device A can be used as the first CGN device provided in the embodiment of the present invention, and the CGN device B is used as the second CGN device provided in the embodiment of the present invention; when the CGN device B is used to allocate a public network for the private network address For the device of the address and the port segment, if the CGN device A is not the device that allocates the public network address and the port segment for the private network address, the CGN device B can be used as the first CGN device provided in the embodiment of the present invention, and the CGN device A is used as the local device.
  • a second CGN device provided in an embodiment of the invention.
  • the CGN device that is the first CGN device in the CGN device A and the CGN device B can allocate the public network address and the port segment for the private network address, so that the CGN device A
  • the CGN device B does not allocate different public network addresses and port segments for the same private network address, meets the requirement of traceability consistency, and avoids waste of resources.
  • an address allocation method is provided, which is applied to the first CGN device side.
  • the first CGN device and the second CGN device are mutually non-repeatingly used for mapping the private network address.
  • the port set of the port, and the division of the port set is implemented by a pre-divided form. As shown in FIG. 4, the following steps are specifically included:
  • the first CGN device receives an address allocation request sent by the second CGN device, where the address allocation request carries the first private network address.
  • the first CGN device searches for the first private network address received in S401 in the corresponding relationship between the recorded private network address, the public network address, and the port segment. If yes, the process proceeds to step S404. If not, the process proceeds to step S404. Go to step S403.
  • the correspondence between the private network address, the public network address, and the port segment may be recorded in the user table.
  • the first private network address may be searched from the user table.
  • the first CGN device allocates a public network address and a port segment to the first private network address, and records a correspondence between the first private network address and the allocated public network address and the port segment.
  • the first private network address and the assigned public network address are not found in the corresponding relationship between the private network address, the public network address, and the port segment. And the correspondence between the port segments is recorded in the user table.
  • the steps S401 to S403 include: searching for the existence of the source address in the corresponding relationship between the recorded private network address, the public network address, and the port segment; and the search result of the source address does not exist in the corresponding relationship, Assigning a public network address and a port segment to the source address, and recording a correspondence between the source address and the assigned public network address and the port segment; and synchronizing the source address and the corresponding assigned public network address and port with the second CGN device The correspondence of the segments.
  • the public network address and the port segment that are allocated to the second CGN device may be synchronized according to the preset synchronization rule. For example, after the public network address and the port segment are allocated for each private network address, the second CGN device is synchronized, or the public network address and the port segment are allocated for the preset number of private network addresses, and then the second CGN is applied. The device synchronizes, or according to the preset synchronization period, when the synchronization period comes, the second CGN device synchronizes the public network address and the port segment allocated in the current period and the corresponding private network address.
  • the first CGN device obtains a first to-be-sent message.
  • the first CGN device may obtain the first to-be-sent packet by using the NAT translation device, that is, the NAT translation device may send the first to-be-sent packet to the first CGN device.
  • the first CGN device determines, from the first port set of the discovered port segment, the port that has not been allocated.
  • the port segment is divided into a first port set and a second port set according to a preset dividing rule, where the first port set is a port set for the first CGN device to perform port allocation, and the second port set is used by the second CGN device.
  • the port set assigned by the port, the port identifiers in the first port set and the second port set are not duplicated.
  • the port segment allocated for the source address (private network address) of the packet sent by the NAT translation device or the port segment allocated for the first private network address sent by the second CGN device is allocated to all private networks.
  • the port segment of the address needs to be divided into mutually non-repeating port sets according to the preset division rule.
  • the first CGN device and the second CGN device can use the ports of the corresponding port sets to perform port allocation.
  • the slave CGN device Before the resource allocation information is synchronized to the slave CGN device, there is another data stream 1.1.1.1: 90- ⁇ baidu.com is offloaded to the slave CGN device, and the slave CGN device may also allocate the data stream with the master CGN device.
  • the same resources of the resource namely the public network IP address 10.1.1.1 and port resource 2050, then the mapping relationship obtained is 1.1.1.1:90[10.1.1.1:2050]-- ⁇ baidu.com.
  • the public network address and the port overlap occur, causing confusion when the backhaul message is converted to the private network IP address, that is, when receiving the packet from 10.1.1.1:2050.
  • the packet cannot be forwarded to 1.1.1.1:80 or forwarded to 1.1.1.1:90.
  • the correct forwarding of the backhaul packet cannot be guaranteed.
  • the address allocation method provided by the embodiment of the present invention divides the private address allocation port segment into mutually non-repeating port sets for the first CGN device and the second CGN device to perform port allocation according to a preset division rule.
  • the first CGN device and the second CGN device do not map the overlapping public address and port for the private network address, and ensure the backhaul message. Forward correctly.
  • the preset dividing rule may be set according to an actual situation, and is pre-agreed with both the first CGN device and the second CGN device, so that both the first CGN device and the second CGN device are aware of a part of the port segment corresponding to the first CGN device.
  • the port segment can be divided into two consecutive segments of the port number, so that the first segment is allocated for the first CGN device, the latter segment is allocated for the second CGN device, or the latter segment is allocated for the second CGN device.
  • the first CGN device For the first CGN device to allocate, for example, for the port segment [2049 ⁇ 2304], [2049 ⁇ 2177] for the first CGN device to allocate, [2178 ⁇ 2304] for the second CGN device for allocation; or, can make The odd port number in the port segment is allocated by the first CGN device, the even port number is allocated for the second CGN device, or the even port number in the port segment is allocated for the first CGN device, and the odd port number is for the second CGN device. Assignment, etc.
  • S410 Replace the source address of the first to-be-sent packet with the public network address corresponding to the source address of the first to-be-sent packet, and replace the source port of the first to-be-sent packet with the port determined by S409, and generate the modified The message is sent and the modified message is sent.
  • the port segment corresponding to the source address of the first to-be-sent packet may be the discovered port segment, and the first to-be-sent packet
  • the public network address corresponding to the source address may be the public network address that is found.
  • the port segment corresponding to the source address of the first packet to be sent may be based on the result that the source address of the first to-be-sent packet does not exist in the corresponding relationship.
  • the public network address corresponding to the source address of the first packet to be sent may be the assigned public network address.
  • steps S401 to S404 and the execution of steps S405 to S410 are not strictly sequential, and the execution of steps S407 to S408 and the execution of steps S409 to S410 are not strictly sequential.
  • Embodiment 2 of the present invention an address allocation method is provided, which is applied to the second CGN device side.
  • Embodiment 2 as shown in FIG. 5, the following steps are specifically included:
  • the second CGN device receives the first to-be-sent packet sent by the NAT translation device.
  • S502 Searching for the public network address and the port segment corresponding to the source address of the first to-be-sent packet received in S501, if the mapping between the recorded private network address, the public network address, and the port segment is performed, If not, the process proceeds to step S503, and if yes, the process proceeds to step S505.
  • the second CGN device sends an address allocation request to the first CGN device.
  • the address allocation request is used to request a public network address and a port segment corresponding to the source address of the first to-be-sent packet.
  • the first CGN device may be the source address of the first to-be-sent packet.
  • the public network address and the port segment are allocated but have not been synchronized to the second CGN device.
  • the first CGN device may not be assigned a public network address and a port segment for the source address of the first to-be-sent packet.
  • the private network address is assigned to the public network address and the port segment. Therefore, the second CGN device needs to send an address allocation request to the first CGN device.
  • the first CGN device can synchronize the assigned public network address and the port segment to the second CGN device. If the first CGN device does not allocate the public network address and the port segment for the private network address, the first The CGN device allocates a public network address and a port segment to the private network address, and synchronizes the assigned public network address and port segment to the second CGN device.
  • the pre-allocated port segment length is 256, that is, the port is pre-allocated into the following port segment format: [2049 ⁇ 2304], [2305 ⁇ 2561], ..., [65279 ⁇ 65535] .
  • the data stream from CPE1 192.1.1.2:80-- ⁇ sina.com is offloaded to CGN device A, and the private network IP address of 192.1.1.2 is not found in the user table of CGN device A, that is to say the private
  • the IP address of the network is online for the first time.
  • the public network IP address and the port segment are not assigned to the IP address of the private network.
  • CGN device A can assign the public IP address 10.1.1.1 and the public network port segment to the private network IP address [1029 ⁇ 2304]. After CGN device A assigns the port segment resource to the private network IP address, the newly assigned information has not been synchronized to CGN device B. At this time, CGN device B may receive 192.1.1.2:90-- ⁇ sohu from CPE2. The .com data packet is also the first time to log in on CGN device B because of 192.168.1.1.2. The private network IP address of 192.1.1.2 is not found in the user table of CGN device B. Similarly, CGN device B needs to be the private network. The IP address is assigned to the public network address and port segment resources. The CGN device B can allocate a public network IP address 10.1.1.2 and a public network port segment [2305 to 2561] for the private network IP address.
  • the private network IP address 192.1.1.2 obtains two different public IP addresses and port segment resources, which cannot guarantee the consistency of traceability.
  • the situation in the above scenario also causes public network address resources and Waste of port resources.
  • Address assigner provided by embodiment of the present invention In the CGN device A and the CGN device B, only the CGN device serving as the first CGN device can assign a public network address and a port segment to the private network address, and the CGN device serving as the second CGN device receives the private network address as the source. If the address is a packet, and the public network address and the port segment allocated for the private network address are not found in the user table, the address allocation request may be sent to the first CGN device to request the first CGN device as the private message.
  • the network address is assigned to the public network address and the port segment, and the assigned public network address and the port segment are synchronized to the second CGN device, so that different public network addresses and port segments are not allocated for the same private network address, which satisfies the traceability consistency. Requirements and avoiding waste of resources.
  • the second CGN device determines, from the second port set of the port segment corresponding to the source address of the first to-be-sent packet, the port that has not been allocated.
  • the second CGN device does not allocate a public network address and a port segment for the private network address in the CGN dual-master scenario, but needs to map the public network address to the source address (private network address) of the received packet, and receive the public network address.
  • the source port of the packet is mapped to the port in the port set.
  • the method further includes: receiving, by the second CGN device The private address sent by the first CGN device and the corresponding public network address and port segment, and according to the preset division rule, the second CGN device can determine the second port set in the port segment for self-allocation.
  • an address allocation method is provided, which is applied to the first CGN device side.
  • the first CGN device and the second CGN device are mutually non-repeatingly used for mapping the private network address.
  • the port set of the port, and the division of the port set is determined by the first CGN device. As shown in FIG. 6, the method specifically includes the following steps:
  • the first CGN device receives an address allocation request sent by the second CGN device, where
  • the address allocation request carries the first private network address.
  • the first CGN device records the private network address, the public network address, and the port segment. In the corresponding relationship, it is found whether there is a first private network address carried in the address allocation request received in S601. If yes, the process goes to step S605. If not, the process goes to step S603.
  • the first CGN device allocates a public network address and a port segment to the first private network address, and records a correspondence between the first private network address and the allocated public network address and the port segment.
  • the first port set is a port set for the first CGN device to perform port allocation
  • the second port set is a port set for the second CGN device to perform port allocation
  • the port identifiers of the first port set and the second port set are not mutually repeat.
  • the first CGN device receives the second to-be-sent packet sent by the NAT translation device.
  • step S607 searching for the public network address and the port segment corresponding to the source address of the second to-be-sent packet received in S606, if the corresponding relationship between the recorded private network address, the public network address, and the port segment is found, If yes, go to step S611, if not, go to step S608.
  • S609. Determine, from S608, a first port set and a second port set in a port segment allocated for a source address of the second to-be-sent packet.
  • S610 Synchronize, to the second CGN device, a source address of the second to-be-sent packet, an allocated public network address, a correspondence between the port segments, and a second port set.
  • the port segment allocated for the source address (private network address) of the packet sent by the NAT translation device, or the port segment allocated for the private network address to be allocated sent by the second CGN device is allocated to all private networks.
  • the port segment of the address needs to be divided into mutually non-repeating port sets according to the preset division rule.
  • the first CGN device and the second CGN device can use the ports of the corresponding port sets to perform port allocation.
  • the first CGN device may divide the port segment into a non-repeating port set according to a preset dividing rule, and send the port set allocated for the second CGN device to the second CGN device.
  • the port segment can be divided into two consecutive segments of the port number, so that the first segment is allocated for the first CGN device, the latter segment is allocated for the second CGN device, or the latter segment is allocated for the second CGN device.
  • the first CGN device For the first CGN device to allocate, for example: for the port segment [2049 ⁇ 2304], [2049 ⁇ 2177] is allocated for the first CGN device, [2178 ⁇ 2304] is allocated for the second CGN device; or, the odd port number in the port segment can be allocated for the first CGN device, even port The number is allocated for the second CGN device, or the even port number in the port segment is allocated for the first CGN device, and the odd port number is allocated for the second CGN device.
  • the division of specific port sets is difficult to enumerate here, as long as the port sets are not duplicated.
  • step S605 and step S608 the assigned public network address and the port segment and the port set for the second CGN device mapping determined by the first CGN device may be synchronized to the second CGN device according to the preset synchronization rule.
  • a public network address and a port segment may be allocated to a second CGN device after each of the private network addresses to be assigned, or a public network address and a port segment may be allocated to a preset number of private network addresses, and then synchronized.
  • the second CGN device or according to the preset synchronization period, synchronizes the public network address and the port segment allocated in the current period and the corresponding private network address to the second CGN device when the synchronization period comes. That is to say, the execution of the synchronization in step S605 and step S608 may be performed in two synchronization processes, or may be completed in one synchronization process.
  • steps S601 to S605 and the execution of steps S606 to S608 are not strictly sequential.
  • the port segment corresponding to the source address of the second to-be-sent packet may be the discovered port segment, and the second to-be-sent packet
  • the public network address corresponding to the source address may be the public network address that is found, and the port segment corresponding to the source address of the second to-be-sent packet may be obtained based on the result that the source address of the second to-be-sent packet does not exist in the corresponding relationship.
  • the public network address corresponding to the source address of the second packet to be sent may be the assigned public network address.
  • steps S601 to S605 and the execution of steps S606 to S612 are not strictly sequential, and the execution of steps S608 to S610 and steps S611 to S612 are not strictly sequential.
  • Embodiment 4 of the present invention an address allocation method is provided, which is applied to the second CGN device side.
  • Embodiment 4 as shown in FIG. 7, the following steps are specifically included:
  • the second CGN device receives the first to-be-sent packet sent by the NAT translation device.
  • step S702 searching for the public network address and the port segment corresponding to the source address of the first to-be-sent packet received in S701, if the corresponding relationship between the recorded private network address, the public network address, and the port segment is found, If not, the process proceeds to step S703, and if yes, the process proceeds to step S705.
  • the second CGN device sends an address allocation request to the first CGN device.
  • the address allocation request is used to request a public network address and a port segment corresponding to the source address of the first to-be-sent packet.
  • the first CGN device divides the port segment into a first port set and a second port set, where the first port set is a port set for the first CGN device to perform port allocation, and the second port set is for the second CGN device to perform port port.
  • the assigned port set, the port identifiers in the first port set and the second port set are not duplicated.
  • S706 Replace the source address of the first to-be-sent packet with the public network address corresponding to the source address of the first to-be-sent packet, and replace the source port of the first to-be-sent packet with the port determined in S705. The message and send the modified message.
  • S707 Receive a correspondence between another private network address sent by the first CGN device and the allocated public network address and the port segment, and a second port set determined by the first CGN device from the port segment.
  • the other private network address is the source address of the packet sent by the NAT translation device received by the first CGN device.
  • step S704 and step S707 the public network address and the port segment that are synchronously allocated by the first CGN device to the second CGN device according to the preset synchronization rule, and the mapping determined by the first CGN device for the second CGN device Port set. Then, the steps received in step S704 and step S707 may be completed in two synchronization processes, or may be completed in one synchronization process.
  • steps S701 to S706 and the execution of step S707 are not strictly sequential.
  • FIG. 8 is a schematic diagram of a data flow of an address allocation method according to an embodiment of the present invention.
  • the data stream 801 represents that the second CGN device receives a packet whose source address is a private network address, and Finding a public network address and a port segment allocated to the private network address, sending an address allocation request to the first CGN device, and receiving, by the second CGN device, a public network address corresponding to the private network address sent by the first CGN device, and After the port segment, record the correspondence between the public network address and the port segment corresponding to the private network address, and determine that the port mapped for the packet forwards the packet; the data stream 802 indicates that the second CGN device subsequently receives the source address.
  • the packet of the private network address can be used to find the public network address and the port segment corresponding to the private network address, and forward the packet without sending the address allocation request to the first CGN device again.
  • the same private network address is not assigned to different public network addresses and port segments, ensuring consistency of traceability and avoiding waste of public network address resources and port resources.
  • FIG. 9 is a second schematic diagram of a data flow of an address allocation method according to an embodiment of the present invention.
  • the data stream 901 represents that the source address is received by the first CGN device as a private network address (for example, 192.168.0.1).
  • the public network address and the port segment corresponding to the recorded private network address, and the port set mapped by the first CGN device are determined from the port set as the report.
  • the data stream 902 is characterized by the public network address and the port corresponding to the recorded private network address after the second CGN device receives the packet with the same private network address (for example, 192.168.0.1).
  • a segment, and a port set for mapping by the second CGN device (eg, [2177 ⁇ 2304]), from which the port mapped to the message is determined.
  • the first CGN device and the second CGN device do not map the overlapping public address and port of the private network address, and ensure correct forwarding of the backhaul message.
  • the embodiment of the present invention further provides a CGN device and a CGN dual host system. Since the principles of the problems solved by the devices and systems are similar to the foregoing address allocation method, the implementation of the device and system can be referred to the foregoing method. The implementation, repetitions will not be repeated.
  • One of the CGN devices provided by the embodiment of the present invention is configured to perform the functions of the first CGN device, the application scenario, and the connection relationship with other devices, such as the second CGN device and the NAT device.
  • the mutual message exchange process can refer to the description in the foregoing method embodiment.
  • the CGN device includes the following modules:
  • the receiving module 1001 is configured to receive an address allocation request sent by the second CGN device, where the address allocation request carries the first private network address;
  • the searching module 1002 is configured to search for the first private network address received by the receiving module 1001 in the corresponding relationship between the recorded private network address, the public network address, and the port segment.
  • the allocating module 1003 is configured to allocate a public network address and a port segment to the first private network address according to the search result of the first private network address in the corresponding relationship obtained by the searching module 1002, and record Corresponding relationship between the first private network address and the assigned public network address and the port segment;
  • the sending module 1004 is configured to synchronize, to the second CGN device, the first private network address and the public network address and the corresponding relationship of the port segment allocated by the allocating module 1003;
  • the CGN device is a device that is configured to allocate a public network address and a port segment for a private network address, and the second CGN device is not pre-set in the CGN dual-master scenario.
  • the receiving module 1001 receives the address allocation request sent by the second CGN device, and the searching module 1002 searches for the first private network address carried in the allocation request, and the searching module 1003 obtains the first private result according to the searching result obtained by the searching module 1002.
  • the network address is assigned to the public network address and the port segment, and the sending module 1004 synchronizes the first private network address with the second CGN device and the assigned public network address and the address allocation process of the port segment. S404.
  • the CGN device further includes: an obtaining module 1005 and a port determining module 1006;
  • the obtaining module 1005 is configured to obtain a first to-be-sent message
  • the searching module 1002 is further configured to: in the corresponding relationship, search for a public network address and a port segment corresponding to a source address of the first to-be-sent packet obtained by the obtaining module 1005;
  • the port determining module 1006 is configured to: based on the public network address and the search result of the port segment that are corresponding to the source address of the first to-be-sent packet, in the corresponding relationship that is obtained by the searching module 1002, The first port set of the port segment found by the lookup module 1002 determines the port that has not been allocated;
  • the sending module 1004 is further configured to replace the source address of the first to-be-sent packet with the public network address that is found by the searching module 1002, and replace the source port of the first to-be-sent packet with The port determined by the port determining module 1006 generates a modified packet and sends the modified packet.
  • the port segment is divided into a second port set and the first end according to a preset dividing rule.
  • a port set the first port set is a port set for port allocation by the CGN device
  • the second port set is a port set for port allocation by the second CGN device
  • the port identifiers in the second port set are not duplicated.
  • the obtaining module 1005 obtains the first to-be-sent packet
  • the search module 1002 searches for the public network address and the port segment corresponding to the source address of the first to-be-sent packet
  • the port determining module 1006 obtains the search result according to the searching module 1002.
  • the method for determining the available port from the first port to be the first to be sent packet, and the sending module 1004 to replace the source address and the source port with the modified message please participate in the steps of Embodiment 1 of the present invention. S405 to step 410.
  • the allocating module 1003 is further configured to determine, from a port segment allocated for the first private network address, a first port set and a second port set, where the first port set is for the CGN device a port set for port allocation, the second port set is a port set for the second CGN device to perform port allocation, and the port identifiers of the first port set and the second port set are not duplicated;
  • the sending module 1004 is specifically configured to synchronize, to the second CGN device, the first private network address and the public network address and the correspondence between the port segments allocated by the allocating module 1003, and the determined second port. set.
  • the receiving module 1001 receives the address allocation request sent by the second CGN device, and the searching module 1002 searches for the first private network address carried in the allocation request, and the searching module 1003 obtains the first private result according to the searching result obtained by the searching module 1002.
  • the network address is assigned a public network address and a port segment, and the port segment is divided into a first port set and a second port set, and the sending module 1004 synchronizes the first private network address with the assigned public network address and port segment to the second CGN device.
  • the address allocation process of the second port set please participate in steps S601 to S605 of the third embodiment of the present invention.
  • the receiving module 1001 is further configured to receive a second to-be-sent packet sent by the network address translation NAT translation device;
  • the searching module 1002 is further configured to: in the corresponding relationship, search for a public network address and a port segment corresponding to a source address of the second to-be-sent packet received by the receiving module 1001;
  • the allocation module 1003 is further configured to: based on the public network address and the search result of the port segment corresponding to the source address of the second to-be-sent packet, that is not found in the correspondence relationship that is obtained by the searching module 1002, Determining, by the source address of the second to-be-sent packet, a public network address and a port segment; and determining, by the port segment allocated for the source address of the second to-be-sent packet, the first port set and the second port set;
  • the sending module 1004 is further configured to synchronize, to the second CGN device, a source address of the second to-be-sent packet, a public network address allocated by the allocating module 1003, and a correspondence between the port segments, and the first Two port set.
  • the CGN device further includes: a port determining module 1006;
  • the port determining module 1006 is configured to: based on the public network address and the search result of the port segment that are corresponding to the source address of the second to-be-sent packet, in the corresponding relationship that is obtained by the searching module 1002, The first port set of the port segment found by the lookup module 1002 determines the port that has not been allocated;
  • the sending module 1004 is further configured to replace the source address of the second to-be-sent packet with the public network address that is found by the searching module 1002, and replace the source port of the second to-be-sent packet with The port determined by the port determining module 1006 generates a modified packet and sends the modified packet.
  • the receiving module 1001 receives the second to-be-sent packet sent by the NAT conversion device, and the search module 1002 searches for the source address of the second to-be-sent packet in the corresponding relationship, and the distribution module 1003 obtains the message according to the searching module 1002.
  • the result of the search is that the source address of the second to-be-sent packet is assigned a public network address and a port segment, and the allocated port segment is divided into a first port set and a second port set, and is synchronized by the sending module 1004 to the second CGN device.
  • a second embodiment of the carrier-grade network address translation CGN device provided by the embodiment of the present invention is configured to perform the function of the second CGN device described in the foregoing method embodiment, and the application scenario thereof and other devices, such as the first CGN device.
  • the CGN device includes:
  • the receiving module 1101 is configured to receive a first to-be-sent packet sent by the network address translation NAT translation device.
  • the locating module 1102 is configured to search, in the correspondence between the recorded private network address, the public network address, and the port segment, whether there is a public address corresponding to the source address of the first to-be-sent packet received by the receiving module 1101. Network address and port segment;
  • the sending module 1103 is configured to: according to the correspondence relationship obtained by the searching module 1102, there is no public network address corresponding to the source address of the first to-be-sent packet, and a search result of the port segment And sending an address allocation request to the first CGN device, where the address allocation request carries a source address of the first to-be-sent packet;
  • the receiving module 1101 is further configured to receive a source address, a public network address, and a port segment of the first to-be-sent packet sent by the first CGN device for the address allocation request sent by the sending module 1103. Correspondence relationship
  • the first CGN device is a pre-agreed device for allocating a public network address and a port segment for the private network address in the CGN dual-master scenario.
  • the CGN device is a non-private network address pre-agreed in the CGN dual-master scenario.
  • the CGN device further includes: a port determining module 1104;
  • the port determining module 1104 is configured to: based on the public network address and the search result of the port segment that are corresponding to the source address of the first to-be-sent packet, in the corresponding relationship that is obtained by the searching module 1102, The second port of the port segment found by the lookup module 1102 determines the port that has not been allocated;
  • the sending module 1103 is further configured to replace the source address of the first to-be-sent packet with the public network address that is found by the searching module 1102, and replace the source port of the first to-be-sent packet with The port determined by the port determining module 1104 generates a modified packet and sends the modified packet.
  • the port segment is divided into a first port set and a second port set according to a preset dividing rule, where the first port set is a port set for port allocation by the first CGN device, and the second port is The set is a port set for port allocation by the CGN device, and the port identifiers of the first port set and the second port set are not duplicated.
  • the receiving module 1101 receives the first to-be-sent packet sent by the NAT translation device, and the searching module 1102 searches for the source address of the first to-be-sent packet in the corresponding relationship, and the sending module 1103 does not find the information according to the searching module 1102.
  • the result of the search of the source address sends an address allocation request to the first CGN device, and the receiving module 1101 receives the public network address and port segment that is replied by the first CGN device for the source address, and the port determining module 1104 is configured from the allocated port segment.
  • the second port is configured to determine the port in a centralized manner, and the address allocation process for transmitting the packet of the source address and the source port is modified by the sending module 1103 to participate in steps S501 to S506 of the second embodiment of the present invention.
  • the receiving module 1101 is configured to receive, by the first CGN device, a source address of the first to-be-sent packet, a public network address, and a correspondence between port segments, and the a second port set determined by the first CGN device from the port segment, wherein the first CGN device divides the port segment into a first port set and a second port set, the first port set is for a port set for port allocation by the first CGN device, the second port set is a port set for port allocation by the CGN device, and the port identifiers of the first port set and the second port set are not duplicated .
  • the receiving module 1101 is further configured to receive, by the first CGN device, a correspondence between another private network address and a public network address and a port segment, and the first CGN device determines the port segment. Second port set,
  • the other private network address is a source address of a packet sent by the NAT translation device received by the first CGN device.
  • the CGN device further includes: a port determining module 1104;
  • the port determining module 1104 is configured to: based on the public network address and the search result of the port segment that are corresponding to the source address of the first to-be-sent packet, in the corresponding relationship that is obtained by the searching module 1102, The second port of the port segment found by the lookup module 1102 determines the port that has not been allocated;
  • the sending module 1103 is further configured to replace the source address of the first to-be-sent packet with the public network address that is found by the searching module 1102, and replace the source port of the first to-be-sent packet with The port determined by the port determining module 1104 generates a modified packet and sends the modified packet.
  • the receiving module 1101 receives the first to-be-sent packet sent by the NAT translation device, and the searching module 1102 searches for the source address of the first to-be-sent packet in the corresponding relationship, and the sending module 1103 does not find the information according to the searching module 1102.
  • the result of the search of the source address sends an address allocation request to the first CGN device, and the receiving module 1101 receives the public network address and the port segment and the second port set allocated by the first CGN device for the source address, and the port determining module 1104
  • a CGN dual-master system includes: one of the foregoing CGN devices, and the second CGN device.
  • an embodiment of the present invention further provides an apparatus and system for establishing a secure connection, and the principle of solving the problem due to the equipment and the system is used to establish security.
  • the method of connection is similar, so the implementation of the device and system can be referred to the implementation of the foregoing method, and the repeated description will not be repeated.
  • the embodiment of the present invention provides a third CGN device for performing the functions of the first CGN device, the application scenario, and the connection relationship with other devices, such as the second CGN device and the NAT device.
  • the mutual message exchange process can refer to the description in the foregoing method embodiment.
  • the CGN device includes a network interface 1201, a processor 1202 (which may be one or more, one of the embodiments of the present invention is taken as an example), a memory 1203, and a bus system 1204, where:
  • the network interface 1201 may be a wired interface, such as a Fiber Distributed Data Interface (FDDI) or a Gigabit Ethernet (GE) interface.
  • the network interface 1201 may also be a wireless interface.
  • the processor 1202 controls the operation of three of the CGN devices, and the processor 1202 may also be referred to as a CPU (Central Processing Unit).
  • Processor 1202 may be an integrated circuit chip with signal processing capabilities.
  • the processor 1202 may also be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a Field-Programmable Gate Array (FPGA), or the like. Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • Memory 1203 can include read only memory and random access memory and provides instructions and data to processor 1202. A portion of the memory 1203 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the bus system 1204 can include a power bus, a control bus, a status signal bus, and the like in addition to the data bus.
  • the bus system may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus.
  • the bus may be one or more physical lines, and when it is a plurality of physical lines, it may be divided into an address bus, a data bus, a control bus, and the like.
  • the processor 1202, the memory 1203, and the network interface 1201 may also be directly connected through a communication line. but For clarity of description, various buses are labeled as bus system 1204 in the figure.
  • the memory 1203 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:
  • Operation instructions include various operation instructions for implementing various operations.
  • Operating system Includes a variety of system programs for implementing various basic services and handling hardware-based tasks.
  • the processor 1202 performs the following operations by calling an operation instruction stored in the memory 1203 (the operation instruction can be stored in the operating system):
  • the network interface 1201 is configured to receive an address allocation request sent by the second CGN device, where the address allocation request carries the first private network address;
  • the processor 1202 is configured to search, in the correspondence between the recorded private network address, the public network address, and the port segment, whether the first private network address received by the network interface 1201 exists; and the corresponding relationship does not exist.
  • the first private network address is searched for, and the public network address and the port segment are allocated to the first private network address, and the corresponding relationship between the first private network address and the assigned public network address and the port segment is recorded;
  • the network interface 1201 is further configured to synchronize, to the second CGN device, the correspondence between the first private network address and the public network address and the port segment allocated by the processor 1202;
  • the CGN device is a device that is configured to allocate a public network address and a port segment for a private network address, and the second CGN device is not pre-set in the CGN dual-master scenario.
  • the network interface 1201 receives the address allocation request sent by the second CGN device, and the processor 1202 searches for the first private network address carried in the allocation request, and allocates a public network address and a port for the first private network address according to the search result.
  • the network interface 1201 to synchronize the first private network address with the second CGN device and the assigned address of the public network address and the port segment please participate in steps S401 to S404 of the first embodiment of the present invention.
  • the network interface 1201 is further configured to obtain a first to-be-sent message
  • the processor 1202 is further configured to: search, in the corresponding relationship, whether there is a public network address and a port segment corresponding to a source address of the first to-be-sent packet obtained by the network interface 1201; The public network address and the search result of the port segment corresponding to the source address of the first to-be-sent packet are determined, and the first port set of the found port segment is determined to be unallocated. port;
  • the network interface 1201 is further configured to replace the source address of the first to-be-sent packet with the public network address that is found by the processor 1202, and replace the source port of the first to-be-sent packet with the processor. Determining, by the port 1202, a modified packet, and sending the modified packet;
  • the port segment is divided into a second port set and the first port set according to a preset division rule, where the first port set is a port set for the CGN device to perform port allocation, and the second port set is Is a port set for the second CGN device to perform port allocation, and the port identifiers in the first port set and the second port set are not mutually exclusive.
  • the network interface 1201 obtains the first to-be-sent packet, and the processor 1202 searches for the public network address and the port segment corresponding to the source address of the first to-be-sent packet, and collects the first port from the first port according to the search result.
  • the process of assigning the to-be-sent packet to determine the available port, and the network interface 1201 to replace the source address and the source port, and the address-allocation process are to be performed in steps S405-410 of the first embodiment of the present invention.
  • the processor 1202 is further configured to determine, according to the port segment allocated for the first private network address, a first port set and a second port set, where the first port set is for the CGN device a port set for port allocation, the second port set is a port set for the second CGN device to perform port allocation, and the port identifiers of the first port set and the second port set are not duplicated;
  • the network interface 1201 is specifically configured to synchronize, to the second CGN device, the first private network address, a public network address allocated by the processor 1202, a correspondence between port segments, and the determined second port. set.
  • the network interface 1201 receives the address allocation request sent by the second CGN device, and the processor 1202 searches for the first private network address carried in the allocation request, and allocates a public network address and a port for the first private network address according to the search result. Segmenting, and dividing the port segment into a first port set and a second port set, and synchronizing the first private network address and the assigned public network address and port segment and the address of the second port set by the network interface 1201 to the second CGN device For the allocation process, please participate in steps S601 to S605 of the third embodiment of the present invention.
  • the network interface 1201 is further configured to receive a second to-be-sent packet sent by the network address translation NAT translation device;
  • the processor 1202 is further configured to: search, in the correspondence, whether there is a public network address and a port segment corresponding to a source address of the second to-be-sent packet received by the network interface 1201;
  • the public network address and the search result of the port segment corresponding to the source address of the second to-be-sent packet are not included in the corresponding relationship, and the public network address is allocated to the source address of the second to-be-sent packet.
  • a port segment and determining a first port set and a second port set from a port segment allocated for a source address of the second to-be-sent packet;
  • the network interface 1201 is further configured to synchronize, to the second CGN device, a source address of the second to-be-sent packet, a public network address allocated by the processor 1202, and a correspondence between port segments, and the Two port set.
  • the processor 1202 is further configured to: according to the public network address and the search result of the port segment that are corresponding to the source address of the second to-be-sent packet, the searched port segment
  • the first port is centralized to determine the ports that have not been assigned;
  • the network interface 1201 is further configured to replace the source address of the second to-be-sent packet with the public network address that is found by the processor 1202, and replace the source port of the second to-be-sent packet with The port determined by the processor 1202 generates a modified packet and sends the modified packet.
  • the network interface 1201 receives the second to-be-sent packet sent by the NAT translation device, and the processor 1202 searches for the source address of the second to-be-sent packet in the corresponding relationship, and sends the second to-be-sent according to the search result.
  • the source address of the packet is assigned a public network address and a port segment, and the port segment is divided into a first port set and a second port set, and the first private network address and the allocated public network are synchronized by the network interface 1201 to the second CGN device.
  • the address and the port segment and the second port set, and the address allocation process for modifying and transmitting the source address and the source port of the second to-be-sent packet participate in steps S606 to S612 of the third embodiment of the present invention.
  • the fourth embodiment of the carrier-level network address translation CGN device provided by the embodiment of the present invention is configured to perform the function of the second CGN device described in the foregoing method embodiment, and the application scenario thereof and other devices, such as the first CGN device.
  • the CGN device includes a network interface 1301, a processor 1302 (which may be one or more, one in each embodiment of the present invention), a memory 1303, and a bus system 1304, where:
  • the network interface 1301 may be a wired interface, such as a Fiber Distributed Data Interface (FDDI) or a Gigabit Ethernet (GE) interface; the network interface 1301 may also be a wireless interface.
  • FDDI Fiber Distributed Data Interface
  • GE Gigabit Ethernet
  • the processor 1302 controls the operation of a fourth of a CGN device, and the processor 1302 may also be referred to as CPU (Central Processing Unit).
  • the processor 1302 may be an integrated circuit chip with signal processing capabilities.
  • the processor 1302 may also be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a Field-Programmable Gate Array (FPGA), or the like. Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • Memory 1303 can include read only memory and random access memory and provides instructions and data to processor 1302. A portion of the memory 1303 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the various components of a fourth CGN device are coupled together by a bus system 1304, which may include, in addition to the data bus, a power bus, a control bus, a status signal bus, and the like.
  • the bus system may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus.
  • the bus may be one or more physical lines, and when it is a plurality of physical lines, it may be divided into an address bus, a data bus, a control bus, and the like.
  • the processor 1302, the memory 1303, and the network interface 1301 may also be directly connected through a communication line.
  • various buses are labeled as bus system 1304 in the figure.
  • the memory 1303 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof:
  • Operation instructions include various operation instructions for implementing various operations.
  • Operating system Includes a variety of system programs for implementing various basic services and handling hardware-based tasks.
  • the processor 1302 performs the following operations by calling an operation instruction stored in the memory 1303 (the operation instruction can be stored in the operating system):
  • the network interface 1301 is configured to receive a first to-be-sent packet sent by the network address translation NAT translation device.
  • the processor 1302 is configured to search, in the correspondence between the recorded private network address, the public network address, and the port segment, whether there is a source address of the first to-be-sent packet received by the network interface 1301. Corresponding to the assigned public network address and port segment;
  • the network interface 1301 is further configured to: according to the public network address corresponding to the source address of the first to-be-sent packet and the search result of the port segment, the first mapping result obtained by the processor 1302 is not present
  • the CGN device sends an address allocation request, where the address allocation request carries the source address of the first to-be-sent packet; and receives the address allocation request sent by the first CGN device for the network interface 1301. Corresponding relationship between the source address of the first to-be-sent packet and the public network address and the port segment;
  • the first CGN device is a pre-agreed device for allocating a public network address and a port segment for the private network address in the CGN dual-master scenario.
  • the CGN device is a non-private network address pre-agreed in the CGN dual-master scenario.
  • the processor 1302 is further configured to: according to the public network address and the search result of the port segment that are corresponding to the source address of the first to-be-sent packet, the searched port segment
  • the second port is centralized to determine the ports that have not been assigned;
  • the network interface 1301 is further configured to replace the source address of the first to-be-sent packet with the public network address that is found by the processor 1302, and replace the source port of the first to-be-sent packet with The port determined by the processor 1302 generates a modified packet, and sends the modified packet;
  • the port segment is divided into a first port set and a second port set according to a preset dividing rule, where the first port set is a port set for port allocation by the first CGN device, and the second port is The set is a port set for port allocation by the CGN device, and the port identifiers of the first port set and the second port set are not duplicated.
  • the network interface 1301 receives the first to-be-sent packet sent by the NAT translation device, and the processor 1302 searches for the source address of the first to-be-sent packet in the corresponding relationship, and the network interface 1301 does not find the identifier according to the processor 1302.
  • the result of the search of the source address sends an address allocation request to the first CGN device, and the network interface 1301 receives the public network address and port segment that is replied by the first CGN device for the source address, and the processor 1302 receives the port segment from the first
  • the two-port centralized determination port, and the network interface 1301, the address allocation process for modifying the packet transmission of the source address and the source port is performed in steps S501 to S506 of the second embodiment of the present invention.
  • the network interface 1301 is specifically configured to receive a source address of the first to-be-sent packet sent by the first CGN device, a correspondence between a public network address and a port segment, and the first CGN device. a second port set determined from the port segments, wherein the first CGN setting The port segment is divided into a first port set and a second port set, the first port set is a port set for the first CGN device to perform port allocation, and the second port set is provided for the CGN device A port set for performing port allocation, the port identifiers of the first port set and the second port set are not duplicated.
  • the network interface 1301 is further configured to receive, by the first CGN device, a correspondence between another private network address and a public network address and a port segment, and the first CGN device determines the port segment. Second port set,
  • the other private network address is a source address of a packet sent by the NAT translation device received by the first CGN device.
  • the processor 1302 is further configured to: according to the public network address and the search result of the port segment that are corresponding to the source address of the first to-be-sent packet, the searched port segment
  • the second port is centralized to determine the ports that have not been assigned;
  • the network interface 1301 is further configured to replace the source address of the first to-be-sent packet with the public network address that is found by the processor 1302, and replace the source port of the first to-be-sent packet with The port determined by the processor 1302 generates a modified packet and sends the modified packet.
  • the network interface 1301 receives the first to-be-sent packet sent by the NAT translation device, and the processor 1302 searches for the source address of the first to-be-sent packet in the corresponding relationship, and the network interface 1301 does not find the identifier according to the processor 1302.
  • the search result of the source address sends an address allocation request to the first CGN device, and the network interface 1301 receives the public network address and the port segment and the second port set allocated by the first CGN device for the source address, and the processor 1302
  • a CGN dual master system provided by the embodiment of the present invention includes: the third of the above CGN devices, and the fourth of the foregoing CGN devices.
  • An address allocation method, a CGN device, and a CGN dual-master system provided by the embodiment of the present invention include: in a CGN dual-master scenario, pre-agreed to determine that the first CGN device is used to perform a public network address and a port for a private network address.
  • the device assigned by the segment determines the second CGN device as a device that does not perform public network address and port segment allocation for the private network address.
  • the second CGN device receives the NAT translation If the first packet to be sent is sent by the device, the source address of the first packet to be sent is found in the corresponding relationship between the private network address, the public network address, and the port segment.
  • the second CGN device sends an address allocation request to the first CGN device; when the first CGN device receives the address allocation request, the recorded private network address and the public network Searching for the first private network address carried in the address allocation request in the correspondence between the address and the port segment; the first CGN device is the first private network based on the search result that the first private network address does not exist in the corresponding relationship Assigning a public network address and a port segment to the address, and recording the correspondence between the first private network address and the assigned public network address and the port segment; synchronizing the first private network address with the assigned public network address and the port segment to the second CGN device Correspondence relationship.
  • the address allocation method provided by the embodiment of the present invention determines that one CGN device (the first CGN device) is configured to perform public network address and port segment allocation for a private address, and another CGN in two CGN devices in a CGN dual-master scenario.
  • the device (the second CGN device) does not allocate the public network address and the port segment for the private address. This prevents the two CGN devices from assigning different public network addresses and port segments to the same private network address without having to synchronize.
  • a private network address can be assigned only one public network address and one port segment to ensure traceability consistency and avoid waste of public address resources and port resources.
  • the embodiments of the present invention may be implemented by hardware, or may be implemented by means of software plus a necessary general hardware platform.
  • the technical solution of the embodiment of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.).
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention.
  • modules in the apparatus in the embodiments may be distributed in the apparatus of the embodiment according to the description of the embodiments, or the corresponding changes may be located in one or more apparatuses different from the embodiment.
  • the modules of the above embodiments may be combined into one module, or may be further split into multiple sub-modules.

Landscapes

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

Abstract

本发明实施例提供了一种地址分配方法、CGN设备及CGN双主系统,包括:第二CGN设备接收NAT转换设备发送的第一待发送报文,在已记录的私网地址、公网地址以及端口段三者的对应关系中查找第一待发送报文的源地址;基于未查找到的查找结果,向第一CGN设备发送请求该源地址公网地址以及端口段的地址分配请求;第一CGN设备在已记录的私网地址、公网地址以及端口段三者的对应关系中查找第一待发送报文的源地址;基于未查找到的查找结果,为第一待发送报文的源地址分配公网地址以及端口段并记录,向第二CGN设备同步该分配的公网地址以及端口段。保证了溯源的一致性,避免了公网地址资源以及端口资源的浪费。设计网络通信技术领域。

Description

一种地址分配方法、CGN设备及CGN双主系统
本申请要求于2014年12月18日提交中国专利局、申请号为201410795836.5、发明名称为“一种地址分配方法、CGN设备及CGN双主系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及移动通信技术领域,尤其涉及一种地址分配方法、运营商级NAT(CGN,Carrie Grade Network Address Translation)设备及CGN双主系统。
背景技术
城域网的宽带用户数量巨大,是消耗网络第四版互联网协议(IPv4,Internet Protocol version 4)地址的主力军。面对IPv4地址的枯竭,引入第六版互联网协议(IPv6,Internet Protocol version 6)是网络演进的必然趋势。但是,在IPV4地址耗尽之前,运营商的网络、业务平台、终端以及网络内容服务商(IPC,Internet Content Provider)无法全面支持IPV6,并具备IPV6商用能力。在IPV6过渡期内,为延长IPV4的使用期限,引入CGN技术,从而保证业务的平稳过渡,为IPV6的部署争取了时间。
独立的CGN设备,例如:防火墙,使用网络地址转换(NAT,Network Address Translation)444技术时,目前只支持集中式场景,在分布式场景中CGN设备使用NAT444技术还存在一些问题,其中集中式场景是指仅存在一个CGN设备进行地址转换的场景,分布式场景是指存在多个CGN设备进行地址转换的场景。
但是,在CGN双主场景中,两个CGN设备都具有为私网地址分配公网地址以及端口段的功能,那么,存在如下场景:两个CGN设备接收到来自于同一私网地址的不同数据包,两个CGN设备各自为该私网地址分配公网地址和端口段,那么,该私网地址可以获得两个不同的公网地址以及端口段。
但是,CGN设备为了满足溯源的要求,要求具有同一个源私网地址的数据流无论被分流到CGN双主场景中的哪个CGN设备,该源私网地址所获得 的公网地址以及端口段必须是相同的。而上述场景中的情况与溯源相违背,无法保证溯源的一致性。
发明内容
本发明实施例提供了一种地址分配方法、CGN设备及CGN双主系统,用以解决现有技术双主场景中CGN设备无法满足溯源一致性的要求的问题。
第一方面,提供一种地址分配方法,包括:
第一运营商级网络地址转换CGN设备接收第二CGN设备发送的地址分配请求,所述地址分配请求中携带第一私网地址;
所述第一CGN设备在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在所述第一私网地址;
基于所述对应关系中不存在所述第一私网地址的查找结果,所述第一CGN设备为所述第一私网地址分配公网地址以及端口段,并记录所述第一私网地址和分配的公网地址以及端口段的对应关系;以及
向所述第二CGN设备同步所述第一私网地址和分配的公网地址以及端口段的对应关系;
其中,所述第一CGN设备为CGN双主场景中预先设定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先设定的不为私网地址分配公网地址以及端口段的设备。
结合第一方面,在第一方面的第一种可能的实现方式中,所述方法还包括:所述第一CGN设备获得第一待发送报文;在所述对应关系中查找是否存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段;基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述第一CGN设备从查找到的端口段的第一端口集中确定尚未分配的端口;并将所述第一待发送报文的源地址替换为查找到的公网地址,以及将所述第一待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文;其中,按照预设划分规则将所述端口段划分为第二端口集和所述第一端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第一方面,在第一方面的第二种可能的实现方式中,向所述第二CGN设备同步所述第一私网地址和分配的公网地址以及端口段的对应关系,具体包括:从为所述第一私网地址分配的端口段中确定第一端口集和第二端口集,其中,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复;向所述第二CGN设备同步所述第一私网地址和分配的公网地址以及端口段的对应关系、以及所述第二端口集。
结合第一方面,或者结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述方法还包括:第一CGN设备接收网络地址转换NAT转换设备发送的第二待发送报文;在所述对应关系中查找是否存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段;基于所述对应关系中不存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,为所述第二待发送报文的源地址分配公网地址以及端口段;从为所述第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集;向所述第二CGN设备同步所述第二待发送报文的源地址和分配的公网地址以及端口段的对应关系、以及所述第二端口集。
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,基于所述对应关系中存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述方法还包括:从查找到的端口段的第一端口集中确定尚未分配的端口;将所述第二待发送报文的源地址替换为查找到的公网地址,以及将所述第二待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文。
第二方面,提供一种地址分配方法,包括:
第二运营商级网络地址转换CGN设备接收网络地址转换NAT转换设备发送的第一待发送报文;
在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段;
基于所述对应关系中不存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述第二CGN设备向第一CGN设备发送地址分配请求,其中,所述地址分配请求携带所述第一待发送报文的源地址;
接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段三者的对应关系;
其中,所述第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备。
结合第二方面,在第二方面的第一种可能的实现方式中,基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述方法还包括:所述第二CGN设备从查找到的端口段的第二端口集中确定尚未分配的端口;并将所述第一待发送报文的源地址替换为查找到的公网地址,以及将所述第一待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文;其中,按照预设划分规则将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第二方面,在第二方面的第二种可能的实现方式中,接收所述第一CGN设备发送的所述第一待发送报文的源地址和分配的公网地址以及端口段的对应关系,具体包括:接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述第一CGN设备将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现方式中,所述方法还包括:接收所述第一CGN设备发送的其他私网地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述其他私网地址为所述第一CGN设备接收的NAT转换设备发送的报文的源地址。
结合第二方面的第二种可能的实现方式,或者结合第二方面的第三中可能的实现方式,在第二方面的第四种可能的实现方式中,基于所述对应关系 中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述方法还包括:所述第二CGN设备从查找到的端口段的第二端口集中确定尚未分配的端口;将所述第一待发送报文的源地址替换为查找到的公网地址,以及将所述第一待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文。
第三方面,提供一种CGN设备,作为第一CGN设备,包括:
接收模块,用于接收第二CGN设备发送的地址分配请求,所述地址分配请求中携带第一私网地址;
查找模块,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在所述接收模块接收的第一私网地址;
分配模块,用于基于所述查找模块得到的所述对应关系中不存在所述第一私网地址的查找结果,为所述第一私网地址分配公网地址以及端口段,并记录所述第一私网地址和分配的公网地址以及端口段的对应关系;
发送模块,用于向所述第二CGN设备同步所述第一私网地址和所述分配模块分配的公网地址以及端口段的对应关系;
其中,本CGN设备为CGN双主场景中预先设定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先设定的不为私网地址分配公网地址以及端口段的设备。
结合第三方面,在第三方面的第一种可能的实现方式中,还包括:获得模块和端口确定模块;所述获得模块,用于获得第一待发送报文;所述查找模块,还用于在所述对应关系中查找是否存在为所述获得模块获得的第一待发送报文的源地址对应分配的公网地址以及端口段;所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第一端口集中确定尚未分配的端口;并所述发送模块,还用于将所述第一待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文;其中,按照预设划分规则将所述端口段划分为第二端口集和所述第一端口集,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分 配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第三方面,在第三方面的第二种可能的实现方式中,所述分配模块,还用于从为所述第一私网地址分配的端口段中确定第一端口集和第二端口集,其中,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复;所述发送模块,具体用于向所述第二CGN设备同步所述第一私网地址和所述分配模块分配的公网地址以及端口段的对应关系、以及确定的所述第二端口集。
结合第三方面,或者结合第三方面的第二种可能的实现方式,在第三方面的第三种可能的实现方式中,所述接收模块,还用于接收网络地址转换NAT转换设备发送的第二待发送报文;所述查找模块,还用于在所述对应关系中查找是否存在为所述接收模块接收的第二待发送报文的源地址对应分配的公网地址以及端口段;所述分配模块,还用于基于所述查找模块得到的所述对应关系中不存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,为所述第二待发送报文的源地址分配公网地址以及端口段;以及从为所述第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集;所述发送模块,还用于向所述第二CGN设备同步所述第二待发送报文的源地址和所述分配模块分配的公网地址以及端口段的对应关系、以及所述第二端口集。
结合第三方面的第三种可能的实现方式,在第三方面的第四种可能的实现方式中,还包括:端口确定模块;所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第一端口集中确定尚未分配的端口;所述发送模块,还用于将所述第二待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第二待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文。
第四方面,提供一种CGN设备,作为第二CGN设备,包括:
接收模块,用于接收网络地址转换NAT转换设备发送的第一待发送报文;
查找模块,用于在已记录的私网地址、公网地址以及端口段三者的对应 关系中查找是否存在为所述接收模块接收的第一待发送报文的源地址对应分配的公网地址以及端口段;
发送模块,用于基于所述查找模块得到的所述对应关系中不存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,向第一CGN设备发送地址分配请求,其中,所述地址分配请求携带所述第一待发送报文的源地址;
所述接收模块,还用于接收所述第一CGN设备针对所述发送模块发送的地址分配请求发送的所述第一待发送报文的源地址和公网地址以及端口段三者的对应关系;
其中,所述第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,本CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备。
结合第四方面,在第四方面的第一种可能的实现方式中,还包括:端口确定模块;所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第二端口集中确定尚未分配的端口;所述发送模块,还用于将所述第一待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文;其中,按照预设划分规则将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第四方面,在第四方面的第二种可能的实现方式中,所述接收模块,具体用于接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述第一CGN设备将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第四方面的第二种可能的方式,在第四方面的第三种可能的实现方式中,所述接收模块,还用于接收所述第一CGN设备发送的其他私网地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述其他私网地址为所述第一CGN设备接收的NAT转换设备发送的报文的源地址。
结合第四方面的第二种可能的方式,或者结合第四方面的第三种可能的实现方式,在第四方面的第四种可能的实现方式中,还包括:端口确定模块;所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第二端口集中确定尚未分配的端口;所述发送模块,还用于将所述第一待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文。
第五方面,提供一种CGN双主系统,包括:第三方面或者第三方面的任意一种可能的实现方式所述的CGN设备,以及第四方面或者第四方面的任意一种可能的实现方式所述的CGN设备。
第六方面、提供一种CGN设备,作为第一CGN设备,包括:
网络接口,用于接收第二CGN设备发送的地址分配请求,所述地址分配请求中携带第一私网地址;
处理器,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在所述网络接口接收的第一私网地址;基于所述对应关系中不存在所述第一私网地址的查找结果,为所述第一私网地址分配公网地址以及端口段,并记录所述第一私网地址和分配的公网地址以及端口段的对应关系;
网络接口,还用于向所述第二CGN设备同步所述第一私网地址和所述处理器分配的公网地址以及端口段的对应关系;
其中,本CGN设备为CGN双主场景中预先设定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先设定的不为私网地址分配公网地址以及端口段的设备。
结合第六方面,在第六方面的第一种可能的实现方式中,所述网络接口, 还用于获得第一待发送报文;所述处理器,还用于在所述对应关系中查找是否存在为所述网络接口获得的第一待发送报文的源地址对应分配的公网地址以及端口段;基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从查找到的端口段的第一端口集中确定尚未分配的端口;所述网络接口,还用于将所述第一待发送报文的源地址替换为处理器查找到的公网地址,以及将所述第一待发送报文的源端口替换为处理器确定的端口,生成修改后的报文,并发送所述修改后的报文;其中,按照预设划分规则将所述端口段划分为第二端口集和所述第一端口集,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第六方面,在第六方面的第二种可能的实现方式中,所述处理器,还用于从为所述第一私网地址分配的端口段中确定第一端口集和第二端口集,其中,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复;所述网络接口,具体用于向所述第二CGN设备同步所述第一私网地址和所述处理器分配的公网地址以及端口段的对应关系、以及确定的所述第二端口集。
结合第六方面,或者结合第六方面的第二种可能的实现方式,在第六方面的第三种可能的实现方式中,所述网络接口,还用于接收网络地址转换NAT转换设备发送的第二待发送报文;所述处理器,还用于在所述对应关系中查找是否存在为所述网络接口接收的第二待发送报文的源地址对应分配的公网地址以及端口段;基于所述对应关系中不存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,为所述第二待发送报文的源地址分配公网地址以及端口段;以及从为所述第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集;所述网络接口,还用于向所述第二CGN设备同步所述第二待发送报文的源地址和所述处理器分配的公网地址以及端口段的对应关系、以及所述第二端口集。
结合第六方面的第三种可能的实现方式,在第六方面的第四种可能的实现方式中,所述处理器,还用于基于所述对应关系中存在为所述第二待发送 报文的源地址对应分配的公网地址以及端口段的查找结果,从查找到的端口段的第一端口集中确定尚未分配的端口;所述网络接口,还用于将所述第二待发送报文的源地址替换为所述处理器查找到的公网地址,以及将所述第二待发送报文的源端口替换为所述处理器确定的端口,生成修改后的报文,并发送所述修改后的报文。
第七方面,提供一种CGN设备,作为第二CGN设备,包括:
网络接口,用于接收网络地址转换NAT转换设备发送的第一待发送报文;
处理器,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为所述网络接口接收的第一待发送报文的源地址对应分配的公网地址以及端口段;
网络接口,还用于基于所述处理器得到的所述对应关系中不存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,向第一CGN设备发送地址分配请求,其中,所述地址分配请求携带所述第一待发送报文的源地址;
所述网络接口,还用于接收所述第一CGN设备针对所述网络接口发送的所述地址分配请求发送的所述第一待发送报文的源地址和公网地址以及端口段三者的对应关系;
其中,所述第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,本CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备。
结合第七方面,在第七方面的第一种可能的实现方式中,所述处理器,还用于基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从查找到的端口段的第二端口集中确定尚未分配的端口;所述网络接口,还用于将所述第一待发送报文的源地址替换为所述处理器查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述处理器确定的端口,生成修改后的报文,并发送所述修改后的报文;其中,按照预设划分规则将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第七方面,在第七方面的第二种可能的实现方式中,所述网络接口,具体用于接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述第一CGN设备将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
结合第七方面的第二种可能的方式,在第七方面的第三种可能的实现方式中,所述网络接口,还用于接收所述第一CGN设备发送的其他私网地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述其他私网地址为所述第一CGN设备接收的NAT转换设备发送的报文的源地址。
结合第七方面的第二种可能的方式,或者结合第七方面的第三种可能的实现方式,在第七方面的第四种可能的实现方式中,所述处理器,还用于基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第二端口集中确定尚未分配的端口;所述网络接口,还用于将所述第一待发送报文的源地址替换为所述处理器查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述处理器确定的端口,生成修改后的报文,并发送所述修改后的报文。
第八方面、提供一种CGN双主系统,包括:第六方面或者第六方面的任意一种可能的实现方式所述的CGN设备,以及上第七方面或者第七方面的任意一种可能的实现方式所述的CGN设备。
本发明实施例的有益效果包括:
本发明实施例提供的一种地址分配方法、CGN设备及CGN双主系统,包括:在CGN双主场景中,预先约定将第一CGN设备确定为用于为私网地址进行公网地址以及端口段分配的设备,将第二CGN设备确定为不为私网地址进行公网地址以及端口段分配的设备。当第二CGN设备接收到NAT转换设备发送的第一待发送报文时,在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在第一待发送报文的源地址;基于上述对应关 系中不存在第一待发送报文的源地址的查找结果,第二CGN设备向第一CGN设备发送地址分配请求;当第一CGN设备接收到地址分配请求时,在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在地址分配请求中携带的第一私网地址;基于上述对应关系中不存在第一私网地址的查找结果,第一CGN设备为第一私网地址分配公网地址以及端口段,并记录第一私网地址和分配的公网地址以及端口段的对应关系;向第二CGN设备同步第一私网地址和分配的公网地址以及端口段的对应关系。本发明实施例提供的地址分配方法,在CGN双主场景的两个CGN设备中,确定其中一个CGN设备(第一CGN设备)用于为私有地址进行公网地址以及端口段分配,另一个CGN设备(第二CGN设备)不为私有地址进行公网地址以及端口段分配,避免了两个CGN设备在没有来得及同步的前提下,为同一个私网地址分配不同的公网地址以及端口段,使得一个私网地址只能分配一个公网地址以及一个端口段,保证了溯源的一致性,避免了公网地址资源以及端口资源的浪费。
附图说明
图1为本发明实施例提供的CGN双主场景中CGN设备使用NAT444技术场景示意图;
图2为本发明实施例提供的一种地址分配方法,应用于第一CGN设备侧的流程图;
图3为本发明实施例提供的一种地址分配方法,应用于第二CGN设备侧的流程图;
图4为本发明实施例1提供的一种地址分配方法,应用于第一CGN设备侧的流程图;
图5为本发明实施例2提供的一种地址分配方法,应用于第二CGN设备侧的流程图;
图6为本发明实施例3提供的一种地址分配方法,应用于第一CGN设备侧的流程图;
图7为本发明实施例4提供的一种地址分配方法,应用于第二CGN设备侧的流程图;
图8为本发明实施例提供的地址分配方法数据流示意图之一;
图9为本发明实施例提供的地址分配方法数据流示意图之二;
图10为本发明实施例提供的CGN设备之一的结构示意图;
图11为本发明实施例提供的CGN设备之二的结构示意图;
图12为本发明实施例提供的CGN设备之三的结构示意图;
图13为本发明实施例提供的CGN设备之四的结构示意图。
具体实施方式
本发明实施例提供了一种地址分配方法、CGN设备及CGN双主系统,以下结合说明书附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。并且在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
图1为现有技术CGN双主场景中CGN设备使用NAT444技术场景示意图。在图1所示的场景中,终端设备1和终端设备2通过路由设备1接入网络,终端设备3和终端设备4通过路由设备2接入网络,终端设备1和终端设备2通过用户接入设备1(CPE,Customer Premises Equipment)利用NAT44技术完成第一层IP地址的转换,终端设备3和终端设备4通过CPE2利用NAT44技术完成第一层IP地址的转换,即将多个终端的地址转换成一个私网地址,并且将以该私网地址为源地址的报文传输给CGN设备A或者CGN设备B。
现有技术中,CGN设备A和CGN设备B可以按照下述方式为私网地址分配公网地址和端口段:CGN设备A或者CGN设备B接收到以私网地址为源地址的报文之后,查找存储的用户表,其中用户表中的表项用于存储私网地址和对应的为该私网地址分配的公网地址以及端口段,判断是否已经为该私网地址分配了公网地址,若查找到相关表项,则将该报文的源地址替换为查找到的表项中记录的为该私网地址分配的公网地址,以及将该报文的源端口替换为已为该私网地址分配的端口段中尚未分配的端口号,将替换后得到的报文发送出去;若未查找到相关表项,则为该私网地址分配公网地址以及端口段,并将该私网地址以及分配的公网地址以及端口段存储到用户表中,以便当需要发送以该私有地址为源地址的报文时,从为该私有地址分配的端口段中确定尚未分配的端口,并将该报文的源地址替换为分配的公网地址, 以及将该报文的源端口替换为确定的端口,将替换后得到的报文发送出去。
基于上述CGN双主场景,本发明实施例提供一种地址分配方法,应用于第一CGN设备侧,如图2所示,包括:
S201、第一CGN设备接收第二CGN设备发送的地址分配请求,
其中,该地址分配请求中携带第一私网地址。
S202、第一CGN设备在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在S201中接收的第一私网地址。
S203、基于上述对应关系中不存在第一私网地址的查找结果,第一CGN设备为第一私网地址分配公网地址以及端口段,并记录第一私网地址和分配的公网地址以及端口段的对应关系。
S204、向第二CGN设备同步第一私网地址和分配的公网地址以及端口段的对应关系。
与上述图2所示方法相应的,本发明实施例还提供一种地址分配方法,应用于第二CGN设备侧,如图3所示,包括:
S301、第二CGN设备接收NAT转换设备发送的第一待发送报文。
S302、在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为S301中接收的第一待发送报文的源地址对应分配的公网地址以及端口段。
S303、基于上述对应关系中不存在为第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,第二CGN设备向第一CGN设备发送地址分配请求,
其中,地址分配请求用于请求为第一待发送报文的源地址对应分配的公网地址以及端口段。
S304、接收第一CGN设备发送的第一待发送报文的源地址和分配的公网地址以及端口段的对应关系。
需要说明的是,本申请实施例中CGN设备的地址分配过程,如S301~S304所示的地址分配过程,与现有技术中地址分配过程的触发时机是类似的。地址分配过程是在接收到待发送报文后,根据记录已建立会话五元组<源地址,源端口,目的地址,目的端口,协议类型>的会话表确定出该报文是一个新建会话的首个报文后才执行的。
进一步地,第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,第二CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备,而仅是为已分配公网地址和端口段的私网地址映射分配的公网地址和分配的端口段中尚未使用的端口号。如图1所示,在现有技术提供的地址分配方法中,CGN设备A和CGN设备B从功能上看并无差别,二者均具有为私网地址分配公网地址和地址段的功能,采用本发明实施例提供的地址分配方法,当CGN设备A是用于为私网地址分配公网地址以及端口段的设备,CGN设备B不是为私网地址分配公网地址以及端口段的设备时,可以将CGN设备A作为本发明实施例中提供的第一CGN设备,将CGN设备B作为本发明实施例中提供的第二CGN设备;当CGN设备B是用于为私网地址分配公网地址以及端口段的设备,CGN设备A不是为私网地址分配公网地址以及端口段的设备时,可以将CGN设备B作为本发明实施例中提供的第一CGN设备,将CGN设备A作为本发明实施例中提供的第二CGN设备。也就是说,采用本发明实施例提供的地址分配方法,CGN设备A和CGN设备B中只有作为第一CGN设备的CGN设备才能为私网地址分配公网地址和端口段,这样,CGN设备A和CGN设备B不会为相同私网地址分配不同的公网地址和端口段,满足溯源一致性的要求,并且避免了资源的浪费。
下面结合附图,用具体实施例对本发明提供的方法及相关设备进行详细描述。
实施例1:
本发明实施例1中,提供一种地址分配方法,应用于第一CGN设备侧,在实施例1中,第一CGN设备和第二CGN设备具有互不重复的各自用来为私网地址映射端口的端口集,且端口集的划分通过预先划分的形式实现。如图4所示,具体包括如下步骤:
S401、第一CGN设备接收第二CGN设备发送的地址分配请求,其中,地址分配请求中携带第一私网地址。
S402、第一CGN设备在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在S401中接收的第一私网地址,若存在,则进入步骤S404,若不存在,进入步骤S403。
进一步地,私网地址、公网地址以及端口段三者的对应关系可以记录在用户表中,本步骤中,可以从用户表中查找该第一私网地址。
S403、第一CGN设备为第一私网地址分配公网地址以及端口段,并记录第一私网地址和分配的公网地址以及端口段的对应关系。
进一步地,基于在私网地址、公网地址以及端口段三者的对应关系中未查找到第一私网地址的查找结果,执行本步骤,可以将第一私网地址和分配的公网地址以及端口段的对应关系记录到用户表中。
进一步地,当第一CGN设备接收到NAT转换设备(可以为利用NAT44技术完成第一层IP地址的转换的设备,例如:CPE设备)发送的源地址为私网地址的报文时,执行与S401~S403类似的步骤,包括:在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在该源地址;基于上述对应关系中不存在该源地址的查找结果,为该源地址分配公网地址以及端口段,并记录该源地址和分配的公网地址以及端口段的对应关系;以及向第二CGN设备同步该源地址和对应的分配的公网地址以及端口段的对应关系。
S404、向第二CGN设备同步第一私网地址和分配的公网地址以及端口段的对应关系。
进一步地,本步骤中,可以按照预设同步规则向第二CGN设备同步分配的公网地址以及端口段。例如,可以每为一个私网地址分配了公网地址和端口段之后就向第二CGN设备同步,或者为预设个数个私网地址分配了公网地址和端口段之后再向第二CGN设备同步,或者按照预设同步周期,当同步周期到来时,向第二CGN设备同步本周期内分配的公网地址和端口段及其对应的私网地址。
S405、第一CGN设备获得第一待发送报文。
进一步地,本步骤中,第一CGN设备可以通过NAT转换设备获得第一待发送报文,即NAT转换设备可以向第一CGN设备发送第一待发送报文。
S406、在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为第一待发送报文的源地址对应分配的公网地址以及端口段,若存在,进入步骤S409,若不存在,进入步骤S407。
S407、为第一待发送报文的源地址分配公网地址以及端口段,并记录第一待发送报文的源地址和分配的公网地址以及端口段的对应关系。
S408、向第二CGN设备同步第一待发送报文的源地址和分配的公网地址以及端口段的对应关系。
S409、第一CGN设备从查找到的端口段的第一端口集中确定尚未分配的端口;
其中,按照预设划分规则将端口段划分为第一端口集和第二端口集,第一端口集是供第一CGN设备进行端口分配的端口集,第二端口集是供第二CGN设备进行端口分配的端口集,第一端口集和第二端口集中的端口标识互不重复。
进一步地,不管是为NAT转换设备发送的报文的源地址(私网地址)分配的端口段,还是为第二CGN设备发送的第一私网地址分配的端口段,针对分配给所有私网地址的端口段,均需要按照预设划分规则将该端口段划分为互不重复的端口集,第一CGN设备和第二CGN设备能使用各自对应的端口集中的端口进行端口分配。
现有技术中存在如下使用场景:假设私网IP地址1.1.1.1已经获得了端口段资源[2048~2304],并且在主CGN设备和从CGN设备上的用户表中均对私网IP地址1.1.1.1的映射关系进行了记录。来自CPE设备的数据流1.1.1.1:80-->baidu.com被分流到主CGN设备,主CGN设备为该数据流分配公网IP地址10.1.1.1及端口资源2050,即映射关系为1.1.1.1:80[10.1.1.1:2050]--→baidu.com。在该资源分配信息被同步到从CGN设备之前,存在另一数据流1.1.1.1:90-→baidu.com被分流到从CGN设备,从CGN设备也可能为该数据流分配与主CGN设备分配的资源相同的资源,即公网IP地址10.1.1.1及端口资源2050,那么得到的映射关系为1.1.1.1:90[10.1.1.1:2050]--→baidu.com。
在上述使用场景中,出现了公网地址以及端口重叠的情况,使得回程的报文再转换成私网IP地址时出现混乱,也就是说,当接收到来自10.1.1.1:2050的报文时,无法确定将该报文转发给1.1.1.1:80,还是转发给1.1.1.1:90,无法保证回程报文的正确转发。本发明实施例提供的地址分配方法,按照预设划分规则将为私有地址分配端口段划分为的互不重复的、且分别供第一CGN设备以及第二CGN设备进行端口分配的端口集,使得第一CGN设备和第二CGN设备不会为私网地址映射重叠的公网地址以及端口,保证了回程报文的 正确转发。
进一步地,预设划分规则可以根据实际情况进行设置,并且与第一CGN设备以及第二CGN设备均预先约定,使得第一CGN设备和第二CGN设备均知晓自身对应的端口段中的部分。例如:可以将端口段分成端口号连续的前后两段,使前一段供第一CGN设备进行分配,后一段供第二CGN设备进行分配,或者使后一段供第二CGN设备进行分配,前一段供第一CGN设备进行分配,例如:对于端口段[2049~2304],使[2049~2177]供第一CGN设备进行分配,[2178~2304]供第二CGN设备进行分配;或者,可以使端口段中奇数端口号供第一CGN设备进行分配,偶数端口号供第二CGN设备进行分配,或者使端口段中偶数端口号供第一CGN设备进行分配,奇数端口号供第二CGN设备进行分配等。
S410、将第一待发送报文的源地址替换为第一待发送报文的源地址对应的公网地址,将第一待发送报文的源端口替换为S409确定的端口,生成修改后的报文,并发送该修改后的报文。
进一步地,基于在上述对应关系中存在第一待发送报文的源地址的结果,第一待发送报文的源地址对应的端口段可以为查找到的端口段,第一待发送报文的源地址对应的公网地址可以为查找到的公网地址,基于在上述对应关系中不存在第一待发送报文的源地址的结果,第一待发送报文的源地址对应的端口段可以为分配的端口段,第一待发送报文的源地址对应的公网地址可以为分配的公网地址。
步骤S401~步骤S404的执行与步骤S405~步骤S410的执行没有严格的先后顺序,以及步骤S407~步骤S408的执行与步骤S409~步骤S410的执行没有严格的先后顺序。
实施例2:
与实施例1相应地,本发明实施例2中,提供一种地址分配方法,应用于第二CGN设备侧,在实施例2中,如图5所示,具体包括如下步骤:
S501、第二CGN设备接收NAT转换设备发送的第一待发送报文。
S502、在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为S501中接收的第一待发送报文的源地址对应分配的公网地址以及端口段,若不存在,则进入步骤S503,若存在,进入步骤S505。
S503、第二CGN设备向第一CGN设备发送地址分配请求,
其中,地址分配请求用于请求为第一待发送报文的源地址对应分配的公网地址以及端口段。
进一步地,本步骤中,当第二CGN设备未查找到第一待发送报文的源地址对应的公网地址和端口段时,可能是第一CGN设备为第一待发送报文的源地址分配了公网地址以及端口段但尚未向第二CGN设备同步,也可能是第一CGN设备尚未为第一待发送报文的源地址分配公网地址以及端口段,由于第二CGN设备不能为私网地址分配公网地址以及端口段,因此,第二CGN设备需要向第一CGN设备发送地址分配请求,若第一CGN设备已经为该私网地址分配了公网地址以及端口段,只是尚未向第二CGN设备同步,则第一CGN设备可以向第二CGN设备同步分配的公网地址和端口段,若第一CGN设备未为该私网地址分配公网地址以及端口段,则第一CGN设备为该私网地址分配公网地址以及端口段,并向第二CGN设备同步分配的公网地址和端口段。
现有技术中存在如下使用场景:假设预分配的端口段长度为256,即端口被预分配为如下端口段形式:[2049~2304],[2305~2561],……,[65279~65535]。假设来自CPE1的数据流192.1.1.2:80--→sina.com被分流到CGN设备A,并且在CGN设备A的用户表中没有查到192.1.1.2这个私网IP地址,也就是说该私网IP地址是首次上线,还没有为该私网IP地址分配公网IP地址以及端口段,CGN设备A可以为该私网IP地址分配公网IP地址10.1.1.1以及公网端口段[1029~2304]。在CGN设备A将该端口段资源分配给该私网IP地址之后,尚未将刚分配的信息同步到CGN设备B,这时CGN设备B可能收到来自CPE2的192.1.1.2:90--→sohu.com数据包,又由于192.168.1.1.2在CGN设备B上也是首次登陆,CGN设备B的用户表中也没有查到192.1.1.2这个私网IP地址,同样CGN设备B需要为该私网IP地址分配公网地址以及端口段资源。CGN设备B可以为该私网IP地址分配公网IP地址10.1.1.2以及公网端口段[2305~2561]。
在上述使用场景中,私网IP地址192.1.1.2获得了两个不同的公网IP地址以及端口段资源,无法保证溯源的一致性,并且上述使用场景中的情况也造成了公网地址资源以及端口资源的浪费。本发明实施例提供的地址分配方 法,CGN设备A和CGN设备B中仅作为第一CGN设备的CGN设备才能为私网地址分配公网地址和端口段,而作为第二CGN设备的CGN设备当接收到以私网地址为源地址的报文,并且在自身存储的用户表中未查找到为该私网地址分配的公网地址以及端口段时,可以向第一CGN设备发送地址分配请求,请求第一CGN设备为该私网地址分配公网地址和端口段,并将分配的公网地址和端口段同步给第二CGN设备,保证不会为相同私网地址分配不同的公网地址和端口段,满足溯源一致性的要求以及避免资源的浪费。
S504、接收第一CGN设备发送的第一待发送报文的源地址和分配的公网地址以及端口段的对应关系。
S505、第二CGN设备从第一待发送报文的源地址对应的端口段的第二端口集中确定尚未分配的端口。
进一步地,第二CGN设备在CGN双主场景中不为私网地址分配公网地址以及端口段,但是需要为接收到的报文的源地址(私网地址)映射公网地址,为接收到的报文的源端口映射分配的端口集中的端口。
S506、将第一待发送报文的源地址替换为第一待发送报文的源地址对应的公网地址,将第一待发送报文的源端口替换为S505中确定的端口,生成修改后的报文,并发送该修改后的报文。
进一步地,本实施例中,在第一CGN设备接收到NAT转换设备发送的报文,且在为该报文的源地址分配了公网地址和端口段之后,还包括:第二CGN设备接收第一CGN设备发送的该私有地址以及对应的公网地址和端口段,并且根据预设划分规则,第二CGN设备能够确定端口段中供自身进行分配的第二端口集。
实施例3:
本发明实施例3中,提供一种地址分配方法,应用于第一CGN设备侧,在实施例3中,第一CGN设备和第二CGN设备具有互不重复的各自用来为私网地址映射端口的端口集,且端口集的划分由第一CGN设备确定。如图6所示,具体包括如下步骤:
S601、第一CGN设备接收第二CGN设备发送的地址分配请求,
其中,地址分配请求中携带第一私网地址。
S602、第一CGN设备在已记录的私网地址、公网地址以及端口段三者的 对应关系中查找是否存在S601中接收的地址分配请求中携带的第一私网地址,若存在,则进入步骤S605,若不存在,进入步骤S603。
S603、第一CGN设备为第一私网地址分配公网地址以及端口段,并记录第一私网地址和分配的公网地址以及端口段的对应关系。
S604、从为第一私网地址分配的端口段中确定第一端口集和第二端口集,
其中,第一端口集是供第一CGN设备进行端口分配的端口集,第二端口集是供第二CGN设备进行端口分配的端口集,第一端口集和第二端口集中的端口标识互不重复。
S605、向第二CGN设备同步第一私网地址和分配的公网地址以及端口段的对应关系、以及第二端口集。
S606、第一CGN设备接收NAT转换设备发送的第二待发送报文。
S607、在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为S606中接收的第二待发送报文的源地址对应分配的公网地址以及端口段,若存在,进入步骤S611,若不存在,进入步骤S608。
S608、为S606中接收的第二待发送报文的源地址分配公网地址以及端口段。
S609、从S608中为第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集。
S610、向第二CGN设备同步第二待发送报文的源地址和分配的公网地址以及端口段的对应关系、以及第二端口集。
进一步地,不管是为NAT转换设备发送的报文的源地址(私网地址)分配的端口段,还是为第二CGN设备发送的待分配私网地址分配的端口段,针对分配给所有私网地址的端口段,均需要按照预设划分规则将该端口段划分为互不重复的端口集,第一CGN设备和第二CGN设备能使用各自对应的端口集中的端口进行端口分配。
进一步地,第一CGN设备可以按照预设划分规则将端口段划分成互不重复的端口集,并将为第二CGN设备分配的端口集发送给第二CGN设备。例如:可以将端口段分成端口号连续的前后两段,使前一段供第一CGN设备进行分配,后一段供第二CGN设备进行分配,或者使后一段供第二CGN设备进行分配,前一段供第一CGN设备进行分配,例如:对于端口段[2049~ 2304],使[2049~2177]供第一CGN设备进行分配,[2178~2304]供第二CGN设备进行分配;或者,可以使端口段中奇数端口号供第一CGN设备进行分配,偶数端口号供第二CGN设备进行分配,或者使端口段中偶数端口号供第一CGN设备进行分配,奇数端口号供第二CGN设备进行分配等。具体端口集的划分方式在这里难以一一列举,只要保证端口集互不重复即可。
进一步地,步骤S605和步骤S608中可以按照预设同步规则将分配的公网地址以及端口段、以及第一CGN设备确定的供第二CGN设备映射的端口集同步给第二CGN设备。例如,可以每为一个待分配私网地址分配了公网地址和端口段之后就同步给第二CGN设备,或者为预设个数个私网地址分配了公网地址和端口段之后再同步给第二CGN设备,或者按照预设同步周期,当同步周期到来时,将本周期内分配的公网地址和端口段及其对应的私网地址同步给第二CGN设备。也就是说,步骤S605和步骤S608中的同步的执行可以为在两次同步过程中完成的,也可以为在一次同步过程中完成的。
进一步地,步骤S601~步骤S605的执行与步骤S606~步骤S608的执行没有严格的先后顺序。
S611、从第二待发送报文的源地址对应的端口段的第一端口集中确定尚未分配的端口。
S612、将第二待发送报文的源地址替换为第二待发送报文的源地址对应的公网地址,以及将第二待发送报文的源端口替换为S611中确定的端口,生成修改后的报文,并发送该修改后的报文。
进一步地,基于在上述对应关系中存在第二待发送报文的源地址的结果,第二待发送报文的源地址对应的端口段可以为查找到的端口段,第二待发送报文的源地址对应的公网地址可以为查找到的公网地址,基于在上述对应关系中不存在第二待发送报文的源地址的结果,第二待发送报文的源地址对应的端口段可以为分配的端口段,第二待发送报文的源地址对应的公网地址可以为分配的公网地址。
进一步地,步骤S601~步骤S605,与步骤S606~步骤S612的执行没有严格的先后顺序,以及步骤S608~步骤S610与步骤S611~步骤S612的执行没有严格的先后顺序。
实施例4:
与实施例3相应地,本发明实施例4中,提供一种地址分配方法,应用于第二CGN设备侧,在实施例4中,如图7所示,具体包括如下步骤:
S701、第二CGN设备接收NAT转换设备发送的第一待发送报文。
S702、在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为S701中接收的第一待发送报文的源地址对应分配的公网地址以及端口段,若不存在,则进入步骤S703,若存在,进入步骤S705。
S703、第二CGN设备向第一CGN设备发送地址分配请求,
其中,地址分配请求用于请求为第一待发送报文的源地址对应分配的公网地址以及端口段。
S704、接收第一CGN设备发送的第一待发送报文的源地址和分配的公网地址以及端口段的对应关系,以及第一CGN设备从端口段中确定的第二端口集。
其中,第一CGN设备将端口段划分为第一端口集和第二端口集,第一端口集是供第一CGN设备进行端口分配的端口集,第二端口集是供第二CGN设备进行端口分配的端口集,第一端口集和第二端口集中的端口标识互不重复。
S705、从第一待发送报文的源地址对应的端口段的第二端口集中确定尚未分配的端口。
S706、将第一待发送报文的源地址替换为第一待发送报文的源地址对应的公网地址,将第一待发送报文的源端口替换为S705中确定的端口,生成修改后的报文,并发送该修改后的报文。
S707、接收第一CGN设备发送的其他私网地址和分配的公网地址以及端口段的对应关系,以及第一CGN设备从端口段中确定的第二端口集,
其中,其他私网地址为第一CGN设备接收的NAT转换设备发送的报文的源地址。
进一步地,步骤S704和步骤S707中,由于第一CGN设备可以按照预设同步规则向第二CGN设备同步分配的公网地址以及端口段、以及第一CGN设备确定的供第二CGN设备映射的端口集。那么,步骤S704和步骤S707中接收的步骤可以为在两次同步过程中完成的,也可以为在一次同步过程中完成的。
进一步地,步骤S701~S706的执行与步骤S707的执行没有严格的先后顺序。
进一步地,图8为本发明实施例提供的地址分配方法数据流示意图之一,如图8所示,数据流801表征当第二CGN设备接收到源地址为私网地址的报文,且未查找到为该私网地址分配的公网地址以及端口段,向第一CGN设备发送地址分配请求,并在第二CGN设备接收到第一CGN设备发送的该私网地址对应的公网地址以及端口段之后,记录该私网地址对应的公网地址以及端口段的对应关系,并确定本次为该报文映射的端口将报文转发;数据流802表征第二CGN设备后续接收到源地址为该私网地址的报文,能够通过自身的记录查找到该私网地址对应的公网地址以及端口段,并进行报文转发,无需再次向第一CGN设备发送地址分配请求。使得同一个私网地址不会分配到不同的公网地址以及端口段,保证了溯源的一致性,避免了公网地址资源以及端口资源的浪费。
进一步地,图9为本发明实施例提供的地址分配方法数据流示意图之二,如图9所示,数据流901表征在第一CGN设备接收到源地址为私网地址(例如:192.168.0.1)的报文之后,根据记录的该私网地址对应的公网地址以及端口段,以及供第一CGN设备映射的端口集(例如:[2049~2176]),从该端口集中确定为该报文映射的端口;数据流902表征在第二CGN设备接收到源地址为相同的私网地址(例如:192.168.0.1)的报文之后,根据记录的该私网地址对应的公网地址以及端口段,以及供第二CGN设备映射的端口集(例如:[2177~2304]),从该端口集中确定为该报文映射的端口。使得第一CGN设备和第二CGN设备不会为私网地址映射重叠的公网地址以及端口,保证了回程报文的正确转发。
基于同一发明构思,本发明实施例还提供了一种CGN设备及CGN双主系统,由于这些设备和系统所解决问题的原理与前述地址分配方法相似,因此该设备和系统的实施可以参见前述方法的实施,重复之处不再赘述。
本发明实施例提供的一种CGN设备之一,用于执行前面方法实施例中所述的第一CGN设备的功能,其应用场景以及与其他设备,例如第二CGN设备和NAT设备的连接关系以及相互报文交换流程,可以参照前面方法实施例中的描述。如图10所示,该CGN设备包括如下模块:
接收模块1001,用于接收第二CGN设备发送的地址分配请求,所述地址分配请求中携带第一私网地址;
查找模块1002,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在所述接收模块1001接收的第一私网地址;
分配模块1003,用于基于所述查找模块1002得到的所述对应关系中不存在所述第一私网地址的查找结果,为所述第一私网地址分配公网地址以及端口段,并记录所述第一私网地址和分配的公网地址以及端口段的对应关系;
发送模块1004,用于向所述第二CGN设备同步所述第一私网地址和所述分配模块1003分配的公网地址以及端口段的对应关系;
其中,本CGN设备为CGN双主场景中预先设定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先设定的不为私网地址分配公网地址以及端口段的设备。
进一步地,接收模块1001接收第二CGN设备发送的地址分配请求,由查找模块1002对分配请求中携带的第一私网地址进行查找,分配模块1003根据查找模块1002得到的查找结果为第一私网地址分配公网地址以及端口段,并由发送模块1004向第二CGN设备同步第一私网地址以及分配的公网地址和端口段的地址分配流程请参加本发明实施例1步骤S401~步骤S404。
进一步地,所述CGN设备,还包括:获得模块1005和端口确定模块1006;
所述获得模块1005,用于获得第一待发送报文;
所述查找模块1002,还用于在所述对应关系中查找是否存在为所述获得模块1005获得的第一待发送报文的源地址对应分配的公网地址以及端口段;
所述端口确定模块1006,用于基于所述查找模块1002得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块1002查找到的端口段的第一端口集中确定尚未分配的端口;并
所述发送模块1004,还用于将所述第一待发送报文的源地址替换为所述查找模块1002查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块1006确定的端口,生成修改后的报文,并发送所述修改后的报文;
其中,按照预设划分规则将所述端口段划分为第二端口集和所述第一端 口集,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
进一步地,获得模块1005获得第一待发送报文,通过查找模块1002查找该第一待发送报文的源地址对应的公网地址以及端口段,端口确定模块1006根据查找模块1002得到的查找结果,从第一端口集中为第一待发送报文确定可用端口,并由发送模块1004将替换了源地址和源端口的修该后的报文发送的地址分配流程请参加本发明实施例1步骤S405~步骤410。
进一步地,所述分配模块1003,还用于从为所述第一私网地址分配的端口段中确定第一端口集和第二端口集,其中,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复;
所述发送模块1004,具体用于向所述第二CGN设备同步所述第一私网地址和所述分配模块1003分配的公网地址以及端口段的对应关系、以及确定的所述第二端口集。
进一步地,接收模块1001接收第二CGN设备发送的地址分配请求,由查找模块1002对分配请求中携带的第一私网地址进行查找,分配模块1003根据查找模块1002得到的查找结果为第一私网地址分配公网地址以及端口段,并将端口段划分成第一端口集和第二端口集,由发送模块1004向第二CGN设备同步第一私网地址以及分配的公网地址和端口段以及第二端口集的地址分配流程请参加本发明实施例3步骤S601~步骤S605。
进一步地,所述接收模块1001,还用于接收网络地址转换NAT转换设备发送的第二待发送报文;
所述查找模块1002,还用于在所述对应关系中查找是否存在为所述接收模块1001接收的第二待发送报文的源地址对应分配的公网地址以及端口段;
所述分配模块1003,还用于基于所述查找模块1002得到的所述对应关系中不存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,为所述第二待发送报文的源地址分配公网地址以及端口段;以及从为所述第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集;
所述发送模块1004,还用于向所述第二CGN设备同步所述第二待发送报文的源地址和所述分配模块1003分配的公网地址以及端口段的对应关系、以及所述第二端口集。
进一步地,所述CGN设备,还包括:端口确定模块1006;
所述端口确定模块1006,用于基于所述查找模块1002得到的所述对应关系中存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块1002查找到的端口段的第一端口集中确定尚未分配的端口;
所述发送模块1004,还用于将所述第二待发送报文的源地址替换为所述查找模块1002查找到的公网地址,以及将所述第二待发送报文的源端口替换为所述端口确定模块1006确定的端口,生成修改后的报文,并发送所述修改后的报文。
进一步地,接收模块1001接收NAT转换设备发送的第二待发送报文,由查找模块1002在所述对应关系中对第二待发送报文的源地址进行查找,分配模块1003根据查找模块1002得到的查找结果为第二待发送报文的源地址分配公网地址以及端口段,将分配的端口段划分成第一端口集和第二端口集,并由发送模块1004向第二CGN设备同步第一私网地址以及分配的公网地址和端口段以及第二端口集,以及将第二待发送报文的源地址和源端口进行修改并发送的地址分配流程请参加本发明实施例3步骤S606~步骤S612。
本发明实施例提供的一种运营商级网络地址转换CGN设备之二,用于执行前面方法实施例中所述的第二CGN设备的功能,其应用场景以及与其他设备,例如第一CGN设备和NAT设备的连接关系以及相互报文交换流程,可以参照前面方法实施例中的描述。如图11所示,该CGN设备包括:
接收模块1101,用于接收网络地址转换NAT转换设备发送的第一待发送报文;
查找模块1102,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为所述接收模块1101接收的第一待发送报文的源地址对应分配的公网地址以及端口段;
发送模块1103,用于基于所述查找模块1102得到的所述对应关系中不存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结 果,向第一CGN设备发送地址分配请求,其中,所述地址分配请求携带所述第一待发送报文的源地址;
所述接收模块1101,还用于接收所述第一CGN设备针对所述发送模块1103发送的所述地址分配请求发送的所述第一待发送报文的源地址和公网地址以及端口段三者的对应关系;
其中,所述第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,本CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备。
进一步地,所述CGN设备,还包括:端口确定模块1104;
所述端口确定模块1104,用于基于所述查找模块1102得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块1102查找到的端口段的第二端口集中确定尚未分配的端口;
所述发送模块1103,还用于将所述第一待发送报文的源地址替换为所述查找模块1102查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块1104确定的端口,生成修改后的报文,并发送所述修改后的报文;
其中,按照预设划分规则将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
进一步地,接收模块1101接收到NAT转换设备发送的第一待发送报文,查找模块1102在所述对应关系中查找第一待发送报文的源地址,发送模块1103根据查找模块1102未查找到该源地址的查找结果,向第一CGN设备发送地址分配请求,接收模块1101接收第一CGN设备回复的为该源地址分配的公网地址和端口段,端口确定模块1104从分配的端口段的第二端口集中确定端口,并由发送模块1103将修改了源地址和源端口的报文发送的地址分配流程参加本发明实施例2的步骤S501~步骤S506。
进一步地,所述接收模块1101,具体用于接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段的对应关系,以及所述 第一CGN设备从所述端口段中确定的第二端口集,其中,所述第一CGN设备将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
进一步地,所述接收模块1101,还用于接收所述第一CGN设备发送的其他私网地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,
其中,所述其他私网地址为所述第一CGN设备接收的NAT转换设备发送的报文的源地址。
进一步地,所述的CGN设备,还包括:端口确定模块1104;
所述端口确定模块1104,用于基于所述查找模块1102得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块1102查找到的端口段的第二端口集中确定尚未分配的端口;
所述发送模块1103,还用于将所述第一待发送报文的源地址替换为所述查找模块1102查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块1104确定的端口,生成修改后的报文,并发送所述修改后的报文。
进一步地,接收模块1101接收到NAT转换设备发送的第一待发送报文,查找模块1102在所述对应关系中查找第一待发送报文的源地址,发送模块1103根据查找模块1102未查找到该源地址的查找结果,向第一CGN设备发送地址分配请求,接收模块1101接收第一CGN设备回复的为该源地址分配的公网地址和端口段以及第二端口集,端口确定模块1104从第二端口集中确定端口,并由发送模块1103将修改了源地址和源端口的报文发送的地址分配流程参见本发明实施例4的步骤S701~步骤S707。
本发明实施例提供的一种CGN双主系统,包括:上述的CGN设备之一,以及上述的CGN设备之二。
基于同一发明构思,本发明实施例还提供了一种用于建立安全连接的设备及系统,由于这些设备和系统所解决问题的原理与前述一种用于建立安全 连接的方法相似,因此该设备和系统的实施可以参见前述方法的实施,重复之处不再赘述。
本发明实施例提供了一种CGN设备之三,用于执行前面方法实施例中所述的第一CGN设备的功能,其应用场景以及与其他设备,例如第二CGN设备和NAT设备的连接关系以及相互报文交换流程,可以参照前面方法实施例中的描述。如图12所示,该CGN设备包括网络接口1201、处理器1202(可以为一个或多个,本发明各实施例中以一个为例)、存储器1203以及总线系统1204,其中:
网络接口1201可以是有线接口,例如光纤分布式数据接口(Fiber Distributed Data Interface,简称FDDI)、千兆以太网(Gigabit Ethernet,简称GE)接口;网络接口1201也可以是无线接口。
处理器1202控制一种CGN设备之三的操作,处理器1202还可以称为CPU(Central Processing Unit,中央处理单元)。处理器1202可能是一种集成电路芯片,具有信号的处理能力。处理器1202还可以是通用处理器、数字信号处理器(DSP,Digital Signal Processing)、专用集成电路(ASIC,Application Specific Integrated Circuit)、现场可编程门阵列(FPGA,Field-Programmable Gate Array)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器1203可以包括只读存储器和随机存取存储器,并向处理器1202提供指令和数据。存储器1203的一部分还可以包括非易失性随机存取存储器(NVRAM)。
一种CGN设备之三的各个组件通过总线系统1204耦合在一起,其中总线系统1204除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。该总线系统可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component Interconnect,外部设备互连)总线或EISA(Extended Industry Standard Architecture,扩展工业标准体系结构)总线等。所述总线可以是一条或多条物理线路,当是多条物理线路时可以分为地址总线、数据总线、控制总线等。在本发明的其它一些实施例中,处理器1202、存储器1203以及网络接口1201也可以通过通信线路直接连接。但 是为了清楚说明起见,在图中将各种总线都标为总线系统1204。
存储器1203存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:
操作指令:包括各种操作指令,用于实现各种操作。
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
在本发明实施例中,处理器1202通过调用存储器1203存储的操作指令(该操作指令可存储在操作系统中),执行如下操作:
网络接口1201,用于接收第二CGN设备发送的地址分配请求,所述地址分配请求中携带第一私网地址;
处理器1202,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在所述网络接口1201接收的第一私网地址;基于所述对应关系中不存在所述第一私网地址的查找结果,为所述第一私网地址分配公网地址以及端口段,并记录所述第一私网地址和分配的公网地址以及端口段的对应关系;
网络接口1201,还用于向所述第二CGN设备同步所述第一私网地址和所述处理器1202分配的公网地址以及端口段的对应关系;
其中,本CGN设备为CGN双主场景中预先设定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先设定的不为私网地址分配公网地址以及端口段的设备。
进一步地,网络接口1201接收第二CGN设备发送的地址分配请求,由处理器1202对分配请求中携带的第一私网地址进行查找,根据查找结果为第一私网地址分配公网地址以及端口段,并由网络接口1201向第二CGN设备同步第一私网地址以及分配的公网地址和端口段的地址分配流程请参加本发明实施例1步骤S401~步骤S404。
进一步地,所述网络接口1201,还用于获得第一待发送报文;
所述处理器1202,还用于在所述对应关系中查找是否存在为所述网络接口1201获得的第一待发送报文的源地址对应分配的公网地址以及端口段;基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从查找到的端口段的第一端口集中确定尚未分配的 端口;
所述网络接口1201,还用于将所述第一待发送报文的源地址替换为处理器1202查找到的公网地址,以及将所述第一待发送报文的源端口替换为处理器1202确定的端口,生成修改后的报文,并发送所述修改后的报文;
其中,按照预设划分规则将所述端口段划分为第二端口集和所述第一端口集,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
进一步地,网络接口1201获得第一待发送报文,通过处理器1202查找该第一待发送报文的源地址对应的公网地址以及端口段,根据查找结果,从第一端口集中为第一待发送报文确定可用端口,并由网络接口1201将替换了源地址和源端口的修该后的报文发送的地址分配流程请参加本发明实施例1步骤S405~步骤410。
进一步地,所述处理器1202,还用于从为所述第一私网地址分配的端口段中确定第一端口集和第二端口集,其中,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复;
所述网络接口1201,具体用于向所述第二CGN设备同步所述第一私网地址和所述处理器1202分配的公网地址以及端口段的对应关系、以及确定的所述第二端口集。
进一步地,网络接口1201接收第二CGN设备发送的地址分配请求,由处理器1202对分配请求中携带的第一私网地址进行查找,根据查找结果为第一私网地址分配公网地址以及端口段,并将端口段划分成第一端口集和第二端口集,并由网络接口1201向第二CGN设备同步第一私网地址以及分配的公网地址和端口段以及第二端口集的地址分配流程请参加本发明实施例3步骤S601~步骤S605。
进一步地,所述网络接口1201,还用于接收网络地址转换NAT转换设备发送的第二待发送报文;
所述处理器1202,还用于在所述对应关系中查找是否存在为所述网络接口1201接收的第二待发送报文的源地址对应分配的公网地址以及端口段;基 于所述对应关系中不存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,为所述第二待发送报文的源地址分配公网地址以及端口段;以及从为所述第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集;
所述网络接口1201,还用于向所述第二CGN设备同步所述第二待发送报文的源地址和所述处理器1202分配的公网地址以及端口段的对应关系、以及所述第二端口集。
进一步地,所述处理器1202,还用于基于所述对应关系中存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从查找到的端口段的第一端口集中确定尚未分配的端口;
所述网络接口1201,还用于将所述第二待发送报文的源地址替换为所述处理器1202查找到的公网地址,以及将所述第二待发送报文的源端口替换为所述处理器1202确定的端口,生成修改后的报文,并发送所述修改后的报文。
进一步地,网络接口1201接收NAT转换设备发送的第二待发送报文,由处理器1202在所述对应关系中对第二待发送报文的源地址进行查找,根据查找结果为第二待发送报文的源地址分配公网地址以及端口段,并将端口段划分成第一端口集和第二端口集,并由网络接口1201向第二CGN设备同步第一私网地址以及分配的公网地址和端口段以及第二端口集,以及将第二待发送报文的源地址和源端口进行修改并发送的地址分配流程请参加本发明实施例3步骤S606~步骤S612。
本发明实施例提供的一种运营商级网络地址转换CGN设备之四,用于执行前面方法实施例中所述的第二CGN设备的功能,其应用场景以及与其他设备,例如第一CGN设备和NAT设备的连接关系以及相互报文交换流程,可以参照前面方法实施例中的描述。如图13所示,该CGN设备包括网络接口1301、处理器1302(可以为一个或多个,本发明各实施例中以一个为例)、存储器1303以及总线系统1304,其中:
网络接口1301可以是有线接口,例如光纤分布式数据接口(Fiber Distributed Data Interface,简称FDDI)、千兆以太网(Gigabit Ethernet,简称GE)接口;网络接口1301也可以是无线接口。
处理器1302控制一种CGN设备之四的操作,处理器1302还可以称为 CPU(Central Processing Unit,中央处理单元)。处理器1302可能是一种集成电路芯片,具有信号的处理能力。处理器1302还可以是通用处理器、数字信号处理器(DSP,Digital Signal Processing)、专用集成电路(ASIC,Application Specific Integrated Circuit)、现场可编程门阵列(FPGA,Field-Programmable Gate Array)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器1303可以包括只读存储器和随机存取存储器,并向处理器1302提供指令和数据。存储器1303的一部分还可以包括非易失性随机存取存储器(NVRAM)。
一种CGN设备之四的各个组件通过总线系统1304耦合在一起,其中总线系统1304除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。该总线系统可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component Interconnect,外部设备互连)总线或EISA(Extended Industry Standard Architecture,扩展工业标准体系结构)总线等。所述总线可以是一条或多条物理线路,当是多条物理线路时可以分为地址总线、数据总线、控制总线等。在本发明的其它一些实施例中,处理器1302、存储器1303以及网络接口1301也可以通过通信线路直接连接。但是为了清楚说明起见,在图中将各种总线都标为总线系统1304。
存储器1303存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:
操作指令:包括各种操作指令,用于实现各种操作。
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
在本发明实施例中,处理器1302通过调用存储器1303存储的操作指令(该操作指令可存储在操作系统中),执行如下操作:
网络接口1301,用于接收网络地址转换NAT转换设备发送的第一待发送报文;
处理器1302,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为所述网络接口1301接收的第一待发送报文的源地址 对应分配的公网地址以及端口段;
网络接口1301,还用于基于所述处理器1302得到的所述对应关系中不存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,向第一CGN设备发送地址分配请求,其中,所述地址分配请求携带所述第一待发送报文的源地址;以及接收所述第一CGN设备针对所述网络接口1301发送的所述地址分配请求发送的所述第一待发送报文的源地址和公网地址以及端口段三者的对应关系;
其中,所述第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,本CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备。
进一步地,所述处理器1302,还用于基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从查找到的端口段的第二端口集中确定尚未分配的端口;
所述网络接口1301,还用于将所述第一待发送报文的源地址替换为所述处理器1302查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述处理器1302确定的端口,生成修改后的报文,并发送所述修改后的报文;
其中,按照预设划分规则将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
进一步地,网络接口1301接收到NAT转换设备发送的第一待发送报文,处理器1302在所述对应关系中查找第一待发送报文的源地址,网络接口1301根据处理器1302未查找到该源地址的查找结果,向第一CGN设备发送地址分配请求,网络接口1301接收第一CGN设备回复的为该源地址分配的公网地址和端口段,处理器1302从分配的端口段的第二端口集中确定端口,并由网络接口1301将修改了源地址和源端口的报文发送的地址分配流程参加本发明实施例2的步骤S501~步骤S506。
进一步地,所述网络接口1301,具体用于接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述第一CGN设 备将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
进一步地,所述网络接口1301,还用于接收所述第一CGN设备发送的其他私网地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,
其中,所述其他私网地址为所述第一CGN设备接收的NAT转换设备发送的报文的源地址。
进一步地,所述处理器1302,还用于基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从查找到的端口段的第二端口集中确定尚未分配的端口;
所述网络接口1301,还用于将所述第一待发送报文的源地址替换为所述处理器1302查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述处理器1302确定的端口,生成修改后的报文,并发送所述修改后的报文。
进一步地,网络接口1301接收到NAT转换设备发送的第一待发送报文,处理器1302在所述对应关系中查找第一待发送报文的源地址,网络接口1301根据处理器1302未查找到该源地址的查找结果,向第一CGN设备发送地址分配请求,网络接口1301接收第一CGN设备回复的为该源地址分配的公网地址和端口段以及第二端口集,处理器1302从第二端口集中确定端口,并由网络接口1301将修改了源地址和源端口的报文发送的地址分配流程参见本发明实施例4的步骤S701~步骤S707。
本发明实施例提供的一种CGN双主系统,包括:上述的CGN设备之三,以及上述的CGN设备之四。
上述各单元的功能可对应于图2至图7所示流程中的相应处理步骤,在此不再赘述。
本发明实施例提供的一种地址分配方法、CGN设备及CGN双主系统,包括:在CGN双主场景中,预先约定将第一CGN设备确定为用于为私网地址进行公网地址以及端口段分配的设备,将第二CGN设备确定为不为私网地址进行公网地址以及端口段分配的设备。当第二CGN设备接收到NAT转换 设备发送的第一待发送报文时,在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在第一待发送报文的源地址;基于上述对应关系中不存在第一待发送报文的源地址的查找结果,第二CGN设备向第一CGN设备发送地址分配请求;当第一CGN设备接收到地址分配请求时,在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在地址分配请求中携带的第一私网地址;基于上述对应关系中不存在第一私网地址的查找结果,第一CGN设备为第一私网地址分配公网地址以及端口段,并记录第一私网地址和分配的公网地址以及端口段的对应关系;向第二CGN设备同步第一私网地址和分配的公网地址以及端口段的对应关系。本发明实施例提供的地址分配方法,在CGN双主场景的两个CGN设备中,确定其中一个CGN设备(第一CGN设备)用于为私有地址进行公网地址以及端口段分配,另一个CGN设备(第二CGN设备)不为私有地址进行公网地址以及端口段分配,避免了两个CGN设备在没有来得及同步的前提下,为同一个私网地址分配不同的公网地址以及端口段,使得一个私网地址只能分配一个公网地址以及一个端口段,保证了溯源的一致性,避免了公网地址资源以及端口资源的浪费。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明实施例可以通过硬件实现,也可以借助软件加必要的通用硬件平台的方式来实现。基于这样的理解,本发明实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
本领域技术人员可以理解附图只是一个优选实施例的示意图,附图中的模块或流程并不一定是实施本发明所必须的。
本领域技术人员可以理解实施例中的装置中的模块可以按照实施例描述进行分布于实施例的装置中,也可以进行相应变化位于不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要 求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (21)

  1. 一种地址分配方法,其特征在于,包括:
    第一运营商级网络地址转换CGN设备接收第二CGN设备发送的地址分配请求,所述地址分配请求中携带第一私网地址;
    所述第一CGN设备在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在所述第一私网地址;
    基于所述对应关系中不存在所述第一私网地址的查找结果,所述第一CGN设备为所述第一私网地址分配公网地址以及端口段,并记录所述第一私网地址和分配的公网地址以及端口段的对应关系;以及
    向所述第二CGN设备同步所述第一私网地址和分配的公网地址以及端口段的对应关系;
    其中,所述第一CGN设备为CGN双主场景中预先设定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先设定的不为私网地址分配公网地址以及端口段的设备。
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    所述第一CGN设备获得第一待发送报文;
    判断是否是首包;如果是首包
    在所述对应关系中查找是否存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段;
    基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述第一CGN设备从查找到的端口段的第一端口集中确定尚未分配的端口;并
    将所述第一待发送报文的源地址替换为查找到的公网地址,以及将所述第一待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文;
    其中,按照预设划分规则将所述端口段划分为第二端口集和所述第一端 口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
  3. 如权利要求1所述的方法,其特征在于,向所述第二CGN设备同步所述第一私网地址和分配的公网地址以及端口段的对应关系,具体包括:
    从为所述第一私网地址分配的端口段中确定第一端口集和第二端口集,其中,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复;
    向所述第二CGN设备同步所述第一私网地址和分配的公网地址以及端口段的对应关系、以及所述第二端口集。
  4. 如权利要求1或3所述的方法,其特征在于,所述方法还包括:
    第一CGN设备接收网络地址转换NAT转换设备发送的第二待发送报文;
    在所述对应关系中查找是否存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段;
    基于所述对应关系中不存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,为所述第二待发送报文的源地址分配公网地址以及端口段;
    从为所述第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集;
    向所述第二CGN设备同步所述第二待发送报文的源地址和分配的公网地址以及端口段的对应关系、以及所述第二端口集。
  5. 如权利要求4所述的方法,其特征在于,基于所述对应关系中存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述方法还包括:
    从查找到的端口段的第一端口集中确定尚未分配的端口;
    将所述第二待发送报文的源地址替换为查找到的公网地址,以及将所述 第二待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文。
  6. 一种地址分配方法,其特征在于,包括:
    第二运营商级网络地址转换CGN设备接收网络地址转换NAT转换设备发送的第一待发送报文;
    在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段;
    基于所述对应关系中不存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述第二CGN设备向第一CGN设备发送地址分配请求,其中,所述地址分配请求携带所述第一待发送报文的源地址;
    接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段三者的对应关系;
    其中,所述第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备。
  7. 如权利要求6所述的方法,其特征在于,基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述方法还包括:
    所述第二CGN设备从查找到的端口段的第二端口集中确定尚未分配的端口;并
    将所述第一待发送报文的源地址替换为查找到的公网地址,以及将所述第一待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文;
    其中,按照预设划分规则将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
  8. 如权利要求6所述的方法,其特征在于,接收所述第一CGN设备发送的所述第一待发送报文的源地址和分配的公网地址以及端口段的对应关系,具体包括:
    接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,
    其中,所述第一CGN设备将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
  9. 如权利要求8所述的方法,其特征在于,所述方法还包括:
    接收所述第一CGN设备发送的其他私网地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,
    其中,所述其他私网地址为所述第一CGN设备接收的NAT转换设备发送的报文的源地址。
  10. 如权利要求8或9所述的方法,其特征在于,基于所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,所述方法还包括:
    所述第二CGN设备从查找到的端口段的第二端口集中确定尚未分配的端口;
    将所述第一待发送报文的源地址替换为查找到的公网地址,以及将所述第一待发送报文的源端口替换为确定的端口,生成修改后的报文,并发送所述修改后的报文。
  11. 一种运营商级网络地址转换CGN设备,作为第一CGN设备,其特征在于,包括:
    接收模块,用于接收第二CGN设备发送的地址分配请求,所述地址分配请求中携带第一私网地址;
    查找模块,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在所述接收模块接收的第一私网地址;
    分配模块,用于基于所述查找模块得到的所述对应关系中不存在所述第一私网地址的查找结果,为所述第一私网地址分配公网地址以及端口段,并记录所述第一私网地址和分配的公网地址以及端口段的对应关系;
    发送模块,用于向所述第二CGN设备同步所述第一私网地址和所述分配模块分配的公网地址以及端口段的对应关系;
    其中,本CGN设备为CGN双主场景中预先设定的用于为私网地址分配公网地址以及端口段的设备,所述第二CGN设备为CGN双主场景中预先设定的不为私网地址分配公网地址以及端口段的设备。
  12. 如权利要求11所述的CGN设备,其特征在于,还包括:获得模块和端口确定模块;
    所述获得模块,用于获得第一待发送报文;
    所述查找模块,还用于在所述对应关系中查找是否存在为所述获得模块获得的第一待发送报文的源地址对应分配的公网地址以及端口段;
    所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第一端口集中确定尚未分配的端口;并
    所述发送模块,还用于将所述第一待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文;
    其中,按照预设划分规则将所述端口段划分为第二端口集和所述第一端口集,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
  13. 如权利要求11所述的CGN设备,其特征在于,所述分配模块,还 用于从为所述第一私网地址分配的端口段中确定第一端口集和第二端口集,其中,所述第一端口集是供本CGN设备进行端口分配的端口集,所述第二端口集是供所述第二CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复;
    所述发送模块,具体用于向所述第二CGN设备同步所述第一私网地址和所述分配模块分配的公网地址以及端口段的对应关系、以及确定的所述第二端口集。
  14. 如权利要求11或13所述的CGN设备,其特征在于,所述接收模块,还用于接收网络地址转换NAT转换设备发送的第二待发送报文;
    所述查找模块,还用于在所述对应关系中查找是否存在为所述接收模块接收的第二待发送报文的源地址对应分配的公网地址以及端口段;
    所述分配模块,还用于基于所述查找模块得到的所述对应关系中不存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,为所述第二待发送报文的源地址分配公网地址以及端口段;以及从为所述第二待发送报文的源地址分配的端口段中确定第一端口集和第二端口集;
    所述发送模块,还用于向所述第二CGN设备同步所述第二待发送报文的源地址和所述分配模块分配的公网地址以及端口段的对应关系、以及所述第二端口集。
  15. 如权利要求14所述的CGN设备,其特征在于,还包括:端口确定模块;
    所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第二待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第一端口集中确定尚未分配的端口;
    所述发送模块,还用于将所述第二待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第二待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文。
  16. 一种运营商级网络地址转换CGN设备,作为第二CGN设备,其特 征在于,包括:
    接收模块,用于接收网络地址转换NAT转换设备发送的第一待发送报文;
    查找模块,用于在已记录的私网地址、公网地址以及端口段三者的对应关系中查找是否存在为所述接收模块接收的第一待发送报文的源地址对应分配的公网地址以及端口段;
    发送模块,用于基于所述查找模块得到的所述对应关系中不存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,向第一CGN设备发送地址分配请求,其中,所述地址分配请求携带所述第一待发送报文的源地址;
    所述接收模块,还用于接收所述第一CGN设备针对所述发送模块发送的地址分配请求发送的所述第一待发送报文的源地址和公网地址以及端口段三者的对应关系;
    其中,所述第一CGN设备为CGN双主场景中预先约定的用于为私网地址分配公网地址以及端口段的设备,本CGN设备为CGN双主场景中预先约定的不为私网地址分配公网地址以及端口段的设备。
  17. 如权利要求16所述的CGN设备,其特征在于,还包括:端口确定模块;
    所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第二端口集中确定尚未分配的端口;
    所述发送模块,还用于将所述第一待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文;
    其中,按照预设划分规则将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
  18. 如权利要求16所述的CGN设备,其特征在于,所述接收模块,具体用于接收所述第一CGN设备发送的所述第一待发送报文的源地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,其中,所述第一CGN设备将所述端口段划分为第一端口集和第二端口集,所述第一端口集是供所述第一CGN设备进行端口分配的端口集,所述第二端口集是供本CGN设备进行端口分配的端口集,所述第一端口集和所述第二端口集中的端口标识互不重复。
  19. 如权利要求18所述的CGN设备,其特征在于,所述接收模块,还用于接收所述第一CGN设备发送的其他私网地址和公网地址以及端口段的对应关系,以及所述第一CGN设备从所述端口段中确定的第二端口集,
    其中,所述其他私网地址为所述第一CGN设备接收的NAT转换设备发送的报文的源地址。
  20. 如权利要求18或19所述的CGN设备,其特征在于,还包括:端口确定模块;
    所述端口确定模块,用于基于所述查找模块得到的所述对应关系中存在为所述第一待发送报文的源地址对应分配的公网地址以及端口段的查找结果,从所述查找模块查找到的端口段的第二端口集中确定尚未分配的端口;
    所述发送模块,还用于将所述第一待发送报文的源地址替换为所述查找模块查找到的公网地址,以及将所述第一待发送报文的源端口替换为所述端口确定模块确定的端口,生成修改后的报文,并发送所述修改后的报文。
  21. 一种CGN双主系统,其特征在于,包括:如权利要求11~15任一所述的CGN设备,以及如权利要求16~20任一所述的CGN设备。
PCT/CN2015/088137 2014-12-18 2015-08-26 一种地址分配方法、cgn设备及cgn双主系统 WO2016095561A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP15869072.7A EP3169044B1 (en) 2014-12-18 2015-08-26 Address allocation method, cgn device and cgn double-master system
US15/596,716 US10320738B2 (en) 2014-12-18 2017-05-16 Address allocation method, CGN device, and CGN dual-active system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410795836.5A CN105791448B (zh) 2014-12-18 2014-12-18 一种地址分配方法、cgn设备及cgn双主系统
CN201410795836.5 2014-12-18

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/596,716 Continuation US10320738B2 (en) 2014-12-18 2017-05-16 Address allocation method, CGN device, and CGN dual-active system

Publications (1)

Publication Number Publication Date
WO2016095561A1 true WO2016095561A1 (zh) 2016-06-23

Family

ID=56125837

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/088137 WO2016095561A1 (zh) 2014-12-18 2015-08-26 一种地址分配方法、cgn设备及cgn双主系统

Country Status (4)

Country Link
US (1) US10320738B2 (zh)
EP (1) EP3169044B1 (zh)
CN (1) CN105791448B (zh)
WO (1) WO2016095561A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3573295A4 (en) * 2017-01-17 2020-01-08 Nec Corporation GATEWAY DEVICE, NETWORK ADDRESS TRANSLATION DEVICE, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND PROGRAM

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685586B (zh) * 2012-09-07 2018-09-04 中兴通讯股份有限公司 一种实现地址共享的方法、装置和系统
EP3105884A4 (en) 2014-02-11 2018-03-21 Yaana Technologies, LLC Mathod and system for metadata analysis and collection with privacy
US10447503B2 (en) 2014-02-21 2019-10-15 Yaana Technologies, LLC Method and system for data flow management of user equipment in a tunneling packet data network
US10334037B2 (en) 2014-03-31 2019-06-25 Yaana Technologies, Inc. Peer-to-peer rendezvous system for minimizing third party visibility and method thereof
US10285038B2 (en) 2014-10-10 2019-05-07 Yaana Technologies, Inc. Method and system for discovering user equipment in a network
US10542426B2 (en) 2014-11-21 2020-01-21 Yaana Technologies, LLC System and method for transmitting a secure message over a signaling network
WO2016176661A1 (en) 2015-04-29 2016-11-03 Yaana Technologies, Inc. Scalable and iterative deep packet inspection for communications networks
US10135930B2 (en) * 2015-11-13 2018-11-20 Yaana Technologies Llc System and method for discovering internet protocol (IP) network address and port translation bindings
CN108259632B (zh) 2017-05-24 2020-02-11 新华三技术有限公司 一种cgn实现方法及装置
CN110166270A (zh) * 2018-02-13 2019-08-23 中兴通讯股份有限公司 热备切换处理方法、设备及存储介质
CN108989483B (zh) * 2018-08-01 2022-02-25 新华三技术有限公司 一种网络地址的配置方法及装置
CN111405025A (zh) * 2020-03-11 2020-07-10 广东中兴新支点技术有限公司 数据传输的方法及装置、传输设备、可读存储介质
CN113840016A (zh) * 2020-06-23 2021-12-24 中兴通讯股份有限公司 报文处理方法、装置和计算机可读存储介质
CN112600765B (zh) * 2020-12-02 2022-07-29 杭州迪普科技股份有限公司 一种配置资源调度方法及装置
CN114793221B (zh) * 2022-03-21 2024-02-09 新华三信息安全技术有限公司 Nat关联表的处理方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136926A (zh) * 2007-10-12 2008-03-05 杭州华三通信技术有限公司 非对称路由情况下的报文转发方法及网络地址转换网关
CN101834831A (zh) * 2009-03-13 2010-09-15 华为技术有限公司 一种实现nat设备冗余备份的方法、装置和系统
CN102377628A (zh) * 2010-08-12 2012-03-14 杭州华三通信技术有限公司 建立DS-Lite隧道的方法和DS-Lite CGN
CN102594933A (zh) * 2011-12-20 2012-07-18 华为技术有限公司 一种公网地址分配的方法、装置及系统

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050152305A1 (en) * 2002-11-25 2005-07-14 Fujitsu Limited Apparatus, method, and medium for self-organizing multi-hop wireless access networks
JP5488591B2 (ja) * 2009-04-16 2014-05-14 日本電気株式会社 通信システム
CN102006337B (zh) * 2010-11-23 2013-12-18 华为技术有限公司 一种基于cgn实体的数据传输方法、cgn实体、网关及系统
US9306903B2 (en) * 2011-09-13 2016-04-05 Cable Television Laboratories, Inc. Deterministic mapping
US9178846B1 (en) * 2011-11-04 2015-11-03 Juniper Networks, Inc. Deterministic network address and port translation
US9191362B2 (en) * 2012-06-26 2015-11-17 Cisco Technology, Inc. Determining the type of upstream network address translation from a home gateway
US9003024B2 (en) * 2012-06-28 2015-04-07 Cable Television Laboratories, Inc. Usage based accounting for network deployment
US8953592B2 (en) * 2012-09-28 2015-02-10 Juniper Networks, Inc. Network address translation for application of subscriber-aware services
CN103117947B (zh) * 2013-01-28 2016-06-29 中兴通讯股份有限公司 一种负载分担方法及装置
CN103188154B (zh) * 2013-04-19 2016-03-02 杭州华三通信技术有限公司 一种网络地址转换的方法和板卡
CN104219334B (zh) * 2013-05-30 2017-09-29 中国联合网络通信集团有限公司 用户溯源方法、装置及宽带接入服务器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136926A (zh) * 2007-10-12 2008-03-05 杭州华三通信技术有限公司 非对称路由情况下的报文转发方法及网络地址转换网关
CN101834831A (zh) * 2009-03-13 2010-09-15 华为技术有限公司 一种实现nat设备冗余备份的方法、装置和系统
CN102377628A (zh) * 2010-08-12 2012-03-14 杭州华三通信技术有限公司 建立DS-Lite隧道的方法和DS-Lite CGN
CN102594933A (zh) * 2011-12-20 2012-07-18 华为技术有限公司 一种公网地址分配的方法、装置及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3573295A4 (en) * 2017-01-17 2020-01-08 Nec Corporation GATEWAY DEVICE, NETWORK ADDRESS TRANSLATION DEVICE, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND PROGRAM

Also Published As

Publication number Publication date
CN105791448B (zh) 2019-10-25
EP3169044A1 (en) 2017-05-17
CN105791448A (zh) 2016-07-20
US10320738B2 (en) 2019-06-11
US20170250944A1 (en) 2017-08-31
EP3169044A4 (en) 2017-08-16
EP3169044B1 (en) 2018-10-03

Similar Documents

Publication Publication Date Title
WO2016095561A1 (zh) 一种地址分配方法、cgn设备及cgn双主系统
JP6538986B2 (ja) 仮想マシンパケット制御
US9419940B2 (en) IPv4 data center support for IPv4 and IPv6 visitors
EP2645679B1 (en) Method and apparatus for message transmission
CN108768692B (zh) 一种网络创建方法、相关设备及系统
WO2018137369A1 (zh) 混合云管理方法、装置和计算设备
US10594586B2 (en) Dialing test method, dialing test system, and computing node
US20090063706A1 (en) Combined Layer 2 Virtual MAC Address with Layer 3 IP Address Routing
US20130024553A1 (en) Location independent dynamic IP address assignment
WO2020253631A1 (zh) Ip地址的配置方法、设备及系统
TW201815131A (zh) 一種資料傳輸的方法及網路設備
CN107547665B (zh) 一种dhcp地址分配的方法、设备及系统
US20150113168A1 (en) Network Bridging
WO2016177145A1 (zh) 报文发送方法及装置
CN114556868B (zh) 虚拟专用网络vpn客户端的专用子网络
CN109194525A (zh) 一种网络节点配置方法及管理节点
WO2018161795A1 (zh) 一种路由优先级配置方法、设备以及控制器
JPWO2014142258A1 (ja) 通信システム、制御装置、アドレス割当方法及びプログラム
US20180262389A1 (en) Advertising method and system in network functions virtualization environment
US9749290B2 (en) Distributing and virtualizing a network address translation (NAT)
CN113489646A (zh) 基于vxlan的分段路由传输方法、服务器、源节点及存储介质
EP3503484A1 (en) Message transmission method, device and network system
US20230246994A1 (en) Address management method, apparatus, and system
EP3300300B1 (en) Method, device and system for configuring user equipment forwarding table
TWI504213B (zh) 第三代合作夥伴計劃網路中位址轉譯器穿越方法

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: 15869072

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2015869072

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2015869072

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE