WO2013117172A1 - Private network address allocation method, device, and system - Google Patents

Private network address allocation method, device, and system Download PDF

Info

Publication number
WO2013117172A1
WO2013117172A1 PCT/CN2013/073470 CN2013073470W WO2013117172A1 WO 2013117172 A1 WO2013117172 A1 WO 2013117172A1 CN 2013073470 W CN2013073470 W CN 2013073470W WO 2013117172 A1 WO2013117172 A1 WO 2013117172A1
Authority
WO
WIPO (PCT)
Prior art keywords
private network
network address
address
allocation
terminal
Prior art date
Application number
PCT/CN2013/073470
Other languages
French (fr)
Chinese (zh)
Inventor
刘海
靳维生
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2013117172A1 publication Critical patent/WO2013117172A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5038Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a private network address allocation method, apparatus, and system. Background technique
  • the private network address of the terminal may come from the packet data network gateway PGW or LMA (Local Mobility Anchor) of different local area networks. Since the PGW or LMA of different LANs may be assigned the same private network address, there may be cases where the private addresses of the two terminals in the same LAN are the same. If the private network addresses of the two terminals are the same, an address conflict is considered to occur, and one of the two terminals with the same private network address cannot perform network communication normally.
  • PGW or LMA Local Mobility Anchor
  • the present invention provides a private network address allocation method, including:
  • the present invention provides a method for obtaining a private network address, including:
  • DHCP response message returned by the access gateway, where the DHCP response message carries a private network address, where the private network address is determined by the access gateway, and is used to uniquely identify the terminal in the local area network.
  • the present invention provides a private network address allocation apparatus, including:
  • a receiving module configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address
  • An obtaining module configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module;
  • control module configured to: when the private network address obtained by the acquiring module conflicts with the stored private network address, control the acquiring module to continue to obtain a private network address from the address allocation network element;
  • a returning module configured to return a DHCP response message to the terminal when the private network address obtained by the acquiring module does not conflict with the stored private network address, where the DHCP response message carries the private acquired by the acquiring module Web address.
  • the present invention provides a private network address allocation apparatus, including:
  • a receiving module configured to receive a dynamic host configuration from the terminal for requesting allocation of a private network address Protocol DHCP request
  • An obtaining module configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module;
  • a processing module configured to: when the private network address obtained by the obtaining module conflicts with the stored private network address, allocate a mapped private network address for uniquely identifying the terminal in the local area network, and establish the acquired by the acquiring module The mapping relationship between the private network address and the assigned mapped private network address;
  • the returning module is configured to return a DHCP response message to the terminal, where the DHCP response message carries a mapped private network address allocated by the processing module.
  • the present invention provides a terminal, including:
  • a terminal sending module configured to send a dynamic host configuration protocol DHCP request for requesting a private network address to the access gateway
  • a terminal receiving module configured to receive a DHCP response message generated by the access gateway, where the DHCP response message carries a private network address, where the private network address is determined by the private network address allocation device, and is used to uniquely identify the terminal.
  • the present invention provides a private network address allocation system, including:
  • a terminal configured to send a dynamic host configuration protocol DHCP request to allocate a private network address to the access gateway;
  • An access gateway configured to receive the DHCP request from the terminal, and obtain a private network address from the address allocation network element according to the DHCP request;
  • An address allocation network element configured to allocate a private network address, and return the allocated private network address to the access gateway;
  • the access gateway is further configured to: when the obtained private network address conflicts with the stored private network address, continue to obtain a private network address from the address allocation network element; and when the obtained private network When the address does not conflict with the stored private network address, a DHCP response message is sent to the terminal, and the DHCP response message carries the acquired private network address.
  • the present invention provides a private network address allocation system, including:
  • a terminal configured to send a dynamic host configuration protocol DHCP request to allocate a private network address to the access gateway;
  • An access gateway configured to receive the DHCP request from the terminal, according to the DHCP Request, obtain a private network address from the address allocation network element;
  • An address allocation network element configured to allocate a private network address, and return the allocated private network address to the access gateway;
  • the access gateway is further configured to: when the obtained private network address conflicts with the stored private network address, allocate a mapped private network address for uniquely identifying the terminal, and establish the obtained private network. A mapping relationship between the address and the allocated mapped private network address, and a returning a DHCP response message to the terminal, where the DHCP response message carries the allocated mapped private network address.
  • the embodiment of the present invention After receiving the DHCP request from the terminal, the embodiment of the present invention obtains the private network address from the address allocation network element, and continues to allocate the network element from the address when the obtained private network address conflicts with the stored private network address. Obtaining a private network address, or assigning a mapped private network address that uniquely identifies the terminal, to obtain a private network address for uniquely identifying the terminal in the local area network, and obtaining a private network uniquely identifying the terminal The address is returned to the terminal. In this way, it is ensured that the private network address returned to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring that the terminal can perform Normal network communication.
  • FIG. 1 is a schematic flow chart of an embodiment of a private network address allocation method provided by the present invention
  • FIG. 2 is a schematic flow chart of an embodiment of step S12 in FIG. 1 of the present invention.
  • FIG. 3 is a schematic flow chart of another embodiment of a private network address allocation method provided by the present invention.
  • FIG. 4 is a schematic flow chart showing another embodiment of a private network address allocation method provided by the present invention.
  • FIG. 5 is a schematic flowchart of an embodiment of a method for acquiring a private network address according to the present invention.
  • FIG. 6 is a schematic structural diagram of an embodiment of a private network address allocation apparatus provided by the present invention.
  • FIG. 7 is a schematic structural diagram of another embodiment of a private network address allocation apparatus according to the present invention.
  • FIG. 8 is a schematic structural diagram of another embodiment of a private network address allocation apparatus according to the present invention.
  • FIG. 9 is a schematic structural diagram of a terminal provided by the present invention.
  • FIG. 10 is a schematic structural diagram of an embodiment of a private network address allocation system according to the present invention.
  • FIG. 11 is a schematic structural diagram of another embodiment of a private network address allocation system according to the present invention. detailed description
  • the terminal is assigned a private network address using the ⁇ (roxy mobile Internet Protocol version 6) protocol.
  • radio access gateway
  • the MAG uses the ⁇ protocol (proxy binding update PBU message or proxy binding response ⁇ message) from the LMA (Local Mobility Anchor: Home Mobility Anchor) Point)
  • proxy binding update PBU message or proxy binding response ⁇ message
  • LMA Local Mobility Anchor: Home Mobility Anchor
  • the MAG can exchange information with the LMAs of different LANs to obtain private network addresses.
  • the terminal After accessing the WLAN (Wireless Local Area Networks) network, the terminal accesses the 3GPP (3rd Generation Partnership Project) core network through the S2a interface to obtain the private network address. Specifically, the terminal accesses the WLAN. Then, the WLAN sends a session establishment request message to the packet data network gateway PGW by using the general packet radio service tunnel GTP protocol, and the PGW allocates a private network address and returns it to the WLAN, and the WLAN returns the received private network address to the terminal.
  • the WLAN can exchange information with the PGWs of different local area networks to obtain a private network address.
  • the present invention provides the following technical solutions:
  • the embodiment of the present invention provides a method for allocating a private network address, and the execution subject may be an access gateway or another network device having an access gateway function. Description.
  • FIG. 1 it is a schematic flowchart of an embodiment of a method for allocating a private network address according to the present disclosure.
  • the method includes:
  • Step S11 receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address
  • a DHCP request for requesting a private network address is automatically sent to the access gateway.
  • the access gateway may be an MAG or a WLAN access network.
  • Step S12 Obtain a private network address from the address allocation network element according to the DHCP request, and continue to obtain a private network from the address allocation network element when the obtained private network address conflicts with the stored private network address.
  • the access gateway After receiving the DHCP request sent by the terminal, the access gateway knows that the terminal request allocates a private network address. Then, the access gateway exchanges information with the address allocation network element to obtain a private network address from the address allocation network element.
  • the private network address obtained by the access gateway from the address allocation network element may or may not conflict with the private network address stored by the access gateway.
  • the private network address stored by the access gateway is a private network address that is stored by the access gateway and returned to other terminals in the local area network. After returning a private network address to the terminal, the access gateway stores the private network address that has been returned to the terminal for subsequent judgment and whether the private network address obtained from the address allocation network element conflicts.
  • the access gateway needs to continue to obtain the private network address from the address allocation network element.
  • the access gateway obtains the private network If the address does not conflict with the stored private network address, the process proceeds to step S13.
  • the access gateway when the access gateway interacts with the address allocation network element for information interaction, the GTP protocol or the ⁇ protocol may be used.
  • the address allocation network element can be a PGW or an LMA.
  • Step S13 When the private network address obtained from the address allocation network element does not conflict with the stored private network address, the DHCP response message is returned to the terminal, where the DHCP response message carries the obtained private network. address.
  • the access gateway returns the private network address obtained from the address allocation network element to the terminal in the form of a DHCP response message.
  • the access gateway after receiving the DHCP request from the terminal, obtains the private network address from the address allocation network element, and when the obtained private network address conflicts with the stored private network address, the secondary address continues.
  • the private network address is obtained by the distribution network element, and when the obtained private network address does not conflict with the stored private network address, the obtained private network address that does not conflict with the stored private network address is returned to the terminal. .
  • the access gateway ensures that the private network address returned to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring the The terminal is capable of normal network communication.
  • FIG. 2 is a schematic flowchart of an embodiment of step S12 in FIG. 1 of the present invention. Specifically, the obtaining, according to the DHCP request, the private network address from the address allocation network element, and continuing to obtain the private information from the address allocation network element when the obtained private network address conflicts with the stored private network address Web address, including:
  • Step S21 Send a distribution private network address request message to the address allocation network element according to the DHCP request.
  • the access gateway After receiving the DHCP request, the access gateway sends a request message for assigning a private network address to the address allocation network element. Specifically, the access gateway may send a request to allocate a private network address message to the address allocation network element in the following two manners:
  • the access gateway uses the GTP protocol to exchange information with the address allocation network element, the access gateway sends a setup session request message to the address allocation network element.
  • the access gateway uses the PMIPv6 protocol to exchange information with the address allocation network element, the access gateway sends a PBU message to the address allocation network element.
  • the address allocation network element After receiving the private network address request message sent by the access gateway, the address allocation network element will A corresponding private network address is assigned and returned to the access gateway. Specifically, the address allocation network element returns the allocated private network address to the access gateway in the form of a response message.
  • Step S22 receiving a response message returned by the address allocation network element, where the response message carries a private network address allocated by the address allocation network element after receiving the allocated private network address request message;
  • the access gateway uses the GTP protocol to exchange information with the address allocation network element, the access gateway receives the setup session response message returned by the address assignment network element, and the setup session response message carries the address allocation network element assignment. Private network address.
  • the access gateway uses the PMIPv6 protocol to exchange information with the address allocation network element, the access gateway receives the PBA message returned by the address allocation network element, and the PBA message carries the private network address allocated by the address allocation network element.
  • Step S23 Determine whether the received private network address conflicts with the stored private network address.
  • the access gateway determines whether the received private network address conflicts with the stored private network address, and specifically includes:
  • the access gateway compares the received private network address with the stored private network address in the database, and determines whether the received private network address is the same as the stored private network address; If the received private network address conflicts with the stored private network address, the process proceeds to step S24. If not, the received private network address does not conflict with the private network address stored by the access gateway. Exit the process.
  • Step S24 sending a release private network address message to the address allocation network element, and then repeatedly executing S21-S23;
  • the access gateway may send a release private network address message to the address allocation network element in two forms:
  • the access gateway uses the GTP protocol to exchange information with the address allocation network element, the access gateway sends a delete session request message to the address allocation network element.
  • the address allocation network element After receiving the private network address message sent by the access gateway, the address allocation network element releases the private network address allocated in step S22.
  • step S21 After the access gateway sends the release private network address message, the process proceeds to step S21, and then the access gateway loops through steps S21-S23 until the determination result of step S23 is no, that is, until the address allocation network element allocation is determined.
  • the private network address is different from the private network address that the access gateway has stored, and does not conflict.
  • the release private network address message sent in step S24 carries an indication message for instructing the address allocation network element to allocate a new private network address.
  • the released private network address message sent in step S24 carries a cell, for example, carried in the delete session request message or the PBU message.
  • a cell the cell is used to instruct the address allocation network element to allocate a new private network address.
  • the address allocation network element allocates a new private network address according to the instruction of releasing the private network address message, thereby avoiding the private network address allocated before the address allocation network element continues to be allocated. Access gateway problem.
  • the allocated private network address request message sent in the step S21 carries an indication message for instructing the address allocation network element to allocate a new private network address.
  • the access gateway may carry a message in the sent private network address request message.
  • the element for example, carries a cell in the sent setup session request message or PBU message, and the cell is used to indicate that the address allocation network element allocates a new private network address.
  • the address allocation network element After receiving the message of releasing the private network address, the address allocation network element allocates a new private network address according to the instruction of releasing the private network address message, thereby avoiding the private network address allocated before the address allocation network element continues to be allocated. Access gateway problem.
  • Step S31 receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address
  • step S11 in the embodiment shown in Fig. 1, and will not be described in detail herein.
  • Step S32 Obtain a private network address from the address allocation network element according to the DHCP request.
  • the access gateway after receiving the DHCP request sent by the terminal, the access gateway knows that the terminal request allocates a private network address. Then, the access gateway exchanges information with the address allocation network element to obtain a private network address from the address allocation network element.
  • the private network address obtained by the access gateway from the address allocation network element may or may not conflict with the private network address stored by the access gateway.
  • the process proceeds to step S33.
  • the private network address obtained by the access gateway from the address allocation network element does not conflict with the private network address stored by the access gateway, the flow proceeds to step S35.
  • the stored private network address is a private network address that is stored by the access gateway and returned to other terminals in the local area network. After the access gateway returns a private network address to the terminal, the private network address that has been returned to the terminal is stored for subsequent judgment and whether the private network address obtained from the address allocation network element conflicts.
  • the access gateway when the access gateway interacts with the address allocation network element for information interaction, the GTP protocol or the ⁇ protocol may be used.
  • the address allocation network element can be a PGW or an LMA.
  • Step S33 when the obtained private network address conflicts with the stored private network address, assigning a mapped private network address for uniquely identifying the terminal in the local area network, and establishing the obtained private network address and the Map the mapping of private network addresses;
  • the access gateway when the private network address obtained by the access gateway conflicts with the stored private network address, the access gateway also allocates the mapped private network address of the local area network to which the access gateway belongs.
  • the access gateway allocates the mapped private network address, it is different from the address allocation network element, and therefore accesses the local area network (that is, only the terminal in the local area network to which the access gateway belongs).
  • the gateway can ensure that the mapped private network addresses are not in conflict with each other, that is, the currently mapped private network address is different from the mapped private network address that the access gateway has assigned to other terminals. Therefore, the mapped private network address allocated by the access gateway can uniquely identify a terminal in the local area network to which the access gateway belongs.
  • the access gateway After the mapping of the private network address is configured, the access gateway further establishes a mapping relationship between the private network address obtained in step S32 and the mapped private network address allocated in this step. A private network address obtained by the access gateway is mapped to a mapped private network address allocated by the access gateway.
  • Step S34 returning a DHCP response message to the terminal, where the DHCP response message carries the mapped private network address;
  • Step S35 When the obtained private network address does not conflict with the stored private network address, return a DHCP response message to the terminal, where the DHCP response message carries the obtained private network address.
  • the access gateway after receiving the DHCP request from the terminal, obtains the private network address from the address allocation network element, and when the obtained private network address does not conflict with the stored private network address, the obtained private The network address is returned to the terminal; and when the obtained private network address conflicts with the stored private network address, a mapping private network address is assigned, and the mapping relationship between the obtained private network address and the allocated mapped private network address is established. And return the assigned mapped private network address to the terminal.
  • the obtained private network address or the assigned mapped private network address can uniquely identify a terminal in the local area network.
  • the access gateway returns the private network address of the terminal (the private network address or access obtained from the address allocation network element)
  • the mapped private network address assigned by the gateway does not conflict with the private network address of other terminals in the local area network, thus ensuring that the terminal can perform normal network communication.
  • the access gateway After the assigned private network address is returned to the terminal, when the terminal has an uplink IP packet to be transmitted, the private network address allocated by the address allocation network element has a mapping relationship with the mapped private network address of the terminal, so the access gateway
  • the source IP address of the uplink IP packet (that is, the mapped private network address assigned by the access gateway) is replaced with the private network address allocated by the address allocation network element, and the uplink IP packet is sent to the address allocation network element.
  • the access gateway needs to replace the destination address of the downlink IP packet (that is, the private network address allocated by the address allocation network element) with the And mapping the private network address allocated by the gateway, and sending the downlink IP packet to the terminal. In this way, normal network communication of the terminals in the local area network is achieved.
  • the access gateway may directly allocate a mapped private network address, and establish an assigned mapped private network address and acquired. Mapping between private network addresses, because of the mapped private network assigned by the access gateway The address can uniquely identify a terminal within its local area network, thus enabling normal network communication of terminals within the local area network.
  • Step S43 receiving a response message returned by the address allocation network element, where the response message carries a private network address allocated by the address allocation network element after receiving the allocated private network address request message;
  • Step S45 Allocating a mapped private network address for uniquely identifying the terminal in the local area network, and establishing a mapping relationship between the obtained private network address and the mapped private network address;
  • step S45 to step S47 is equivalent to the operation of step S33 to step S35 in the embodiment shown in FIG. 3, and is not described in detail herein.
  • Step S51 Send a dynamic host configuration protocol DHCP request for requesting allocation of a private network address to the access gateway;
  • the private network address returned by the access gateway that is received by the terminal can uniquely identify the terminal in the local area network, so that the private network address that the terminal lives and the private network address of other terminals in the regional network do not The conflict, in turn, guarantees normal network communication of the terminal.
  • FIG. 6 is a schematic structural diagram of an embodiment of a private network address allocation apparatus according to the present invention.
  • the apparatus 6 includes:
  • the receiving module 61 is configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
  • the terminal After the terminal is powered on, the terminal automatically sends a DHCP request for requesting the assignment of the private network address to the receiving module 61 of the device.
  • the receiving module 61 forwards the received DHCP request to the obtaining module 62 after receiving the DHCP request sent by the terminal.
  • the control module 63 is configured to control the obtaining module 62 to continue to obtain a private network address from the address allocation network element when the private network address acquired by the obtaining module 62 conflicts with the stored private network address; wherein the obtaining module 62
  • the private network address obtained by the address allocation NE may or may not conflict with the private network address stored by the access gateway.
  • the stored private network address is the private network address stored by the device 6 and returned by the device to other terminals in the local area network. After returning a private network address to the terminal, the device stores the private network address that has been returned to the terminal for subsequent use. Determine whether there is a conflict with the private network address obtained from the address allocation network element.
  • the returning module 64 is configured to: when the private network address obtained by the obtaining module 62 does not collide with the stored private network address, return a DHCP response message to the terminal, where the DHCP response message carries the acquiring module 62.
  • the returning module 64 returns the private network address obtained by the obtaining module 62 to the terminal in the form of a DHCP response message.
  • the obtaining module 62 obtains the private network address from the address allocation network element, and obtains the private network address and the stored private network address obtained by the obtaining module 62.
  • the control module 63 controls the obtaining module 62 to continue from the control module 63.
  • the address allocation network element obtains the IPV4 private network address, until the private network address obtained by the obtaining module 62 does not conflict with the stored private network address, and finally the obtained private network address that is obtained by the returning module 64 does not conflict with the stored private network address.
  • the private network address is returned to the terminal. In this way, it is ensured that the private network address returned by the returning module 64 to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring the said The terminal is capable of normal network communication.
  • FIG. 7 is a schematic structural diagram of another embodiment of a private network address allocation apparatus according to the present invention.
  • the obtaining module 62 includes:
  • the sending unit 621 is configured to send a distribution private network address request message to the address allocation network element according to the DHCP request received by the receiving module 61.
  • the sending unit 621 sends the private allocation according to the DHCP request received by the receiving module 61.
  • the network address request message is assigned to the address allocation network element.
  • the sending unit 621 may send a request to allocate an IPV4 private network address message to the address allocation network element in the following two manners:
  • the sending unit 621 When the sending unit 621 performs information exchange with the address allocation network element by using the GTP protocol, the sending unit 621 sends a setup session request message to the address allocation network element.
  • the sending unit 621 uses the PMIPv6 protocol to perform information exchange with the address allocation network element, the sending unit 621 sends a PBU message to the address allocation network element.
  • the receiving unit 622 is configured to receive a response message returned by the address allocation network element, where the response message carries a private network address that is allocated by the address allocation network element after receiving the allocated private network address request message;
  • the address allocation network element After receiving the assignment private network address request message sent by the sending unit 621, the address allocation network element allocates a corresponding private network address and returns it to the receiving unit 622. Specifically, the address allocation network element returns the assigned private network address to the receiving unit 622 by returning a response message.
  • the form of the private network address received by the receiving unit 622 and returned by the address allocation network element also has two types. :
  • the sending unit 621 uses the GTP protocol to perform information exchange with the address allocation network element
  • the receiving unit 622 receives the setup session response message returned by the address allocation network element, where the setup session response message carries the address allocation network element.
  • the assigned private network address
  • the receiving unit 622 receives the PBA message returned by the address allocation network element, where the PBA message carries the private network address allocated by the address allocation network element. .
  • the determining unit 623 is configured to determine whether the private network address received by the receiving unit 622 and the stored private network address conflict;
  • the determining unit 623 compares the private network address received by the receiving unit 622 with the private network address stored by the device, to determine the private network address received by the receiving unit 622 and the stored private network. Whether the address conflicts. If the determining unit 623 determines that the private network address received by the receiving unit 622 is the same as the private network address stored by the device, the private network address received by the receiving unit 622 and the private network stored by the device are determined. Address conflict. At this time, the control module 63 controls the sending unit 621 to send a release private network address message to the address allocation network element, and then send the network element. Sending a private network address request message to the address allocation network element;
  • the control module 63 is specifically configured to: when the determination result of the determining unit 623 is a conflict, that is, when the private network address received by the receiving unit 622 collides with the stored private network address, the sending unit 621 is controlled first. Sending a release private network address message to the address allocation network element, and then sending a distribution private network address request message to the address allocation network element.
  • the sending unit 621 is further configured to: after the control of the control module 63, send a release private network address message to the address allocation network element, and then send a distribution private network address request message to the address distribution network. yuan.
  • the sending unit 621 can send the release private network address message to the address allocation network element in two forms:
  • the sending unit 621 uses the GTP protocol to perform information exchange with the address allocation network element, the sending unit 621 sends a delete session request message to the address allocation network element.
  • the sending unit 621 sends a release private network address message to the address allocation network element, and sends a distribution private network address request message to the address allocation network element again, the sending unit 621 sends the private network.
  • the address request message carries an indication message for instructing the address allocation network element to allocate a new private network address.
  • the sending unit 621 may send the sending unit 621.
  • the assigned private network address request message carries a cell.
  • the establishment of the session request message or the PBU message carries a cell, and the cell is used to indicate that the address allocation network element allocates a new private network address.
  • the address allocation network element allocates a new private network address according to the instruction of releasing the private network address message, thereby avoiding the private network address allocated before the address allocation network element continues to be allocated. Access gateway problem.
  • the receiving module 81 is configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
  • the obtaining module 82 is configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module 81.
  • the obtaining module 82 knows that the terminal requests to allocate a private network address according to the DHCP request sent by the receiving module 81. Then, the obtaining module 82 performs information interaction with the address allocation network element to Obtain a private network address at the address allocation NE.
  • the obtaining module 82 specifically includes:
  • the sending unit 821 When the sending unit 821 performs information exchange with the address allocation network element by using the GTP protocol, the sending unit 821 sends a setup session request message to the address allocation network element.
  • the form of the private network address received by the receiving unit 822 and returned by the address allocation network element also has two types. :
  • the receiving unit 822 receives the setup session response message returned by the address allocation network element, where the setup session response message carries the address allocation network element.
  • the assigned private network address
  • the control processing module 83 assigns the mapped private network address; if not, the control return module 84 returns the private network address received by the receiving unit 822 to the terminal.
  • the stored private network address is a private network address that is stored by the device 8 and that is returned by the device 8 to other terminals in the local area network from the address allocation network element. After returning a private network address to the terminal, the device stores the private network address that has been returned to the terminal for subsequent judgment on whether the private network address obtained from the address allocation network element conflicts.
  • the processing module 83 allocates a mapped private network address of the local area network to which the device belongs in the address space of the device.
  • the processing module 83 is different from the address allocation network element because the processing module 83 allocates the mapped private network address based on the local area network to which the device belongs (that is, only the terminal in the local area network to which the device belongs); 83 can ensure that the mapped private network address of the allocation does not conflict, that is, the currently assigned mapped private network address is different from the mapped private network address that the processing module 83 has assigned to other terminals. Therefore, the mapped private network address assigned by the processing module 83 can uniquely identify a terminal within the local area network to which the device belongs.
  • the processing module 83 further establishes a mapping relationship between the private network address obtained by the obtaining module 82 and the allocated mapped private network address after the mapping of the private network address is allocated. Specifically, the processing module 83 receives the receiving unit 822. A private network address is mapped to a mapped private network address assigned by the processing module 83.
  • the returning module 84 is configured to return a DHCP response message to the terminal, where the DHCP response message carries the mapped private network address allocated by the processing module 83.
  • the returning module 84 is further configured to: when the private network address obtained by the obtaining module 82 does not conflict with the stored private network address, return a DHCP response message to the terminal, where the DHCP response message carries The private network address obtained by the obtaining module 82.
  • the receiving module 81 after receiving the DHCP request from the terminal, obtains the private network address from the address allocation network element by the obtaining module 82, and obtains the private network address obtained by the obtaining module 82 and the stored private network.
  • the returning module 84 will allocate the network elements from the address.
  • the obtained private network address is returned to the terminal, and when the private network address obtained by the obtaining module 82 conflicts with the stored private network address, the processing module 83 allocates a mapped private network address, and establishes the obtained private network address and the allocated private network address.
  • the mapping of the private network address is mapped, and the assigned mapped private network address is returned to the terminal through the return module 84.
  • the returning module 84 returns the private network address of the terminal (the private network address obtained from the address allocation network element or the allocated network address)
  • the mapping of the private network address does not conflict with the private network address of other terminals in the local area network. This ensures that the terminal can perform normal network communication.
  • the access gateway When the device is allocated to the terminal by using the device described in this embodiment, and the assigned mapped private network address is returned to the terminal, when the terminal has an uplink IP packet to be transmitted, the network element is allocated by the address allocation.
  • the private network address is mapped to the mapped private network address of the terminal. Therefore, the access gateway replaces the source address of the uplink IP packet (that is, the mapped private network address allocated by the device) with the private network address allocated by the address allocation network element, and The uplink IP packet is sent to the address allocation network element.
  • the access gateway needs to replace the destination address of the downlink IP packet (that is, the private network address allocated by the address allocation network element) with the device. Assigning a mapped private network address, and transmitting the downlink IP packet to the terminal. In this way, normal network communication of the terminals in the local area network is achieved.
  • the present invention further provides a terminal 9, where the 9 includes: a terminal sending module 91, configured to send a dynamic host configuration protocol requesting to allocate a private network address.
  • a DHCP request for assigning a private network address is automatically sent to the private network address allocation device.
  • the terminal receiving module 92 is configured to receive a DHCP response message generated by the access gateway, where the DHCP response message carries a private network address, where the private network address is determined by the private network address allocation device, and is used to uniquely identify the local area network. Said terminal.
  • private network address allocation device described in this step may specifically be the device described in FIG. 6-8.
  • the private network address returned by the private network address allocation device received by the terminal can
  • the terminal is uniquely identified in the local area network, so that the private network address of the terminal does not conflict with the private network address of other terminals in the area network, thereby ensuring normal network communication of the terminal.
  • FIG. 10 it is a schematic structural diagram of an embodiment of a private network address allocation system provided by the present invention.
  • the system 10 includes:
  • the terminal 9 is configured to send a dynamic host configuration protocol DHCP request for assigning a private network address to the access gateway;
  • the access gateway 101 is configured to receive the DHCP request from the terminal 9, and obtain a private network address from the address allocation network element according to the DHCP request.
  • An address allocation network element 102 configured to allocate a private network address, and return the allocated private network address to the access gateway 101;
  • the access gateway 101 after receiving the DHCP request from the terminal, the access gateway 101 obtains the private network address from the address allocation network element, and when the obtained private network address does not conflict with the stored private network address, The obtained private network address is returned to the terminal; and when the obtained private network address conflicts with the stored private network address, the private network address is continuously obtained from the address allocation network element until the obtained private network address is stored. The private network address does not conflict, and finally the obtained private network address that does not conflict with the stored private network address is returned to the terminal.
  • the access gateway 101 ensures that the private network address returned to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring The terminal is capable of normal network communication.
  • the terminal 9 is configured to send a dynamic host configuration protocol requesting to allocate an IPV4 private network address to the access gateway;
  • the access gateway 111 is further configured to: when the obtained private network address conflicts with the stored private network address, assign a mapped private network address, and establish the obtained private network address and the mapped private network. And mapping the address, and returning a DHCP response message to the terminal 9, where the DHCP response message carries the mapped private network address.

Landscapes

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

Abstract

The embodiments of the present invention disclose a private network address allocation method, comprising: receiving from a terminal a Dynamic Host Configuration Protocol (DHCP) request for a private network address allocation; acquiring from an address allocation network element a private network address according to the DHCP request, and continuing to acquire a private network address from the address allocation network element when the acquired private network address conflicts with any stored private network address; when the private network address acquired from the address allocation network element does not conflict with any stored private network address, returning a DHCP response message to the terminal, the DHCP response message carrying the acquired private network address. The embodiments of the present invention also disclose a private network address allocation method, device, and system. The present invention ensures that the private network address returned to the terminal does not conflict with the private network addresses of other terminals, thereby ensuring the terminal can conduct normal network communications.

Description

一种私网地址分配方法、 装置及系统  Private network address allocation method, device and system
本申请要求于 2012 年 2 月 9 日提交中国专利局、 申请号为 201210028822.1、发明名称为"一种私网地址分配方法、装置及系统"的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域  This application claims priority to Chinese Patent Application No. 201210028822.1, entitled "A Private Network Address Assignment Method, Apparatus, and System" on February 9, 2012, the entire contents of which are incorporated by reference. In this application. Technical field
本发明涉及通信技术领域, 尤其涉及一种私网地址分配方法、 装置及系 统。 背景技术  The present invention relates to the field of communications technologies, and in particular, to a private network address allocation method, apparatus, and system. Background technique
IPV4 ( Internet Protocol version 4 : 网际协议版本 4 )地址可以分为公网 地址和私网地址。 其中, 私网地址在一个局域网唯一且有效, 在不同的局域 网里面, 不同的终端可以使用相同的私网地址。  IPV4 (Internet Protocol version 4: Internet Protocol version 4) addresses can be classified into public network addresses and private network addresses. The private network address is unique and valid in a local area network. Different terminals can use the same private network address in different local area networks.
在同一局域网内, 终端的私网地址可能来自不同局域网的包数据网络网 关 PGW或 LMA(Local Mobility Anchor:家乡移动性锚点)。由于不同局域网的 PGW或 LMA可能分配相同的私网地址, 如此, 则可能会出现同一局域网内 的两个终端私网地址相同的情况。 如果两个终端的私网地址相同, 则认为发 生了地址冲突, 造成私网地址相同的两个终端中的其中一个不能正常进行网 络通信。 发明内容  In the same local area network, the private network address of the terminal may come from the packet data network gateway PGW or LMA (Local Mobility Anchor) of different local area networks. Since the PGW or LMA of different LANs may be assigned the same private network address, there may be cases where the private addresses of the two terminals in the same LAN are the same. If the private network addresses of the two terminals are the same, an address conflict is considered to occur, and one of the two terminals with the same private network address cannot perform network communication normally. Summary of the invention
本发明实施例所要解决的技术问题在于, 提供一种私网地址分配方法、 装置及系统, 保证终端能够进行正常的网络通信。  The technical problem to be solved by the embodiments of the present invention is to provide a private network address allocation method, device and system, which ensure that the terminal can perform normal network communication.
一方面, 本发明提供了一种私网地址分配方法, 包括:  In one aspect, the present invention provides a private network address allocation method, including:
接收来自终端的用于请求分配私网地址的动态主机配置协议 DHCP请 求;  Receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
根据所述 DHCP请求, 从地址分配网元处获取私网地址, 并当所述获取 的私网地址与已存储的私网地址冲突时, 则继续从地址分配网元获取私网地 址; 当从地址分配网元处获取的私网地址与已存储的私网地址不冲突时, 则 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述获取的 私网地址。 Obtaining a private network address from the address allocation network element according to the DHCP request, and continuing to obtain a private network address from the address allocation network element when the obtained private network address conflicts with the stored private network address; When the private network address obtained from the address allocation network element does not conflict with the stored private network address, a DHCP response message is returned to the terminal, and the obtained DHCP response message carries the obtained private network address.
一方面, 本发明提供了另一种私网地址分配方法, 包括:  In one aspect, the present invention provides another private network address allocation method, including:
接收来自终端的用于请求分配私网地址的动态主机配置协议 DHCP请 求;  Receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
根据所述 DHCP请求, 从地址分配网元处获取私网地址;  Obtaining a private network address from the address allocation network element according to the DHCP request;
当所述获取的私网地址与已存储的私网地址冲突时, 分配用于在局域网 内唯一标识所述终端的映射私网地址, 并建立所述获取的私网地址与所述分 配的映射私网地址的映射关系;  When the obtained private network address conflicts with the stored private network address, the mapped private network address for uniquely identifying the terminal in the local area network is allocated, and the obtained private network address and the allocated mapping are established. Mapping of private network addresses;
返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述分 配的映射私网地址。  Returning a DHCP response message to the terminal, where the DHCP response message carries the assigned mapped private network address.
一方面, 本发明提供了一种获取私网地址的方法, 包括:  In one aspect, the present invention provides a method for obtaining a private network address, including:
发送用于请求分配私网地址的动态主机配置协议 DHCP请求给接入网 关;  Sending a dynamic host configuration protocol DHCP request for requesting allocation of a private network address to the access gateway;
接收接入网关返回的 DHCP应答消息, 所述 DHCP应答消息中携带私网 地址, 所述私网地址是接入网关确定的, 用于在局域网内唯一标识所述终端。  Receiving a DHCP response message returned by the access gateway, where the DHCP response message carries a private network address, where the private network address is determined by the access gateway, and is used to uniquely identify the terminal in the local area network.
一方面, 本发明提供了一种私网地址分配装置, 包括:  In one aspect, the present invention provides a private network address allocation apparatus, including:
接收模块, 用于接收来自终端的用于请求分配私网地址的动态主机配置 协议 DHCP请求;  a receiving module, configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
获取模块, 用于根据所述接收模块接收到的 DHCP请求, 从地址分配网 元处获取私网地址;  An obtaining module, configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module;
控制模块, 用于在所述获取模块获取的私网地址与已存储的私网地址冲 突时, 控制所述获取模块继续从所述地址分配网元处获取私网地址;  a control module, configured to: when the private network address obtained by the acquiring module conflicts with the stored private network address, control the acquiring module to continue to obtain a private network address from the address allocation network element;
返回模块, 用于在所述获取模块获取的私网地址与已存储的私网地址不 冲突时, 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所 述获取模块获取的私网地址。  a returning module, configured to return a DHCP response message to the terminal when the private network address obtained by the acquiring module does not conflict with the stored private network address, where the DHCP response message carries the private acquired by the acquiring module Web address.
一方面, 本发明提供了一种私网地址分配装置, 包括:  In one aspect, the present invention provides a private network address allocation apparatus, including:
接收模块, 用于接收来自终端的用于请求分配私网地址的动态主机配置 协议 DHCP请求; a receiving module, configured to receive a dynamic host configuration from the terminal for requesting allocation of a private network address Protocol DHCP request;
获取模块, 用于根据所述接收模块接收的 DHCP请求, 从地址分配网元 处获取私网地址;  An obtaining module, configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module;
处理模块, 用于当所述获取模块获取的私网地址与已存储的私网地址冲 突时, 分配用于在局域网内唯一标识所述终端的映射私网地址, 并建立所述 获取模块获取的私网地址与分配的映射私网地址的映射关系;  a processing module, configured to: when the private network address obtained by the obtaining module conflicts with the stored private network address, allocate a mapped private network address for uniquely identifying the terminal in the local area network, and establish the acquired by the acquiring module The mapping relationship between the private network address and the assigned mapped private network address;
返回模块, 用于返回 DHCP应答消息给所述终端, 所述 DHCP应答消息 中携带有所述处理模块分配的映射私网地址。  The returning module is configured to return a DHCP response message to the terminal, where the DHCP response message carries a mapped private network address allocated by the processing module.
一方面, 本发明提供了一种终端, 包括:  In one aspect, the present invention provides a terminal, including:
终端发送模块, 用于发送请求分配私网地址的动态主机配置协议 DHCP 请求给接入网关;  a terminal sending module, configured to send a dynamic host configuration protocol DHCP request for requesting a private network address to the access gateway;
终端接收模块, 用于接收接入网关生成的 DHCP应答消息, 所述 DHCP 应答消息中携带私网地址, 所述私网地址是私网地址分配装置确定的, 用于 在局域网内唯一标识所述终端。  a terminal receiving module, configured to receive a DHCP response message generated by the access gateway, where the DHCP response message carries a private network address, where the private network address is determined by the private network address allocation device, and is used to uniquely identify the terminal.
一方面, 本发明提供了一种私网地址分配系统, 包括:  In one aspect, the present invention provides a private network address allocation system, including:
终端, 用于发送请求分配私网地址的动态主机配置协议 DHCP请求给接 入网关;  a terminal, configured to send a dynamic host configuration protocol DHCP request to allocate a private network address to the access gateway;
接入网关, 用于接收来自所述终端的所述 DHCP请求, 根据所述 DHCP 请求, 从地址分配网元处获取私网地址;  An access gateway, configured to receive the DHCP request from the terminal, and obtain a private network address from the address allocation network element according to the DHCP request;
地址分配网元, 用于分配私网地址, 并将分配的私网地址返回给所述接 入网关;  An address allocation network element, configured to allocate a private network address, and return the allocated private network address to the access gateway;
所述接入网关, 还用于当所述获取的私网地址与已存储的私网地址冲突 时, 则继续从所述地址分配网元处获取私网地址; 以及当所述获取的私网地 址与已存储的私网地址不冲突时, 则返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述获取的私网地址。  The access gateway is further configured to: when the obtained private network address conflicts with the stored private network address, continue to obtain a private network address from the address allocation network element; and when the obtained private network When the address does not conflict with the stored private network address, a DHCP response message is sent to the terminal, and the DHCP response message carries the acquired private network address.
一方面, 本发明提供了一种私网地址分配系统, 包括:  In one aspect, the present invention provides a private network address allocation system, including:
终端, 用于发送请求分配私网地址的动态主机配置协议 DHCP请求给接 入网关;  a terminal, configured to send a dynamic host configuration protocol DHCP request to allocate a private network address to the access gateway;
接入网关, 用于接收来自所述终端的所述 DHCP请求, 根据所述 DHCP 请求, 从地址分配网元处获取私网地址; An access gateway, configured to receive the DHCP request from the terminal, according to the DHCP Request, obtain a private network address from the address allocation network element;
地址分配网元, 用于分配私网地址, 并将分配的私网地址返回给所述接 入网关;  An address allocation network element, configured to allocate a private network address, and return the allocated private network address to the access gateway;
所述接入网关, 还用于当所述获取的私网地址与已存储的私网地址冲突 时, 则分配用于唯一标识所述终端的映射私网地址, 并建立所述获取的私网 地址与所述分配的映射私网地址的映射关系, 以及返回 DHCP应答消息给所 述终端, 所述 DHCP应答消息中携带有所述分配的映射私网地址。  The access gateway is further configured to: when the obtained private network address conflicts with the stored private network address, allocate a mapped private network address for uniquely identifying the terminal, and establish the obtained private network. A mapping relationship between the address and the allocated mapped private network address, and a returning a DHCP response message to the terminal, where the DHCP response message carries the allocated mapped private network address.
本发明实施例在接收到来自终端的 DHCP请求之后, 从地址分配网元处 获取私网地址, 并当所述获取的私网地址与已存储的私网地址冲突时, 继续 从地址分配网元处获取私网地址, 或者分配一个唯一标识所述终端的映射私 网地址, 以得到一个用于在局域网内唯一标识所述终端的私网地址, 并将得 到的唯一标识所述终端的私网地址返回给所述终端。 如此, 则保证了返回给 所述终端的私网地址在局域网中是唯一的, 即返回给终端的私网地址与局域 网内其它终端的私网地址不会冲突, 从而保证了所述终端能够进行正常网络 通信。 附图说明  After receiving the DHCP request from the terminal, the embodiment of the present invention obtains the private network address from the address allocation network element, and continues to allocate the network element from the address when the obtained private network address conflicts with the stored private network address. Obtaining a private network address, or assigning a mapped private network address that uniquely identifies the terminal, to obtain a private network address for uniquely identifying the terminal in the local area network, and obtaining a private network uniquely identifying the terminal The address is returned to the terminal. In this way, it is ensured that the private network address returned to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring that the terminal can perform Normal network communication. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1 是本发明提供的一种私网地址分配方法的一个实施例的流程示意 图;  1 is a schematic flow chart of an embodiment of a private network address allocation method provided by the present invention;
图 2是本发明图 1中步骤 S12的一个实施例的流程示意图;  2 is a schematic flow chart of an embodiment of step S12 in FIG. 1 of the present invention;
图 3是本发明提供的一种私网地址分配方法的另一个实施例的流程示意 图;  3 is a schematic flow chart of another embodiment of a private network address allocation method provided by the present invention;
图 4是是本发明提供的一种私网地址分配方法的另一个实施例的流程示 意图;  4 is a schematic flow chart showing another embodiment of a private network address allocation method provided by the present invention;
图 5 是本发明提供的一种私网地址获取方法的一个实施例的流程示意 图; FIG. 5 is a schematic flowchart of an embodiment of a method for acquiring a private network address according to the present invention. Figure
图 6 是本发明提供的一种私网地址分配装置的一个实施例的结构示意 图;  6 is a schematic structural diagram of an embodiment of a private network address allocation apparatus provided by the present invention;
图 7是本发明提供的一种私网地址分配装置的另一个实施例的结构示意 图;  FIG. 7 is a schematic structural diagram of another embodiment of a private network address allocation apparatus according to the present invention; FIG.
图 8是本发明提供的一种私网地址分配装置的另一个实施例的结构示意 图;  FIG. 8 is a schematic structural diagram of another embodiment of a private network address allocation apparatus according to the present invention; FIG.
图 9是本发明提供的一种终端的结构示意图;  9 is a schematic structural diagram of a terminal provided by the present invention;
图 10 是本发明提供的一种私网地址分配系统的一个实施例的结构示意 图;  FIG. 10 is a schematic structural diagram of an embodiment of a private network address allocation system according to the present invention; FIG.
图 11是本发明提供的一种私网地址分配系统的另一个实施例的结构示意 图。 具体实施方式  FIG. 11 is a schematic structural diagram of another embodiment of a private network address allocation system according to the present invention. detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作 出创造性劳动前提下所获得的所有其他实施例 , 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
在给终端分配私网地址时, 可以釆用下述两种方式:  When assigning a private network address to a terminal, you can use the following two methods:
( 1 )采用 ΡΜΙΡνό ( roxy mobile Internet Protocol version 6: 代理移动 网际协议版本 6 )协议给终端分配私网地址。 具体地, 当终端附着到 MAG ( mobile access gateway : 移动接入网关) 时, MAG通过 ΡΜΙΡνό协议 (代 理绑定更新 PBU 消息或代理绑定应答 ΡΒΑ 消息)从 LMA(Local Mobility Anchor : 家乡移动性锚点)获取私网地址, 并将获取到的私网 地址发送给终端。 其中, MAG可与不同局域网的 LMA进行信息交互, 获取 私网地址。  (1) The terminal is assigned a private network address using the ΡΜΙΡνό (roxy mobile Internet Protocol version 6) protocol. Specifically, when the terminal is attached to the MAG (mobile access gateway), the MAG uses the ΡΜΙΡνό protocol (proxy binding update PBU message or proxy binding response 消息 message) from the LMA (Local Mobility Anchor: Home Mobility Anchor) Point) Obtain a private network address, and send the obtained private network address to the terminal. The MAG can exchange information with the LMAs of different LANs to obtain private network addresses.
( 2 )终端在接入 WLAN (Wireless Local Area Networks: 无线局域网络) 网络之后, 通过 S2a接口接入 3GPP ( 3rd Generation Partnership Project: 第三 代合作伙伴计划)核心网, 以获取私网地址。 具体地, 在终端接入 WLAN之 后, WLAN釆用通用分组无线业务隧道 GTP协议发送建立会话请求消息给 包数据网络网关 PGW, PGW分配一个私网地址并返回给 WLAN, WLAN将 接收到的私网地址返回给终端。 其中, WLAN可以与不同局域网的 PGW进 行信息交互, 获取私网地址。 (2) After accessing the WLAN (Wireless Local Area Networks) network, the terminal accesses the 3GPP (3rd Generation Partnership Project) core network through the S2a interface to obtain the private network address. Specifically, the terminal accesses the WLAN. Then, the WLAN sends a session establishment request message to the packet data network gateway PGW by using the general packet radio service tunnel GTP protocol, and the PGW allocates a private network address and returns it to the WLAN, and the WLAN returns the received private network address to the terminal. The WLAN can exchange information with the PGWs of different local area networks to obtain a private network address.
如果两个终端的私网地址相同, 则认为发生了地址冲突, 造成私网地址 相同的两个终端中的其中一个不能正常进行网络通信。  If the private network addresses of the two terminals are the same, an address conflict is considered to occur, causing one of the two terminals with the same private network address to fail to perform network communication.
为了解决上述技术问题, 本发明提供了如下技术方案:  In order to solve the above technical problem, the present invention provides the following technical solutions:
本发明实施例提供了一种私网地址分配方法, 其执行主体可以是接入网 关, 也可以为具有接入网关功能的其它网络设备, 下面, 以执行主体为接入 网关为例, 进行举例说明。  The embodiment of the present invention provides a method for allocating a private network address, and the execution subject may be an access gateway or another network device having an access gateway function. Description.
请参考图 1 , 是本发明提供的一种私网地址分配方法的一个实施例的流 程示意图, 所述方法包括:  Referring to FIG. 1 , it is a schematic flowchart of an embodiment of a method for allocating a private network address according to the present disclosure. The method includes:
步骤 S11 , 接收来自终端的用于请求分配私网地址的动态主机配置协议 DHCP请求;  Step S11, receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
本步骤中, 当终端开机之后, 会自动发送请求分配私网地址的 DHCP请 求给接入网关。 其中, 接入网关可以是 MAG, 也可以是 WLAN接入网。  In this step, after the terminal is powered on, a DHCP request for requesting a private network address is automatically sent to the access gateway. The access gateway may be an MAG or a WLAN access network.
步骤 S 12 , 根据所述 DHCP请求, 从地址分配网元处获取私网地址, 并 当所述获取的私网地址与已存储的私网地址冲突时, 则继续从地址分配网元 获取私网地址;  Step S12: Obtain a private network address from the address allocation network element according to the DHCP request, and continue to obtain a private network from the address allocation network element when the obtained private network address conflicts with the stored private network address. Address
本步骤中, 接入网关在接收到终端发来的 DHCP请求之后, 知道终端请 求分配一个私网地址。 于是, 接入网关与地址分配网元进行信息交互, 以从 地址分配网元处获取一个私网地址。  In this step, after receiving the DHCP request sent by the terminal, the access gateway knows that the terminal request allocates a private network address. Then, the access gateway exchanges information with the address allocation network element to obtain a private network address from the address allocation network element.
其中, 接入网关从地址分配网元处获取的私网地址与接入网关已存储的 私网地址可能会冲突, 也可能不冲突。 其中, 接入网关已存储的私网地址, 是接入网关存储的、 已返回给局域网内其它终端的私网地址。 接入网关每返 回一个私网地址给终端之后, 均会将已返回给终端的私网地址进行存储, 以 用于后续的判断与从地址分配网元处获取的私网地址是否发生冲突。  The private network address obtained by the access gateway from the address allocation network element may or may not conflict with the private network address stored by the access gateway. The private network address stored by the access gateway is a private network address that is stored by the access gateway and returned to other terminals in the local area network. After returning a private network address to the terminal, the access gateway stores the private network address that has been returned to the terminal for subsequent judgment and whether the private network address obtained from the address allocation network element conflicts.
当接入网关获取的私网地址与接入网关已存储的私网地址冲突时, 则接 入网关需要继续从地址分配网元处获取私网地址。 当接入网关获取的私网地 址与已存储的私网地址不冲突时, 则进入步骤 S13。 When the private network address obtained by the access gateway conflicts with the private network address stored by the access gateway, the access gateway needs to continue to obtain the private network address from the address allocation network element. When the access gateway obtains the private network If the address does not conflict with the stored private network address, the process proceeds to step S13.
其中, 接入网关与地址分配网元进行信息交互时, 可釆用 GTP协议或 ΡΜΙΡνό协议。 而地址分配网元, 则可以为 PGW或 LMA。  Wherein, when the access gateway interacts with the address allocation network element for information interaction, the GTP protocol or the ΡΜΙΡνό protocol may be used. The address allocation network element can be a PGW or an LMA.
步骤 S13 , 当从地址分配网元处获取的私网地址与已存储的私网地址不 冲突时, 则返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有 所述获取的私网地址。  Step S13: When the private network address obtained from the address allocation network element does not conflict with the stored private network address, the DHCP response message is returned to the terminal, where the DHCP response message carries the obtained private network. address.
其中, 接入网关是以 DHCP应答消息的形式将其从地址分配网元处获取 的私网地址返回给所述终端的。  The access gateway returns the private network address obtained from the address allocation network element to the terminal in the form of a DHCP response message.
本实施例中 , 接入网关在接收来自终端 DHCP请求之后 , 通过从地址分 配网元处获取私网地址, 当所述获取的私网地址与已存储的私网地址冲突时, 则继续从地址分配网元处获取私网地址, 以及当所述获取的私网地址与已存 储的私网地址不冲突时, 则将获取的、 与已存储的私网地址不冲突的私网地 址返回给终端。 如此, 接入网关则保证了返回给所述终端的私网地址在局域 网中是唯一的, 即返回给终端的私网地址与局域网内其它终端的私网地址不 会冲突, 从而保证了所述终端能够进行正常的网络通信。  In this embodiment, after receiving the DHCP request from the terminal, the access gateway obtains the private network address from the address allocation network element, and when the obtained private network address conflicts with the stored private network address, the secondary address continues. The private network address is obtained by the distribution network element, and when the obtained private network address does not conflict with the stored private network address, the obtained private network address that does not conflict with the stored private network address is returned to the terminal. . In this way, the access gateway ensures that the private network address returned to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring the The terminal is capable of normal network communication.
请参考图 2, 是本发明图 1中步骤 S12的实施例的流程示意图。 具体地, 所述根据所述 DHCP请求, 从地址分配网元处获取私网地址, 并当所述获取 的私网地址与已存储的私网地址冲突时, 则继续从地址分配网元获取私网地 址, 包括:  Please refer to FIG. 2, which is a schematic flowchart of an embodiment of step S12 in FIG. 1 of the present invention. Specifically, the obtaining, according to the DHCP request, the private network address from the address allocation network element, and continuing to obtain the private information from the address allocation network element when the obtained private network address conflicts with the stored private network address Web address, including:
步骤 S21 , 根据所述 DHCP请求, 发送分配私网地址请求消息给所述地 址分配网元;  Step S21: Send a distribution private network address request message to the address allocation network element according to the DHCP request.
本步骤中, 接入网关在接收到 DHCP请求之后, 则会发送分配私网地址 请求消息给地址分配网元。 具体地, 接入网关可釆用下述两种方式发送请求 分配私网地址消息给地址分配网元:  In this step, after receiving the DHCP request, the access gateway sends a request message for assigning a private network address to the address allocation network element. Specifically, the access gateway may send a request to allocate a private network address message to the address allocation network element in the following two manners:
( 1 ) 当接入网关釆用 GTP协议与地址分配网元进行信息交互时, 接入 网关发送建立会话请求消息给所述地址分配网元。  (1) When the access gateway uses the GTP protocol to exchange information with the address allocation network element, the access gateway sends a setup session request message to the address allocation network element.
( 2 ) 当接入网关釆用 PMIPv6协议与地址分配网元进行信息交互时, 接 入网关发送 PBU消息给所述地址分配网元。  (2) When the access gateway uses the PMIPv6 protocol to exchange information with the address allocation network element, the access gateway sends a PBU message to the address allocation network element.
地址分配网元在接收到接入网关发送的分配私网地址请求消息之后, 会 分配相应的私网地址, 并返回给所述接入网关。 具体地, 地址分配网元是通 过应答消息的形式, 将分配的私网地址返回给接入网关的。 After receiving the private network address request message sent by the access gateway, the address allocation network element will A corresponding private network address is assigned and returned to the access gateway. Specifically, the address allocation network element returns the allocated private network address to the access gateway in the form of a response message.
步骤 S22, 接收所述地址分配网元返回的应答消息, 所述应答消息中携 带有所述地址分配网元在接收到所述分配私网地址请求消息之后分配的私网 地址;  Step S22, receiving a response message returned by the address allocation network element, where the response message carries a private network address allocated by the address allocation network element after receiving the allocated private network address request message;
由于接入网关发送给地址分配网元的请求分配私网地址消息的形式有两 种, 相应地, 接入网关接收到的、 由地址分配网元返回的私网地址的形式也 有两种:  There are two types of private network address messages that are sent by the access gateway to the address allocation network element. Correspondingly, there are two types of private network addresses received by the access gateway and returned by the address allocation network element:
( 1 ) 当接入网关釆用 GTP协议与地址分配网元进行信息交互时, 接入 网关接收到地址分配网元返回的建立会话应答消息, 该建立会话应答消息中 携带有地址分配网元分配的私网地址。  (1) When the access gateway uses the GTP protocol to exchange information with the address allocation network element, the access gateway receives the setup session response message returned by the address assignment network element, and the setup session response message carries the address allocation network element assignment. Private network address.
( 2 ) 当接入网关釆用 PMIPv6协议与地址分配网元进行信息交互时, 接 入网关接收到地址分配网元返回的 PBA消息, 该 PBA消息中携带地址分配 网元分配的私网地址。  (2) When the access gateway uses the PMIPv6 protocol to exchange information with the address allocation network element, the access gateway receives the PBA message returned by the address allocation network element, and the PBA message carries the private network address allocated by the address allocation network element.
步骤 S23 , 判断所述接收到的私网地址与已存储的私网地址是否冲突; 其中, 接入网关判断所述接收到的私网地址与已存储的私网地址是否冲 突, 具体包括:  Step S23: Determine whether the received private network address conflicts with the stored private network address. The access gateway determines whether the received private network address conflicts with the stored private network address, and specifically includes:
接入网关将所述接收到的私网地址与其数据库中已存储的私网地址进行 比较, 判断所述接收到的私网地址与所述已存储的私网地址是否相同; 若相 同, 则判断接收到的私网地址与所述已存储的私网地址冲突, 流程进入步骤 S24; 若不相同, 则判断所述接收到的私网地址与接入网关已存储的私网地 址不冲突, 即退出流程。  The access gateway compares the received private network address with the stored private network address in the database, and determines whether the received private network address is the same as the stored private network address; If the received private network address conflicts with the stored private network address, the process proceeds to step S24. If not, the received private network address does not conflict with the private network address stored by the access gateway. Exit the process.
步骤 S24, 发送释放私网地址消息给所述地址分配网元, 然后重复执行 S21- S23;  Step S24, sending a release private network address message to the address allocation network element, and then repeatedly executing S21-S23;
本步骤中, 接入网关可通过两种形式发送释放私网地址消息给所述地址 分配网元:  In this step, the access gateway may send a release private network address message to the address allocation network element in two forms:
( 1 ) 当接入网关釆用 GTP协议与地址分配网元进行信息交互时, 接入 网关发送删除会话请求消息给地址分配网元。  (1) When the access gateway uses the GTP protocol to exchange information with the address allocation network element, the access gateway sends a delete session request message to the address allocation network element.
( 2 ) 当接入网关釆用 PMIPv6协议与地址分配网元进行信息交互时, 接 入网关发送 PBU消息给地址分配网元, 其中该 PBU消息中携带所述获取的 私网地址, 并设置生命周期 lifetime=0, lifetime=0用于指示地址分配网元释 放该获取的私网地址。 (2) When the access gateway uses the PMIPv6 protocol to exchange information with the address allocation network element, The inbound gateway sends a PBU message to the address allocation network element, where the PBU message carries the obtained private network address, and sets a lifecycle lifetime=0, and lifetime=0 is used to indicate that the address allocation network element releases the obtained private network address. .
地址分配网元接收到接入网关发送的释放私网地址消息之后, 则释放所 述在步骤 S22中分配的私网地址。  After receiving the private network address message sent by the access gateway, the address allocation network element releases the private network address allocated in step S22.
接入网关在发送所述释放私网地址消息之后, 流程会进入步骤 S21 , 接 着接入网关会循环执行步骤 S21-S23 , 直到步骤 S23 的判断结果为否为止, 即直到判断地址分配网元分配的私网地址与接入网关已存储的私网地址不相 同、 不冲突为止。  After the access gateway sends the release private network address message, the process proceeds to step S21, and then the access gateway loops through steps S21-S23 until the determination result of step S23 is no, that is, until the address allocation network element allocation is determined. The private network address is different from the private network address that the access gateway has stored, and does not conflict.
进一步地, 步骤 S24发送的释放私网地址消息中携带有用于指示所述地 址分配网元分配新私网地址的指示消息。  Further, the release private network address message sent in step S24 carries an indication message for instructing the address allocation network element to allocate a new private network address.
具体地, 当接入网关发送释放私网地址消息给所述地址分配网元时, 可 以在步骤 S24发送的释放私网地址消息中携带一个信元, 例如在删除会话请 求消息或 PBU消息中携带一个信元,该信元用于指示地址分配网元分配新的 私网地址。 地址分配网元在接收到释放私网地址消息之后, 就会按照释放私 网地址消息的指示, 分配新的私网地址, 这样就避免了出现地址分配网元继 续分配之前分配的私网地址给接入网关的问题。  Specifically, when the access gateway sends a release private network address message to the address allocation network element, the released private network address message sent in step S24 carries a cell, for example, carried in the delete session request message or the PBU message. A cell, the cell is used to instruct the address allocation network element to allocate a new private network address. After receiving the message of releasing the private network address, the address allocation network element allocates a new private network address according to the instruction of releasing the private network address message, thereby avoiding the private network address allocated before the address allocation network element continues to be allocated. Access gateway problem.
或者, 当接入网关执行网步骤 S24并再次执行步骤 S21时, 步骤 S21发 送的分配私网地址请求消息中携带有用于指示所述地址分配网元分配新私网 地址的指示消息。  Alternatively, when the access gateway performs the network step S24 and performs the step S21 again, the allocated private network address request message sent in the step S21 carries an indication message for instructing the address allocation network element to allocate a new private network address.
具体地, 当接入网关发送释放私网地址消息给所述地址分配网元并再次 发送分配私网地址请求消息给地址分配网元时, 可以在发送的分配私网地址 请求消息中携带一个信元,例如在发送的建立会话请求消息或 PBU消息中携 带一个信元, 该信元用于指示地址分配网元分配新的私网地址。 地址分配网 元在接收到释放私网地址消息之后, 就会按照释放私网地址消息的指示, 分 配新的私网地址, 这样就避免了出现地址分配网元继续分配之前分配的私网 地址给接入网关的问题。  Specifically, when the access gateway sends a release private network address message to the address allocation network element and sends a distribution private network address request message to the address allocation network element again, the access gateway may carry a message in the sent private network address request message. The element, for example, carries a cell in the sent setup session request message or PBU message, and the cell is used to indicate that the address allocation network element allocates a new private network address. After receiving the message of releasing the private network address, the address allocation network element allocates a new private network address according to the instruction of releasing the private network address message, thereby avoiding the private network address allocated before the address allocation network element continues to be allocated. Access gateway problem.
请参考图 3 , 是本发明提供的一种私网地址分配方法的另一个实施例的 流程示意图, 所述方法包括: 步骤 S31 , 接收来自终端的用于请求分配私网地址的动态主机配置协议 DHCP请求; Referring to FIG. 3, it is a schematic flowchart of another embodiment of a method for allocating a private network address according to the present disclosure. The method includes: Step S31, receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
本步骤的操作与图 1所示的实施例中步骤 S11的操作相同, 在此不详细 描述。  The operation of this step is the same as the operation of step S11 in the embodiment shown in Fig. 1, and will not be described in detail herein.
步骤 S32, 根据所述 DHCP请求, 从地址分配网元处获取私网地址; 本步骤中, 接入网关在接收到终端发来的 DHCP请求之后, 知道终端请 求分配一个私网地址。 于是, 接入网关与地址分配网元进行信息交互, 以从 地址分配网元处获取一个私网地址。  Step S32: Obtain a private network address from the address allocation network element according to the DHCP request. In this step, after receiving the DHCP request sent by the terminal, the access gateway knows that the terminal request allocates a private network address. Then, the access gateway exchanges information with the address allocation network element to obtain a private network address from the address allocation network element.
其中, 接入网关从地址分配网元处获取的私网地址与接入网关已存储的 私网地址可能会冲突, 也可能不冲突。 当接入网关从地址分配网元处获取的 私网地址与接入网关已存储的私网地址冲突时, 则进入步骤 S33。 当接入网 关从地址分配网元处获取的私网地址与接入网关已存储的私网地址不冲突 时, 则流程进入步骤 S35。  The private network address obtained by the access gateway from the address allocation network element may or may not conflict with the private network address stored by the access gateway. When the private network address obtained by the access gateway from the address allocation network element conflicts with the private network address stored by the access gateway, the process proceeds to step S33. When the private network address obtained by the access gateway from the address allocation network element does not conflict with the private network address stored by the access gateway, the flow proceeds to step S35.
其中, 已存储的私网地址, 是接入网关存储的、 已返回给局域网内其它 终端的私网地址。 接入网关每返回一个私网地址给终端之后, 均会将已返回 给终端的私网地址进行存储, 以用于后续的判断与从地址分配网元处获取的 私网地址是否发生冲突。  The stored private network address is a private network address that is stored by the access gateway and returned to other terminals in the local area network. After the access gateway returns a private network address to the terminal, the private network address that has been returned to the terminal is stored for subsequent judgment and whether the private network address obtained from the address allocation network element conflicts.
其中, 接入网关与地址分配网元进行信息交互时, 可釆用 GTP协议或 ΡΜΙΡνό协议。 而地址分配网元, 则可以为 PGW或 LMA。  Wherein, when the access gateway interacts with the address allocation network element for information interaction, the GTP protocol or the ΡΜΙΡνό protocol may be used. The address allocation network element can be a PGW or an LMA.
步骤 S33 , 当所述获取的私网地址与已存储的私网地址冲突时, 分配用 于在局域网内唯一标识所述终端的映射私网地址, 并建立所述获取的私网地 址与所述映射私网地址的映射关系;  Step S33, when the obtained private network address conflicts with the stored private network address, assigning a mapped private network address for uniquely identifying the terminal in the local area network, and establishing the obtained private network address and the Map the mapping of private network addresses;
本步骤中, 当接入网关获取的私网地址与已存储的私网地址冲突时, 接 入网关还在其地址空间分配其所属局域网的映射私网地址。 由于接入网关在 分配映射私网地址时, ^^于其所属的局域网的 (即只为接入网关所属局域 网内的终端分配映射私网地址), 与地址分配网元不同, 因此, 接入网关能够 保证其分配的映射私网地址不会冲突, 即保证当前分配的映射私网地址与接 入网关已分配给其他终端的映射私网地址不相同。 因此, 接入网关分配的映 射私网地址能够在接入网关所属的局域网内唯一标识一个终端。 接入网关在分配了映射私网地址之后, 还建立步骤 S32中获取的私网地 址与本步骤中分配的映射私网地址的映射关系。 其中, 接入网关获取的一个 私网地址对应映射为接入网关分配的一个映射私网地址。 In this step, when the private network address obtained by the access gateway conflicts with the stored private network address, the access gateway also allocates the mapped private network address of the local area network to which the access gateway belongs. When the access gateway allocates the mapped private network address, it is different from the address allocation network element, and therefore accesses the local area network (that is, only the terminal in the local area network to which the access gateway belongs). The gateway can ensure that the mapped private network addresses are not in conflict with each other, that is, the currently mapped private network address is different from the mapped private network address that the access gateway has assigned to other terminals. Therefore, the mapped private network address allocated by the access gateway can uniquely identify a terminal in the local area network to which the access gateway belongs. After the mapping of the private network address is configured, the access gateway further establishes a mapping relationship between the private network address obtained in step S32 and the mapped private network address allocated in this step. A private network address obtained by the access gateway is mapped to a mapped private network address allocated by the access gateway.
步骤 S34, 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携 带有所述映射私网地址;  Step S34, returning a DHCP response message to the terminal, where the DHCP response message carries the mapped private network address;
步骤 S35 , 当所述获取的私网地址与已存储的私网地址不冲突时, 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述获取的私网 地址。  Step S35: When the obtained private network address does not conflict with the stored private network address, return a DHCP response message to the terminal, where the DHCP response message carries the obtained private network address.
本实施例中 , 接入网关在接收来自终端 DHCP请求之后 , 通过从地址分 配网元处获取私网地址, 当获取的私网地址与已存储的私网地址不冲突时, 则将获取的私网地址返回给终端; 以及当获取的私网地址与已存储的私网地 址冲突时, 则分配一个映射私网地址, 并建立获取的私网地址与所述分配的 映射私网地址的映射关系, 以及将分配的映射私网地址返回给终端。 由于获 取的私网地址或分配的映射私网地址均能在局域网中唯一标识一个终端, 因 此, 接入网关返回给终端的私网地址(从地址分配网元处获取的私网地址或 接入网关分配的映射私网地址)与局域网内其它终端的私网地址均不会冲突, 如此则保证了所述终端能够进行正常的网络通信。 分配的映射私网地址返回给终端之后, 当终端有上行 IP包需要传输时, 由于 所述地址分配网元分配的私网地址与所述终端的映射私网地址存在映射关 系,因此接入网关即将上行 IP包的源地址(即接入网关分配的映射私网地址 ) 替换为地址分配网元分配的私网地址, 并将上行 IP包发送给地址分配网元。 相应地, 当地址分配网元有下行 IP包需要传输给所述终端时, 接入网关需要 将所述下行 IP包的目的地址(即地址分配网元分配的私网地址 )替换为所述 接入网关分配的映射私网地址, 并将所述下行 IP包发送给所述终端。 如此, 则实现了局域网内的终端的正常网络通信。  In this embodiment, after receiving the DHCP request from the terminal, the access gateway obtains the private network address from the address allocation network element, and when the obtained private network address does not conflict with the stored private network address, the obtained private The network address is returned to the terminal; and when the obtained private network address conflicts with the stored private network address, a mapping private network address is assigned, and the mapping relationship between the obtained private network address and the allocated mapped private network address is established. And return the assigned mapped private network address to the terminal. The obtained private network address or the assigned mapped private network address can uniquely identify a terminal in the local area network. Therefore, the access gateway returns the private network address of the terminal (the private network address or access obtained from the address allocation network element) The mapped private network address assigned by the gateway does not conflict with the private network address of other terminals in the local area network, thus ensuring that the terminal can perform normal network communication. After the assigned private network address is returned to the terminal, when the terminal has an uplink IP packet to be transmitted, the private network address allocated by the address allocation network element has a mapping relationship with the mapped private network address of the terminal, so the access gateway The source IP address of the uplink IP packet (that is, the mapped private network address assigned by the access gateway) is replaced with the private network address allocated by the address allocation network element, and the uplink IP packet is sent to the address allocation network element. Correspondingly, when the address allocation network element has a downlink IP packet to be transmitted to the terminal, the access gateway needs to replace the destination address of the downlink IP packet (that is, the private network address allocated by the address allocation network element) with the And mapping the private network address allocated by the gateway, and sending the downlink IP packet to the terminal. In this way, normal network communication of the terminals in the local area network is achieved.
其中, 需要说明的是, 在步骤 S32中, 接入网关在从地址分配网元处获 取到私网地址之后, 也可以直接分配一个映射私网地址, 并建立分配的映射 私网地址与获取的私网地址之间的映射关系, 由于接入网关分配的映射私网 地址的能够在其所述的局域网内唯一标识一个终端, 如此, 也能够实现局域 网内的终端的正常网络通信。 It should be noted that, in step S32, after obtaining the private network address from the address allocation network element, the access gateway may directly allocate a mapped private network address, and establish an assigned mapped private network address and acquired. Mapping between private network addresses, because of the mapped private network assigned by the access gateway The address can uniquely identify a terminal within its local area network, thus enabling normal network communication of terminals within the local area network.
请参考图 4, 是本发明提供的一种 IPV4私网地址分配方法的另一个实施 例的流程示意图, 所述方法包括:  Referring to FIG. 4, it is a schematic flowchart of another embodiment of an IPV4 private network address allocation method provided by the present invention, where the method includes:
步骤 S41 , 接收来自终端的用于请求分配私网地址的动态主机配置协议 Step S41: Receive a dynamic host configuration protocol from the terminal for requesting allocation of a private network address.
DHCP请求; DHCP request;
步骤 S42, 根据所述 DHCP请求, 发送分配私网地址请求消息给所述地 址分配网元;  Step S42: Send a distribution private network address request message to the address allocation network element according to the DHCP request.
步骤 S43 , 接收所述地址分配网元返回的应答消息, 所述应答消息中携 带有所述地址分配网元在接收到所述分配私网地址请求消息之后分配的私网 地址;  Step S43, receiving a response message returned by the address allocation network element, where the response message carries a private network address allocated by the address allocation network element after receiving the allocated private network address request message;
其中,步骤 S42-S43的操作相当于图 3所示的实施例中步骤 S32的操作。 步骤 S44, 判断所述接收到的私网地址与已存储的私网地址是否冲突; 其中, 步骤 S44的操作与图 2所示的实施例中步骤 S23的操作相同, 在 此不重复描述。 若判断结果为冲突, 则进入流程步骤 S45。 若判断结果为不 冲突, 则进入流程步骤 S47。  The operations of steps S42-S43 correspond to the operations of step S32 in the embodiment shown in FIG. Step S44: It is determined whether the received private network address conflicts with the stored private network address. The operation of step S44 is the same as the operation of step S23 in the embodiment shown in FIG. 2, and the description is not repeated here. If the result of the determination is a conflict, the flow proceeds to step S45. If the result of the determination is that there is no conflict, the flow proceeds to step S47.
步骤 S45 , 分配用于在局域网内唯一标识所述终端的映射私网地址, 并 建立所述获取的私网地址与所述映射私网地址的映射关系;  Step S45: Allocating a mapped private network address for uniquely identifying the terminal in the local area network, and establishing a mapping relationship between the obtained private network address and the mapped private network address;
步骤 S46, 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携 带有所述映射私网地址;  Step S46, returning a DHCP response message to the terminal, where the DHCP response message carries the mapped private network address;
步骤 S47 , 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携 带有所述获取的私网地址。  Step S47: Return a DHCP response message to the terminal, where the DHCP response message carries the obtained private network address.
其中, 步骤 S45-步骤 S47的操作相当于图 3所示的实施例中步骤 S33-步 骤 S35的操作, 在此不详细描述。  The operation of step S45 to step S47 is equivalent to the operation of step S33 to step S35 in the embodiment shown in FIG. 3, and is not described in detail herein.
相应地, 请参考图 5 , 是本发明提供的一种获取私网地址的方法, 所述 方法的执行主体可以为终端, 所述方法具体包括:  Correspondingly, referring to FIG. 5, the method for obtaining a private network address is provided by the present invention. The method may be a terminal, where the method specifically includes:
步骤 S51 , 发送用于请求分配私网地址的动态主机配置协议 DHCP请求 给接入网关;  Step S51: Send a dynamic host configuration protocol DHCP request for requesting allocation of a private network address to the access gateway;
当终端开机之后, 会自动发送请求分配私网地址的 DHCP请求给接入网 关。 其中, 接入网关可以是 MAG, 也可以是 WLAN接入网。 When the terminal is powered on, it will automatically send a DHCP request requesting to assign a private network address to the access network. turn off. The access gateway may be a MAG or a WLAN access network.
步骤 S52 , 接收接入网关返回的 DHCP应答消息, 所述 DHCP应答消息 中携带私网地址, 所述私网地址是接入网关确定的, 用于在局域网内唯一标 识所述终端。  Step S52: Receive a DHCP response message returned by the access gateway, where the DHCP response message carries a private network address, where the private network address is determined by the access gateway, and is used to uniquely identify the terminal in the local area network.
其中, 需要说明的是, 接入网关在确定所述返回给终端的私网地址时, 可以釆用上述图 1-图 4所示的实施例所描述的方法来进行确定。  It should be noted that, when determining the private network address returned to the terminal, the access gateway may perform the determination by using the method described in the embodiments shown in FIG. 1 to FIG. 4 above.
本实施例中, 由于终端接收到的接入网关返回的私网地址能够在局域网 内唯一标识所述终端, 如此则使得终端活得的私网地址与区域网内其他终端 的私网地址不会冲突, 进而保证了所述终端的正常网络通信。  In this embodiment, the private network address returned by the access gateway that is received by the terminal can uniquely identify the terminal in the local area network, so that the private network address that the terminal lives and the private network address of other terminals in the regional network do not The conflict, in turn, guarantees normal network communication of the terminal.
上述图 1-图 5对本发明实施例公开的私网地址分配方法进行了详细的介 绍, 下面结合附图 6-11 , 对釆用了上述方法的装置及系统进行详细描述。  The above-mentioned FIG. 1 to FIG. 5 show a detailed description of the private network address allocation method disclosed in the embodiment of the present invention. The apparatus and system using the above method will be described in detail below with reference to FIG. 6-11.
请参考图 6, 是本发明提供的一种私网地址分配装置的一个实施例的结 构示意图, 所述装置 6包括:  Referring to FIG. 6, FIG. 6 is a schematic structural diagram of an embodiment of a private network address allocation apparatus according to the present invention. The apparatus 6 includes:
接收模块 61 , 用于接收来自终端的用于请求分配私网地址的动态主机配 置协议 DHCP请求;  The receiving module 61 is configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
其中, 当终端开机之后, 终端会自动发送请求分配私网地址的 DHCP请 求给所述装置的接收模块 61。 接收模块 61在接收到终端发来的 DHCP请求 之后, 将接收到的 DHCP请求转发给获取模块 62。  After the terminal is powered on, the terminal automatically sends a DHCP request for requesting the assignment of the private network address to the receiving module 61 of the device. The receiving module 61 forwards the received DHCP request to the obtaining module 62 after receiving the DHCP request sent by the terminal.
获取模块 62, 用于根据所述接收模块 61接收到的 DHCP请求, 从地址 分配网元处获取私网地址;  The obtaining module 62 is configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module 61.
其中, 获取模块 62根据接收模块 61发来的 DHCP请求, 知道终端请求 分配一个私网地址。 于是, 获取模块 62与地址分配网元进行信息交互, 以从 地址分配网元处获取一个私网地址。  The obtaining module 62 knows that the terminal requests to allocate a private network address according to the DHCP request sent by the receiving module 61. Then, the obtaining module 62 exchanges information with the address allocation network element to obtain a private network address from the address allocation network element.
控制模块 63 , 用于在所述获取模块 62获取的私网地址与已存储的私网 地址冲突时, 控制所述获取模块 62继续从地址分配网元获取私网地址; 其中,获取模块 62从地址分配网元处获取的私网地址与接入网关已存储 的私网地址可能会冲突, 也可能不冲突。 其中, 已存储的私网地址, 是装置 6 存储的、 该装置已返回给局域网内其它终端的私网地址。 装置每返回一个 私网地址给终端之后, 均会存储将已返回给终端的私网地址, 以用于后续的 判断与从地址分配网元处获取的私网地址是否发生冲突。 The control module 63 is configured to control the obtaining module 62 to continue to obtain a private network address from the address allocation network element when the private network address acquired by the obtaining module 62 conflicts with the stored private network address; wherein the obtaining module 62 The private network address obtained by the address allocation NE may or may not conflict with the private network address stored by the access gateway. The stored private network address is the private network address stored by the device 6 and returned by the device to other terminals in the local area network. After returning a private network address to the terminal, the device stores the private network address that has been returned to the terminal for subsequent use. Determine whether there is a conflict with the private network address obtained from the address allocation network element.
当获取模块 62 获取的私网地址与已存储的私网地址冲突, 则控制模块 63控制获取模块 62继续从地址分配网元处获取 IPV4私网地址。 当获取模块 62获取的私网地址与已存储的私网地址不冲突时, 则返回模块 64返回获取 的私网地址给所述终端。  When the private network address obtained by the obtaining module 62 conflicts with the stored private network address, the control module 63 controls the obtaining module 62 to continue to obtain the IPV4 private network address from the address allocation network element. When the private network address obtained by the obtaining module 62 does not conflict with the stored private network address, the returning module 64 returns the obtained private network address to the terminal.
其中, 需要说明的是, 获取模块 62与地址分配网元进行信息交互时, 可 釆用 GTP协议或 PMIPv6协议。 具体地, 地址分配网元, 则可以为 PGW或 LMA。  It should be noted that, when the obtaining module 62 interacts with the address allocation network element, the GTP protocol or the PMIPv6 protocol may be used. Specifically, the address allocation network element may be a PGW or an LMA.
返回模块 64, 用于在所述获取模块 62获取的私网地址与已存储的私网 地址不冲突时, 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携 带有所述获取模块 62获取的私网地址。  The returning module 64 is configured to: when the private network address obtained by the obtaining module 62 does not collide with the stored private network address, return a DHCP response message to the terminal, where the DHCP response message carries the acquiring module 62. The private network address obtained.
其中, 返回模块 64是以 DHCP应答消息的形式将获取模块 62获取的私 网地址返回给所述终端的。  The returning module 64 returns the private network address obtained by the obtaining module 62 to the terminal in the form of a DHCP response message.
本实施例中,在接收模块 61接收到来自终端的 DHCP请求之后,通过获 取模块 62从地址分配网元处获取私网地址, 并在获取模块 62获取的私网地 址与已存储的私网地址不冲突时,通过返回模块 64将所述获取的私网地址返 回给终端; 当获取模块 62获取的私网地址与已存储的私网地址冲突时, 则通 过控制模块 63控制获取模块 62继续从地址分配网元处获取 IPV4私网地址, 直到获取模块 62获取的私网地址与已存储的私网地址不冲突为止,最后通过 返回模块 64将获取的、 与已存储的私网地址不冲突的私网地址返回给终端。 如此, 则保证了返回模块 64 返回给所述终端的私网地址在局域网中是唯一 的, 即返回给终端的私网地址与局域网内其它终端的私网地址不会冲突, 从 而保证了所述终端能够进行正常的网络通信。  In this embodiment, after the receiving module 61 receives the DHCP request from the terminal, the obtaining module 62 obtains the private network address from the address allocation network element, and obtains the private network address and the stored private network address obtained by the obtaining module 62. When the content is not in conflict, the obtained private network address is returned to the terminal through the returning module 64. When the private network address obtained by the obtaining module 62 conflicts with the stored private network address, the control module 63 controls the obtaining module 62 to continue from the control module 63. The address allocation network element obtains the IPV4 private network address, until the private network address obtained by the obtaining module 62 does not conflict with the stored private network address, and finally the obtained private network address that is obtained by the returning module 64 does not conflict with the stored private network address. The private network address is returned to the terminal. In this way, it is ensured that the private network address returned by the returning module 64 to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring the said The terminal is capable of normal network communication.
请参考图 7, 是本发明提供的一种私网地址分配装置的另一个实施例的 结构示意图, 本实施例与图 6所示的实施例的区别在于, 所述获取模块 62具 体包括:  Referring to FIG. 7, FIG. 7 is a schematic structural diagram of another embodiment of a private network address allocation apparatus according to the present invention. The difference between this embodiment and the embodiment shown in FIG. 6 is that the obtaining module 62 includes:
发送单元 621 , 用于根据所述接收模块 61接收到的 DHCP请求, 发送分 配私网地址请求消息给所述地址分配网元;  The sending unit 621 is configured to send a distribution private network address request message to the address allocation network element according to the DHCP request received by the receiving module 61.
其中,发送单元 621根据接收模块 61接收到的 DHCP请求,发送分配私 网地址请求消息给地址分配网元。 具体地, 发送单元 621 可以釆用下述两种 方式发送请求分配 IPV4私网地址消息给地址分配网元: The sending unit 621 sends the private allocation according to the DHCP request received by the receiving module 61. The network address request message is assigned to the address allocation network element. Specifically, the sending unit 621 may send a request to allocate an IPV4 private network address message to the address allocation network element in the following two manners:
( 1 ) 当发送单元 621釆用 GTP协议与地址分配网元进行信息交互时, 发送单元 621发送建立会话请求消息给所述地址分配网元。  (1) When the sending unit 621 performs information exchange with the address allocation network element by using the GTP protocol, the sending unit 621 sends a setup session request message to the address allocation network element.
( 2 )当发送单元 621釆用 PMIPv6协议与地址分配网元进行信息交互时, 发送单元 621发送 PBU消息给所述地址分配网元。  (2) When the sending unit 621 uses the PMIPv6 protocol to perform information exchange with the address allocation network element, the sending unit 621 sends a PBU message to the address allocation network element.
接收单元 622, 用于接收所述地址分配网元返回的应答消息, 所述应答 消息中携带有所述地址分配网元在接收到所述分配私网地址请求消息之后分 配的私网地址;  The receiving unit 622 is configured to receive a response message returned by the address allocation network element, where the response message carries a private network address that is allocated by the address allocation network element after receiving the allocated private network address request message;
地址分配网元在接收到发送单元 621 发送的分配私网地址请求消息之 后, 会分配相应的私网地址, 并返回给接收单元 622。 具体地, 地址分配网 元是通过返回应答消息的形式, 将分配的私网地址返回给接收单元 622的。  After receiving the assignment private network address request message sent by the sending unit 621, the address allocation network element allocates a corresponding private network address and returns it to the receiving unit 622. Specifically, the address allocation network element returns the assigned private network address to the receiving unit 622 by returning a response message.
其中, 由于发送单元 621发送给地址分配网元的请求分配私网地址消息 的形式有两种, 相应地, 接收单元 622接收到的、 由地址分配网元返回的私 网地址的形式也有两种:  There are two forms of the private network address message that are sent by the sending unit 621 to the address allocation network element. Correspondingly, the form of the private network address received by the receiving unit 622 and returned by the address allocation network element also has two types. :
( 1 ) 当发送单元 621釆用 GTP协议与地址分配网元进行信息交互时, 接收单元 622会接收到地址分配网元返回的建立会话应答消息, 该建立会话 应答消息中携带有地址分配网元分配的私网地址。  (1) When the sending unit 621 uses the GTP protocol to perform information exchange with the address allocation network element, the receiving unit 622 receives the setup session response message returned by the address allocation network element, where the setup session response message carries the address allocation network element. The assigned private network address.
( 2 )当发送单元 621釆用 PMIPv6协议与地址分配网元进行信息交互时, 接收单元 622会接收到地址分配网元返回的 PBA消息, 该 PBA消息中携带 地址分配网元分配的私网地址。  (2) When the sending unit 621 uses the PMIPv6 protocol to perform information exchange with the address allocation network element, the receiving unit 622 receives the PBA message returned by the address allocation network element, where the PBA message carries the private network address allocated by the address allocation network element. .
判断单元 623 , 用于判断所述接收单元 622接收到的私网地址与已存储 的私网地址是否冲突;  The determining unit 623 is configured to determine whether the private network address received by the receiving unit 622 and the stored private network address conflict;
具体地, 判断单元 623通过将所述接收单元 622接收到的私网地址与该 装置已存储的私网地址进行比较的方式, 以判断接收单元 622接收到的私网 地址与已存储的私网地址是否冲突。 若判断单元 623判断所述接收单元 622 接收到的私网地址与该装置已存储的私网地址相同时, 则判断所述接收单元 622接收到的私网地址与所述装置已存储的私网地址冲突。 此时控制模块 63 控制发送单元 621先发送释放私网地址消息给所述地址分配网元, 然后再发 送分配私网地址请求消息给所述地址分配网元; Specifically, the determining unit 623 compares the private network address received by the receiving unit 622 with the private network address stored by the device, to determine the private network address received by the receiving unit 622 and the stored private network. Whether the address conflicts. If the determining unit 623 determines that the private network address received by the receiving unit 622 is the same as the private network address stored by the device, the private network address received by the receiving unit 622 and the private network stored by the device are determined. Address conflict. At this time, the control module 63 controls the sending unit 621 to send a release private network address message to the address allocation network element, and then send the network element. Sending a private network address request message to the address allocation network element;
所述控制模块 63 , 具体用于在所述判断单元 623的判断结果为冲突时, 即所述接收单元 622接收的私网地址与已存储的私网地址冲突时, 控制所述 发送单元 621先发送释放私网地址消息给所述地址分配网元, 然后再发送分 配私网地址请求消息给所述地址分配网元。  The control module 63 is specifically configured to: when the determination result of the determining unit 623 is a conflict, that is, when the private network address received by the receiving unit 622 collides with the stored private network address, the sending unit 621 is controlled first. Sending a release private network address message to the address allocation network element, and then sending a distribution private network address request message to the address allocation network element.
所述发送单元 621 , 还用于在所述控制模块 63的控制作用下, 先发送释 放私网地址消息给所述地址分配网元, 然后再发送分配私网地址请求消息给 所述地址分配网元。  The sending unit 621 is further configured to: after the control of the control module 63, send a release private network address message to the address allocation network element, and then send a distribution private network address request message to the address distribution network. yuan.
其中, 发送单元 621可通过两种形式发送释放私网地址消息给所述地址 分配网元:  The sending unit 621 can send the release private network address message to the address allocation network element in two forms:
( 1 ) 当发送单元 621釆用 GTP协议与地址分配网元进行信息交互时, 发送单元 621发送删除会话请求消息给地址分配网元。  (1) When the sending unit 621 uses the GTP protocol to perform information exchange with the address allocation network element, the sending unit 621 sends a delete session request message to the address allocation network element.
( 2 )当发送单元 621釆用 PMIPv6协议与地址分配网元进行信息交互时, 发送单元 621发送 PBU消息给地址分配网元, 其中该 PBU消息中携带所述 IPV4私网地址, 并设置生命周期 lifetime=0, lifetime=0用于指示地址分配网 元释放该 IPV4私网地址。  (2) When the sending unit 621 uses the PMIPv6 protocol to perform information exchange with the address allocation network element, the sending unit 621 sends a PBU message to the address allocation network element, where the PBU message carries the IPV4 private network address, and sets the life cycle. The lifetime=0, lifetime=0 is used to indicate that the address allocation NE releases the IPV4 private network address.
地址分配网元接收到发送单元 621发送的释放私网地址消息之后, 则释 放所述分配的私网地址。发送单元 621在发送所述释放 IPV4私网地址消息给 地址分配网元之后, 还会执行: 发送请求分配私网地址消息给所述地址分配 网元;  After receiving the private network address message sent by the sending unit 621, the address allocation network element releases the allocated private network address. After sending the release IPV4 private network address message to the address allocation network element, the sending unit 621 further performs: sending a request to allocate a private network address message to the address allocation network element;
其中, 需要说明的是, 当判断单元 623判断接收单元 622接收的私网地 址冲突之后, 下述操作会循环执行:  It should be noted that, after the determining unit 623 determines that the private network address conflict received by the receiving unit 622, the following operations are performed cyclically:
发送单元 621先发送所述释放私网地址消息给地址分配网元, 然后再次 发送释放私网地址消息给地址分配网元; 地址分配网元也会重新分配私网地 址并返回给接收单元 622;  The sending unit 621 first sends the release private network address message to the address allocation network element, and then sends the release private network address message to the address allocation network element again; the address distribution network element also re-allocates the private network address and returns to the receiving unit 622;
上述跳出循环的条件是: 判断单元 623判断接收单元 622接收到的私网 地址与已存储的私网地址不相同, 不冲突。 此时, 发送单元 621则不会再发 送释放私网地址消息给地址分配网元。  The condition of the above-mentioned bounce loop is: The judging unit 623 judges that the private network address received by the receiving unit 622 is different from the stored private network address, and does not conflict. At this time, the sending unit 621 will not send the release private network address message to the address allocation network element.
进一步地, 所述发送单元 621发送的释放私网地址消息中携带有用于指 示所述地址分配网元分配新私网地址的指示消息。 Further, the release private network address message sent by the sending unit 621 is carried in the An indication message indicating that the address allocation network element allocates a new private network address.
具体地, 当发送单元 621发送释放私网地址消息给所述地址分配网元时, 可以在发送单元 621发送的释放私网地址消息中携带一个信元, 例如在删除 会话请求消息或 PBU消息中携带一个信元,该信元用于指示地址分配网元分 配新的私网地址。 地址分配网元在接收到释放私网地址消息之后, 就会按照 释放私网地址消息的指示, 分配新的私网地址, 这样就避免了出现地址分配 网元继续分配之前分配的私网地址给接入网关的问题。  Specifically, when the sending unit 621 sends the release private network address message to the address allocation network element, the transmitting unit 621 may carry a cell in the release private network address message, for example, in deleting the session request message or the PBU message. Carrying a cell, the cell is used to indicate that the address allocation network element allocates a new private network address. After receiving the message of releasing the private network address, the address allocation network element allocates a new private network address according to the instruction of releasing the private network address message, thereby avoiding the private network address allocated before the address allocation network element continues to be allocated. Access gateway problem.
或者, 在所述发送单元 621发送释放私网地址消息给所述地址分配网元 之后并再次发送分配私网地址请求消息给所述地址分配网元时, 所述发送单 元 621发送的分配私网地址请求消息中携带有用于指示所述地址分配网元分 配新私网地址的指示消息。  Or, after the sending unit 621 sends a release private network address message to the address allocation network element, and sends a distribution private network address request message to the address allocation network element again, the sending unit 621 sends the private network. The address request message carries an indication message for instructing the address allocation network element to allocate a new private network address.
具体地, 在发送单元 621发送了释放私网地址消息给所述地址分配网元 之后, 当发送单元 621再次发送分配私网地址请求消息给所述地址分配网元 时, 可以在发送单元 621发送的分配私网地址请求消息中携带一个信元, 例 如在建立会话请求消息或 PBU消息中携带一个信元,该信元用于指示地址分 配网元分配新的私网地址。 地址分配网元在接收到释放私网地址消息之后, 就会按照释放私网地址消息的指示, 分配新的私网地址, 这样就避免了出现 地址分配网元继续分配之前分配的私网地址给接入网关的问题。  Specifically, after the sending unit 621 sends the release private network address message to the address allocation network element, when the sending unit 621 sends the allocation private network address request message to the address allocation network element again, the sending unit 621 may send the sending unit 621. The assigned private network address request message carries a cell. For example, the establishment of the session request message or the PBU message carries a cell, and the cell is used to indicate that the address allocation network element allocates a new private network address. After receiving the message of releasing the private network address, the address allocation network element allocates a new private network address according to the instruction of releasing the private network address message, thereby avoiding the private network address allocated before the address allocation network element continues to be allocated. Access gateway problem.
请参考图 8, 是本发明提供的私网地址分配装置的另一个实施例的结构 示意图, 所述装置 8包括:  Referring to FIG. 8, FIG. 8 is a schematic structural diagram of another embodiment of a private network address allocation apparatus according to the present disclosure. The apparatus 8 includes:
接收模块 81 , 用于接收来自终端的用于请求分配私网地址的动态主机配 置协议 DHCP请求;  The receiving module 81 is configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
其中, 当终端开机之后, 终端会自动发送请求分配私网地址的 DHCP请 求给所述装置的接收模块 81。 接收模块 81在接收到终端发来的 DHCP请求 之后, 将接收到的 DHCP请求转发给获取模块 82。  After the terminal is powered on, the terminal automatically sends a DHCP request for requesting the assignment of the private network address to the receiving module 81 of the device. The receiving module 81 forwards the received DHCP request to the obtaining module 82 after receiving the DHCP request sent by the terminal.
获取模块 82, 用于根据所述接收模块 81接收的 DHCP请求, 从地址分 配网元处获取私网地址;  The obtaining module 82 is configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module 81.
其中, 获取模块 82根据接收模块 81发来的 DHCP请求, 知道终端请求 分配一个私网地址。 于是, 获取模块 82与地址分配网元进行信息交互, 以从 地址分配网元处获取一个私网地址。 The obtaining module 82 knows that the terminal requests to allocate a private network address according to the DHCP request sent by the receiving module 81. Then, the obtaining module 82 performs information interaction with the address allocation network element to Obtain a private network address at the address allocation NE.
其中, 所述获取模块 82具体包括:  The obtaining module 82 specifically includes:
发送单元 821 , 用于根据所述接收模块 81接收到的 DHCP请求, 发送分 配私网地址请求消息给所述地址分配网元;  The sending unit 821 is configured to send, according to the DHCP request received by the receiving module 81, a distribution private network address request message to the address allocation network element;
其中,发送单元 821根据接收模块 81接收到的 DHCP请求 ,发送分配私 网地址请求消息给地址分配网元。 具体地, 发送单元 821 可以釆用下述两种 方式发送请求分配私网地址消息给地址分配网元:  The sending unit 821 sends a distribution private network address request message to the address allocation network element according to the DHCP request received by the receiving module 81. Specifically, the sending unit 821 can send a request to allocate a private network address message to the address allocation network element in the following two manners:
( 1 ) 当发送单元 821釆用 GTP协议与地址分配网元进行信息交互时, 发送单元 821发送建立会话请求消息给所述地址分配网元。  (1) When the sending unit 821 performs information exchange with the address allocation network element by using the GTP protocol, the sending unit 821 sends a setup session request message to the address allocation network element.
( 2 )当发送单元 821釆用 PMIPv6协议与地址分配网元进行信息交互时, 发送单元 821发送 PBU消息给所述地址分配网元。  (2) When the sending unit 821 uses the PMIPv6 protocol to perform information exchange with the address allocation network element, the sending unit 821 sends a PBU message to the address allocation network element.
接收单元 822 , 用于接收所述地址分配网元返回的应答消息, 所述应答 消息中携带有所述地址分配网元在接收到所述分配私网地址请求消息之后分 配的私网地址。  The receiving unit 822 is configured to receive a response message returned by the address allocation network element, where the response message carries a private network address that is allocated by the address allocation network element after receiving the allocated private network address request message.
其中, 由于发送单元 821发送给地址分配网元的请求分配私网地址消息 的形式有两种, 相应地, 接收单元 822接收到的、 由地址分配网元返回的私 网地址的形式也有两种:  There are two forms of the private network address message that are sent by the sending unit 821 to the address allocation network element. Accordingly, the form of the private network address received by the receiving unit 822 and returned by the address allocation network element also has two types. :
( 1 ) 当发送单元 821釆用 GTP协议与地址分配网元进行信息交互时, 接收单元 822会接收到地址分配网元返回的建立会话应答消息, 该建立会话 应答消息中携带有地址分配网元分配的私网地址。  (1) When the sending unit 821 performs the information exchange with the address allocation network element by using the GTP protocol, the receiving unit 822 receives the setup session response message returned by the address allocation network element, where the setup session response message carries the address allocation network element. The assigned private network address.
( 2 )当发送单元 821釆用 PMIPv6协议与地址分配网元进行信息交互时, 接收单元 822会接收到地址分配网元返回的 PBA消息, 该 PBA消息中携带 地址分配网元分配的私网地址。  (2) When the sending unit 821 uses the PMIPv6 protocol to perform information exchange with the address allocation network element, the receiving unit 822 receives the PBA message returned by the address allocation network element, where the PBA message carries the private network address allocated by the address allocation network element. .
处理模块 83 , 用于当所述获取模块 82获取的私网地址与已存储的私网 地址冲突时, 分配用于在局域网内唯一标识所述终端的映射私网地址, 并建 立所述获取模块 83获取的私网地址与所述分配的映射私网地址的映射关系; 其中, 接收单元 822从地址分配网元处接收的私网地址与接入网关已存 储的私网地址可能会冲突, 也可能不冲突。 当接收单元 822从地址分配网元 处获取的私网地址与接入网关已存储的私网地址冲突时, 则控制处理模块 83 分配映射私网地址。 当接收单元 822从地址分配网元处接收的私网地址与接 入网关已存储的私网地址不冲突时, 则控制返回模块 84工作。 The processing module 83 is configured to: when the private network address obtained by the obtaining module 82 conflicts with the stored private network address, allocate a mapped private network address for uniquely identifying the terminal in the local area network, and establish the acquiring module a mapping relationship between the obtained private network address and the allocated mapped private network address; wherein the receiving unit 822 may conflict with the private network address received by the accessing network element and the private network address stored by the access gateway, May not conflict. When the receiving unit 822 conflicts with the private network address that has been stored by the access gateway from the address allocation network element, the control processing module 83 Assign a mapped private network address. When the receiving unit 822 does not collide with the private network address received by the access gateway from the address allocation network element, the control return module 84 operates.
具体地, 若接收单元 822接收到的私网地址与该装置 8已存储的私网地 址相同, 则判断所述接收单元 822接收到的私网地址与所述装置 8已存储的 私网地址冲突, 则控制处理模块 83分配映射私网地址; 若不相同, 则控制返 回模块 84将接收单元 822接收到的私网地址返回给终端。  Specifically, if the private network address received by the receiving unit 822 is the same as the private network address that the device 8 has stored, it is determined that the private network address received by the receiving unit 822 conflicts with the private network address that the device 8 has stored. Then, the control processing module 83 assigns the mapped private network address; if not, the control return module 84 returns the private network address received by the receiving unit 822 to the terminal.
其中, 已存储的私网地址, 是装置 8存储的、 该装置 8已返回给局域网 内其它终端的、 从地址分配网元处获取的私网地址。 装置每返回一个私网地 址给终端之后, 均会存储将已返回给终端的私网地址, 以用于后续的判断从 地址分配网元获取的私网地址是否发生冲突。  The stored private network address is a private network address that is stored by the device 8 and that is returned by the device 8 to other terminals in the local area network from the address allocation network element. After returning a private network address to the terminal, the device stores the private network address that has been returned to the terminal for subsequent judgment on whether the private network address obtained from the address allocation network element conflicts.
其中,处理模块 83在该装置的地址空间分配该装置所属局域网的映射私 网地址。 由于处理模块 83在分配映射私网地址时, 是基于该装置所属的局域 网的(即只为该装置所属局域网内的终端分配映射私网地址;), 与地址分配网 元不同, 因此, 处理模块 83能够保证其分配的映射私网地址不会冲突, 即保 证当前分配的映射私网地址与处理模块 83 已分配给其他终端的映射私网地 址不相同。 因此, 处理模块 83分配的映射私网地址能够在所述装置所属的局 域网内唯一标识一个终端。  The processing module 83 allocates a mapped private network address of the local area network to which the device belongs in the address space of the device. The processing module 83 is different from the address allocation network element because the processing module 83 allocates the mapped private network address based on the local area network to which the device belongs (that is, only the terminal in the local area network to which the device belongs); 83 can ensure that the mapped private network address of the allocation does not conflict, that is, the currently assigned mapped private network address is different from the mapped private network address that the processing module 83 has assigned to other terminals. Therefore, the mapped private network address assigned by the processing module 83 can uniquely identify a terminal within the local area network to which the device belongs.
其中, 所述处理模块 83在分配映射私网地址之后, 还建立所述获取模块 82获取的私网地址与分配的映射私网地址的映射关系; 具体地, 处理模块 83 将接收单元 822接收的一个私网地址对应映射为处理模块 83分配的一个映射 私网地址。  The processing module 83 further establishes a mapping relationship between the private network address obtained by the obtaining module 82 and the allocated mapped private network address after the mapping of the private network address is allocated. Specifically, the processing module 83 receives the receiving unit 822. A private network address is mapped to a mapped private network address assigned by the processing module 83.
返回模块 84 , 用于返回 DHCP应答消息给所述终端, 所述 DHCP应答消 息中携带有所述处理模块 83分配的映射私网地址。  The returning module 84 is configured to return a DHCP response message to the terminal, where the DHCP response message carries the mapped private network address allocated by the processing module 83.
其中, 所述返回模块 84, 还用于在所述获取模块 82获取的私网地址与 已存储的私网地址不冲突时, 返回 DHCP应答消息给所述终端, 所述 DHCP 应答消息中携带有所述获取模块 82获取的私网地址。  The returning module 84 is further configured to: when the private network address obtained by the obtaining module 82 does not conflict with the stored private network address, return a DHCP response message to the terminal, where the DHCP response message carries The private network address obtained by the obtaining module 82.
本实施例所述的装置,接收模块 81在接收来自终端 DHCP请求之后,通 过获取模块 82从地址分配网元处获取私网地址, 并在获取模块 82获取的私 网地址与已存储的私网地址不冲突时,通过返回模块 84将从地址分配网元处 获取的私网地址返回给终端,以及当获取模块 82获取的私网地址与已存储的 私网地址冲突, 则通过处理模块 83分配一个映射私网地址, 并建立获取的私 网地址与分配的映射私网地址的映射关系, 以及将分配的映射私网地址通过 返回模块 84返回给终端。由于获取的私网地址或分配的映射私网地址均能在 局域网中唯一标识一个终端, 因此, 返回模块 84返回给终端的私网地址(从 地址分配网元处获取的私网地址或分配的映射私网地址 )与局域网内其它终 端的私网地址不会冲突, 如此则保证了所述终端能够进行正常的网络通信。 In the device of this embodiment, after receiving the DHCP request from the terminal, the receiving module 81 obtains the private network address from the address allocation network element by the obtaining module 82, and obtains the private network address obtained by the obtaining module 82 and the stored private network. When the addresses do not conflict, the returning module 84 will allocate the network elements from the address. The obtained private network address is returned to the terminal, and when the private network address obtained by the obtaining module 82 conflicts with the stored private network address, the processing module 83 allocates a mapped private network address, and establishes the obtained private network address and the allocated private network address. The mapping of the private network address is mapped, and the assigned mapped private network address is returned to the terminal through the return module 84. Since the obtained private network address or the assigned mapped private network address can uniquely identify a terminal in the local area network, the returning module 84 returns the private network address of the terminal (the private network address obtained from the address allocation network element or the allocated network address) The mapping of the private network address does not conflict with the private network address of other terminals in the local area network. This ensures that the terminal can perform normal network communication.
当釆用本实施例中所述的装置给终端分配私网地址, 并将分配的映射私 网地址返回给终端之后, 当终端有上行 IP包需要传输时, 由于所述地址分配 网元分配的私网地址与所述终端的映射私网地址存在映射关系, 因此接入网 关即将上行 IP包的源地址 (即装置分配的映射私网地址)替换为地址分配网 元分配的私网地址, 并将上行 IP包发送给地址分配网元。 相应地, 当地址分 配网元有下行 IP包需要传输给所述终端时, 接入网关需要将所述下行 IP包 的目的地址(即地址分配网元分配的私网地址)替换为所述装置分配的映射 私网地址, 并将所述下行 IP包发送给所述终端。 如此, 则实现了局域网内的 终端的正常网络通信。  When the device is allocated to the terminal by using the device described in this embodiment, and the assigned mapped private network address is returned to the terminal, when the terminal has an uplink IP packet to be transmitted, the network element is allocated by the address allocation. The private network address is mapped to the mapped private network address of the terminal. Therefore, the access gateway replaces the source address of the uplink IP packet (that is, the mapped private network address allocated by the device) with the private network address allocated by the address allocation network element, and The uplink IP packet is sent to the address allocation network element. Correspondingly, when the address allocation network element has a downlink IP packet to be transmitted to the terminal, the access gateway needs to replace the destination address of the downlink IP packet (that is, the private network address allocated by the address allocation network element) with the device. Assigning a mapped private network address, and transmitting the downlink IP packet to the terminal. In this way, normal network communication of the terminals in the local area network is achieved.
其中, 需要说明的是上述图 6-图 8中所述的装置, 可以是接入网关, 或 者是具有接入网功能的其他网络设备。  It should be noted that the apparatus described in the foregoing FIG. 6 to FIG. 8 may be an access gateway or other network equipment having an access network function.
相应地, 请参考图 9, 本发明还提供了一种终端 9, 所述 9包括: 终端发送模块 91 , 用于发送请求分配私网地址的动态主机配置协议 Correspondingly, referring to FIG. 9, the present invention further provides a terminal 9, where the 9 includes: a terminal sending module 91, configured to send a dynamic host configuration protocol requesting to allocate a private network address.
DHCP请求给接入网关; DHCP request to the access gateway;
其中, 当终端开机之后, 会自动发送请求分配私网地址的 DHCP请求给 私网地址分配装置。  When the terminal is powered on, a DHCP request for assigning a private network address is automatically sent to the private network address allocation device.
终端接收模块 92,用于接收接入网关生成的 DHCP应答消息,所述 DHCP 应答消息中携带私网地址, 所述私网地址是私网地址分配装置确定的, 用于 在局域网内唯一标识所述终端。  The terminal receiving module 92 is configured to receive a DHCP response message generated by the access gateway, where the DHCP response message carries a private network address, where the private network address is determined by the private network address allocation device, and is used to uniquely identify the local area network. Said terminal.
其中, 需要说明的是, 本步骤中所述的私网地址分配装置, 具体可以为 图 6-图 8中所述的装置。  It should be noted that the private network address allocation device described in this step may specifically be the device described in FIG. 6-8.
本实施例中, 由于终端接收到的私网地址分配装置返回的私网地址能够 在局域网内唯一标识所述终端, 如此则使得终端活得的私网地址与区域网内 其他终端的私网地址不会冲突, 进而保证了所述终端的正常网络通信。 In this embodiment, the private network address returned by the private network address allocation device received by the terminal can The terminal is uniquely identified in the local area network, so that the private network address of the terminal does not conflict with the private network address of other terminals in the area network, thereby ensuring normal network communication of the terminal.
请参考图 10, 是本发明提供的一种私网地址分配系统的一个实施例的结 构示意图, 所述系统 10包括:  Referring to FIG. 10, it is a schematic structural diagram of an embodiment of a private network address allocation system provided by the present invention. The system 10 includes:
终端 9 , 用于发送请求分配私网地址的动态主机配置协议 DHCP请求给 接入网关;  The terminal 9 is configured to send a dynamic host configuration protocol DHCP request for assigning a private network address to the access gateway;
接入网关 101 , 用于接收来自所述终端 9的所述 DHCP请求, 根据所述 DHCP请求, 从地址分配网元处获取私网地址;  The access gateway 101 is configured to receive the DHCP request from the terminal 9, and obtain a private network address from the address allocation network element according to the DHCP request.
地址分配网元 102, 用于分配私网地址, 并将分配的私网地址返回给所 述接入网关 101 ;  An address allocation network element 102, configured to allocate a private network address, and return the allocated private network address to the access gateway 101;
所述接入网关 101 , 还用于在所述获取的私网地址与已存储的私网地址 冲突时, 则继续从所述地址分配网元 102处获取私网地址; 以及用于在所述 获取的私网地址与已存储的私网地址不冲突时, 则返回 DHCP应答消息给所 述终端 9, 所述 DHCP应答消息中携带有所述获取的私网地址。  The access gateway 101 is further configured to: when the obtained private network address conflicts with the stored private network address, continue to obtain a private network address from the address allocation network element 102; When the obtained private network address does not conflict with the stored private network address, a DHCP response message is sent to the terminal 9. The DHCP response message carries the obtained private network address.
本实施例的系统, 接入网关 101在接收来自终端 DHCP请求之后, 通过 从地址分配网元处获取私网地址, 并在获取的私网地址与已存储的私网地址 不冲突时, 则将所述获取的私网地址返回给终端; 以及在获取的私网地址与 已存储的私网地址冲突时, 则继续从地址分配网元处获取私网地址, 直到获 取的私网地址与已存储的私网地址不冲突为止, 最后将获取的、 与已存储的 私网地址不冲突的私网地址返回给终端。 如此, 接入网关 101则保证了返回 给所述终端的私网地址在局域网中是唯一的, 即返回给终端的私网地址与局 域网内其它终端的私网地址不会冲突, 从而保证了所述终端能够进行正常的 网络通信。  In the system of this embodiment, after receiving the DHCP request from the terminal, the access gateway 101 obtains the private network address from the address allocation network element, and when the obtained private network address does not conflict with the stored private network address, The obtained private network address is returned to the terminal; and when the obtained private network address conflicts with the stored private network address, the private network address is continuously obtained from the address allocation network element until the obtained private network address is stored. The private network address does not conflict, and finally the obtained private network address that does not conflict with the stored private network address is returned to the terminal. In this way, the access gateway 101 ensures that the private network address returned to the terminal is unique in the local area network, that is, the private network address returned to the terminal does not conflict with the private network address of other terminals in the local area network, thereby ensuring The terminal is capable of normal network communication.
请参考图 11 , 是本发明提供的一种私网地址分配系统的另一个实施例的 结构示意图, 所述系统 11包括:  Referring to FIG. 11, which is a schematic structural diagram of another embodiment of a private network address allocation system according to the present invention, the system 11 includes:
终端 9,用于发送请求分配 IPV4私网地址的动态主机配置协议 DHCP请 求给接入网关;  The terminal 9 is configured to send a dynamic host configuration protocol requesting to allocate an IPV4 private network address to the access gateway;
接入网关 111 , 用于接收来自所述终端的所述 DHCP 请求, 根据所述 DHCP请求, 从地址分配网元处获取私网地址; 地址分配网元 111 ,用于分配私网地址,并将分配的私网地址返回给所述 接入网关 111 ; The access gateway 111 is configured to receive the DHCP request from the terminal, and obtain a private network address from the address allocation network element according to the DHCP request. An address allocation network element 111, configured to allocate a private network address, and return the allocated private network address to the access gateway 111;
所述接入网关 111 ,还用于当所述获取的私网地址与已存储的私网地址冲 突时, 则分配映射私网地址, 并建立所述获取的私网地址与所述映射私网地 址的映射关系, 以及返回 DHCP应答消息给所述终端 9, 所述 DHCP应答消 息中携带有所述映射私网地址。  The access gateway 111 is further configured to: when the obtained private network address conflicts with the stored private network address, assign a mapped private network address, and establish the obtained private network address and the mapped private network. And mapping the address, and returning a DHCP response message to the terminal 9, where the DHCP response message carries the mapped private network address.
本实施例中, 接入网关 111在接收来自终端 DHCP请求之后, 通过从地 址分配网元处获取私网地址, 并在获取的私网地址与已存储的私网地址冲突 时, 则分配一个映射私网地址, 并建立获取的私网地址与所述映射私网地址 的映射关系, 以及将分配的映射私网地址返回给终端。 由于从地址分配网元 处获取的私网地址或分配的映射私网地址均能在局域网中唯一标识一个终 端, 因此, 接入网关 111返回给终端的私网地址(从地址分配网元处获取的 私网地址或映射私网地址 ) 与局域网内其它终端的私网地址均不会冲突, 如 此则保证了所述终端能够进行正常的网络通信。  In this embodiment, after receiving the DHCP request from the terminal, the access gateway 111 obtains a private network address from the address allocation network element, and allocates a mapping when the obtained private network address conflicts with the stored private network address. The private network address, and the mapping relationship between the obtained private network address and the mapped private network address, and the assigned mapped private network address are returned to the terminal. The private network address obtained from the address allocation network element or the assigned mapped private network address can uniquely identify a terminal in the local area network. Therefore, the access gateway 111 returns the private network address of the terminal (obtained from the address allocation network element) The private network address or the private network address of the private network address does not conflict with the private network address of other terminals in the local area network, thus ensuring that the terminal can perform normal network communication.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流 程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于 一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体( Read-Only Memory, ROM )或随机存 己忆体 ( Random Access Memory, RAM )等。  A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. In execution, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所揭露的仅为本发明较佳实施例而已, 当然不能以此来限定本发明 之权利范围, 本领域普通技术人员可以理解实现上述实施例的全部或部分流 程, 并依本发明权利要求所作的等同变化, 仍属于发明所涵盖的范围。  The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited thereto, and those skilled in the art can understand all or part of the process of implementing the above embodiments, and according to the claims of the present invention. The equivalent change is still within the scope of the invention.

Claims

权 利 要 求 Rights request
1、 一种私网地址分配方法, 其特征在于, 包括:  A private network address allocation method, comprising:
接收来自终端的用于请求分配私网地址的动态主机配置协议 DHCP请 求;  Receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
根据所述 DHCP请求, 从地址分配网元处获取私网地址, 并当所述获取 的私网地址与已存储的私网地址冲突时, 则继续从地址分配网元获取私网地 址;  Obtaining a private network address from the address allocation network element according to the DHCP request, and continuing to obtain a private network address from the address allocation network element when the obtained private network address conflicts with the stored private network address;
当从地址分配网元处获取的私网地址与已存储的私网地址不冲突时, 则 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述获取的 私网地址。  When the private network address obtained from the address allocation network element does not conflict with the stored private network address, a DHCP response message is returned to the terminal, and the DHCP response message carries the obtained private network address.
2、 如权利要求 1所述的方法, 其特征在于, 所述根据所述 DHCP请求, 从地址分配网元处获取私网地址, 并当所述获取的私网地址与已存储的私网 地址冲突时, 则继续从地址分配网元获取私网地址, 包括: 2. The method according to claim 1, wherein the obtaining, according to the DHCP request, a private network address from an address allocation network element, and obtaining the private network address and the stored private network address In case of conflict, the device continues to obtain the private network address from the address allocation network element, including:
步骤 A: 根据所述 DHCP请求, 发送分配私网地址请求消息给所述地址 分配网元;  Step A: Send a distribution private network address request message to the address allocation network element according to the DHCP request;
步骤 B: 接收所述地址分配网元返回的应答消息, 所述应答消息中携带 有所述地址分配网元在接收到所述分配私网地址请求消息之后分配的私网地 址;  Step B: receiving a response message returned by the address allocation network element, where the response message carries a private network address allocated by the address allocation network element after receiving the allocated private network address request message;
步骤 C: 判断所述接收到的私网地址与已存储的私网地址是否冲突; 步骤 D: 若判断结果是冲突时, 则发送释放私网地址消息给所述地址分 配网元, 并重复执行步骤 A至步骤 C。  Step C: determining whether the received private network address conflicts with the stored private network address; Step D: If the judgment result is a conflict, sending a release private network address message to the address allocation network element, and repeating the execution Step A to step C.
3、 如权利要求 2所述的方法, 其特征在于, 步骤 D发送的释放私网地 址消息中携带有用于指示所述地址分配网元分配新私网地址的指示消息; 或 者, The method of claim 2, wherein the release private network address message sent by step D carries an indication message for instructing the address allocation network element to allocate a new private network address; or
当执行完步骤 D并再次执行步骤 A时,步骤 A发送的分配私网地址请求 消息中携带有用于指示所述地址分配网元分配新私网地址的指示消息。 When the step D is performed and the step A is performed again, the allocated private network address request message sent by the step A carries an indication message for instructing the address allocation network element to allocate a new private network address.
4、 一种私网地址分配方法, 其特征在于, 包括: A method for allocating a private network address, comprising:
接收来自终端的用于请求分配私网地址的动态主机配置协议 DHCP请 求;  Receiving a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
根据所述 DHCP请求, 从地址分配网元处获取私网地址;  Obtaining a private network address from the address allocation network element according to the DHCP request;
当所述获取的私网地址与已存储的私网地址冲突时, 分配用于在局域网 内唯一标识所述终端的映射私网地址, 并建立所述获取的私网地址与所述分 配的映射私网地址的映射关系;  When the obtained private network address conflicts with the stored private network address, the mapped private network address for uniquely identifying the terminal in the local area network is allocated, and the obtained private network address and the allocated mapping are established. Mapping of private network addresses;
返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述分 配的映射私网地址。  Returning a DHCP response message to the terminal, where the DHCP response message carries the assigned mapped private network address.
5、 如权利要求 4所述的方法, 其特征在于, 所述根据所述 DHCP请求, 从地址分配网元处获取私网地址, 包括: The method of claim 4, wherein the obtaining the private network address from the address allocation network element according to the DHCP request includes:
根据所述 DHCP请求,发送分配私网地址请求消息给所述地址分配网元; 接收所述地址分配网元返回的应答消息, 所述应答消息中携带有所述地 址分配网元在接收到所述分配私网地址请求消息之后分配的私网地址。  Sending a distribution private network address request message to the address allocation network element according to the DHCP request; receiving a response message returned by the address allocation network element, where the response message carries the address allocation network element at the receiving end The private network address assigned after the private network address request message is allocated.
6、 一种私网地址分配装置, 其特征在于, 包括: A private network address allocation device, comprising:
接收模块, 用于接收来自终端的用于请求分配私网地址的动态主机配置 协议 DHCP请求;  a receiving module, configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
获取模块, 用于根据所述接收模块接收到的 DHCP请求, 从地址分配网 元处获取私网地址;  An obtaining module, configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module;
控制模块, 用于在所述获取模块获取的私网地址与已存储的私网地址冲 突时, 控制所述获取模块继续从地址分配网元处获取私网地址;  a control module, configured to: when the private network address obtained by the obtaining module conflicts with the stored private network address, control the acquiring module to continue to obtain a private network address from the address allocation network element;
返回模块, 用于在所述获取模块获取的私网地址与已存储的私网地址不 冲突时, 返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所 述获取模块获取的私网地址。  a returning module, configured to return a DHCP response message to the terminal when the private network address obtained by the acquiring module does not conflict with the stored private network address, where the DHCP response message carries the private acquired by the acquiring module Web address.
7、 如权利要求 6所述的装置, 其特征在于, 所述获取模块包括: 发送单元, 用于根据所述接收模块接收到的 DHCP请求, 发送分配私网 地址请求消息给所述地址分配网元; The device of claim 6, wherein the obtaining module comprises: a sending unit, configured to send and allocate a private network according to the DHCP request received by the receiving module An address request message is allocated to the address network element;
接收单元, 用于接收所述地址分配网元返回的应答消息, 所述应答消息 中携带有所述地址分配网元在接收到所述分配私网地址请求消息之后分配的 私网地址;  a receiving unit, configured to receive a response message returned by the address allocation network element, where the response message carries a private network address allocated by the address allocation network element after receiving the allocated private network address request message;
判断单元, 用于判断所述接收单元接收到的私网地址与已存储的私网地 址是否冲突;  a determining unit, configured to determine whether the private network address received by the receiving unit conflicts with the stored private network address;
所述控制模块, 具体用于在所述判断单元的判断结果为冲突时, 控制所 述发送单元先发送释放私网地址消息给所述地址分配网元, 然后再发送分配 私网地址请求消息给所述地址分配网元。  The control module is specifically configured to: when the determining result of the determining unit is a conflict, control the sending unit to first send a release private network address message to the address allocation network element, and then send a distribution private network address request message to the The address assigns a network element.
8、 如权利要求 7所述的装置, 其特征在于, 所述发送单元发送的释放私 网地址消息中携带有用于指示所述地址分配网元分配新私网地址的指示消 息; 或者, The apparatus according to claim 7, wherein the release private network address message sent by the sending unit carries an indication message for instructing the address allocation network element to allocate a new private network address; or
在所述发送单元发送释放私网地址消息给所述地址分配网元之后并再次 发送分配私网地址请求消息给所述地址分配网元时, 所述发送单元再次发送 的分配私网地址请求消息中携带有用于指示所述地址分配网元分配新私网地 址的指示消息。  After the sending unit sends a release private network address message to the address allocation network element and sends a distribution private network address request message to the address allocation network element again, the sending unit resends the assigned private network address request message. There is an indication message for instructing the address allocation network element to allocate a new private network address.
9、 一种私网地址分配装置, 其特征在于, 包括: A private network address allocation device, comprising:
接收模块, 用于接收来自终端的用于请求分配私网地址的动态主机配置 协议 DHCP请求;  a receiving module, configured to receive a dynamic host configuration protocol DHCP request from the terminal for requesting allocation of a private network address;
获取模块, 用于根据所述接收模块接收的 DHCP请求, 从地址分配网元 处获取私网地址;  An obtaining module, configured to obtain a private network address from the address allocation network element according to the DHCP request received by the receiving module;
处理模块, 用于当所述获取模块获取的私网地址与已存储的私网地址冲 突时, 分配用于在局域网内唯一标识所述终端的映射私网地址, 并建立所述 获取模块获取的私网地址与分配的映射私网地址的映射关系;  a processing module, configured to: when the private network address obtained by the obtaining module conflicts with the stored private network address, allocate a mapped private network address for uniquely identifying the terminal in the local area network, and establish the acquired by the acquiring module The mapping relationship between the private network address and the assigned mapped private network address;
返回模块, 用于返回 DHCP应答消息给所述终端, 所述 DHCP应答消息 中携带有所述处理模块分配的映射私网地址。 And a returning module, configured to return a DHCP response message to the terminal, where the DHCP response message carries a mapped private network address allocated by the processing module.
10、 如权利要求 9所述的装置, 其特征在于, 所述获取模块包括: 发送单元, 用于根据所述接收模块接收到的 DHCP请求, 发送分配私网 地址请求消息给所述地址分配网元; The device according to claim 9, wherein the obtaining module comprises: a sending unit, configured to send a distribution private network address request message to the address distribution network according to the DHCP request received by the receiving module Yuan
接收单元, 用于接收所述地址分配网元返回的应答消息, 所述应答消息 中携带有所述地址分配网元在接收到所述分配私网地址请求消息之后分配的 私网地址。  And a receiving unit, configured to receive a response message returned by the address allocation network element, where the response message carries a private network address that is allocated by the address allocation network element after receiving the allocated private network address request message.
11、 一种私网地址分配系统, 其特征在于, 包括: 11. A private network address allocation system, comprising:
终端, 用于发送请求分配私网地址的动态主机配置协议 DHCP请求给接 入网关;  a terminal, configured to send a dynamic host configuration protocol DHCP request to allocate a private network address to the access gateway;
接入网关, 用于接收来自所述终端的所述 DHCP请求, 根据所述 DHCP 请求, 从地址分配网元处获取私网地址;  An access gateway, configured to receive the DHCP request from the terminal, and obtain a private network address from the address allocation network element according to the DHCP request;
地址分配网元, 用于分配私网地址, 并将分配的私网地址返回给所述接 入网关;  An address allocation network element, configured to allocate a private network address, and return the allocated private network address to the access gateway;
所述接入网关, 还用于当所述获取的私网地址与已存储的私网地址冲突 时, 则继续从所述地址分配网元获取私网地址; 以及当所述获取的私网地址 与已存储的私网地址不冲突时, 则返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述获取的私网地址。  The access gateway is further configured to: when the obtained private network address conflicts with the stored private network address, continue to obtain the private network address from the address allocation network element; and when the obtained private network address When the private network address does not conflict with the stored private network address, a DHCP response message is sent to the terminal, and the DHCP response message carries the acquired private network address.
12、 一种私网地址分配系统, 其特征在于, 包括: 12. A private network address allocation system, comprising:
终端, 用于发送请求分配私网地址的动态主机配置协议 DHCP请求给接 入网关;  a terminal, configured to send a dynamic host configuration protocol DHCP request to allocate a private network address to the access gateway;
接入网关, 用于接收来自所述终端的所述 DHCP请求, 根据所述 DHCP 请求, 从地址分配网元处获取私网地址;  An access gateway, configured to receive the DHCP request from the terminal, and obtain a private network address from the address allocation network element according to the DHCP request;
地址分配网元, 用于分配私网地址, 并将分配的私网地址返回给所述接 入网关;  An address allocation network element, configured to allocate a private network address, and return the allocated private network address to the access gateway;
所述接入网关, 还用于当所述获取的私网地址与已存储的私网地址冲突 时, 则分配用于唯一标识所述终端的映射私网地址, 并建立所述获取的私网 地址与所述映射私网地址的映射关系,以及返回 DHCP应答消息给所述终端, 所述 DHCP应答消息中携带有所述分配的映射私网地址。 The access gateway is further configured to: when the obtained private network address conflicts with the stored private network address, allocate a mapped private network address for uniquely identifying the terminal, and establish the obtained private network. a mapping relationship between the address and the mapped private network address, and returning a DHCP response message to the terminal, The DHCP reply message carries the allocated mapped private network address.
PCT/CN2013/073470 2012-02-09 2013-03-29 Private network address allocation method, device, and system WO2013117172A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210028822.1 2012-02-09
CN201210028822.1A CN103248716B (en) 2012-02-09 2012-02-09 Distribution method, device and system of private network address

Publications (1)

Publication Number Publication Date
WO2013117172A1 true WO2013117172A1 (en) 2013-08-15

Family

ID=48927937

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/073470 WO2013117172A1 (en) 2012-02-09 2013-03-29 Private network address allocation method, device, and system

Country Status (2)

Country Link
CN (1) CN103248716B (en)
WO (1) WO2013117172A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363296A (en) * 2020-09-30 2022-04-15 大唐移动通信设备有限公司 Address conflict detection method, user plane network element and control plane network element

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049547B (en) * 2015-07-30 2018-05-25 大唐移动通信设备有限公司 A kind of gateway address distribution method and equipment
CN109617922B (en) * 2019-01-24 2021-04-27 杭州迪普科技股份有限公司 Processing method and device for VPN protection network segment conflict, and electronic equipment
CN111445654B (en) * 2019-12-09 2021-12-14 珠海派诺科技股份有限公司 Quick access method for fire monitoring system, fire monitoring system and storage medium
CN112261173A (en) * 2020-10-20 2021-01-22 四川天邑康和通信股份有限公司 DHCP server allocation address conflict detection method relating to convergence gateway

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1708021A (en) * 2004-06-11 2005-12-14 华为技术有限公司 Method of distributing switchin-in address for user terminal
WO2006060072A1 (en) * 2004-11-30 2006-06-08 General Instrument Corporation Device, system and method for automatically determining an appropriate lan ip address range in a multi-router network environment
CN1870587A (en) * 2005-12-13 2006-11-29 华为技术有限公司 Management method and system for file of access terminal equipment
CN101030882A (en) * 2006-02-27 2007-09-05 华为技术有限公司 Method for accessing user network management platform

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3539413B2 (en) * 2001-08-31 2004-07-07 ソニー株式会社 Network connection device, network connection system, and network connection method
JP4561983B2 (en) * 2005-01-13 2010-10-13 日本電気株式会社 Local content connection system, mobile terminal, local content connection method, and client program
US20060221955A1 (en) * 2005-04-05 2006-10-05 Mark Enright IP addressing in joined private networks
CN100493102C (en) * 2005-12-01 2009-05-27 中国科学院计算技术研究所 Method for distribution of IP address in wideband wireless city area network
CN101478403A (en) * 2009-01-15 2009-07-08 中山大学 UPnP digital household gateway apparatus having security mechanism
CN101764856B (en) * 2009-12-17 2012-11-07 华为技术有限公司 IP address allocation method and gateway
CN101841467B (en) * 2010-03-16 2012-02-22 北京星网锐捷网络技术有限公司 Method, equipment and system for controlling multicast streams
CN102244620A (en) * 2010-05-13 2011-11-16 工业和信息化部电信传输研究所 Method and system for determining association relationship between gateway and equipment
CN101951417B (en) * 2010-09-21 2013-01-30 北京星网锐捷网络技术有限公司 Method, system and trunk equipment for assigning multiple server addresses
CN102246495A (en) * 2011-04-20 2011-11-16 华为技术有限公司 Method and access node for preventing address conflict
CN102291259B (en) * 2011-08-10 2013-09-11 天津大学 Low-voltage power line communication network layer management method based on multi-master station mode

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1708021A (en) * 2004-06-11 2005-12-14 华为技术有限公司 Method of distributing switchin-in address for user terminal
WO2006060072A1 (en) * 2004-11-30 2006-06-08 General Instrument Corporation Device, system and method for automatically determining an appropriate lan ip address range in a multi-router network environment
CN1870587A (en) * 2005-12-13 2006-11-29 华为技术有限公司 Management method and system for file of access terminal equipment
CN101030882A (en) * 2006-02-27 2007-09-05 华为技术有限公司 Method for accessing user network management platform

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363296A (en) * 2020-09-30 2022-04-15 大唐移动通信设备有限公司 Address conflict detection method, user plane network element and control plane network element

Also Published As

Publication number Publication date
CN103248716A (en) 2013-08-14
CN103248716B (en) 2017-04-12

Similar Documents

Publication Publication Date Title
JP6855575B2 (en) How to change between networks and devices, and related devices
US10516647B2 (en) Method for establishing data connection on mobile network, mobile network, and policy control entity
CN106664551B (en) Method and device for allocating IP address
JP2006520548A (en) Mobile internet protocol communication system and method using dual stack conversion mechanism
JP2020522957A (en) Session management method and apparatus
KR20160070471A (en) Method and apparatus for allocating ip address for direct communication mobile station
WO2017147752A1 (en) Mobility management method, apparatus and system
WO2014183696A1 (en) Path establishment method, controller and mobility management entity
WO2013117172A1 (en) Private network address allocation method, device, and system
JP7310006B2 (en) SERVICE CONTINUITY IMPLEMENTATION METHOD, RELATED DEVICE, AND SYSTEM
US20240098583A1 (en) PDU session continuity for a UE moving between a telecommunications network and a gateway device
JP2015507876A (en) Method, apparatus and system for accessing core network by non-3GPP
CN116746213A (en) Service data flow continuity for UEs in a system involving gateway devices
KR101481337B1 (en) Mobile Communication System Based on Software Defined Networks and Method for Processing Access of Mobile Equipment thereof
KR100684322B1 (en) Method for establishing connection for ip management messages in mobile communication system and method for allocating ip address thereby
CN113573381A (en) Transmission processing method, equipment, device and medium for non-IP type data
US20180077112A1 (en) Ip address allocation method in d2d communication and user equipment
KR20040051328A (en) Hand-Over Method Between Wireless Local Area Network and Mobile Telecommunication Network
KR20040049189A (en) Internet Protocol Allocating Method in Inter-working Systems of Wireless Local Area Network and Universal Mobile Telecommunication
WO2014169590A1 (en) Data service communication method, device, and system
WO2020066056A1 (en) Control plane device, program, system, and information processing device
KR100388487B1 (en) Method and Apparatus for Assigning Dynamic IP Address to ISP Subscriber Mobile Terminal Visiting 3rd Generation GPRS Network
WO2018223974A1 (en) Session management method and apparatus.
CN107306391B (en) Network address allocation method and device and gateway equipment
US9515990B1 (en) Communicating reregistration information based on the lifetime of a communication session

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13747282

Country of ref document: EP

Kind code of ref document: A1