IP address allocation method, device and equipment

By prioritizing the allocation of IPv6 addresses in address allocation devices, the problem of IPv4 addresses occupied by dual-stack user equipment is solved, the tense state of IPv4 address resources is alleviated, and the continuous development of the Internet is ensured.

CN114079648BActive Publication Date: 2025-02-25HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010818117.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-14
Publication Date
2025-02-25
Estimated Expiration
2040-08-14

AI Technical Summary

Technical Problem

In the case of shortage of IPv4 address resources, dual-stack user equipment occupies both IPv4 addresses and IPv6 addresses, resulting in a shortage of IPv4 addresses. How to alleviate the shortage of IPv4 addresses is urgently needed.

Method used

By implementing an IP address allocation method in the address allocation device, the specific steps include: when the network device has assigned an IPv6 address, it does not respond to its requested IPv4 address; or delay responding to the IPv4 address request when the IPv6 address is not assigned, so as to Priority is given to allocating IPv6 addresses to reduce the use of IPv4 address resources.

Benefits of technology

This method effectively reduces the occupation of IPv4 addresses, alleviates the tension of IPv4 address resources, and ensures the further development of the Internet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114079648B_ABST
    Figure CN114079648B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an IP address allocation method, apparatus and device, wherein the method includes: when the address allocation device receives a first request message sent by a network device to request an IPv4 address, it can first determine whether the address allocation device has allocated an IPv6 address to the network device, and if the IPv6 address has been allocated to the network device, the address allocation device will no longer respond to the first request message. That is, when the address allocation device has allocated an IPv6 address to the network device, it will no longer respond to the first request message and will not allocate an IPv4 address to the network device, thereby achieving priority allocation of IPv6 addresses, reducing the occupation of IPv4 address resources, and alleviating the problem of IPv4 address resource shortage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to an IP address allocation method, device and equipment. Background Art

[0002] Internet Protocol (IP) address, also translated as Internet Protocol address, is a protocol designed for computer networks to connect and communicate with each other. Currently, IP addresses can be divided into (internet protocol version 4, IPv4) addresses and (internet protocol version 6, IPv6) addresses. With the rapid development of the Internet, the limited address space defined by IPv4 will be exhausted, and the lack of address space will inevitably hinder the further development of the Internet. In order to expand the address space, IPv6 is used to redefine the address space.

[0003] In actual applications, there are three types of user devices. One is a single-stack IPv4 user device. The server only allocates an IPv4 address to the user device to access the IPv4 network. Another is a single-stack IPv6 user device. The server only allocates an IPv6 address to the user device to access the IPv4 network. Another is a dual-stack (IPv4+IPv6) user device. The server can allocate an IPv4 address and an IPv6 address to the user device at the same time, so that the user device can access both the IPv4 network and the IPv6 network.

[0004] When IPv4 address resources are relatively tight, dual-stack user devices occupy both IPv4 and IPv6 addresses, which leads to an even greater shortage of IPv4 addresses. How to alleviate the shortage of IPv4 addresses is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide an IP address allocation method, apparatus and device, which can reduce the occupation of IPv4 addresses by user devices accessing the network.

[0006] In the first aspect of the embodiment of the present application, an IP address allocation method is provided, which may include: an address allocation device receives a first request message sent by a network device, the first request message is used to request an IPv4 address; when the address allocation device determines that an IPv6 address has been allocated to the network device, the address allocation device does not respond to the first request message. In this implementation, when the address allocation device has allocated an IPv6 address to the network device, it will no longer respond to the first request message and no longer allocate an IPv4 address to the network device, thereby achieving priority allocation of IPv6 addresses, reducing the occupation of IPv4 address resources, and alleviating the problem of IPv4 address resource shortage.

[0007] In a possible implementation, after the address allocation device receives a first request message sent by the network device, it also includes: the address allocation device receives a second request message sent by the network device, the second request message is used to request an IPv6 address; the address allocation device allocates the IPv6 address to the network device according to the second request message; the address allocation device determines that the IPv6 address has been allocated to the network device, including: when the address allocation device successfully allocates the IPv6 address to the network device, the address allocation device determines that the IPv6 address has been allocated to the network device.

[0008] In a possible implementation, before the address allocation device receives a first request message sent by the network device, it also includes: the address allocation device receives a second request message sent by the network device, the second request message is used to request an IPv6 address; the address allocation device allocates the IPv6 address to the network device according to the second request message; the address allocation device determines that the IPv6 address has been allocated to the network device, including: when the address allocation device successfully allocates the IPv6 address to the network device, the address allocation device determines that the IPv6 address has been allocated to the network device.

[0009] In the second aspect of the embodiment of the present application, an IP address allocation method is provided, the method further comprising: an address allocation device receives a first request message sent by a network device, the first request message being used to request an IPv4 address; when the address allocation device determines that an IPv6 address is not allocated to the network device, the address allocation device delays a preset time to respond to the first request message. In this implementation, when the address allocation device receives a first request message sent by a network device for requesting an IPv4 address, even if the address allocation device has not yet allocated an IPv6 address to the network device, it does not immediately respond to the first request message to allocate an IPv4 address to the network device, but delays responding to the first request message to implement priority allocation of IPv6 addresses and reduce the occupation of IPv4 addresses.

[0010] In one possible implementation, the address allocation device delays a preset time to respond to the first request message, including: when the address allocation device does not receive a second request message within the preset time, the address allocation device allocates an IPv4 address to the network device according to the first request message, and the second request message is used to request an IPv6 address.

[0011] In a possible implementation, the address allocation device delays a preset time to respond to the first request message, including: the address allocation device receives a second request message within the preset time, the address allocation device allocates an IPv6 address to the network device according to the second request message, and the second request message is used to request the IPv6 address; when the address allocation device fails to allocate an IPv6 address to the network device, the address allocation device allocates an IPv4 address to the network device according to the first request message.

[0012] In a possible implementation, the network device is a dual-stack device that carries the Point-to-Point Protocol over Ethernet.

[0013] In a third aspect of the embodiment of the present application, an IP address allocation method is provided, the method comprising: when the address allocation device has allocated an IPv6 address to a network device, the address allocation device determines whether an IPv4 address has been allocated to the network device; when the address allocation device determines that an IPv4 address has been allocated to the network device, the address allocation device reclaims the IPv4 address. In this implementation, when the address allocation device determines that both an IPv6 address and an IPv4 address are allocated to the same network device, the address allocation device can reclaim the allocated IPv4 address, thereby alleviating the tension of IPv4 address resources.

[0014] In a possible implementation manner, the address allocation device reclaims the IPv4 address, including: the address allocation device does not respond to the IPv4 detection message sent by the network device.

[0015] In a possible implementation, the address allocation device reclaims the IPv4 address, including: the address allocation device reclaims the IPv4 address according to a third request message sent by the network device, where the third request message is used to request the address allocation device to reclaim the IPv4 address.

[0016] In a possible implementation, the network device is a dual-stack device that carries the Internet Protocol over Ethernet.

[0017] In the fourth aspect of the embodiments of the present application, an IP address allocation device is provided, the device comprising: a receiving unit, configured to receive a first request message sent by a network device, the first request message being used to request an IPv4 address; and a processing unit, configured to prevent the address allocation device from responding to the first request message when it is determined that an IPv6 address has been allocated to the network device.

[0018] In one possible implementation, the device also includes: an allocation unit and a determination unit; the receiving unit is further used to receive a second request message sent by the network device after receiving the first request message, and the second request message is used to request an IPv6 address; the allocation unit is used to allocate the IPv6 address to the network device according to the second request message; the determination unit is used to determine that the IPv6 address has been allocated to the network device when the allocation of the IPv6 address to the network device is successful.

[0019] In one possible implementation, the device also includes an allocation unit and a determination unit; the receiving unit is further used to receive a second request message sent by the network device before the address allocation device receives the first request message sent by the network device, and the second request message is used to request an IPv6 address; the allocation unit is used to allocate the IPv6 address to the network device according to the second request message; the determination unit is used to determine that the IPv6 address has been allocated to the network device when the allocation of the IPv6 address to the network device is successful.

[0020] In the fifth aspect of the embodiments of the present application, an IP address allocation device is provided, which also includes: a receiving unit, used for the address allocation device to receive a first request message sent by a network device, wherein the first request message is used to request an IPv4 address; and a processing unit, used to delay a preset time to respond to the first request message when it is determined that an IPv6 address is not allocated to the network device.

[0021] In a possible implementation, the processing unit is specifically configured to allocate an IPv4 address to the network device according to the first request message if the second request message is not received within the preset time, and the second request message is used to request an IPv6 address.

[0022] In a possible implementation, the processing unit is specifically used to receive a second request message within the preset time, and allocate an IPv6 address to the network device according to the second request message, wherein the second request message is used to request the IPv6 address; when the address allocation device fails to allocate an IPv6 address to the network device, the address allocation device allocates an IPv4 address to the network device according to the first request message.

[0023] In a possible implementation manner, the network device is a device that carries a point-to-point protocol over Ethernet.

[0024] In the sixth aspect of the embodiments of the present application, an IP address allocation device is provided, the device comprising: a determination unit, for when the address allocation device has allocated an IPv6 address to a network device, the address allocation device determines whether an IPv4 address has been allocated to the network device; a recovery unit, for when it is determined that an IPv4 address has been allocated to the network device, the address allocation device recovers the IPv4 address.

[0025] In a possible implementation, the recovery unit is specifically configured to not respond to the IPv4 detection message sent by the network device.

[0026] In a possible implementation, the recovery unit is specifically configured to recover the IPv4 address according to a third request message sent by the network device, where the third request message is used to request the address allocation device to recover the IPv4 address.

[0027] In a possible implementation, the network device is an Ethernet device carrying Internet Protocol.

[0028] In a seventh aspect of the embodiments of the present application, a device is provided, the device comprising: a processor and a memory;

[0029] The memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the device executes the method described in the first aspect.

[0030] In an eighth aspect of the embodiments of the present application, a computer-readable storage medium is provided, comprising instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect above.

[0031] Through the method provided in the embodiment of the present application, when the address allocation device receives the first request message sent by the network device for requesting an IPv4 address, it can first determine whether the address allocation device has allocated an IPv6 address to the network device. If the IPv6 address has been allocated to the network device, the address allocation device will no longer respond to the first request message. That is, when the address allocation device has allocated an IPv6 address to the network device, it will no longer respond to the first request message and will no longer allocate an IPv4 address to the network device, thereby achieving priority allocation of IPv6 addresses, reducing the occupation of IPv4 address resources, and alleviating the problem of tight IPv4 address resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1a A schematic diagram of PPPoE dual-stack device access;

[0034] Figure 1b This is a schematic diagram of IPoE dual-stack device access;

[0035] Figure 1c This is another IPoE dual-stack device access diagram;

[0036] Figure 2 A flow chart of an IP address allocation method provided in an embodiment of the present application;

[0037] Figure 3 Another flow chart of an IP address allocation method provided in an embodiment of the present application;

[0038] Figure 4 A flowchart of another IP address allocation method provided in an embodiment of the present application;

[0039] Figure 5 A flow chart of an IP address allocation method for a PPPoE dual-stack device provided in an embodiment of the present application;

[0040] Figure 6 A flow chart of an IP address allocation method for an IPoE dual-stack device provided in an embodiment of the present application;

[0041] Figure 7 A structural diagram of an IP address allocation device provided in an embodiment of the present application;

[0042] Figure 8 A structural diagram of another IP address allocation device provided in an embodiment of the present application;

[0043] Fig. 9 A structural diagram of another IP address allocation device provided in an embodiment of the present application;

[0044] Fig.10 A device structure diagram provided for an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.

[0046] To facilitate understanding of the specific implementation of the embodiments of the present application, the technologies involved in the embodiments of the present application will be described below.

[0047] Dual stack refers to enabling both the IPv4 protocol stack and the IPv6 protocol stack on a device. The device can obtain both IPv4 and IPv6 addresses at the same time, allowing the device to access both the IPv4 network through the IPv4 address and the IPv6 network through the IPv6 address.

[0048] With the rapid development of IP networks, user authentication methods, as the core of operability and management, have received close attention from operators and manufacturers. The core authentication technologies currently under discussion mainly include Internet Protocol Control Protocol (IPoE) and Point-to-Point Protocol over Ethernet (PPPoE).

[0049] In the dual-stack application scenario, it can be divided into PPPoE dual-stack access and IPoE dual-stack access. To facilitate understanding of the specific process of each access, the following will be explained with reference to the accompanying drawings.

[0050] See also Figure 1a , the figure is a PPPoE dual stack access negotiation flow chart, the PPPoE dual stack access negotiation process includes two stages: PPPoE negotiation (discovery stage) and PPP negotiation (session stage). Among them, the PPPoE negotiation stage includes determining the Ethernet MAC address of the broadband access server (BRAS), and the BRAS assigning the session ID used for PPPoE access to the user equipment to uniquely identify a PPPoE virtual link between the user equipment and the BARS. Among them, the PPP negotiation includes the link control protocol (LCP) negotiation stage, the authentication stage, and the network control protocol (NCP) negotiation stage.

[0051] The PPPoE negotiation phase consists of the following four processes:

[0052] (1) The PPPoE client broadcasts a (PPPoE active discovery initial, PADI) message, which includes the service type information that the client needs to obtain. The client can be carried by a user device.

[0053] (2) After receiving the PADI message, all PPPoE broadband access servers compare the requested service with the service they can provide. If the service can be provided, they unicast a reply (PPPoE active discovery offer, PADO) message.

[0054] (3) According to the network topology, the client may receive PADO messages from multiple broadband access servers. The client selects the service area corresponding to the first PADO message received as the server to be communicated with, and unicasts a (PPPoE active discovery request, PADR) message.

[0055] (4) The broadband access server generates a unique session ID to represent the session with the client. It sends the session ID to the client by sending a PPPoE active discovery session-confirmation (PADs) message. After the session is successfully established, it enters the session phase.

[0056] PPP negotiation phase

[0057] (1) The LCP negotiation phase is mainly used to establish a PPP link. In this phase, the basic communication method will be selected. The devices at both ends of the link (client and server) send configuration information packets to each other through LCP. Once a configuration success packet is sent and received, the exchange is completed and the LCP is turned on.

[0058] (2) During the authentication phase, the client sends its identity to the broadband access server. This phase uses a secure authentication method to prevent a third party from stealing data or impersonating a remote server to take over the connection with the client. Before the authentication is completed, it is prohibited to proceed from the authentication phase to the network layer protocol phase. In this phase, only packets of the link control protocol, authentication protocol, and link quality monitoring protocol are allowed. The most commonly used authentication protocols are the password authentication protocol (PAP) and the challenge-handshake authentication protocol (CHAP). Figure 1aTake CHAP authentication as an example. In actual applications, the broadband access server can perform authentication, or the broadband access server can send an authentication request to an authentication, authorization, accounting (AAA) server, and the AAA server can perform authentication.

[0059] Among them, PAP authentication is a two-way handshake protocol, which is a simple plain text authentication method. When the two ends of the link can transmit data to each other, the broadband access server requires the client to provide a username and password. The client uses PAP to send the username and password to the server in plain text. The broadband access server checks whether it is correct according to the user table on the local end (or radius server). If it is correct, it sends an ACK message to the client, otherwise it sends a NAK message. The link will not be closed directly if the authentication fails, but the link will be closed only when the number of authentications reaches a certain value.

[0060] CHAP authentication is a three-way handshake protocol, which is an encrypted authentication method that only transmits the username in the network without transmitting the password. First, the broadband access server sends a challenge password to the client, which includes the session ID and a random challenge string. The client uses the MD5 hash algorithm to return the username and encrypted challenge password, session ID and password. The broadband access server stores the client's password. The server can repeat the client's operation and compare the result with the password returned by the client.

[0061] (3) NCP negotiation phase: After authentication is successful, an address is assigned to the client. The main function of NCP negotiation is to negotiate the network layer parameters of the PPP message, such as IP Control Protocol (IPCP) and IPv6 Control Protocol (IPv6CP). In this phase, the client and the broadband access server send Configure-Request messages to each other and respond to Configure-ACK messages, which indicates that the NCP negotiation is successful and the network can be accessed normally.

[0062] Among them, if IPCP negotiation succeeds, an IPv4 address can be assigned to the client, and if IPv6CP negotiation succeeds, an IPv6 address can be assigned to the client. It should be noted that when allocating IPv6 addresses under PPPoE, it is usually mainly applied to two types of gateway scenarios. One is to allocate interface addresses to clients in a bridging gateway scenario; the other is to allocate wide area network (WAN) port addresses and local area network (LAN) port prefixes for home networks in a routing gateway scenario. In a bridging gateway scenario, when entering the PPP negotiation stage, the client initiates a PPP connection request; in a routing gateway scenario, the gateway initiates a PPP connection request.

[0063] The PPPoE dual-stack device negotiates both IPv4 and IPv6 at the NCP negotiation stage. There is no strict requirement for the order of dual-stack address allocation. The order of IPv4 and IPv6 address allocation can be determined according to the order in which the client and the broadband access server complete the interaction. After the PPPoE dual-stack device is successfully connected, the client and the broadband access server can send echo messages at regular intervals for detection. The IPv4 and IPv6 addresses are detected using the same echo message. If multiple detections fail, the user is triggered to go offline.

[0064] See also Figure 1b-1c ,This figure is the IPoE dual stack access flow chart. When IPoE dual stack access, the order of IPv4 address and IP v6 address allocation is determined according to the order in which the client and BARS interact. When the address allocation device receives the IPv4 access request first, it first performs authentication. When the authentication passes, the IPv4 address is allocated to the client. When the address allocation device receives the IPv6 access request again, there is no need to perform authentication again.

[0065] in, Figure 1b The address allocation device first receives an IPv4 access request. During the access process, the client broadcasts a discovery message (such as DHCP Discover) so that all BRASs in the same network segment can receive the discovery message. After receiving the discovery message, the BRAS authenticates and authorizes the client through the AAA server, and sends its own address and the address that can be allocated to the client to the client through a response message (such as DHCP Offer).

[0066] The client can receive response messages sent by multiple address allocation devices. Normally, the client receives and processes the first response message received, and broadcasts the request message to broadcast the selected BRAS and IP address. For the selected BRAS, a response message (such as DHCP Ack) will be sent to the client. After the client successfully accesses through the IPv4 address, it will periodically detect through (address resolution protocol, ARP) messages. If multiple consecutive detections fail, it will trigger the IPv4 single stack to go offline. The IPv4 single stack going offline will not affect the normal IPv6 service functions of the client.

[0067] Figure 1c This is a schematic diagram of the BRAS first receiving an access request of the IPv6 type. The access process takes ND exclusive + PD access as an example. The client sends a router solicitation (RS) message. After receiving the message, the BRAS performs authentication and authorization through the AAA server, and uses a router advertisement (RA) message to allocate an IPv6 prefix for the WAN port to the client. The client determines the BRAS by sending a Solicit message, and the BRAS responds to the Solicit message by sending an Advertise message to announce that it will provide DHCPv6 services to the client. The client requests an IPv6 address and other configuration information from the BRAS by sending a request message Request, and the BRAS sends a response message Reply carrying the address and configuration information.

[0068] When the client successfully accesses through the IPv6 address, it will periodically detect the user through the neighbor discovery (ND) message. If the detection fails for multiple times in a row, it will trigger the IPv6 single stack offline. The IPv6 single stack offline will not affect the normal IPv4 service functions.

[0069] At present, according to the type and number of addresses allocated to the client, it can be divided into single-stack IPv4 user equipment, single-stack IPv6 user equipment and dual-stack (IPv4+IPv6) user equipment. Among them, when a single-stack IPv4 user equipment accesses the network, only an IPv4 address is allocated to the terminal, and the terminal can only access the IPv4 network; defect: IPv4 address resources are scarce.

[0070] When a single-stack IPv6 user device accesses the network, only an IPv6 address is allocated to the terminal, and the terminal can only access the IPv6 network; Disadvantages: Some terminals do not support the IPv6 protocol (for example, the Android system does not support DHCPv6, and some home gateways do not support IPv6). If the IPv6 address acquisition fails, the terminal will not be able to access the IPv4 network, and the service will be affected.

[0071] When a dual-stack (IPv4+IPv6) user device accesses the network, an IPv4 address and an IPv6 address can be allocated to the terminal at the same time, so that the terminal can access both the IPv4 network and the IPv6 network. Disadvantage: It will also occupy IPv4 addresses, which makes IPv4 address resources scarce.

[0072] It should be noted that the address allocation device in the embodiment of the present application can be various devices with address allocation function, such as dynamic host configuration protocol (DHCP) equipment, broadband remote access server (BRAS), etc.

[0073] Based on this, an embodiment of the present application provides an IP address allocation method for solving the problem that when a dual-stack user device accesses a network, an IPv4 address is still allocated when an IPv6 address is allocated, thereby causing a shortage of IPv4 address resources.

[0074] To facilitate understanding of the specific implementation of the present application, an explanation will be given below with reference to the accompanying drawings.

[0075] Method Example 1

[0076] See also Figure 2 , which is a flow chart of an IP address allocation method provided in an embodiment of the present application, such as Figure 2 As shown, the method may include:

[0077] S201: An address allocation device receives a first request message sent by a network device.

[0078] In this embodiment, the network device may request an IPv4 address by sending a first request message to the address allocation device, wherein the first request message is used to request an IPv4 address.

[0079] The network device may be a PPPoE dual-stack device or an IPoE dual-stack device. When the network device is a PPPoE device, after it has passed PAP / CHAP authentication and authentication, the network device sends a first request message to the address device to request the allocation of an IPv4 address. When the network device is an IPoE device, when the network device sends the first request message to the address allocation device, the address allocation device may determine whether the network device has been authenticated based on the device identifier in the first request message, and if it has been authenticated and authentication has passed, perform subsequent address allocation operations. If the address allocation device determines that the network device has not been authenticated or authentication has failed, it authenticates the network device based on the first request message, so that subsequent address allocation operations can be performed after authentication has passed. The authentication operation of the address allocation device on the network device can be referred to. Figure 1b-1c The specific implementation in .

[0080] In some implementations, the first request message may include a device identifier of the network device and a message type, wherein the device identifier is used by an address allocation device to uniquely identify the network device based on the device identifier, and the message type is used to indicate that the first request message is used to request an IPv6 address.

[0081] S202: When the address allocation device determines that an IPv6 address has been allocated to the network device, the address allocation device does not respond to the first request message.

[0082] In this embodiment, after receiving the first request message sent by the network device, the address allocation device can first determine whether an IPv6 address has been allocated to the network device. If the address allocation device has allocated an IPv6 address to the network device, the address allocation device will no longer respond to the first request message, will not allocate an IPv4 address to the network device, and the network device will communicate using the IPv6 address.

[0083] The address allocation device may pre-store the correspondence between the device identification of the network device and the allocated IPv6 address. When the address allocation device receives the first request message sent by the network device, it may search for an allocated IPv6 address based on the device identification in the first request message and the above correspondence. If the IPv6 address corresponding to the device identification can be found, it is determined that the address allocation device has allocated an IPv6 address to the network device.

[0084] In some implementations, the address allocation device determines that an IPv6 address has been allocated to a network device, which can be divided into the following situations:

[0085] One is that, before receiving the first request message sent by the network device, the address allocation device first receives the second request message sent by the network device, and the second request message is used to request an IPv6 address; the address allocation device allocates an IPv6 address to the network device according to the second request message; when the address allocation device determines that the IPv6 address has been successfully allocated to the network device, the address allocation device determines that the IPv6 address has been allocated to the network. That is, the address allocation device first receives the second request message, and allocates an IPv6 address to the network device according to the second request message. At the same time, the address allocation device can store the corresponding relationship between the device identification of the network device and the allocated IPv6 address. When the address allocation device receives the first request message later, the allocated IPv6 address can be found according to the device identification in the first request message and the above-mentioned corresponding relationship. If the allocation of the IPv6 address is successful, it is determined that the network device has been allocated an IPv6 address.

[0086] Another is that, after receiving the first request message sent by the network device, the address allocation device receives the second request message sent by the network device, and the user of the second request message requests an IPv6 address; the address allocation device allocates an IPv6 address to the network device according to the second request message; when the address allocation device determines that the IPv6 address has been successfully allocated to the network device, the address allocation device determines that the IPv6 address has been allocated to the network device. That is, in this implementation, the address allocation device first receives the first request message sent by the network device, and then receives the second request message sent by the network device. In this case, when the address allocation device receives the first request message sent by the network device, it temporarily does not respond to the first request message, but first allocates an IPv6 address to the network device according to the second request message. When the address allocation device successfully allocates an IPv6 address to the network device, the address allocation device determines that the IPv6 address has been allocated to the network device.

[0087] The solution provided by the above embodiment is that when the address allocation device receives the first request message sent by the network device for requesting an IPv4 address and has allocated an IPv6 address to the network device, the IPv4 address is not allocated to the network device by no longer responding to the first request message, so as to avoid wasting the IPv4 address. When the address allocation device receives the first request message, the address allocation device has not allocated an IPv6 address to the network device. How to avoid occupying the IPv4 address will be explained in conjunction with the accompanying drawings.

[0088] Method Example 2

[0089] See also Figure 3 , which is a flow chart of another IP address allocation method provided in an embodiment of the present application, such as Figure 3As shown, the method may include:

[0090] S301: An address allocation device receives a first request message sent by a network device.

[0091] In this embodiment, the specific implementation of S301 may refer to the implementation of S201 described above.

[0092] S302: The address allocation device determines that no IPv6 address is allocated to the network device, and the address allocation device delays a preset time to respond to the first request message.

[0093] In this embodiment, after the address allocation device receives the first request message sent by the network device, it can determine whether the IPv6 address has been allocated to the network device according to the first request message. When the address allocation device has not allocated an IPv6 address to the network device, the address allocation device delays the response to the first request message for a preset time. That is, when the address allocation device receives the first request message sent by the network device for requesting an IPv4 address, even if the address allocation device has not allocated an IPv6 address to the network device, it does not immediately respond to the first request message to allocate an IPv4 address to the network device, but delays the response to the first request message.

[0094] The purpose of the address allocation device delaying the response to the first request message is to wait for the arrival of the second request message, which is used to request an IPv6 address. If the network device sends the second request message to the address allocation device within the preset delay time, the address allocation device allocates an IPv6 address to the network device according to the second request message. It can be seen that in this embodiment, even if the address allocation device receives the first request message first, it can wait for the second request message by delaying the processing of the first request message, so as to preferentially allocate an IPv6 address to the network device, thereby reducing the occupation of IPv4 addresses.

[0095] In some implementations, when the address allocation device does not receive the second request message within a preset time, the address allocation device may allocate an IPv4 address to the network device according to the first request message. In this embodiment, to ensure that the network device can provide normal communication services, if the address allocation device does not receive the second request message sent by the network device within a preset time, the IPv4 address may be directly allocated to the network device according to the first request message, so that the network device can use the IPv4 address for data transmission.

[0096] In some implementations, when the address allocation device does not receive the second request message within the preset time, the address allocation device may again delay the preset time to respond to the first request message to wait for the second request message. In order to avoid the network device being unable to obtain an IP address due to a long delay, thereby affecting the data transmission of the network device, the address allocation device may pre-set a delay threshold or a delay time threshold. When the number of delays reaches the preset number threshold or when the total delay duration reaches the preset duration threshold, the address allocation device may no longer perform delay processing and allocate an IPv4 address to the network device according to the first request message, so that the network device can use the IPv4 address for data transmission. For example, the preset number threshold is 4 times, and when the address allocation device delays 4 times, the IPv4 address can be allocated to the network device according to the first request message. For another example, the preset duration threshold is 8ms, and if the cumulative duration of the preset time of multiple delays reaches 8ms, the address allocation device can allocate an IPv4 address to the network device according to the first request message.

[0097] When the address allocation device performs multiple delay processes, the preset time of each delay may be the same, for example, the preset time of each delay is 1 millisecond. Of course, the preset time of each delay may also be different. Specifically, different preset times may be delayed in an increasing or decreasing manner. For example, the preset time of the first delay is 2 milliseconds, and the preset time of the second delay is 1.8 milliseconds.

[0098] In some implementations, when the address allocation device receives the second request message within a preset time, the address allocation device allocates an IPv6 address to the network device according to the second request message; when the address allocation device fails to allocate an IPv6 address to the network device, the address allocation device allocates an IPv4 address to the network device according to the first request message. In this embodiment, when the address allocation device receives the second request message within a preset time, the address allocation device may allocate an IPv6 address to the network device according to the second request message. When the address allocation device successfully allocates an IPv6 address to the network device, the address allocation device may allocate an IPv4 address to the network device according to the first request message. Figure 2 In the embodiment described, the first request message is no longer responded. When the address allocation device fails to allocate an IPv6 address to the network device, the address allocation device can respond to the first request message and allocate an IPv4 address to the network device. That is, in this embodiment, when the address allocation device fails to allocate an IPv6 address to the network device, it allocates an IPv4 address to the network device.

[0099] In some implementations, although the address allocation device does not receive the second request message within the preset delay time, it receives the second request message sent by the network device when the address allocation device allocates an IPv4 address to the network device. At this time, the address allocation device can allocate an IPv6 address to the network device at the same time according to the second request message. Alternatively, when the IPv6 address allocation fails, the network device can send the second request message to the address allocation device again. At this time, although the address allocation device allocates an IPv4 address to the network device, it can still allocate an IPv6 address to the network device according to the second request message.

[0100] It should be noted that, considering that the network device is a PPPoE dual-stack device, the time interval between the network device sending the first request message and the second request message to the address allocation device is relatively small. In order to avoid the address allocation device allocating an IPv4 address to the network device when the network device sends the first request message first, this embodiment delays the response to the first request message through delayed processing, so that when the second request message is received within the preset time of the delay, an IPv6 address is preferentially allocated to the network device.

[0101] It can be seen from the above embodiments that in some application scenarios, there are situations where the address allocation device allocates both IPv4 addresses and IPv6 addresses to network devices. In this case, how to reduce the occupation of IPv4 addresses, the embodiment of the present application provides another implementation method, which will be described below in conjunction with the accompanying drawings.

[0102] Method Example 3

[0103] See also Figure 4 , which is a flow chart of another IP address allocation method provided in an embodiment of the present application, such as Figure 4 As shown, the method may include:

[0104] S401: When the address allocation device has allocated an IPv6 address to a network device, the address allocation device determines whether an IPv4 address has been allocated to the device on the network; if yes, execute S402; otherwise, end.

[0105] In this embodiment, when the address allocation device has allocated an IPv6 address to a network device, the address allocation device may determine whether an IPv4 address has been allocated to the network device. When the address allocation device determines that an IPv6 address has been allocated to the network device and an IPv4 address has been allocated at the same time, S402 is executed. If the address allocation device determines that an IPv6 address has been allocated to the network device and an IPv4 address has not been allocated to the network device, no operation may be performed, or when the network device continues to send a first request message to the address allocation device, the address allocation device no longer responds to the first request message, thereby reducing the occupation of the IPv4 address. The specific implementation of the address allocation device not responding to the first request message can be found in Figure 2 The embodiments described above will not be described in detail herein.

[0106] S402: The address allocation device reclaims the IPv4 address.

[0107] When the address allocation device determines to allocate both an IPv6 address and an IPv4 address to the same network device, the address allocation device can reclaim the allocated IPv4 address, thereby alleviating the tense state of IPv4 address resources.

[0108] The address allocation device can reclaim the allocated IPv4 addresses in the following ways:

[0109] One is that the address allocation device does not respond to the IPv4 detection message sent by the network device. It can be seen from the above description that after the address allocation device allocates an IP address to the network device, the network device and the address allocation device can notify the address allocation device that the network device is online by sending a detection message to maintain the use of the allocated IP address. When the address allocation allocates both an IPv6 address and an IPv4 address to the network device, when the network device sends a detection message for the IPv4 address to the address allocation device, the address allocation device reclaims the IPv4 address by not responding to the detection message.

[0110] It should be noted that in this implementation, since in the IPoE dual-stack access scenario, the detection message of the IPv6 address and the detection message of the IPv4 address are different messages, the address allocation device can reclaim the IPv4 address by not responding to the network device sending the IPv4 address detection message. That is, in this embodiment, the network device can be a dual-stack device carrying the Internet Protocol IPoE over Ethernet.

[0111] Another is that the address allocation device reclaims the IPv4 address according to the third request message sent by the network device, and the third request message is used to request the address allocation device to reclaim the IPv4 address. In this implementation, when the network device determines that it has allocated both an IPv6 address and an IPv4 address, it actively sends a third request message to the address allocation device to request the address allocation device to reclaim the IPv4 address allocated by the network device. Among them, the third request message may include the device identification of the network device. After receiving the third request message, the address allocation device finds the corresponding IPv4 address according to the device identification in the third request message, and reclaims the IPv4 address to put the IPv4 address into the address pool, thereby increasing the number of IPv4 addresses in the address pool. Alternatively, the third request message includes the device identification of the network device and the IPv4 address corresponding to the network device. When the address allocation device receives the third request message, it directly reclaims the IPv4 address included in the third request message.

[0112] In some implementations, when the address allocation device allocates IP addresses to network devices, it can record the IP addresses allocated to each network device, thereby avoiding repeated allocation of IP addresses. In this case, when the address allocation device reclaims the IPv4 address of a certain network device, it also deletes the previous record of the reclaimed IPv4 address, so that the IPv4 address can be allocated smoothly later.

[0113] Considering the differences between the PPPoE and IPoE access processes and detection processes, they are described separately below.

[0114] Method Example 4

[0115] See also Figure 5 , which is a flow chart of an IP address allocation method provided in an embodiment of the present application, and Figure 2-Figure 4 The same contents as in the embodiment can be found in Figure 2-Figure 4 The description of the embodiment is as follows: Figure 5 As shown, the method for the PPPoE dual-stack access scenario may include:

[0116] S501: The address allocation device receives a request message sent by a network device.

[0117] In this embodiment, in the PPPoE dual stack access scenario, after the address allocation device and the network device have gone through PPPoE negotiation and LCP negotiation and authentication in PPP negotiation, they enter the NCP negotiation phase. In the NCP negotiation phase, the network device can send a request message to the address allocation device to request the address allocation device to allocate an IP address to it.

[0118] In the NCP negotiation phase, the network device and the address allocation device can negotiate both IPv4 addresses and IPv6 addresses. In order to ensure that IPv6 addresses are allocated to network devices in priority, information on the priority allocation of IPv6 addresses can be configured in the address allocation device. When the address allocation device receives a request message sent by the network device, it can first determine the type of the request message to perform different operations according to different judgment results. The request message can be divided into a first request message and a second request message, wherein the first request message is used to request an IPv4 address, i.e., an IPv4 request message, and the second request message is used to request an IPv6 address, i.e., an IPv6 request message. Specifically, the type of the requested IP address can be carried in the request message, and the address allocation device determines the type of the request message by parsing the request message. When the request message is the second request message, S502 is executed; when the type of the request message is the first request message, S504 is executed.

[0119] S502: When the request message is an IPv6 request message, the address allocation device allocates an IPv6 address to the network device according to the request message.

[0120] In this embodiment, when the request message received by the address allocation device is an IPv6 request message, it indicates that the network device and the address allocation device negotiate an IPv6 address, and the address allocation device allocates an IPv6 address to the network device. When the negotiation between the address allocation device and the network device succeeds, it indicates that the address allocation device successfully allocates an IPv6 address to the network device.

[0121] S503: The address allocation device determines whether an IPv4 address has been allocated to the network device. If an IPv4 address has not been allocated, S509 is executed; otherwise, no operation is performed.

[0122] When the address allocation device has allocated an IPv6 address to a network device, in order to avoid allocating an IPv4 address again when an IPv6 address is allocated, resulting in a waste of IPv4 address resources, the address allocation device can determine whether to allocate an IPv4 address to the network device. If an IPv4 address has not been allocated, the address allocation device will no longer respond to the request message for an IPv4 address sent by the network device. That is, when the address allocation device receives the second request message first, it will give priority to allocating an IPv6 address to the network device, and will not respond to the first request message received subsequently, and will not allocate an IPv4 address to the network device.

[0123] Specifically, the address allocation device can store the correspondence between the network device identifier and the allocated IP address (IPv4 address). When receiving a request message sent by the network device, it can determine whether to allocate an IPv4 address for the network device based on the device identifier in the request message and the above correspondence.

[0124] It should be noted that if the address allocation device has allocated an IPv4 address to the network device, since in the current PPPoE dual-stack access, the message for detecting the IPv4 address and the message for detecting the IPv6 address are the same message, the IPv4 address cannot be recovered by not responding to the detection message. In the future development of communications, when PPPoE dual-stack access is used, different detection messages are sent to detect IPv4 addresses and IPv6 addresses respectively. In this case, the address allocation device can recover the IPv4 address by not responding to the IPv4 address detection message.

[0125] S504: When the request message is an IPv4 request message, the address allocation device determines whether an IPv6 address has been allocated to the network device. If no IPv6 address has been allocated, S505 is executed; otherwise, S609 is executed.

[0126] In this embodiment, when the request message received by the address allocation device is an IPv4 request message, it indicates that the network device and the address allocation device are negotiating an IPv4 address. To avoid allocating an IPv4 address again when an IPv6 address is allocated, when the address allocation device receives the first request message, the address allocation device can first determine whether an IPv6 address has been allocated to the network device. If the IPv6 address has not been allocated, S505 is executed, that is, the reason why the IPv6 address has not been allocated is further determined; if the IPv6 address has been allocated, S510 is executed, and the first request message is no longer responded to.

[0127] For example, the address allocation device can store the correspondence between the network device identifier and the allocated IP address (IPv6). When receiving a first request message sent by the network device, it can determine whether to allocate an IPv6 address to the network device based on the device identifier of the network device in the first request message and the above correspondence.

[0128] S505: The address allocation device determines whether an IPv6 request message has been received. If yes, execute S506; if not, execute S507.

[0129] When the address allocation device determines that the IPv6 address has not been allocated to the network device, the reason for not allocating the IPv6 address can be further determined, that is, the reason for determining that the address allocation device has not allocated the IPv6 address is that the second request message has not been received, or the second request message has been received but the IPv6 address negotiation failed. If the address allocation device has received the second request message sent by the network device but the negotiation failed, S506 is executed, and the address allocation device allocates an IPv4 address to the network device. If the address allocation device has not received the second request message, S507 is executed.

[0130] S506: The address allocation device allocates an IPv4 address to the network device according to the IPv4 request message.

[0131] In this embodiment, when the address allocation device has received the IPv6 request message and the IPv6 address allocation fails, the address allocation device can allocate an IPv4 address to the network device according to the IPv4 request message. That is, the address allocation device allocates an IPv4 address to the network device without allocating an IPv6 address to the network device, so as to ensure that the network device can perform data transmission services.

[0132] S507: The address allocation device delays a preset time to respond to the IPv4 request message.

[0133] In this embodiment, when the address allocation device has not received an IPv6 request message, it indicates that the network device and the address allocation device have not yet performed IPv6 address negotiation, and the address allocation device can perform IPv4 address negotiation after a preset delay time according to a pre-configured delay mechanism. For example, "IPv4 negotiation delay X milliseconds" is pre-configured, and when the address allocation device first receives the first request message, it first delays X milliseconds before performing IPv4 address negotiation.

[0134] S508: The address allocation device determines whether the IPv6 request message sent by the network device is received within a preset time. If yes, execute S502; otherwise, execute S506.

[0135] When the address allocation device receives the IPv6 request message sent by the network device within the preset delayed time, S302 is executed to perform IPv6 negotiation according to the request message to allocate an IPv6 address to the network device.

[0136] When the address allocation device does not receive the IPv6 request message sent by the network device within the preset delay time, the IPv4 address negotiation is performed according to the IPv4 request message to allocate an IPv4 address to the network device.

[0137] S509: The address allocation device does not respond to the subsequently received IPv4 request message.

[0138] In this embodiment, after the address allocation device allocates an IPv6 address to a network device, it will not respond to a request message subsequently sent by the network device for requesting an IPv4 address, thereby reducing the occupation of IPv4 addresses.

[0139] In some implementations, when the address allocation device allocates an IPv6 address to a network device according to a second request message and the IPv6 address allocation fails, if the address allocation device has not yet allocated an IPv4 address, the address allocation device may respond to the first request message to allocate an IPv4 address to the network device.

[0140] It should be noted that when performing IPv6 address negotiation, when applied to a bridge-type gateway scenario, the interface address is allocated to the user host. In this case, the network device is a user device, such as a personal computer, and the address allocation device allocates an IPv6 address to the user device. When applied to a routing gateway scenario, the IPv6 WAN interface address and IPv6 LAN interface prefix are allocated to the home network. In this case, the network device is a home gateway, and the address allocation device allocates an IPv6 address to the home gateway.

[0141] Method Example 5

[0142] See also Figure 6 , which is a flow chart of an IP address allocation method provided in an embodiment of the present application, and Figure 2-Figure 4 The same contents as in the embodiment can be found in Figure 2-Figure 4 The description of the embodiment is as follows: Figure 6 As shown, the method for the IPoE dual-stack access scenario may include:

[0143] S601: The address allocation device receives a request message sent by a network device.

[0144] In this embodiment, in an IPoE dual-stack user access scenario, the network device sends a request message to the address allocation device to obtain an IP address, so that the address allocation device allocates an IP address to the network device according to the request message.

[0145] In the IPoE dual-stack user access scenario, the network device can request the address allocation device to allocate an IPv4 address for it, and can also request the address allocation device to allocate an IPv6 address. In order to ensure that the IPv6 address is allocated to the network device first, the information of the priority allocation of the IPv6 address can be configured in the address allocation device. When the address allocation device receives the request message sent by the network device, it can determine the type of the request message and perform different operations according to different message types. Among them, the request message can be divided into a first request message and a second request message, the first request message is used to request an IPv4 address, that is, an IPv4 request message, and the second request message is used to request an IPv6 address, that is, an IPv6 request message. Specifically, the type of the requested IP address can be carried in the request message, and the address allocation device determines the type of the request message by parsing the request message. When the type of the request message is the second request message, S602 is executed; when the type of the request message is IPv4, S605 is executed.

[0146] S602: When the request message is an IPv6 request message, the address allocation device allocates an IPv6 address to the network device according to the request message.

[0147] In this embodiment, when the request message received by the address allocation device is an IPv6 request message, it indicates that the network device requests an IPv6 address, and the address allocation device allocates an IPv6 address to the network device according to the request message.

[0148] It should be noted that after receiving the request message, the address allocation device can determine whether to authenticate the network device based on the device identification carried in the request message. If the authentication has been performed and the authentication is successful, the address allocation device will allocate an IPv6 address based on the request message. If the address allocation device has not authenticated the network device, it will authenticate the network device. When the authentication is successful, it will allocate an IPv6 address to the network device. The authentication process of the address allocation device on the network device can be found in Figure 1b-1c Specifically, after the address allocation device authenticates the network device, the corresponding relationship between the network device identifier and the authentication pass can be stored, so that when the first request message sent by the network device is subsequently received, it can be determined based on the device identifier in the request message that the authentication has been performed, and no further authentication is required.

[0149] S603: The address allocation device determines whether an IPv4 address has been allocated to the network device. If an IPv4 address has been allocated, execute S604; otherwise, execute S607.

[0150] After the address allocation device receives the request message for the IPv6 address and allocates the IPv6 address to the network device, in order to avoid allocating the IPv4 address when allocating the IPv6 address, resulting in the problem of wasting IPv4 address resources, the address allocation device can determine whether the IPv4 address has been allocated to the network device. If the IPv4 address has not been allocated, the address allocation device will no longer respond to the subsequent request message for the IPv4 address sent by the network device, and will not allocate the IPv4 address to the network device. When the address allocation device determines that the IPv4 address has been allocated to the network device, S604 is executed, that is, the IPv4 address is recycled.

[0151] Specifically, the address allocation device can store the correspondence between the device identification of the network device and the allocated IPv4 address. When receiving a request message sent by the network device, it can determine whether to allocate an IPv4 address for the network device based on the device identification in the request message and the above correspondence.

[0152] S604: The address allocation device reclaims the IPv4 address.

[0153] In this embodiment, when the address allocation device allocates both IPv6 addresses and IPv4 addresses to network devices, the address allocation device may reclaim the allocated IPv4 addresses.

[0154] Specifically, in the case of IPoE dual-stack access, since the time interval between the network device sending the first request message and the second request message is relatively large, the time at which the network device obtains the IPv4 address and the IPv6 address is different. In order to ensure that the allocated IP address is valid, the network device will send different detection messages to detect the IPv4 address and the IPv6 address respectively. For example, the network device detects the IPv4 address by sending an arp message at regular intervals, and detects the IPv6 address by sending an ND message at regular intervals. When the address allocation device receives the detection message sent by the network device, it will send a response message to the network device to determine that the allocated IP address is valid. Based on this, in order to enable the address allocation device to recycle the IPv4 address, when the address allocation device receives the detection message of the IPv4 address sent by the network device, it will not respond to the detection message, and the detection fails. When the detection fails, the network device IPv4 single stack is triggered to go offline, and the network device releases the allocated IPv4 address, thereby realizing the recovery of the IPv4 address.

[0155] In some implementations, when the network device obtains the IPv6 address allocated by the address allocation device, the network device may actively release the IPv4 address, so that the address allocation device reclaims the IPv4 address.

[0156] S605: When the request message is an IPv4 request message, the address allocation device determines whether to allocate an IPv6 address for the network device. If the IPv6 address is not allocated, execute S606; otherwise, execute S607.

[0157] In this embodiment, when the request message received by the address allocation device is an IPv4 request message, it indicates that the network device requests an IPv4 address. Before allocating an IPv4 address to the network device, in order to avoid allocating an IPv4 address when allocating an IPv6 address, resulting in a waste of IPv4 addresses, it can be determined whether the address allocation device allocates an IPv6 address to the network device. If the IPv6 address has not been allocated, S606 is executed; if the IPv6 address has been allocated, S607 is executed, and the IPv4 request message is no longer responded to.

[0158] For example, the address allocation device can store the correspondence between the device identification of the network device and the allocated IP address (IPv6 address). When receiving an IPv4 request message sent by the network device, it can determine whether an IPv6 address has been allocated to the network device based on the device identification in the request message and the above correspondence.

[0159] S606: The address allocation device allocates an IPv4 address to the network device according to the IPv4 request message.

[0160] In this embodiment, when the request message first received by the address allocation device is the first request message and the address allocation device has not yet allocated an IPv6 address, the address allocation device can allocate an IPv4 address to the network device based on the request message, so that the network device can use the IPv4 address to access the network and perform data transmission.

[0161] It should be noted that in the IPoE dual-stack access scenario, the time interval between the network device sending the first request message and the second request message to the address allocation device is relatively large. In order to ensure that the network device can be allocated an IP address in time to use the IP address for data transmission, in this case, no delay processing is required. Of course, if other factors are not considered, the response to the first request message may also be delayed. For specific implementation, please refer to the above embodiment.

[0162] After the address allocation device allocates an IPv4 address to the network device, it can continue to receive a second request message sent by the network device to allocate an IPv6 address to the network device. When the address allocation device allocates an IPv6 address to the network device, S604 can be executed to reclaim the allocated IPv4 address.

[0163] S607: The address allocation device does not respond to the IPv4 request message.

[0164] In this embodiment, after the address allocation device allocates an IPv6 address to a network device, in order to reduce the occupation of IPv4 addresses, it will no longer respond to the first request message subsequently sent by the network device and will not allocate an IPv4 address to the network device.

[0165] In some implementations, when the address allocation device allocates an IPv6 address to a network device based on a second request message and the IPv6 address allocation fails, if the address allocation device has not yet allocated an IPv4 address to the network device, the address allocation device will respond to the first request message to allocate an IPv4 address to the network device.

[0166] Based on the above method embodiment, the embodiment of the present application also provides an address allocation device, which will be described below in conjunction with the accompanying drawings.

[0167] Device Example 1

[0168] See also Figure 7 , which is a structural diagram of an IP address allocation device provided in an embodiment of the present application. The device 700 can be applied to an address allocation device to perform Figure 2 , Figure 6 or Figure 7 The functions of the address allocation device in the embodiment shown may include:

[0169] The receiving unit 701 is configured to receive a first request message sent by a network device, where the first request message is used to request an IPv4 address;

[0170] The processing unit 702 is configured to, when it is determined that an IPv6 address has been allocated to the network device, cause the address allocation device to not respond to the first request message.

[0171] In a possible implementation, the device further includes: an allocating unit and a determining unit;

[0172] The receiving unit is further configured to receive a second request message sent by the network device after receiving the first request message, wherein the second request message is used to request an IPv6 address;

[0173] The allocating unit is configured to allocate the IPv6 address to the network device according to the second request message;

[0174] The determining unit is used to determine that the IPv6 address has been allocated to the network device when the IPv6 address is allocated to the network device successfully.

[0175] In a possible implementation, the device further includes an allocating unit and a determining unit;

[0176] The receiving unit is further configured to receive a second request message sent by the network device before the address allocation device receives the first request message sent by the network device, wherein the second request message is used to request an IPv6 address;

[0177] The allocating unit is configured to allocate the IPv6 address to the network device according to the second request message;

[0178] The determining unit is used to determine that the IPv6 address has been allocated to the network device when the IPv6 address is allocated to the network device successfully.

[0179] It should be noted that the specific executable functions and implementations of the device 700 in this embodiment can be found in Figure 2 , Figure 5 and Figure 6 The corresponding description about the address allocation device in the illustrated embodiment will not be repeated here.

[0180] Device Example 2

[0181] See also Figure 8 , which is a structural diagram of another address allocation device provided in an embodiment of the present application. The device 800 can be applied to an address allocation device to perform Figure 3 , Figure 5 and Figure 6 The functions of the address allocation device in the embodiment shown include:

[0182] A receiving unit 801 is configured to receive, by an address allocation device, a first request message sent by a network device, where the first request message is used to request an IPv4 address;

[0183] The processing unit 802 is configured to delay responding to the first request message for a preset time when it is determined that no IPv6 address is allocated to the network device.

[0184] In a possible implementation, the processing unit 802 is specifically configured to allocate an IPv4 address to the network device according to the first request message if the second request message is not received within the preset time, and the second request message is used to request an IPv6 address.

[0185] In a possible implementation, the processing unit 802 is specifically used to receive a second request message within the preset time, and allocate an IPv6 address to the network device according to the second request message, where the second request message is used to request the IPv6 address; when the address allocation device fails to allocate an IPv6 address to the network device, the address allocation device allocates an IPv4 address to the network device according to the first request message.

[0186] In a possible implementation manner, the network device is a device that carries a point-to-point protocol over Ethernet.

[0187] When it is necessary to explain, the specific executable functions and implementations of the device 800 can be found in Figure 3 , Figure 5 and Figure 6 The corresponding description about the address allocation device in the illustrated embodiment will not be repeated here.

[0188] Device Example 3

[0189] See also Fig. 9 , which is a structural diagram of another address allocation device provided in an embodiment of the present application, and the device 900 can be applied to Figure 4-Figure 6 The functions of the address allocation device in the embodiment shown include:

[0190] A determining unit 901 is configured to determine whether to allocate an IPv4 address to a network device when the address allocation device has allocated an IPv6 address to the network device;

[0191] The reclaiming unit 902 is configured to, when it is determined that an IPv4 address has been allocated to the network device, have the address allocation device reclaim the IPv4 address.

[0192] In a possible implementation, the recovery unit 902 is specifically configured to not respond to the IPv4 detection message sent by the network device.

[0193] In a possible implementation, the recovery unit 902 is specifically configured to recover the IPv4 address according to a third request message sent by the network device, where the third request message is used to request the address allocation device to recover the IPv4 address.

[0194] In a possible implementation, the network device is an Ethernet device carrying Internet Protocol.

[0195] When it is necessary to explain, the specific executable functions and implementations of the device 900 can be found in Figure 4 , Figure 5 and Figure 6 The corresponding description about the address allocation device in the illustrated embodiment will not be repeated here.

[0196] Device Example 4

[0197] See also Fig.10 , which is a device structure diagram provided in an embodiment of the present application, the device may be Figure 2-Figure 6 The address allocation device or network device in the embodiment shown may also be Figure 7-Figure 9The device implementation of the address allocation apparatus in the illustrated embodiment.

[0198] See also Fig.10 As shown, the device 1000 includes: a processor 1010, a communication interface 1020 and a memory 1030. The number of the processor 1010 in the device 1000 can be one or more. Fig.10 In the embodiment of the present application, the processor 1010, the communication interface 1020 and the memory 1030 may be connected via a bus system or other means, wherein: Fig.10 The connection via bus system 1040 is taken as an example.

[0199] The processor 1010 may be a CPU, an NP, or a combination of a CPU and an NP. The processor 1010 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0200] The communication interface 1020 is used to receive and send messages. Specifically, the communication interface 1020 may include a receiving interface and a sending interface. The receiving interface may be used to receive messages, and the sending interface may be used to send messages. The number of the communication interface 1020 may be one or more.

[0201] The memory 1030 may include a volatile memory (English: volatile memory), such as a random-access memory (RAM); the memory 1030 may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (HDD) or a solid-state drive (SSD); the memory 1030 may also include a combination of the above-mentioned types of memory.

[0202] Optionally, the memory 1030 stores an operating system and a program, an executable module or a data structure, or a subset thereof, or an extended set thereof, wherein the program may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor 1010 may read the program in the memory 1030 so that the device 1000 implements the IP address allocation method provided in the embodiment of the present application.

[0203] The memory 1030 may be a storage device in the communication device 1000 , or may be a storage device independent of the communication device 1000 .

[0204] The bus system 1040 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus system 1040 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0205] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0206] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0207] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical business division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0208] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0209] In addition, each business unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software business units.

[0210] If the integrated unit is implemented in the form of a software business unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0211] Those skilled in the art will appreciate that in one or more of the above examples, the services described in the present invention may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, the services may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media may be any available media that can be accessed by a general-purpose or special-purpose computer.

[0212] The above specific implementation modes further describe the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation modes of the present invention.

[0213] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for allocating an IP address, characterized in that: The method comprises: The address allocation device receives a first request message sent by the network device, where the first request message is used to request an IPv4 address; When the address allocation device determines that an IPv6 address has been allocated to the network device, the address allocation device does not respond to the first request message, so as to achieve the purpose of not allocating an IPv4 address to the network device.

2. The method according to claim 1, characterized in that After the address allocation device receives the first request message sent by the network device, the method further includes: The address allocation device receives a second request message sent by the network device, where the second request message is used to request an IPv6 address; The address allocation device allocates the IPv6 address to the network device according to the second request message; The address allocation device determines that an IPv6 address has been allocated to the network device, including: When the address allocating device successfully allocates the IPv6 address to the network device, the address allocating device determines that the IPv6 address has been allocated to the network device.

3. The method according to claim 1, characterized in that Before the address allocation device receives the first request message sent by the network device, the method further includes: The address allocation device receives a second request message sent by the network device, where the second request message is used to request an IPv6 address; The address allocation device allocates the IPv6 address to the network device according to the second request message; The address allocation device determines that an IPv6 address has been allocated to the network device, including: When the address allocating device successfully allocates the IPv6 address to the network device, the address allocating device determines that the IPv6 address has been allocated to the network device.

4. A method for allocating an IP address, characterized in that: The method further comprises: The address allocation device receives a first request message sent by the network device, where the first request message is used to request an IPv4 address; When the address allocation device determines that no IPv6 address is allocated to the network device, the address allocation device delays a preset time to respond to the first request message.

5. The method according to claim 4, characterized in that The address allocation device delays a preset time to respond to the first request message, including: When the address allocation device does not receive the second request message within the preset time, the address allocation device allocates an IPv4 address to the network device according to the first request message, and the second request message is used to request an IPv6 address.

6. The method according to claim 4, characterized in that The address allocation device delays a preset time to respond to the first request message, including: The address allocation device receives a second request message within the preset time, and the address allocation device allocates an IPv6 address to the network device according to the second request message, where the second request message is used to request the IPv6 address; When the address allocation device fails to allocate an IPv6 address to the network device, the address allocation device allocates an IPv4 address to the network device according to the first request message.

7. The method according to any one of claims 4 to 6, characterized in that: The network device is a dual-stack device that carries the point-to-point protocol over Ethernet.

8. A method for allocating an IP address, characterized in that: The method comprises: When the address allocation device has allocated an IPv6 address to the network device, the address allocation device determines whether an IPv4 address has been allocated to the network device; When the address allocation device determines that the IPv4 address has been allocated to the network device, the address allocation device reclaims the IPv4 address.

9. The method according to claim 8, characterized in that The address allocation device reclaiming the IPv4 address includes: The address allocation device does not respond to the IPv4 detection message sent by the network device.

10. The method according to claim 8, characterized in that The address allocation device reclaiming the IPv4 address includes: The address allocation device reclaims the IPv4 address according to a third request message sent by the network device, where the third request message is used to request the address allocation device to reclaim the IPv4 address.

11. The method according to claim 9, characterized in that The network device is a dual-stack device that carries the Internet Protocol over Ethernet.

12. An IP address allocation device, characterized in that: The device comprises: A receiving unit, configured to receive a first request message sent by a network device, wherein the first request message is used to request an IPv4 address; The processing unit is used for not responding to the first request message when it is determined that the IPv6 address has been allocated to the network device, so as to achieve the purpose of not allocating an IPv4 address to the network device.

13. The device according to claim 12, characterized in that The device further includes: an allocating unit and a determining unit; the receiving unit is further configured to receive a second request message sent by the network device after receiving the first request message, wherein the second request message is used to request an IPv6 address; The allocating unit is configured to allocate the IPv6 address to the network device according to the second request message; The determining unit is used to determine that the IPv6 address has been allocated to the network device when the IPv6 address is allocated to the network device successfully.

14. The device according to claim 12, further comprising an allocating unit and a determining unit; The receiving unit is further configured to receive a second request message sent by the network device before receiving the first request message sent by the network device, wherein the second request message is used to request an IPv6 address; The allocating unit is configured to allocate the IPv6 address to the network device according to the second request message; The determining unit is used to determine that the IPv6 address has been allocated to the network device when the IPv6 address is allocated to the network device successfully.

15. An IP address allocation device, characterized in that: The device also includes: A receiving unit, configured to receive a first request message sent by a network device, wherein the first request message is used to request an IPv4 address; The processing unit is used to delay a preset time to respond to the first request message when it is determined that no IPv6 address is allocated to the network device.

16. The device according to claim 15, characterized in that The processing unit is specifically configured to allocate an IPv4 address to the network device according to the first request message if the second request message is not received within the preset time, and the second request message is used to request an IPv6 address.

17. The device according to claim 15, characterized in that The processing unit is specifically used to receive a second request message within the preset time, allocate an IPv6 address to the network device according to the second request message, and the second request message is used to request the IPv6 address; when the allocation of the IPv6 address to the network device fails, allocate an IPv4 address to the network device according to the first request message.

18. The device according to any one of claims 15 to 17, characterized in that: The network device is a device that carries the point-to-point protocol over Ethernet.

19. An IP address allocation device, characterized in that: The device comprises: a determining unit, configured to determine whether an IPv4 address has been allocated to the network device when the address allocation device has allocated an IPv6 address to the network device; The recovery unit is used to recover the IPv4 address when it is determined that the IPv4 address has been allocated to the network device.

20. The device according to claim 19, characterized in that The recovery unit is specifically used to not respond to the IPv4 detection message sent by the network device.

21. The device according to claim 19, characterized in that The recovery unit is specifically used to recover the IPv4 address according to a third request message sent by the network device, and the third request message is used to request the address allocation device to recover the IPv4 address.

22. The device according to any one of claims 19 to 21, characterized in that The network device is an Ethernet device that carries the Internet Protocol.

23. A device, comprising: Processor and memory; The memory is used to store instructions; The processor is used to execute the instructions in the memory so that the device executes the method according to any one of claims 1 to 11.

24. A computer-readable storage medium comprising instructions, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Apparatus, method, system and software product supporting transition between network communication protocols

    CN1679297A