WO2012139283A1 - Method and appratus for address allocation - Google Patents

Method and appratus for address allocation Download PDF

Info

Publication number
WO2012139283A1
WO2012139283A1 PCT/CN2011/072686 CN2011072686W WO2012139283A1 WO 2012139283 A1 WO2012139283 A1 WO 2012139283A1 CN 2011072686 W CN2011072686 W CN 2011072686W WO 2012139283 A1 WO2012139283 A1 WO 2012139283A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
node
ipv6
reserved
ipv6 address
Prior art date
Application number
PCT/CN2011/072686
Other languages
French (fr)
Chinese (zh)
Inventor
蒋胜
傅瑜
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201180000242.5A priority Critical patent/CN102835094B/en
Priority to PCT/CN2011/072686 priority patent/WO2012139283A1/en
Publication of WO2012139283A1 publication Critical patent/WO2012139283A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/659Internet protocol version 6 [IPv6] addresses

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to an address allocation method and apparatus. Background technique
  • DHCP Dynamic Host Configuration Protocol
  • DHCP includes DHCPv4 that supports IPv4 and DHCPv6 (Active Host Configure Protocol for IPv6) that supports IPv6.
  • DHCPv6 is a version of DHCP that supports IPv6 (Internet Protocol version 6, Internet Protocol version 6).
  • the basic protocol specification is defined by RFC3315 (RFC: Request For Comments) of the IETF (Internet Engineering Task Force, Internet Engineering Task Force: The Most Authoritative Technology Standardization Organization of the Internet), and the IPv6 Stateless Address Autoconfiguration Protocol is completed.
  • DHCPv6 belongs to a stateful address configuration protocol.
  • the DHCPv6 server allocates a complete IPv6 address to the client, and the final server can record the assigned IPv6 address and the client binding relationship. In order to enhance the manageability of the network.
  • DHCPv6 The typical networking of DHCPv6 generally includes the following two roles:
  • DHCPv6 client A device that dynamically obtains IPv6 addresses, IPv6 prefixes, or other network configuration parameters.
  • DHCPv6 server A device responsible for assigning IPv6 addresses, IPv6 prefixes, and other network configuration parameters to DHCPv6 clients.
  • the DHCPv6 server can not only assign IPv6 addresses to DHCPv6 clients, but also assign IPv6 prefixes to them.
  • the process of assigning addresses to clients by the DHCPv6 server is divided into two categories: the address fast assignment process of interacting two messages and the address assignment process of interacting four messages.
  • the DHCPv6 client carries the Rapid Commit option in the Solicit message sent, indicating that the client wants the server to quickly assign an address/prefix and network configuration parameters to it;
  • the DHCPv6 client sends a Solicit packet to the DHCPv6 server, requesting the DHCPv6 server to assign an IPv6 address/prefix and network configuration parameters.
  • the DHCPv6 server replies to the Advertise message to notify the client of the address that can be assigned to it. /prefix and network configuration parameters.
  • the DHCPv6 client receives notification messages from multiple servers, it selects one of the servers according to the order in which the messages are received, the server priority, etc., and sends a Request message to the server.
  • the server confirms that it is assigned an address/prefix and network configuration parameters.
  • the DHCPv6 server returns a Reply message, confirming that the address/prefix and network configuration parameters are assigned to the client.
  • DHCP can assign addresses and other configuration information through the DHCPV6 server. Addresses and other configuration information are implemented by inclusion in the options.
  • the client requests the DHCPv6 server to allocate an address, it can include the IA_TA (Identity Association - Temporary Address) option in the text option of the Request text to tell the server to request the temporary address to be assigned, and the ⁇ _ ⁇ option can be used at the same time. Contains the address it needs. After the server receives the client's request, it assigns the client the temporary address it needs.
  • RFC3315 also states that DHCP can extend the use of DHCP by defining new options.
  • An embodiment of the present invention provides an address allocation method and apparatus, which adds an IPv6 address reservation function to a DHCP protocol, that is, a DHCPV6 server reserves an IPv6 address for a node in an address pool.
  • An address allocation method includes:
  • the IPv6 address corresponding to the IPv6 address information When the IPv6 address corresponding to the IPv6 address information exists, the IPv6 address corresponding to the IPv6 address information is marked as a reserved address, and the correspondence between the node and the reserved address is recorded;
  • the address that is required to be allocated in the received address allocation option is the reserved address, it is determined whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
  • the reserved address is assigned to the node that requests the address.
  • An address allocation device includes:
  • a first receiving unit configured to receive an address reservation option sent by the node, where the address reservation option includes IPv6 address information
  • a first processing unit configured to mark, according to the IPv6 address corresponding to the IPv6 address information, an IPv6 address corresponding to the IPv6 address information as a reserved address, and record between the node and the reserved address Correspondence relationship
  • a first determining unit configured to determine, when the address to be allocated in the received address allocation option is the reserved address, whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
  • an allocating unit configured to allocate the reserved address to the node that requests the address when the node that needs to allocate the address is the same as the node corresponding to the reserved address.
  • the solution defines a new address reservation option, so that the node can send an address reservation option in the sending request, after the server receives the request to carry the option,
  • the IPv6 address is reserved for the node from the address pool of the server.
  • the server allocates the reserved IPv6 address to the node. Therefore, as long as the embodiment of the present invention is adopted
  • the solution provides an IPv6 address reservation function for the DHCP protocol, which enables the node to reserve the required IPv6 address by applying in advance, so as to prevent a situation where a large number of applications cause a shortage of addresses and the node cannot obtain the required IPv6 address. It is convenient for users to make arrangements in advance.
  • FIG. 1 is a schematic diagram of a fast address allocation process of two messages exchanged between a DHCPv6 server and a client in the prior art
  • FIG. 2 is a schematic diagram of an address allocation process of four messages exchanged between a DHCPv6 server and a client in the prior art
  • FIG. 3 is a flowchart of an address allocation method according to Embodiment 1 of the present invention.
  • FIG. 4 is a schematic structural diagram of an address allocation apparatus according to Embodiment 1 of the present invention.
  • FIG. 5 is a schematic diagram of a format of an address reservation option according to Embodiment 2 of the present invention.
  • FIG. 6 is a flowchart of a method for applying for a reserved address based on four messages of a DHCPv6 server and a client interaction according to Embodiment 2 of the present invention
  • FIG. 7 is a flowchart of a method for requesting a reserved address based on two messages exchanged between a DHCPv6 server and a client according to Embodiment 2 of the present invention
  • FIG. 8 is a flow chart of a method for obtaining a reserved address after applying for a reserved address according to Embodiment 2 of the present invention.
  • FIG. 9 is a schematic structural diagram of an address allocation apparatus according to Embodiment 2 of the present invention.
  • this embodiment provides an address allocation method, including: Step 301: Receive an address reservation option sent by a node, where the address reservation option includes IPv6 address information;
  • Step 302 When an IPv6 address corresponding to the IPv6 address information exists, mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record a correspondence between the node and the reserved address.
  • Step 303 When the address that is required to be allocated in the received address allocation option is the reserved address, determine whether the node corresponding to the reserved address is the node corresponding to the reserved address. Same
  • Step 304 When the node that requires the address allocation is the same as the node corresponding to the reserved address, allocate the reserved address to the node that requests the address.
  • the embodiment provides an address allocation apparatus, including: a first receiving unit 401, configured to receive an address reservation option sent by a node, where the address reservation option includes IPv6 address information;
  • the first processing unit 402 is configured to mark, according to the IPv6 address corresponding to the IPv6 address information, an IPv6 address corresponding to the IPv6 address information as a reserved address, and record between the node and the reserved address. Correspondence relationship;
  • the first determining unit 403 is configured to determine, when the address requested to be allocated in the received address allocation option is the reserved address, whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
  • the allocating unit 404 is configured to allocate the reserved address to the node that requests the address when the node that needs to allocate the address is the same as the node corresponding to the reserved address.
  • the solution defines a new address reservation option, so that the node can send an address reservation option in the sending request, after the server receives the request carrying the option.
  • the IPv6 address is reserved for the node from the address pool of the server.
  • the server allocates the reserved IPv6 address to the node. Therefore, as long as the solution provided by the embodiment of the present invention is adopted, the node can reserve the required IPv6 address by applying in advance, thereby preventing the situation that a large number of applications cause a shortage of addresses and the node cannot obtain the required I Pv6 address in the future, which is convenient.
  • the user makes arrangements in advance.
  • DHCPv6 supporting IPv6 is taken as an example.
  • This embodiment provides an address allocation method, and a new DHCP option needs to be added. As shown in Figure 5, this option is used to pass information to the IA_RA ( Identity As sociat - Reserved Address).
  • IA_RA Identity As sociat - Reserved Address
  • the newly defined option is the address reservation option 0PTI0N_IA_RA, which contains:
  • Option type opt ion-code : opt ion-code is used to indicate that this option is an address reservation option. The definition of the value needs to be assigned by the standard organization after the official standard is released.
  • IAID Identity Set Identifier
  • the IAID is used to identify the reserved address IA_RA, the IAID is the unique identifier of IA_RA, the IAID must be different from the other IA_RA of the client;
  • Other options IA_RA-options: Other options are associated with IA_RA
  • the options, other options include reserved address information, that is, the reserved address I A_RA belongs to the sub-option under other options.
  • the address allocation method in the embodiment of the present invention includes two schemes in which two messages are exchanged between the DHCPv6 server and the client, and the four messages are based on interaction.
  • the address allocation method shown in FIG. 6 is based on the interaction of four messages. Apply for a reserved address, including:
  • Step 602 The DHCPv6 server that is available in the network returns an Advertise message to the client, where the Advertise text is used to notify the node that the node can be assigned an IPv6 address, and the client returns the Adver ti according to the Advertise message. Select the DHCPV6 server that meets the requirements in the server of the se message.
  • Step 603 The selected server receives the Request message sent by the client, where the Request message includes an address reservation option, and the address reservation option includes the IPv6 address information to be reserved.
  • This address reservation option is used to tell the server that the client needs to request to reserve an IPv6 address or an IPv6 address prefix.
  • IA_RA-options you need to specify the reserved IPv6 address information. You can specify the reserved IPv6 address or IPv6 address prefix.
  • the prefix length is greater than 64 bits and less than 128 bits. address).
  • Step 604 Determine whether there is a corresponding IPv6 address in the IPv6 address information. If an IPv6 address corresponding to the IPv6 address information exists, go to step 605. If the IPv6 address corresponding to the IPv6 address information does not exist, perform the step. 606.
  • Step 605 Mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record the correspondence between the client and the reserved address.
  • the DHCPV6 server may send a Reply packet to the client, and carry a reservation success message in the Reply packet.
  • the DHCPV6 server returns a reservation failure message to the client.
  • the DHCPV6 server may send a Reply packet to the client, and carry a reservation failure message in the Reply packet.
  • the embodiment of the present invention can also apply for a reserved address by using an address allocation scheme based on the interaction of two messages, as shown in FIG. 7.
  • the address allocation method specifically includes:
  • Step 701 The DHCPV6 server receives the So ic i t message sent by the client, and the So ic i t message carries the Rapid Commi t option and the address reservation option OPTION_IA_RA.
  • the Rapi d Commi t option and address reservation options are used to identify that the client wants the server to quickly reserve an IPv6 address or IPv6 prefix for it.
  • the other option IA_RA-opt ions in the address reservation option contains the address information to be reserved. You can specify the reserved IPv6 address or IPv6 address prefix (the prefix length is greater than 64 bits and less than 128 bits, which is used to reserve an IPv6 address. ).
  • Step 702 Determine whether the DHCPV6 server supports fast allocation and whether there is an IPv6 address corresponding to the IPv6 address information. If the DHCPV6 server supports fast allocation and the IPv6 address corresponding to the IPv6 address information exists, step 703 is performed; If the IPv6 address corresponding to the IPv6 address information exists or does not support fast allocation, step 704 is performed.
  • Step 703 Mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record the correspondence between the client and the reserved address.
  • the DHCPV6 server may send a reply message to the client, and carry a reservation success message in the reply message.
  • Step 704 The DHCPV6 server sends a Reply message to the client, and carries a reservation failure message in the Reply message.
  • the corresponding IPv6 address in the IPv6 address information includes an IPv6 address or an IPv6 address prefix, which can be represented in multiple manners, and an IPv6 address can be represented by setting a specific rule.
  • the IPv6 address information includes an IPv6 address
  • the IPv6 address corresponding to the IPv6 address information is the one IPv6 address; or the IPv6 address information includes an IPv6 address prefix.
  • the IPv6 address corresponding to the IPv6 address information is all IPv6 addresses represented by the IPv6 address prefix; or the IPv6 address information includes two IPv6 addresses, and the IPv6 address information
  • the IPv6 address corresponding to the information is the two IPv6 addresses and all IPv6 addresses between the two IPv6 addresses. In this way, the server can identify the addresses that need to be reserved and allocate according to such rules.
  • the address reservation option further includes an IAID.
  • the IAID is a unique identifier for IA_RA, and the IAID must be different from the other IA_RAs of the client.
  • the correspondence between the client and the reserved address needs to be recorded, and the client and the The correspondence between the reserved addresses is: recording the correspondence between the media access control address (MAC) address of the client and the reserved address, or recording the MAC address and the IAID combination.
  • the correspondence between the client and the reserved address is: recording the correspondence between the media access control address (MAC) address of the client and the reserved address, or recording the MAC address and the IAID combination.
  • the reserved period (li fet ime ) of the reserved address or the address segment may be included in other options ( IA_RA-opt ions ) in the address reservation option. That is, within the reserved period, the DHCPv6 server reserves the IPv6 address or IPv6 address prefix for the client in the address pool and does not assign it to other clients. During the reservation period, it is determined whether the client that requires the address allocation is the same as the client corresponding to the reserved address; and after the reservation period expires, the DHCPv6 server releases the reserved IPv6 address or IPv6 address segment.
  • IPv6 address corresponding to the IPv6 address information is removed as a mark of the reserved address, and the corresponding relationship between the client and the reserved address is deleted. After the release, the IPv6 address or IPv6 address segment can be allocated to other clients to avoid wasting resources.
  • Step 801 Send a Reques t message to the server, where the Reques t message includes an address reservation option, and the address reservation option includes an IPv6 address information.
  • Step 802 When the server requests the allocated IPv6 address to be the reserved address, the server determines whether the client that needs to allocate the IPv6 address is the same as the client corresponding to the reserved address. When the client that requires the address allocation is the same as the client corresponding to the reserved address, step 803 is performed; When the clients corresponding to the reserved addresses are different, step 804 is performed.
  • Step 803 Allocate the reserved address to the node that requires an IPv6 address to be allocated.
  • Step 804 Reject the reserved address for the client that requires the IPv6 address to be allocated.
  • the DHCPv6 server can send a Rep ly message to the client, and carry the allocation failure information in the Reply message.
  • Step 805 When the reservation period has not expired, the DHCPV6 server receives the Renew (update) packet sent by the client, where the Renew packet includes an address reservation option 0PTI0N_IA_RA, where the address reservation option is The IPv6 address information is included; the IPv6 address information in the address reservation option carried in the Renew address is updated, and the reservation period corresponding to the IPv6 address information is updated, so that the DHCPV6 server continues to reserve the IPv6 for the client. Address or IPv6 address segment.
  • Step 806 After the reservation period expires, the DHCPV6 server releases the reserved IPv6 address or the IPv6 address segment.
  • the IPv6 address corresponding to the IPv6 address information is removed as a mark of the reserved address, and the corresponding relationship between the client and the reserved address is deleted. After the release, the IPv6 address or IPv6 address segment can be allocated to other clients to avoid wasting resources.
  • This embodiment provides an address allocation apparatus.
  • the address allocation includes two schemes based on the interaction of two messages and four messages, as shown in FIG. 9, the address allocation based on the interaction of four messages.
  • Device including:
  • the notification unit 902 is configured to return an Adveriti message to the client, where the Advert is used to notify the client that an IPv6 address can be assigned to the client.
  • the client can select a DHCPV6 server that meets the requirements from the DHCPV6 server that has returned the Adverit message according to the Adver t se message.
  • the first receiving unit 903 is configured to receive, by the client, a Reques t packet, where the Reques t packet includes an address reservation option, and the address reservation option includes the IPv6 address information that needs to be reserved.
  • This address reservation option is used to tell the server client to apply for an IPv6 address or IPv6 address prefix.
  • IA_RA-opt i ons you need to specify the IPv6 address information to be reserved.
  • the prefix length is greater than 64 bits and less than 128 bits. Leave a piece of IPv6 Address).
  • the second determining unit 904 is configured to determine whether an IPv6 address corresponding to the IPv6 address information exists.
  • the first processing unit 905 is configured to mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record a correspondence between the client and the reserved address.
  • the first replying unit 906 is configured to send a reply message to the client to notify the reservation that the reservation is successful.
  • the method is further configured to send a reply message to the client, and notify the reservation that the reservation fails.
  • the first receiving unit 903 is further configured to receive the So lic message sent by the client, and request the message So. l
  • the ic it packet carries the Rapi d Commi t option and the address reservation option 0PTI0N_ IA_RA.
  • the Rapi d Commi t option and address reservation options are used to identify that the client wants the server to quickly reserve an IPv6 address or IPv6 prefix for it.
  • the address information to be reserved may be specified, and the reserved IPv6 address or IPv6 address prefix may be specified (the prefix length is greater than 64 bits and less than 128 bits, and used to reserve a segment. IPv6 address).
  • the second determining unit 904 is further configured to determine whether the DHCPv6 server supports fast allocation and whether a corresponding address exists.
  • the first processing unit 905 is further configured to mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record a correspondence between the client and the reserved address.
  • the first replying unit 906 is further configured to send a Reply message to the client, and carry a reservation success message in the Reply message; and also send a Reply message to the client, and carry the reservation in the Reply message. Failure message.
  • the client obtains the reserved address, and the address reservation device further includes:
  • the third receiving unit 907 is configured to receive the Reques t message sent by the client to the DHCPV6 server, where the Reques t message includes an address allocation option, and the address allocation option includes the IPv6 address information.
  • the first determining unit 908 is configured to determine, when the IPv6 address that is required to be allocated in the received address allocation option is the reserved address, whether the client that requires the address allocation is the same as the client corresponding to the reserved address.
  • the allocating unit 909 is configured to allocate the reserved address to the node that requires the IPv6 address to be allocated; and is further configured to refuse to allocate the reserved address to the client that requires the IPv6 address to be allocated.
  • the second reply unit 910 is configured to send a reply message to the client, and reply to the assignment success or rejection information.
  • the update unit 911 is configured to: when the reservation period has not expired, receive a Renew message sent by the client, where the Renew message includes an address reservation option (OPTION_IA_RA), and the address reservation option
  • the IPv6 address information is included in the address reservation option of the Renew message, and the reservation period corresponding to the IPv6 address information is updated, so that the DHCPV6 server continues to reserve the address for the client. IPv6 address or IPv6 address segment.
  • the second processing unit 912 is configured to: after the expiration of the reservation period, the DHCPV6 server releases the reserved IPv6 address or the IPv6 address segment.
  • the IPv6 address corresponding to the IPv6 address information is removed as a mark of the reserved address, and the corresponding relationship between the client and the reserved address is deleted. After the release, the IPv6 address or IPv6 address segment can be allocated to other clients to avoid wasting resources.
  • the corresponding IPv6 address in the IPv6 address information includes an IPv6 address or an IPv6 address prefix, which can be represented in multiple manners, and the specific rule can be used to indicate the address.
  • the IPv6 address information includes an IPv6 address
  • the IPv6 address corresponding to the IPv6 address information is the one IPv6 address; or the IPv6 address information includes an IPv6 address prefix.
  • the IPv6 address corresponding to the IPv6 address information is the IPv6 address represented by the IPv6 address prefix; or the IPv6 address information includes two IPv6 addresses, and the IPv6 address corresponding to the IPv6 address information is the two An IPv6 address, and all IPv6 addresses between the two IPv6 addresses.
  • the DHCPv6 server can identify and allocate IPv6 addresses that need to be reserved according to such rules.
  • the address reservation option further includes an IAID.
  • the IAID is a unique identifier for IA_RA, and the IAID must be different from the other reserved addresses (IA-RA) of the client.
  • the correspondence between the client and the reserved address needs to be recorded.
  • Recording the correspondence between the client and the reserved address is: recording a correspondence between the MAC address of the client and the reserved address or recording the location by a combination of a MAC address and an IAID Corresponding relationship between the client and the reserved address.
  • the client on the same link is used as an example.
  • the node may be applied to a node, and the node includes a DHCPv6 client or a DHCPv6 proxy server.
  • the DHCPv6 proxy server is a DHCPv6 client and a DHCPv6 server.
  • the DHCPv6 proxy server can be used to request an IPv6 address from the DHCPv6 server and be assigned to the DHCPv6 client. Therefore, this embodiment is of course applicable to the DHCPv6 proxy server.
  • the DHCPv6 proxy server requires a large number of IPv6 addresses, so it will apply for a reserved address segment. , I won't go into details here.
  • the solution defines a new address reservation option, so that the node can send an address reservation option in the sending request, after the server receives the request carrying the option.
  • the I Pv6 address is reserved for the node from the address pool of the server.
  • the server allocates the reserved IP address to the node. Therefore, as long as the solution provided by the embodiment of the present invention is adopted, the node can reserve the required IPv6 address by applying in advance, thereby preventing the situation that a large number of applications cause a shortage of addresses and the node cannot obtain the I Pv6 address in the future, which is convenient.
  • the user makes arrangements in advance.
  • the scheme of the address allocation apparatus in this embodiment may adopt the scheme of the address allocation method in this embodiment, and details are not described herein again.
  • the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. .
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer.
  • a hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

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

Abstract

A method and an apparatus for address allocation are disclosed in the present invention. The present invention relates to the technical field of communications and solves the problem in the prior art that, in the current Dynamic Host Configure Protocol (DHCP), users can not reserve one Internet Protocol Version 6 (IPV6) address or a section of IPV6 addresses in a Dynamic Host Configure Protocol Version for IPV6 (DHCPV6) server address pool for a future specific usage. The solution provided in the embodiment of the present invention includes the following steps: a node is enabled to carry an address reservation option in its sending request by defining a new address reservation option; an IPV6 address is reserved for the node from the server address pool after the server has received the request carrying the option; then, the server allocates the reserved IPV6 address to the node when the node sends a request for the allocation of the reserved address. The embodiment of the present invention is applicable to a DHCPv6 protocol-based communication system.

Description

地址分配方法及装置 技术领域  Address allocation method and device
本发明涉及通信技术领域, 尤其涉及一种地址分配方法及装置。 背景技术  The present invention relates to the field of communications technologies, and in particular, to an address allocation method and apparatus. Background technique
DHCP ( Dynamic Host Configure Protocol, 动态主机配置协议) 是 DHCPV6服务器自动将 IP地址分配给网络中的节点的协议。 DHCP根 据支持协议的不同, 包括支持 IPv4协议的 DHCPv4和支持 IPv6协议的 DHCPv6 ( Dynamic Host Configure Protocol for IPv6, 支持 IPv6的 动态主机配置协议) 。 DHCPv6是 DHCP支持 IPv6 ( Internet Protocol version 6,互联网协议第六版)的版本。协议基本规范由 IETF( Internet Engineering Task Force, 互联网工程任务组: 全球互联网最具权威的 技术标准化组织) 的 RFC3315 ( RFC: Request For Comments, 请求评 议)定义,完成了 IPv6无状态地址自动配置协议所完成的功能, DHCPv6 属于一种有状态地址配置协议, 在有状态地址配置过程中, DHCPv6 服 务器分配一个完整的 IPv6地址给客户端, 而且最终服务器能把分配的 IPv6地址和客户端的绑定关系记录在案, 从而增强了网络的可管理性。  DHCP (Dynamic Host Configuration Protocol) is a protocol in which a DHCPV6 server automatically assigns an IP address to a node in the network. According to different support protocols, DHCP includes DHCPv4 that supports IPv4 and DHCPv6 (Active Host Configure Protocol for IPv6) that supports IPv6. DHCPv6 is a version of DHCP that supports IPv6 (Internet Protocol version 6, Internet Protocol version 6). The basic protocol specification is defined by RFC3315 (RFC: Request For Comments) of the IETF (Internet Engineering Task Force, Internet Engineering Task Force: The Most Authoritative Technology Standardization Organization of the Internet), and the IPv6 Stateless Address Autoconfiguration Protocol is completed. The completed function, DHCPv6 belongs to a stateful address configuration protocol. In the stateful address configuration process, the DHCPv6 server allocates a complete IPv6 address to the client, and the final server can record the assigned IPv6 address and the client binding relationship. In order to enhance the manageability of the network.
DHCPv6 典型组网中一般包括以下二种角色:  The typical networking of DHCPv6 generally includes the following two roles:
DHCPv6客户端: 动态获取 IPv6 地址、 IPv6 前缀或其他网络配置 参数的设备。  DHCPv6 client: A device that dynamically obtains IPv6 addresses, IPv6 prefixes, or other network configuration parameters.
DHCPv6 服务器: 负责为 DHCPv6 客户端分配 IPv6 地址、 IPv6 前 缀和其他网络配置参数的设备。 DHCPv6 服务器不仅可以为 DHCPv6 客 户端分配 IPv6 地址, 还可以为其分配 IPv6 前缀。  DHCPv6 server: A device responsible for assigning IPv6 addresses, IPv6 prefixes, and other network configuration parameters to DHCPv6 clients. The DHCPv6 server can not only assign IPv6 addresses to DHCPv6 clients, but also assign IPv6 prefixes to them.
目前, DHCPv6 服务器为客户端分配地址的过程分为两类: 交互两 个消息的地址快速分配过程和交互四个消息的地址分配过程。  Currently, the process of assigning addresses to clients by the DHCPv6 server is divided into two categories: the address fast assignment process of interacting two messages and the address assignment process of interacting four messages.
如图 1所示, 交互两个信息的地址快速分配过程为:  As shown in Figure 1, the process of quickly assigning addresses to two messages is:
(1) DHCPv6 客户端在发送的 Solicit (要求) 报文中携带 Rapid Commit (快速应答)选项, 标识客户端希望服务器能够快速为其分配地 址 /前缀和网络配置参数;  (1) The DHCPv6 client carries the Rapid Commit option in the Solicit message sent, indicating that the client wants the server to quickly assign an address/prefix and network configuration parameters to it;
(2)如果 DHCPv6服务器支持快速分配过程, 则直接返回 Reply (回 复) 文, 为客户端分配 IPv6 地址 /前缀和其他网络配置参数。 如果 DHCPv6 服务器不支持快速分配过程, 则采用交互四个消息的分配过程 为客户端分配 IPv6地址和其他网络配置参数, 具体操作参阅图 2所示 地址分配过程中的 (2) ~ (4) 等步骤。 (2) If the DHCPv6 server supports the fast allocation process, return the Reply text directly, and assign the IPv6 address/prefix and other network configuration parameters to the client. in case The DHCPv6 server does not support the fast allocation process. The IPv4 address and other network configuration parameters are assigned to the client by the process of assigning four messages. For details, refer to steps (2) ~ (4) in the address allocation process shown in Figure 2. .
交互四个消息的分配过程如图 2 所示, 交互四个信息的地址分配 具体过程为:  The process of allocating four messages is shown in Figure 2. The address assignment of the four messages is as follows:
( 1) DHCPv6 客户端向 DHCPV6 服务器发送 Solicit 报文, 请求 DHCPv6 服务器为其分配 IPv6 地址 /前缀和网络配置参数。  1) The DHCPv6 client sends a Solicit packet to the DHCPv6 server, requesting the DHCPv6 server to assign an IPv6 address/prefix and network configuration parameters.
( 2 )如果 Solicit消息中没有携带 Rapid Commit选项,或 Solicit 报文中携带 Rapid Commit 选项, 但服务器不支持快速分配过程, 则 DHCPv6 服务器回复 Advertise (通告) 文, 通知客户端可以为其分 配的地址 /前缀和网络配置参数。  (2) If the Rapid Commit option is not carried in the Solicit message, or the Rapid Commit option is carried in the Solicit message, but the server does not support the fast allocation process, the DHCPv6 server replies to the Advertise message to notify the client of the address that can be assigned to it. /prefix and network configuration parameters.
( 3) 如果 DHCPv6 客户端接收到多个服务器回复的通知报文, 则 根据消息接收的先后顺序、 服务器优先级等, 选择其中一台服务器, 并 向该服务器发送 Request (请求)报文, 请求服务器确认为其分配地址 /前缀和网络配置参数。  (3) If the DHCPv6 client receives notification messages from multiple servers, it selects one of the servers according to the order in which the messages are received, the server priority, etc., and sends a Request message to the server. The server confirms that it is assigned an address/prefix and network configuration parameters.
(4) DHCPv6 服务器返回 Reply 文, 确认将地址 /前缀和网络配 置参数分配给客户端使用。  (4) The DHCPv6 server returns a Reply message, confirming that the address/prefix and network configuration parameters are assigned to the client.
RFC3315中指出, DHCP可以通过 DHCPV6服务器分配地址和其他配 置信息,地址和其他配置信息是通过包含在选项中而实现的。客户端向 DHCPv6服务器请求分配地址的时候, 可以在 Request 文的 文选项 中包含 IA_TA ( Identity Association - Temporary Address , 标识联 盟 -临时地址) 选项来告诉服务器请求分配的是临时地址, 同时可以在 ΙΑ_ΤΑ选项中包含它所需要的地址。 服务器接收到客户端的请求后, 为 该客户端分配它所需要的临时地址。 同时, RFC3315 中也指出, DHCP 可以通过定义新的选项来扩展 DHCP的应用。  As noted in RFC3315, DHCP can assign addresses and other configuration information through the DHCPV6 server. Addresses and other configuration information are implemented by inclusion in the options. When the client requests the DHCPv6 server to allocate an address, it can include the IA_TA (Identity Association - Temporary Address) option in the text option of the Request text to tell the server to request the temporary address to be assigned, and the ΙΑ_ΤΑ option can be used at the same time. Contains the address it needs. After the server receives the client's request, it assigns the client the temporary address it needs. At the same time, RFC3315 also states that DHCP can extend the use of DHCP by defining new options.
发明人发现现有技术中至少存在如下问题:  The inventors have found that at least the following problems exist in the prior art:
在目前的 DHCP协议中, 用户不能在 DHCPV6服务器地址池中预留 某个或者某一段 IPv6地址留作将来有特殊用途使用, 即客户端希望服 务器将这些 IPv6地址为它保留一段时间, 暂时不分配给其他客户端使 用。  In the current DHCP protocol, users cannot reserve a certain or a certain IPv6 address in the DHCPV6 server address pool for future special use. That is, the client wants the server to reserve these IPv6 addresses for a period of time, temporarily not allocated. Used by other clients.
发明内容 本发明的实施例提供一种地址分配方法及装置, 为 DHCP协议增加 了 IPv6地址预留的功能,即 DHCPV6服务器在地址池中为节点预留 IPv6 地址。 Summary of the invention An embodiment of the present invention provides an address allocation method and apparatus, which adds an IPv6 address reservation function to a DHCP protocol, that is, a DHCPV6 server reserves an IPv6 address for a node in an address pool.
为达到上述目的, 本发明的实施例采用如下技术方案:  In order to achieve the above object, the embodiment of the present invention adopts the following technical solutions:
一种地址分配方法, 包括:  An address allocation method includes:
接收节点发送的地址预留选项, 所述地址预留选项中包含 IPv6地 址信息;  Receiving an address reservation option sent by the node, where the address reservation option includes IPv6 address information;
在存在所述 IPv6地址信息对应的 IPv6地址时, 将所述 IPv6地址 信息对应的 IPv6地址标记为预留地址, 并记录所述节点与所述预留地 址之间的对应关系;  When the IPv6 address corresponding to the IPv6 address information exists, the IPv6 address corresponding to the IPv6 address information is marked as a reserved address, and the correspondence between the node and the reserved address is recorded;
在接收到的地址分配选项中要求分配的地址为所述预留地址时, 判断要求分配地址的节点与所述预留地址对应的节点是否相同;  When the address that is required to be allocated in the received address allocation option is the reserved address, it is determined whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
在要求分配地址的节点与所述预留地址对应的节点相同时, 为所 述要求分配地址的节点分配所述预留地址。  When the node that requests the address is the same as the node corresponding to the reserved address, the reserved address is assigned to the node that requests the address.
一种地址分配装置, 包括:  An address allocation device includes:
第一接收单元, 用于接收节点发送的地址预留选项, 所述地址预 留选项中包含 IPv6地址信息;  a first receiving unit, configured to receive an address reservation option sent by the node, where the address reservation option includes IPv6 address information;
第一处理单元, 用于在存在所述 IPv6地址信息对应的 IPv6地址 时, 将所述 IPv6地址信息对应的 IPv6地址标记为预留地址, 并记录所 述节点与所述预留地址之间的对应关系;  a first processing unit, configured to mark, according to the IPv6 address corresponding to the IPv6 address information, an IPv6 address corresponding to the IPv6 address information as a reserved address, and record between the node and the reserved address Correspondence relationship
第一判断单元, 用于在接收到的地址分配选项中要求分配的地址 为所述预留地址时,判断要求分配地址的节点与所述预留地址对应的节 点是否相同;  a first determining unit, configured to determine, when the address to be allocated in the received address allocation option is the reserved address, whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
分配单元 , 用于在要求分配地址的节点与所述预留地址对应的节 点相同时, 为所述要求分配地址的节点分配所述预留地址。  And an allocating unit, configured to allocate the reserved address to the node that requests the address when the node that needs to allocate the address is the same as the node corresponding to the reserved address.
本发明实施例提供的地址分配方法及装置, 该方案通过定义了一 种新的地址预留选项,使节点的发送请求中可携带地址预留选项,在服 务器接收到携带该选项的请求后, 从服务器的地址池中为节点预留出 IPv6 地址, 在今后该节点发送要求分配预留地址的请求时, 服务器就 将预留的 IPv6地址分配给该节点。 因此, 只要采取了本发明实施例提 供的方案, 为 DHCP协议增加了 IPv6地址预留的功能, 可以使节点通过 提前申请预留出所需 IPv6地址, 防止以后出现大量申请造成地址短缺 而该节点无法获得所需 IPv6地址的情形, 方便了用户提前做出安排。 附图说明 The address allocation method and device provided by the embodiment of the present invention, the solution defines a new address reservation option, so that the node can send an address reservation option in the sending request, after the server receives the request to carry the option, The IPv6 address is reserved for the node from the address pool of the server. When the node sends a request for the allocation of the reserved address in the future, the server allocates the reserved IPv6 address to the node. Therefore, as long as the embodiment of the present invention is adopted The solution provides an IPv6 address reservation function for the DHCP protocol, which enables the node to reserve the required IPv6 address by applying in advance, so as to prevent a situation where a large number of applications cause a shortage of addresses and the node cannot obtain the required IPv6 address. It is convenient for users to make arrangements in advance. DRAWINGS
图 1为现有技术中 DHCPv6服务器和客户端交互两个消息的地址快 速分配过程的示意图;  1 is a schematic diagram of a fast address allocation process of two messages exchanged between a DHCPv6 server and a client in the prior art;
图 2为现有技术中 DHCPv6服务器和客户端交互四个消息的地址分 配过程的示意图;  2 is a schematic diagram of an address allocation process of four messages exchanged between a DHCPv6 server and a client in the prior art;
图 3为本发明实施例 1地址分配方法的流程图;  3 is a flowchart of an address allocation method according to Embodiment 1 of the present invention;
图 4为本发明实施例 1地址分配装置的结构示意图;  4 is a schematic structural diagram of an address allocation apparatus according to Embodiment 1 of the present invention;
图 5为本发明实施例 2地址预留选项的格式示意图;  FIG. 5 is a schematic diagram of a format of an address reservation option according to Embodiment 2 of the present invention; FIG.
图 6为本发明实施例 2以 DHCPv6服务器和客户端交互四个消息为 基础的申请预留地址方法的流程图;  6 is a flowchart of a method for applying for a reserved address based on four messages of a DHCPv6 server and a client interaction according to Embodiment 2 of the present invention;
图 7为本发明实施例 2以 DHCPv6服务器和客户端交互两个消息为 基础的申请预留地址方法的流程图;  FIG. 7 is a flowchart of a method for requesting a reserved address based on two messages exchanged between a DHCPv6 server and a client according to Embodiment 2 of the present invention;
图 8 为本发明实施例 2 申请预留地址后获取预留地址方法的流程 图;  8 is a flow chart of a method for obtaining a reserved address after applying for a reserved address according to Embodiment 2 of the present invention;
图 9为本发明实施例 2地址分配装置的结构示意图。  FIG. 9 is a schematic structural diagram of an address allocation apparatus according to Embodiment 2 of the present invention.
具体实施方式 detailed description
下面结合附图对本发明实施例地址分配方法及装置进行详细描 述。  The address allocation method and apparatus of the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
实施例 1  Example 1
如图 3所示, 本实施例提供了一种地址分配方法, 包括: 步骤 301, 接收节点发送的地址预留选项, 所述地址预留选项中包 含 IPv6地址信息;  As shown in FIG. 3, this embodiment provides an address allocation method, including: Step 301: Receive an address reservation option sent by a node, where the address reservation option includes IPv6 address information;
步骤 302, 在存在所述 IPv6地址信息对应的 IPv6地址时, 将所述 IPv6地址信息对应的 IPv6地址标记为预留地址, 并记录所述节点与所 述预留地址之间的对应关系;  Step 302: When an IPv6 address corresponding to the IPv6 address information exists, mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record a correspondence between the node and the reserved address.
步骤 303, 在接收到的地址分配选项中要求分配的地址为所述预留 地址时, 判断要求分配地址的节点与所述预留地址对应的节点是否相 同; Step 303: When the address that is required to be allocated in the received address allocation option is the reserved address, determine whether the node corresponding to the reserved address is the node corresponding to the reserved address. Same
步骤 304, 在要求分配地址的节点与所述预留地址对应的节点相同 时 , 为所述要求分配地址的节点分配所述预留地址。  Step 304: When the node that requires the address allocation is the same as the node corresponding to the reserved address, allocate the reserved address to the node that requests the address.
如图 4所示, 本实施例提供了一种地址分配装置, 包括: 第一接收单元 401, 用于接收节点发送的地址预留选项, 所述地址 预留选项中包含 IPv6地址信息;  As shown in FIG. 4, the embodiment provides an address allocation apparatus, including: a first receiving unit 401, configured to receive an address reservation option sent by a node, where the address reservation option includes IPv6 address information;
第一处理单元 402, 用于在存在所述 IPv6地址信息对应的 IPv6地 址时,将所述 IPv6地址信息对应的 IPv6地址标记为预留地址, 并记录 所述节点与所述预留地址之间的对应关系;  The first processing unit 402 is configured to mark, according to the IPv6 address corresponding to the IPv6 address information, an IPv6 address corresponding to the IPv6 address information as a reserved address, and record between the node and the reserved address. Correspondence relationship;
第一判断单元 403, 用于在接收到的地址分配选项中要求分配的地 址为所述预留地址时,判断要求分配地址的节点与所述预留地址对应的 节点是否相同;  The first determining unit 403 is configured to determine, when the address requested to be allocated in the received address allocation option is the reserved address, whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
分配单元 404, 用于在要求分配地址的节点与所述预留地址对应的 节点相同时, 为所述要求分配地址的节点分配所述预留地址。  The allocating unit 404 is configured to allocate the reserved address to the node that requests the address when the node that needs to allocate the address is the same as the node corresponding to the reserved address.
本发明实施例提供的地址分配方法及装置, 该方案通过定义了一 种新的地址预留选项,使节点的发送请求中可携带地址预留选项,在服 务器在接收到携带该选项的请求后,从服务器的地址池中为节点预留出 IPv6 地址, 在今后该节点发送要求分配预留地址的请求时, 服务器就 将预留的 IPv6地址分配给该节点。 因此, 只要采取了本发明实施例提 供的方案, 就可以节点通过提前申请预留出所需 IPv6地址, 防止以后 出现大量申请造成地址短缺而该节点无法获得所需 I Pv6地址的情形 , 方便了用户提前做出安排。  The address allocation method and device provided by the embodiment of the present invention, the solution defines a new address reservation option, so that the node can send an address reservation option in the sending request, after the server receives the request carrying the option. The IPv6 address is reserved for the node from the address pool of the server. When the node sends a request for the allocation of the reserved address in the future, the server allocates the reserved IPv6 address to the node. Therefore, as long as the solution provided by the embodiment of the present invention is adopted, the node can reserve the required IPv6 address by applying in advance, thereby preventing the situation that a large number of applications cause a shortage of addresses and the node cannot obtain the required I Pv6 address in the future, which is convenient. The user makes arrangements in advance.
实施例 2  Example 2
本实施例以支持 IPv6 的 DHCPv6为例, 本实施例提供了一种地址 分配方法, 需要增加一种新的 DHCP选项。 如图 5所示, 该选项用于传 递予贞留地址 IA_RA ( Identity As sociat ion -Reserved Address,标识联 盟 -保留地址) 的信息。 新定义的选项为地址预留选项 0PTI0N_IA_RA, 包含:  In this embodiment, DHCPv6 supporting IPv6 is taken as an example. This embodiment provides an address allocation method, and a new DHCP option needs to be added. As shown in Figure 5, this option is used to pass information to the IA_RA ( Identity As sociat - Reserved Address). The newly defined option is the address reservation option 0PTI0N_IA_RA, which contains:
选项类型 ( opt ion-code ) : opt ion-code 用于标示该选项为地址 预留选项, 数值的定义需要等正式标准发布后由标准组织分配;  Option type ( opt ion-code ) : opt ion-code is used to indicate that this option is an address reservation option. The definition of the value needs to be assigned by the standard organization after the official standard is released.
选项长度 ( option-len ) : option-len 用于标示整个地址预留选 项的长度, 长度值 =IAID的长度 (4) +IA_RA-options的长度, 单位为 字节; Option length ( option-len ): option-len is used to indicate the entire address reservation Length of item, length value = length of IAID (4) + length of IA_RA-options, in bytes;
IAID (身份集合标识符) : IAID 用于标识预留地址 IA_RA, IAID 为 IA_RA的唯一标识, IAID 必须和该客户端的其他的 IA_RA不同; 其他选项(IA_RA-options): 其他选项为与 IA_RA相关联的选项, 其他选项中包含预留的地址信息,即预留地址 I A_RA属于其他选项下的 子选项。  IAID (Identity Set Identifier): The IAID is used to identify the reserved address IA_RA, the IAID is the unique identifier of IA_RA, the IAID must be different from the other IA_RA of the client; Other options (IA_RA-options): Other options are associated with IA_RA The options, other options include reserved address information, that is, the reserved address I A_RA belongs to the sub-option under other options.
本发明实施例的地址分配方法包括 DHCPv6服务器和客户端之间交 互两个消息为基础和交互四个消息为基础的两种方案,如图 6所示的地 址分配方法, 以交互四消息为基础申请预留地址, 包括:  The address allocation method in the embodiment of the present invention includes two schemes in which two messages are exchanged between the DHCPv6 server and the client, and the four messages are based on interaction. The address allocation method shown in FIG. 6 is based on the interaction of four messages. Apply for a reserved address, including:
步骤 601, DHCPV6服务器接收到客户端发送的 Solicit报文, 该 报文用于定位 DHCPv6服务器并请求服务器为所述客户端分配 IPv6地 址;  Step 601: The DHCPV6 server receives the Solicit message sent by the client, where the message is used to locate the DHCPv6 server and request the server to allocate an IPv6 address to the client.
步骤 602, 网内可用的 DHCPV6服务器返回 Advertise报文给客户 端, 所述 Advertise 文用于通知所述节点可以为所述节点分配 IPv6 地址,客户端依据 Advertise报文,从返回了所述 Adver t i se报文的服 务器中选择符合要求的 DHCPV6服务器。  Step 602: The DHCPv6 server that is available in the network returns an Advertise message to the client, where the Advertise text is used to notify the node that the node can be assigned an IPv6 address, and the client returns the Adver ti according to the Advertise message. Select the DHCPV6 server that meets the requirements in the server of the se message.
步骤 603,选定的服务器接收客户端发送的 Request报文, Request 报文中包含地址预留选项, 地址预留选项中包含需要预留的 IPv6地址 信息。  Step 603: The selected server receives the Request message sent by the client, where the Request message includes an address reservation option, and the address reservation option includes the IPv6 address information to be reserved.
该地址预留选项用于告诉服务器客户端需要申请预留一个 IPv6地 址或者 IPv6地址前缀。 在地址预留选项的其它选项 ( IA_RA-options ) 中包含需要预留的 IPv6地址信息,可以指定这个预留的 IPv6地址或者 IPv6地址前缀(前缀长度大于 64位小于 128位, 用来预留一段地址)。  This address reservation option is used to tell the server that the client needs to request to reserve an IPv6 address or an IPv6 address prefix. In the other options of the address reservation option ( IA_RA-options ), you need to specify the reserved IPv6 address information. You can specify the reserved IPv6 address or IPv6 address prefix. The prefix length is greater than 64 bits and less than 128 bits. address).
步骤 604, 判断是否存在所述 IPv6地址信息中对应的 IPv6地址, 如果存在所述 IPv6地址信息对应的 IPv6地址, 则执行步骤 605; 如果 不存在所述 IPv6地址信息对应的 IPv6地址, 则执行步骤 606。  Step 604: Determine whether there is a corresponding IPv6 address in the IPv6 address information. If an IPv6 address corresponding to the IPv6 address information exists, go to step 605. If the IPv6 address corresponding to the IPv6 address information does not exist, perform the step. 606.
步骤 605,将所述 IPv6地址信息对应的 IPv6地址标记为预留地址, 并记录所述客户端与所述预留地址之间的对应关系。  Step 605: Mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record the correspondence between the client and the reserved address.
并且, 在步骤 605中, DHCPV6服务器可以向客户端发送 Reply报 文, 并在 Reply报文中携带预留成功消息。 步骤 606 , DHCPV6 服务器向客户端返回预留失败消息; 具体实现 时, DHCPV6服务器可以通过向客户端发送 Reply报文, 并在 Reply报 文中携带预留失败消息。 Moreover, in step 605, the DHCPV6 server may send a Reply packet to the client, and carry a reservation success message in the Reply packet. Step 606: The DHCPV6 server returns a reservation failure message to the client. In a specific implementation, the DHCPV6 server may send a Reply packet to the client, and carry a reservation failure message in the Reply packet.
除了图 6 中所示的以交互四个消息为基础的地址分配方案申请预 留地址,本发明实施例还可以通过以交互两个消息为基础的地址分配方 案申请预留地址, 如图 7所示, 该地址分配方法具体包括:  In addition to the application of the address allocation scheme based on the four message exchanges shown in FIG. 6, the embodiment of the present invention can also apply for a reserved address by using an address allocation scheme based on the interaction of two messages, as shown in FIG. 7. The address allocation method specifically includes:
步骤 701 , DHCPV6 服务器接收到客户端发送的 So l ic i t 报文, So l ic i t报文中携带 Rapid Commi t选项和地址预留选项 OPTION— IA_RA。  Step 701: The DHCPV6 server receives the So ic i t message sent by the client, and the So ic i t message carries the Rapid Commi t option and the address reservation option OPTION_IA_RA.
Rapi d Commi t 选项和地址预留选项用于标识客户端希望服务器能 够快速为其预留一个 IPv6地址或者 IPv6前缀。在地址预留选项的其它 选项 IA_RA-opt ions中包含需要预留的地址信息,可以指定这个预留的 IPv6地址或者 IPv6地址前缀(前缀长度大于 64位小于 128位, 用来 预留一段 IPv6地址) 。  The Rapi d Commi t option and address reservation options are used to identify that the client wants the server to quickly reserve an IPv6 address or IPv6 prefix for it. The other option IA_RA-opt ions in the address reservation option contains the address information to be reserved. You can specify the reserved IPv6 address or IPv6 address prefix (the prefix length is greater than 64 bits and less than 128 bits, which is used to reserve an IPv6 address. ).
步骤 702 , 判断 DHCPV6服务器是否支持快速分配并且是否存在所 述 IPv6地址信息对应的 IPv6地址, 如果所述 DHCPV6服务器支持快速 分配并且存在所述 IPv6地址信息对应的 IPv6地址, 则执行步骤 703; 如果不存在所述 IPv6地址信息对应的 IPv6地址或者不支持快速分配, 则执行步骤 704。  Step 702: Determine whether the DHCPV6 server supports fast allocation and whether there is an IPv6 address corresponding to the IPv6 address information. If the DHCPV6 server supports fast allocation and the IPv6 address corresponding to the IPv6 address information exists, step 703 is performed; If the IPv6 address corresponding to the IPv6 address information exists or does not support fast allocation, step 704 is performed.
步骤 703,将所述 IPv6地址信息对应的 IPv6地址标记为预留地址, 并记录所述客户端与所述预留地址之间的对应关系。  Step 703: Mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record the correspondence between the client and the reserved address.
并且, 在步骤 703中, DHCPV6服务器可以向客户端发送 Reply报 文, 并在 Reply报文中携带预留成功消息。  In addition, in step 703, the DHCPV6 server may send a reply message to the client, and carry a reservation success message in the reply message.
步骤 704 , DHCPV6服务器向客户端发送 Rep ly报文, 并在 Reply 报文中携带预留失败消息。  Step 704: The DHCPV6 server sends a Reply message to the client, and carries a reservation failure message in the Reply message.
优选地, 所述 IPv6地址信息中对应的 IPv6地址包括 IPv6地址或 IPv6 地址前缀, 可以以多种方式表示, 可以通过设定具体的规则来表 示 IPv6地址。 例如, 在地址预留选项的其它选项中, 所述 IPv6地址信 息包括一个 IPv6地址, 所述 IPv6地址信息对应的 IPv6地址即为所述 一个 IPv6地址;或者所述 IPv6地址信息包括 IPv6地址前缀,所述 IPv6 地址信息对应的 IPv6地址即为所述 IPv6地址前缀所表示的全部 IPv6 地址; 或者所述 IPv6地址信息包括两个 IPv6地址, 所述 IPv6地址信 息对应的 IPv6地址为所述两个 IPv6地址、 以及所述两个 IPv6地址之 间的全部 IPv6地址。 这样, 服务器根据这样的规则就可以识别需要预 留的地址并进行分配。 Preferably, the corresponding IPv6 address in the IPv6 address information includes an IPv6 address or an IPv6 address prefix, which can be represented in multiple manners, and an IPv6 address can be represented by setting a specific rule. For example, in other options of the address reservation option, the IPv6 address information includes an IPv6 address, and the IPv6 address corresponding to the IPv6 address information is the one IPv6 address; or the IPv6 address information includes an IPv6 address prefix. The IPv6 address corresponding to the IPv6 address information is all IPv6 addresses represented by the IPv6 address prefix; or the IPv6 address information includes two IPv6 addresses, and the IPv6 address information The IPv6 address corresponding to the information is the two IPv6 addresses and all IPv6 addresses between the two IPv6 addresses. In this way, the server can identify the addresses that need to be reserved and allocate according to such rules.
优选地, 为了标识和管理预留地址, 所述地址预留选项中还包括 IAID。 IAID为 IA_RA的唯一标识, IAID必须和该客户端的其他的 IA_RA 不同。  Preferably, in order to identify and manage the reserved address, the address reservation option further includes an IAID. The IAID is a unique identifier for IA_RA, and the IAID must be different from the other IA_RAs of the client.
优选地, 为了保证服务器将来能识别出申请的客户端使其能够获 得预留地址, 需要记录所述客户端与所述预留地址之间的对应关系, 所 述记录所述客户端与所述预留地址之间的对应关系为:记录所述客户端 的介质访问控制地址 (MAC ) 地址与所述预留地址之间的对应关系, 或 者也可以通过记录 MAC地址和 IAID组合的形式记录所述客户端与所述 预留地址之间的对应关系。  Preferably, in order to ensure that the server can identify the client in the future to obtain the reserved address, the correspondence between the client and the reserved address needs to be recorded, and the client and the The correspondence between the reserved addresses is: recording the correspondence between the media access control address (MAC) address of the client and the reserved address, or recording the MAC address and the IAID combination. The correspondence between the client and the reserved address.
优选地, 另外, 在步骤 603中, 或者在步骤 701 , 可在地址预留选 项中的其他选项 ( IA_RA-opt ions ) 中包含此预留地址或者地址段的预 留期限 ( l i fet ime ) , 即在预留期限以内, DHCPv6 服务器在地址池中 为客户端保留该 IPv6地址或者 IPv6地址前缀,不分配给其他客户端使 用。在所述预留期限内, 判断要求分配地址的客户端与所述预留地址对 应的客户端是否相同; 而过了预留期限以后, DHCPv6 服务器则释放该 预留的 IPv6地址或者 IPv6地址段, 可通过取消所述 IPv6地址信息对 应的 IPv6地址为预留地址的标记, 并删除所述客户端与所述预留地址 之间的对应关系进行释放。释放后该 IPv6地址或者 IPv6地址段可以分 配给其他客户端使用, 以免造成资源的浪费。  Preferably, in addition, in step 603, or in step 701, the reserved period (li fet ime ) of the reserved address or the address segment may be included in other options ( IA_RA-opt ions ) in the address reservation option. That is, within the reserved period, the DHCPv6 server reserves the IPv6 address or IPv6 address prefix for the client in the address pool and does not assign it to other clients. During the reservation period, it is determined whether the client that requires the address allocation is the same as the client corresponding to the reserved address; and after the reservation period expires, the DHCPv6 server releases the reserved IPv6 address or IPv6 address segment. The IPv6 address corresponding to the IPv6 address information is removed as a mark of the reserved address, and the corresponding relationship between the client and the reserved address is deleted. After the release, the IPv6 address or IPv6 address segment can be allocated to other clients to avoid wasting resources.
在完成上述图 6或图 7所示的申请预留地址步骤后,在预留期限内, 客户端在需要使用该预留的 IPv6地址或者 IPv6地址段时,如图 8所示, 可以按下述步骤申请获取预留地址并完成地址分配:  After completing the application for reserving the address step shown in FIG. 6 or FIG. 7 , during the reservation period, when the client needs to use the reserved IPv6 address or IPv6 address segment, as shown in FIG. 8 , the user can press The steps apply to obtain the reserved address and complete the address assignment:
步骤 801, 向服务器发送 Reques t报文, Reques t报文中包含地址 预留选项, 地址预留选项中包含 IPv6地址信息。  Step 801: Send a Reques t message to the server, where the Reques t message includes an address reservation option, and the address reservation option includes an IPv6 address information.
步骤 802, 服务器在接收到的地址分配选项中要求分配的 IPv6地 址为所述预留地址时, 判断要求分配 IPv6地址的客户端与所述预留地 址对应的客户端是否相同。在要求分配地址的客户端与所述预留地址对 应的客户端相同时, 执行步骤 803; 在要求配置分配地址的客户端与所 述预留地址对应的客户端不相同时, 执行步骤 804。 Step 802: When the server requests the allocated IPv6 address to be the reserved address, the server determines whether the client that needs to allocate the IPv6 address is the same as the client corresponding to the reserved address. When the client that requires the address allocation is the same as the client corresponding to the reserved address, step 803 is performed; When the clients corresponding to the reserved addresses are different, step 804 is performed.
步骤 803, 为所述要求分配 IPv6地址的节点分配所述预留地址。 步骤 804 , 拒绝为所述要求分配 IPv6地址的客户端分配所述预留 地址。 并且, DHCPV6服务器可向客户端发送 Rep ly报文, 并在 Reply 报文中携带分配失败信息。  Step 803: Allocate the reserved address to the node that requires an IPv6 address to be allocated. Step 804: Reject the reserved address for the client that requires the IPv6 address to be allocated. In addition, the DHCPv6 server can send a Rep ly message to the client, and carry the allocation failure information in the Reply message.
步骤 805, 在预留期限未到期时, DHCPV6 服务器接收到所述客户 端发送的 Renew (更新) 报文, 所述 Renew 报文中包含地址预留选项 0PTI0N_ IA_RA , 所述地址预留选项中包含 IPv6 地址信息; 居所述 Renew ^艮文中携带的地址预留选项中的 IPv6地址信息, 更新所述 IPv6 地址信息对应的预留期限, 以使 DHCPV6服务器继续为所述客户端预留 该 IPv6地址或者 IPv6地址段。  Step 805: When the reservation period has not expired, the DHCPV6 server receives the Renew (update) packet sent by the client, where the Renew packet includes an address reservation option 0PTI0N_IA_RA, where the address reservation option is The IPv6 address information is included; the IPv6 address information in the address reservation option carried in the Renew address is updated, and the reservation period corresponding to the IPv6 address information is updated, so that the DHCPV6 server continues to reserve the IPv6 for the client. Address or IPv6 address segment.
步骤 806, 预留期限届满后, DHCPV6服务器释放该预留的 IPv6地 址或者 IPv6地址段。 可通过取消所述 IPv6地址信息对应的 IPv6地址 为预留地址的标记,并删除所述客户端与所述预留地址之间的对应关系 进行释放。释放后该 IPv6地址或者 IPv6地址段可以分配给其他客户端 使用, 以免造成资源的浪费。  Step 806: After the reservation period expires, the DHCPV6 server releases the reserved IPv6 address or the IPv6 address segment. The IPv6 address corresponding to the IPv6 address information is removed as a mark of the reserved address, and the corresponding relationship between the client and the reserved address is deleted. After the release, the IPv6 address or IPv6 address segment can be allocated to other clients to avoid wasting resources.
本实施例提供了一种地址分配装置, 同样,地址分配包括交互两个 消息为基础和交互四个消息为基础的两种方案,如图 9所示, 以交互四 个消息为基础的地址分配装置, 包括:  This embodiment provides an address allocation apparatus. Similarly, the address allocation includes two schemes based on the interaction of two messages and four messages, as shown in FIG. 9, the address allocation based on the interaction of four messages. Device, including:
第二接收单元 901, 用于接收客户端发送的 So l ic i t报文, 该报文 用于定位 DHCPv6服务器并请求服务器为所述客户端分配地址;  The second receiving unit 901 is configured to receive a So1 ic packet sent by the client, where the packet is used to locate the DHCPv6 server and request the server to allocate an address for the client.
通告单元 902 , 用于返回 Adver t i se 报文给所述客户端, 所述 Adver t i se 文用于通知客户端可以为其分配 IPv6地址。 客户端可以 依据 Adver t i se报文, 从返回了所述 Adver t i se报文的 DHCPV6服务器 中选择符合要求的 DHCPV6服务器。  The notification unit 902 is configured to return an Adveriti message to the client, where the Advert is used to notify the client that an IPv6 address can be assigned to the client. The client can select a DHCPV6 server that meets the requirements from the DHCPV6 server that has returned the Adverit message according to the Adver t se message.
第一接收单元 903, 用于接收客户端发送 Reques t报文, Reques t 报文中包含地址预留选项, 地址预留选项中包含需要预留的 IPv6地址 信息。 该地址预留选项用于告诉服务器客户端需要申请预留一个 IPv6 地址或者 IPv6地址前缀。在地址预留选项的其它选项( IA_RA-opt i ons ) 中包含需要预留的 IPv6地址信息,可以指定这个预留的 IPv6地址或者 IPv6地址前缀(前缀长度大于 64位小于 128位, 用来预留一段 IPv6 地址) 。 The first receiving unit 903 is configured to receive, by the client, a Reques t packet, where the Reques t packet includes an address reservation option, and the address reservation option includes the IPv6 address information that needs to be reserved. This address reservation option is used to tell the server client to apply for an IPv6 address or IPv6 address prefix. In the other options of the address reservation option ( IA_RA-opt i ons ), you need to specify the IPv6 address information to be reserved. You can specify the reserved IPv6 address or IPv6 address prefix. The prefix length is greater than 64 bits and less than 128 bits. Leave a piece of IPv6 Address).
第二判断单元 904 , 用于判断是否存在所述 IPv6地址信息对应的 IPv6地址。  The second determining unit 904 is configured to determine whether an IPv6 address corresponding to the IPv6 address information exists.
第一处理单元 905,用于将所述 IPv6地址信息对应的 IPv6地址标 记为预留地址, 并记录所述客户端与所述预留地址之间的对应关系。  The first processing unit 905 is configured to mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record a correspondence between the client and the reserved address.
第一回复单元 906,用于向客户端发送 Reply报文,通知预留成功; 还用于向客户端发送 Reply报文, 通知预留失败。  The first replying unit 906 is configured to send a reply message to the client to notify the reservation that the reservation is successful. The method is further configured to send a reply message to the client, and notify the reservation that the reservation fails.
另外, 如图 9所示, 在以交互两个消息为基础的地址分配装置中, 所述第一接收单元 903,还用于接收到客户端发送的 So l ic i t报文, 要求报文 So l ic i t 报文中携带 Rapi d Commi t 选项和地址预留选项 0PTI0N_ IA_RA。 Rapi d Commi t 选项和地址预留选项用于标识客户端希 望服务器能够快速为其预留一个 IPv6地址或者 IPv6前缀。在地址预留 选项的其它选项 ( IA_RA-opt ions ) 中包含需要预留的地址信息, 可以 指定这个预留的 IPv6地址或者 IPv6地址前缀 (前缀长度大于 64位小 于 128位, 用来预留一段 IPv6地址) 。  In addition, as shown in FIG. 9, in the address allocation apparatus based on the two messages, the first receiving unit 903 is further configured to receive the So lic message sent by the client, and request the message So. l The ic it packet carries the Rapi d Commi t option and the address reservation option 0PTI0N_ IA_RA. The Rapi d Commi t option and address reservation options are used to identify that the client wants the server to quickly reserve an IPv6 address or IPv6 prefix for it. In the other options of the address reservation option ( IA_RA-opt ions ), the address information to be reserved may be specified, and the reserved IPv6 address or IPv6 address prefix may be specified (the prefix length is greater than 64 bits and less than 128 bits, and used to reserve a segment. IPv6 address).
所述第二判断单元 904 , 还用于在判断 DHCPv6 服务器是否支持快 速分配及是否存在对应的地址。  The second determining unit 904 is further configured to determine whether the DHCPv6 server supports fast allocation and whether a corresponding address exists.
所述第一处理单元 905, 还用于将所述 IPv6地址信息对应的 IPv6 地址标记为预留地址,并记录所述客户端与所述预留地址之间的对应关 系。  The first processing unit 905 is further configured to mark the IPv6 address corresponding to the IPv6 address information as a reserved address, and record a correspondence between the client and the reserved address.
所述第一回复单元 906 , 还用于向客户端发送 Reply 文, 并在 Reply报文中携带预留成功消息; 还用于向客户端发送 Reply报文, 并 在 Reply报文中携带预留失败消息。  The first replying unit 906 is further configured to send a Reply message to the client, and carry a reservation success message in the Reply message; and also send a Reply message to the client, and carry the reservation in the Reply message. Failure message.
申请预留地址后, 如图 9所示, 为完成分配预留地址, 使客户端获 取预留地址, 地址预留装置还包括:  After the application for the reserved address, as shown in FIG. 9, in order to complete the allocation of the reserved address, the client obtains the reserved address, and the address reservation device further includes:
第三接收单元 907, 用于接收所述客户端向 DHCPV6 服务器发送 Reques t报文, Reques t报文中包含地址分配选项, 地址分配选项中包 含 IPv6地址信息。  The third receiving unit 907 is configured to receive the Reques t message sent by the client to the DHCPV6 server, where the Reques t message includes an address allocation option, and the address allocation option includes the IPv6 address information.
第一判断单元 908 , 用于当接收到的地址分配选项中要求分配的 IPv6 地址为所述预留地址时, 判断要求分配地址的客户端与所述预留 地址对应的客户端是否相同。 分配单元 909, 用于为所述要求分配 IPv6地址的节点分配所述预 留地址; 还用于拒绝为所述要求分配 IPv6地址的客户端分配所述预留 地址。 The first determining unit 908 is configured to determine, when the IPv6 address that is required to be allocated in the received address allocation option is the reserved address, whether the client that requires the address allocation is the same as the client corresponding to the reserved address. The allocating unit 909 is configured to allocate the reserved address to the node that requires the IPv6 address to be allocated; and is further configured to refuse to allocate the reserved address to the client that requires the IPv6 address to be allocated.
第二回复单元 910, 用于向客户端发送 Reply 文, 回复分配成功 或拒绝信息。  The second reply unit 910 is configured to send a reply message to the client, and reply to the assignment success or rejection information.
更新单元 911 , 用于在预留期限未到期时, 接收到所述客户端发送 的 Renew报文,所述 Renew报文中包含地址预留选项( OPTION— IA_RA ) , 所述地址预留选项中包含 IPv6地址信息; 根据所述 Renew报文中携带 的地址预留选项中的 IPv6地址信息,更新所述 IPv6地址信息对应的预 留期限, 以使 DHCPV6服务器继续为所述客户端预留该 IPv6地址或者 IPv6地址段。  The update unit 911 is configured to: when the reservation period has not expired, receive a Renew message sent by the client, where the Renew message includes an address reservation option (OPTION_IA_RA), and the address reservation option The IPv6 address information is included in the address reservation option of the Renew message, and the reservation period corresponding to the IPv6 address information is updated, so that the DHCPV6 server continues to reserve the address for the client. IPv6 address or IPv6 address segment.
第二处理单元 912, 用于预留期限届满后, DHCPV6服务器释放该预 留的 IPv6地址或者 IPv6地址段。 可通过取消所述 IPv6地址信息对应 的 IPv6地址为预留地址的标记, 并删除所述客户端与所述预留地址之 间的对应关系进行释放。释放后该 IPv6地址或者 IPv6地址段可以分配 给其他客户端使用, 以免造成资源的浪费。  The second processing unit 912 is configured to: after the expiration of the reservation period, the DHCPV6 server releases the reserved IPv6 address or the IPv6 address segment. The IPv6 address corresponding to the IPv6 address information is removed as a mark of the reserved address, and the corresponding relationship between the client and the reserved address is deleted. After the release, the IPv6 address or IPv6 address segment can be allocated to other clients to avoid wasting resources.
优选地, 所述 IPv6地址信息中对应的 IPv6地址包括 IPv6地址或 IPv6 地址前缀, 可以以多种方式表示, 可以通过设定具体的规则来表 示地址。 例如, 在地址预留选型的其它选项中, 所述 IPv6地址信息包 括一个 IPv6地址, 所述 IPv6地址信息对应的 IPv6地址即为所述一个 IPv6地址; 或者所述 IPv6地址信息包括 IPv6地址前缀, 所述 IPv6地 址信息对应的 IPv6地址即为所述 IPv6地址前缀所表示的全部 IPv6地 址; 或者所述 IPv6地址信息包括两个 IPv6地址, 所述 IPv6地址信息 对应的 IPv6地址为所述两个 IPv6地址、 以及所述两个 IPv6地址之间 的全部 IPv6地址。 这样, DHCPv6服务器根据这样的规则就可以识别需 要预留的 IPv6地址并进行分配。  Preferably, the corresponding IPv6 address in the IPv6 address information includes an IPv6 address or an IPv6 address prefix, which can be represented in multiple manners, and the specific rule can be used to indicate the address. For example, in other options of the address reservation selection, the IPv6 address information includes an IPv6 address, and the IPv6 address corresponding to the IPv6 address information is the one IPv6 address; or the IPv6 address information includes an IPv6 address prefix. The IPv6 address corresponding to the IPv6 address information is the IPv6 address represented by the IPv6 address prefix; or the IPv6 address information includes two IPv6 addresses, and the IPv6 address corresponding to the IPv6 address information is the two An IPv6 address, and all IPv6 addresses between the two IPv6 addresses. In this way, the DHCPv6 server can identify and allocate IPv6 addresses that need to be reserved according to such rules.
优选地, 为了标识和管理预留地址, 所述地址预留选项中还包括 IAID。 IAID为 IA_RA的唯一标识, IAID 必须和该客户端的其他的预 留地址 ( IA— RA ) 不同。  Preferably, in order to identify and manage the reserved address, the address reservation option further includes an IAID. The IAID is a unique identifier for IA_RA, and the IAID must be different from the other reserved addresses (IA-RA) of the client.
优选地, 为了保证服务器将来能识别出申请的客户端使其能够获 得预留地址, 需要记录所述客户端与所述预留地址之间的对应关系, 所 述记录所述客户端与所述预留地址之间的对应关系为:记录所述客户端 的 MAC地址与所述预留地址之间的对应关系或者也可以通过 MAC地址和 I A I D组合的形式记录所述客户端与所述预留地址之间的对应关系。 Preferably, in order to ensure that the server can identify the client in the future to obtain the reserved address, the correspondence between the client and the reserved address needs to be recorded. Recording the correspondence between the client and the reserved address is: recording a correspondence between the MAC address of the client and the reserved address or recording the location by a combination of a MAC address and an IAID Corresponding relationship between the client and the reserved address.
优选地, 本实施例中以同一链路上客户端为例, 本实施例中可以 适用于节点, 节点包括 DHCPv6客户端或者 DHCPv6代理服务器, 由于 DHCPv6代理服务器为 DHCPv6客户端与 DHCPv6服务器信息传递的中介, DHCPv6 代理服务器可用于向 DHCPv6 服务器申请 IPv6 地址并分配给 DHCPv6客户端, 因此本实施例当然适用于 DHCPv6代理服务器, 一般情 况下 DHCPv6代理服务器需要大量的 IPv6地址,所以会申请预留地址段, 这里不再赘述。  Preferably, in this embodiment, the client on the same link is used as an example. In this embodiment, the node may be applied to a node, and the node includes a DHCPv6 client or a DHCPv6 proxy server. The DHCPv6 proxy server is a DHCPv6 client and a DHCPv6 server. The DHCPv6 proxy server can be used to request an IPv6 address from the DHCPv6 server and be assigned to the DHCPv6 client. Therefore, this embodiment is of course applicable to the DHCPv6 proxy server. Generally, the DHCPv6 proxy server requires a large number of IPv6 addresses, so it will apply for a reserved address segment. , I won't go into details here.
本发明实施例提供的地址分配方法及装置, 该方案通过定义了一 种新的地址预留选项,使节点的发送请求中可携带地址预留选项,在服 务器在接收到携带该选项的请求后,从服务器的地址池中为节点预留出 I Pv6 地址, 在今后该节点发送要求分配预留地址的请求时, 服务器就 将预留的 I Pv6地址分配给该节点。 因此, 只要采取了本发明实施例提 供的方案, 就可以使节点通过提前申请预留出所需的 IPv6地址, 防止 以后出现大量申请造成地址短缺而该节点无法获得 I Pv6地址的情形 , 方便了用户提前做出安排。  The address allocation method and device provided by the embodiment of the present invention, the solution defines a new address reservation option, so that the node can send an address reservation option in the sending request, after the server receives the request carrying the option. The I Pv6 address is reserved for the node from the address pool of the server. When the node sends a request for the allocation of the reserved address in the future, the server allocates the reserved IP address to the node. Therefore, as long as the solution provided by the embodiment of the present invention is adopted, the node can reserve the required IPv6 address by applying in advance, thereby preventing the situation that a large number of applications cause a shortage of addresses and the node cannot obtain the I Pv6 address in the future, which is convenient. The user makes arrangements in advance.
本实施例中地址分配装置的方案可以采用本实施例中地址分配方 法的方案, 不再赘述。  The scheme of the address allocation apparatus in this embodiment may adopt the scheme of the address allocation method in this embodiment, and details are not described herein again.
通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本 发明可借助软件加必需的通用硬件的方式来实现, 当然也可以通过硬件, 但 很多情况下前者是更佳的实施方式。 基于这样的理解, 本发明的技术方案本 质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来, 该 计算机软件产品存储在可读取的存储介质中, 如计算机的软盘, 硬盘或光盘 等, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述的方法。  Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. . Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer. A hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保 护范围应以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto, and any person skilled in the art can easily within the technical scope disclosed by the present invention. All changes or substitutions contemplated are intended to be included within the scope of the invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims

权利 要求 书 Claim
1、 一种地址分配方法, 其特征在于, 包括: An address allocation method, comprising:
接收节点发送的地址预留选项, 所述地址预留选项中包含 IPv6地址 信息;  Receiving an address reservation option sent by the node, where the address reservation option includes IPv6 address information;
在存在所述 IPv6地址信息对应的 IPv6地址时, 将所述 IPv6地址信 息对应的 IPv6地址标记为预留地址, 并记录所述节点与所述预留地址之 间的对应关系;  When the IPv6 address corresponding to the IPv6 address information exists, the IPv6 address corresponding to the IPv6 address information is marked as a reserved address, and the correspondence between the node and the reserved address is recorded;
在接收到的地址分配选项中要求分配的地址为所述预留地址时, 判 断要求分配地址的节点与所述预留地址对应的节点是否相同;  When the address that is required to be allocated in the received address allocation option is the reserved address, it is determined whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
在要求分配地址的节点与所述预留地址对应的节点相同时, 为所述 要求分配地址的节点分配所述预留地址。  When the node that requests the address is the same as the node corresponding to the reserved address, the reserved address is allocated to the node that requests the address.
2、 根据权利要求 1所述的地址分配方法, 其特征在于, 所述方法还 包括:  The address allocation method according to claim 1, wherein the method further comprises:
在不存在所述 IPv6地址信息对应的 IPv6地址时, 向所述节点返回 预留失败消息。  When there is no IPv6 address corresponding to the IPv6 address information, a reservation failure message is returned to the node.
3、 根据权利要求 1所述的地址分配方法, 其特征在于, 所述方法还 包括:  The address allocation method according to claim 1, wherein the method further comprises:
在要求分配地址的节点与所述预留地址对应的节点不相同时, 拒绝 为所述要求分配地址的节点分配所述预留地址。  When the node that requests the allocation of the address is different from the node corresponding to the reserved address, the node that is required to allocate the address is refused to be allocated the reserved address.
4、 根据权利要求 1所述的地址分配方法, 其特征在于:  4. The address allocation method according to claim 1, wherein:
所述 IPv6地址信息包括一个 IPv6地址, 所述 IPv6地址信息对应的 IPv6地址为所述一个 IPv6地址; 或者  The IPv6 address information includes an IPv6 address, and the IPv6 address corresponding to the IPv6 address information is the one IPv6 address; or
所述 IPv6地址信息包括 IPv6地址前缀, 所述 IPv6地址信息对应的 IPv6地址为所述 IPv6地址前缀所表示的全部 IPv6地址; 或者  The IPv6 address information includes an IPv6 address prefix, and the IPv6 address corresponding to the IPv6 address information is all IPv6 addresses represented by the IPv6 address prefix; or
所述 IPv6地址信息包括两个 IPv6地址, 所述 IPv6地址信息对应的 IPv6地址为所述两个 IPv6地址、以及所述两个 IPv6地址之间的全部 IPv6 地址。  The IPv6 address information includes two IPv6 addresses, and the IPv6 address corresponding to the IPv6 address information is the two IPv6 addresses and all IPv6 addresses between the two IPv6 addresses.
5、 根据权利要求 1所述的地址分配方法, 其特征在于, 所述地址预 留选项中还包括身份集合标识符。  The address allocation method according to claim 1, wherein the address reservation option further includes an identity set identifier.
6、 根据权利要求 1所述的地址分配方法, 其特征在于, 所述地址预 留选项中还包括预留期限;  The address allocation method according to claim 1, wherein the address reservation option further includes a reservation period;
所述判断要求分配地址的节点与所述预留地址对应的节点是否相同 为: 在所述预留期限内, 判断要求分配地址的节点与所述预留地址对应 的节点是否相同; Determining whether the node corresponding to the assigned address is the same as the node corresponding to the reserved address And: determining, during the reservation period, whether the node that requires the address allocation is the same as the node corresponding to the reserved address;
所述方法还包括: 在所述预留期限以外, 取消所述 IPv6地址信息对 应的 IPv6地址为预留地址的标记, 并删除所述节点与所述预留地址之间 的对应关系。  The method further includes: deleting the IPv6 address corresponding to the IPv6 address information as a reserved address mark, and deleting the correspondence between the node and the reserved address.
7、 根据权利要求 6所述的地址分配方法, 其特征在于, 还包括: 接收所述节点发送的更新报文, 该更新报文中包含所述地址预留选 项;  The address allocation method according to claim 6, further comprising: receiving an update message sent by the node, where the update message includes the address reservation option;
才艮据所述更新4艮文对所述地址预留选项中包含的 IPv6地址信息对应 的预留期限进行更新。  The reservation period corresponding to the IPv6 address information included in the address reservation option is updated according to the update.
8、 根据权利要求 1至 7中任意一项所述的地址分配方法, 其特征在 于, 所述记录所述节点与所述预留地址之间的对应关系为: 记录所述节 点的介质访问控制地址与所述预留地址之间的对应关系、 或者记录所述 节点的介质访问控制地址和身份集合标识符组合的形式与所述预留地址 之间的对应关系。  The address allocation method according to any one of claims 1 to 7, wherein the recording of the correspondence between the node and the reserved address is: recording media access control of the node Correspondence between the address and the reserved address, or a correspondence between the form of the combination of the medium access control address and the identity set identifier of the node and the reserved address.
9、 根据权利要求 1至 7中任意一项所述的地址分配方法, 其特征在 于, 在支持快速分配的情况下, 所述地址预留选项携带在要求报文中, 所述要求报文中还携带有快速应答选项;  The address allocation method according to any one of claims 1 to 7, wherein, in the case of supporting fast allocation, the address reservation option is carried in a request message, where the request message is included. Also carries a quick answer option;
所述接收节点发送的地址预留选项包括: 接收节点发送所述携带有 地址预留选项的要求报文, 所述要求报文用于请求服务器为所述节点分 配 IPv6地址。  The address reservation option sent by the receiving node includes: the receiving node sends the request packet carrying the address reservation option, where the request message is used to request the server to allocate an IPv6 address for the node.
10、 根据权利要求 1 至 7 中任意一项所述的地址分配方法, 其特征 在于, 在所述接收节点发送的地址预留选项之前, 所述方法还包括: 接收到节点发送的要求报文, 所述要求报文用于请求服务器为所述 节点分配 IPv6地址;  The address allocation method according to any one of claims 1 to 7, wherein before the address reservation option sent by the receiving node, the method further comprises: receiving a request message sent by the node The request message is used to request the server to allocate an IPv6 address to the node;
网内可用的 DHCPV6服务器向所述节点返回通告报文, 所述通告报文 用于通知所述节点可以为所述节点分配 IPv6地址, 并使所述节点依据所 述通告报文选择 DHCPV6服务器;  The DHCPv6 server that is available in the network returns an advertisement message to the node, where the advertisement message is used to notify the node that an IPv6 address can be allocated to the node, and the node selects a DHCPV6 server according to the advertisement message;
所述接收节点发送的地址预留选项为: 接收节点发送的请求报文, 所述地址预留选项携带在所述请求报文中。  The address reservation option sent by the receiving node is: receiving a request message sent by the node, where the address reservation option is carried in the request message.
11、 根据权利要求 1 至 7 中任意一项所述的地址分配方法, 其特征 在于, 所述节点为 DHCPv6客户端或者 DHCPv6代理服务器。 The address allocation method according to any one of claims 1 to 7, wherein the node is a DHCPv6 client or a DHCPv6 proxy server.
12、 一种地址分配装置, 其特征在于, 包括: 12. An address allocation apparatus, comprising:
第一接收单元, 用于接收节点发送的地址预留选项, 所述地址预留 选项中包含 IPv6地址信息;  a first receiving unit, configured to receive an address reservation option sent by the node, where the address reservation option includes IPv6 address information;
第一处理单元, 用于在存在所述 IPv6地址信息对应的 IPv6地址时, 将所述 IPv6地址信息对应的 IPv6地址标记为预留地址, 并记录所述节 点与所述预留地址之间的对应关系;  a first processing unit, configured to mark, according to the IPv6 address corresponding to the IPv6 address information, an IPv6 address corresponding to the IPv6 address information as a reserved address, and record between the node and the reserved address Correspondence relationship
第一判断单元, 用于在接收到的地址分配选项中要求分配的地址为 所述预留地址时, 判断要求分配地址的节点与所述预留地址对应的节点 是否相同;  a first determining unit, configured to determine, when the address that is required to be allocated in the received address allocation option is the reserved address, whether the node corresponding to the reserved address is the same as the node corresponding to the reserved address;
分配单元 , 用于在要求分配地址的节点与所述预留地址对应的节点 相同时, 为所述要求分配地址的节点分配所述预留地址。  And an allocating unit, configured to allocate the reserved address to the node that requests the address when the node that needs to allocate the address is the same as the node corresponding to the reserved address.
13、 根据权利要求 12所述的地址分配装置, 其特征在于,  13. The address distribution device according to claim 12, wherein:
第一回复单元, 用于在不存在所述 IPv6地址信息对应的 IPv6地址 时, 向所述节点返回预留失败消息。  The first replying unit is configured to return a reservation failure message to the node when the IPv6 address corresponding to the IPv6 address information does not exist.
14、 根据权利要求 12所述的地址分配装置, 其特征在于,  14. The address distribution device according to claim 12, wherein:
所述分配单元还用于在要求分配地址的节点与所述预留地址对应的 节点不相同时, 拒绝为所述要求分配地址的节点分配所述预留地址。  The allocating unit is further configured to refuse to allocate the reserved address to the node that requests the address allocation when the node that requires the address allocation is different from the node corresponding to the reserved address.
15、 根据权利要求 12所述的地址分配装置, 其特征在于:  15. The address distribution apparatus according to claim 12, wherein:
所述 IPv6地址信息包括一个 IPv6地址, 所述 IPv6地址信息对应的 IPv6地址为所述一个 IPv6地址; 或者  The IPv6 address information includes an IPv6 address, and the IPv6 address corresponding to the IPv6 address information is the one IPv6 address; or
所述 IPv6地址信息包括 IPv6地址前缀, 所述 IPv6地址信息对应的 IPv6地址为所述 IPv6地址前缀所表示的全部 IPv6地址; 或者  The IPv6 address information includes an IPv6 address prefix, and the IPv6 address corresponding to the IPv6 address information is all IPv6 addresses represented by the IPv6 address prefix; or
所述 IPv6地址信息包括两个 IPv6地址, 所述 IPv6地址信息对应的 IPv6地址为所述两个 IPv6地址、以及所述两个 IPv6地址之间的全部 IPv6 地址。  The IPv6 address information includes two IPv6 addresses, and the IPv6 address corresponding to the IPv6 address information is the two IPv6 addresses and all IPv6 addresses between the two IPv6 addresses.
16、 居权利要求 12所述的地址分配装置, 其特征在于, 所述地址 预留选项中还包括预留期限;  The address allocation device of claim 12, wherein the address reservation option further includes a reservation period;
所述第一判断单元用于在所述预留期限内, 判断要求分配地址的节 点与所述预留地址对应的节点是否相同;  The first determining unit is configured to determine, during the reservation period, whether the node corresponding to the allocated address is the same as the node corresponding to the reserved address;
所述地址分配装置还包括: 第二处理单元, 用于在所述预留期限届 满后, 取消所述 IPv6地址信息对应的 IPv6地址为预留地址的标记, 并 删除所述节点与所述预留地址之间的对应关系。 The address allocation apparatus further includes: a second processing unit, configured to: after the expiration of the reservation period, cancel the IPv6 address corresponding to the IPv6 address information as a mark of the reserved address, and delete the node and the pre- The correspondence between the addresses is left.
17、 根据权利要求 16所述的地址分配装置, 其特征在于, 还包括: 更新单元, 用于接收所述节点发送的更新报文, 该更新报文中包含 所述地址预留选项, 并根据所述更新报文对所述地址预留选项中包含的 IPv6地址信息对应的预留期限进行更新。 The address distribution apparatus according to claim 16, further comprising: an update unit, configured to receive an update message sent by the node, where the update message includes the address reservation option, and according to The update message updates a reservation period corresponding to the IPv6 address information included in the address reservation option.
18、 根据权利要求 12至 17 中任意一项所述的地址分配装置, 其特 征在于, 所述地址预留选项携带在要求报文中, 所述要求报文中还携带 有快速应答选项;  The address allocation device according to any one of claims 12 to 17, wherein the address reservation option is carried in a request message, and the request message further carries a quick response option;
所述第一接收单元用于接收节点发送所述携带有地址预留选项的要 求报文。  The first receiving unit is configured to receive, by the receiving node, the request message carrying the address reservation option.
19、 根据权利要求 12至 17 中任意一项所述的地址分配装置, 其特 征在于, 所述装置还包括:  The address distribution device according to any one of claims 12 to 17, wherein the device further comprises:
第二接收单元, 用于接收到节点发送的要求报文, 所述要求报文用 于请求为所述节点分配 IPv6地址;  a second receiving unit, configured to receive a request message sent by the node, where the request message is used to request to allocate an IPv6 address to the node;
通告单元, 用于向节点返回通告报文, 所述通告报文用于通知所述 节点可以为所述节点分配 IPv6地址;  An advertising unit, configured to return an advertisement message to the node, where the advertisement message is used to notify the node that an IPv6 address can be allocated to the node;
所述第一接收单元用于接收节点发送的请求报文, 所述地址预留选项 携带在所述请求报文中。  The first receiving unit is configured to receive a request message sent by the node, where the address reservation option is carried in the request message.
PCT/CN2011/072686 2011-04-12 2011-04-12 Method and appratus for address allocation WO2012139283A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201180000242.5A CN102835094B (en) 2011-04-12 2011-04-12 Address distribution method and device
PCT/CN2011/072686 WO2012139283A1 (en) 2011-04-12 2011-04-12 Method and appratus for address allocation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/072686 WO2012139283A1 (en) 2011-04-12 2011-04-12 Method and appratus for address allocation

Publications (1)

Publication Number Publication Date
WO2012139283A1 true WO2012139283A1 (en) 2012-10-18

Family

ID=47008787

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/072686 WO2012139283A1 (en) 2011-04-12 2011-04-12 Method and appratus for address allocation

Country Status (2)

Country Link
CN (1) CN102835094B (en)
WO (1) WO2012139283A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10938775B2 (en) * 2016-05-04 2021-03-02 Siemens Aktiengesellschaft Configuration data distribution unit and method for configuring communication devices in an industrial automation system
CN112887186A (en) * 2019-11-29 2021-06-01 中兴通讯股份有限公司 Multi-plane network access method, device and computer storage medium
CN115189913A (en) * 2020-12-18 2022-10-14 支付宝(杭州)信息技术有限公司 Data message transmission method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001086908A1 (en) * 2000-05-10 2001-11-15 Nokia Corporation Method for an automatic allocation of ip addresses
JP2004129126A (en) * 2002-10-07 2004-04-22 Oki Electric Ind Co Ltd Address assignment system
CN1794737A (en) * 2004-12-20 2006-06-28 阿尔卡特公司 Device for dynamically allocating variable length prefixes to network equipments of an ip-network.
CN101277261A (en) * 2007-03-30 2008-10-01 富士施乐株式会社 Identifier assigning device, identifier assigning system and information processing method
WO2010000923A1 (en) * 2008-07-03 2010-01-07 Nokia Corporation Network address assignment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986665B (en) * 2010-11-04 2013-06-26 中国电信股份有限公司 Internet protocol version 6 (IPV6) address allocating method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001086908A1 (en) * 2000-05-10 2001-11-15 Nokia Corporation Method for an automatic allocation of ip addresses
JP2004129126A (en) * 2002-10-07 2004-04-22 Oki Electric Ind Co Ltd Address assignment system
CN1794737A (en) * 2004-12-20 2006-06-28 阿尔卡特公司 Device for dynamically allocating variable length prefixes to network equipments of an ip-network.
CN101277261A (en) * 2007-03-30 2008-10-01 富士施乐株式会社 Identifier assigning device, identifier assigning system and information processing method
WO2010000923A1 (en) * 2008-07-03 2010-01-07 Nokia Corporation Network address assignment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10938775B2 (en) * 2016-05-04 2021-03-02 Siemens Aktiengesellschaft Configuration data distribution unit and method for configuring communication devices in an industrial automation system
CN112887186A (en) * 2019-11-29 2021-06-01 中兴通讯股份有限公司 Multi-plane network access method, device and computer storage medium
CN112887186B (en) * 2019-11-29 2024-03-22 中兴通讯股份有限公司 Multi-plane network access method, device and computer storage medium
CN115189913A (en) * 2020-12-18 2022-10-14 支付宝(杭州)信息技术有限公司 Data message transmission method and device
CN115189913B (en) * 2020-12-18 2024-01-05 支付宝(杭州)信息技术有限公司 Data message transmission method and device

Also Published As

Publication number Publication date
CN102835094B (en) 2015-07-29
CN102835094A (en) 2012-12-19

Similar Documents

Publication Publication Date Title
JP5663549B2 (en) Method, apparatus and system for assigning public IP addresses
US10075412B2 (en) Client aware DHCP lease managment
EP2442521B1 (en) Method for obtaining ip address of dynamic host configuration protocol version 6 server, dynamic host configuration protocol version 6 server and dynamic host configuration protocol version 6 communication system
US10218671B2 (en) Dynamic media access control address allocation and leasing for wireless network
KR20050060045A (en) A fast handover method in dhcpv4, handover apparatus thereof and recording medium thereof
WO2011072540A1 (en) Ip address assignment method and gateway
WO2009089780A1 (en) Method for establishing data connection in mobile network, mobile network and policy control entity
WO2014086167A1 (en) Mobile terminal and address allocation method and system thereof
CN111935335A (en) DHCP address allocation method and device
WO2012174914A1 (en) Method and device for controlling address configuration manner
CN103384282A (en) Method for obtaining IPV6ND address and broadband remote access server (BARS)
CN115460175B (en) IPv6 address generation method and device, electronic equipment and storage medium
JP4852110B2 (en) IPv6 address acquisition apparatus, method, and system
WO2012139283A1 (en) Method and appratus for address allocation
CN106878479B (en) Address allocation method and device
KR20100029241A (en) Method and apparatus for verification of dynamic host configuration protocol (dhcp) release message
WO2016177185A1 (en) Method and apparatus for processing media access control (mac) address
EP2238735B1 (en) Method and apparatus for allocation of parameter values in a communications system
CN107770070B (en) Information transmission method, equipment and system
JP2005210554A (en) Dhcp substitute server
JP5415354B2 (en) Server apparatus, communication control method, and communication control program
CN107888460B (en) Method and device for accessing client to network
Park et al. Fast address configuration for WLAN
Johnson et al. RFC 6656: Description of Cisco Systems' Subnet Allocation Option for DHCPv4
Johnson et al. Description of Cisco Systems' Subnet Allocation Option for DHCPv4

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180000242.5

Country of ref document: CN

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

Ref document number: 11863273

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11863273

Country of ref document: EP

Kind code of ref document: A1