WO2019037664A1 - 地址分配 - Google Patents
地址分配 Download PDFInfo
- Publication number
- WO2019037664A1 WO2019037664A1 PCT/CN2018/101100 CN2018101100W WO2019037664A1 WO 2019037664 A1 WO2019037664 A1 WO 2019037664A1 CN 2018101100 W CN2018101100 W CN 2018101100W WO 2019037664 A1 WO2019037664 A1 WO 2019037664A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- address
- dhcp
- response
- message
- address request
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5061—Pools of addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5076—Update or notification mechanisms, e.g. DynDNS
Definitions
- the DHCP client communicates with the DHCP server through the DHCP relay to obtain an IP address from the DHCP server. For example, when receiving the address request message sent by the DHCP client, the DHCP relay adds the primary IP address of the DHCP relay to the address request message and forwards it to the DHCP server.
- the DHCP server selects an unused IP address from the address pool corresponding to the primary IP address, and notifies the DHCP client of the IP address through the DHCP relay, thereby successfully assigning an IP address to the DHCP client.
- FIG. 1 is a schematic diagram of an application scenario in an embodiment of the present disclosure
- FIG. 2 is a flowchart of an address allocation method in an embodiment of the present disclosure
- FIG. 3 is a structural diagram of an address distribution apparatus in an embodiment of the present disclosure.
- FIG. 4 is a hardware structure diagram of a DHCP relay in an embodiment of the present disclosure.
- first, second, third, etc. may be used to describe various information in the embodiments of the present disclosure, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
- first information may also be referred to as second information without departing from the scope of the present disclosure.
- second information may also be referred to as first information.
- word “if” may be interpreted to mean “at time” or "when” or "in response to determination.”
- the DHCP server may not be able to assign an IP address to the DHCP client, resulting in the DHCP client not being available. use.
- FIG. 1 a schematic diagram of an application scenario of a DHCP client and a DHCP server are in different physical network segments, and a DHCP client can communicate with a DHCP server through a DHCP relay, thereby obtaining from a DHCP server. IP address.
- the DHCP client can be a terminal device
- the DHCP relay can be a BRAS (Broadband Remote Access Server) device
- the DHCP client and the DHCP relay can be connected through an Ethernet, the DHCP client.
- the terminal can access the DHCP relay through IPOE (IP Protocol over Ethernet).
- IPOE IP Protocol over Ethernet
- the DHCP relay can be configured with multiple IP addresses.
- the number of IP addresses can be selected according to experience, such as two or more IP addresses. There is no limit to the number of IP addresses.
- the IP address configured by the DHCP relay may include 3.3.3.1, 4.4.4.1, 5.5.5.1, and 6.6.6.1.
- Each IP address corresponds to an address pool of the DHCP server.
- the IP address 3.3.3.1 corresponds to the address of the DHCP server.
- the IP address 4.4.4.1 corresponds to the address pool B of the DHCP server
- the IP address 5.5.5.1 corresponds to the address pool C of the DHCP server
- the IP address 6.6.6.1 corresponds to the address pool D of the DHCP server.
- the DHCP server may include multiple address pools.
- the number of address pools is selected according to experience.
- the number of address pools is the same as the number of IP addresses configured by the DHCP relay.
- the DHCP server includes address pool A, address pool B, address pool C, and address pool D.
- Address pool A corresponds to IP address 3.3.3.1, and address pool A has an address range of (3.3.3.0 to 3.3.18.160).
- 3.3.3.1 is the disabled IP address.
- Address pool B corresponds to the IP address 4.4.4.1, and the address range of address pool B is (4.4.4.0 to 4.4.19.160). 4.4.4.1 in this address range is the disabled IP address.
- Address pool C corresponds to the IP address 5.5.5.1, and the address range of address pool C is (5.5.5.0 to 5.5.20.160). 5.5.5.1 in this address range is the disabled IP address.
- the address pool D corresponds to the IP address 6.6.6.1, and the address range of the address pool D is (6.6.6.0 to 6.6.21160), and 6.6.6.1 in the address range is the disabled IP address.
- the DHCP relay can select the primary IP address from multiple IP addresses and select the remaining IP address as the alternate IP address.
- the DHCP relay can select the IP address 3.3.3.1 as the primary IP address, the remaining IP address 4.4.4.1, the IP address 5.5.5.1, and the IP address 6.6.6.1, and the DHCP relay is selected as the alternate IP address.
- FIG. 2 it is a flowchart of an address allocation method according to an embodiment of the present disclosure.
- the method may be applied to a DHCP relay.
- the method may include the following steps:
- Step 201 After receiving the first DHCP discovery packet sent by the DHCP client, generate a first address request message by using the primary IP address, and send the first address request message to the DHCP server.
- the process of generating a first address request message by using a primary IP address may include: after receiving the first DHCP discovery message, the DHCP relay adds the primary IP address to the first DHCP.
- the discovery packet for example, is added to the giaddr (DHCP relay IP address) field of the first DHCP discovery packet, so that the DHCP discovery packet carrying the primary IP address is obtained, and the obtained DHCP discovery packet is referred to as the first address.
- Request a message.
- the first DHCP discovery message may be a broadcast type DHCP-DISCOVER message, and the first address request message may also be a DHCP-DISCOVER message.
- a DHCP client when a DHCP client requests an IP address, it can send a DHCP discovery packet.
- the DHCP relay can query whether the source MAC address of the DHCP discovery packet is recorded in the temporary entry. That is, the MAC address of the DHCP client). If there is no record, the DHCP discovery packet is the first DHCP discovery packet sent by the DHCP client. The first DHCP discovery packet sent by the DHCP client is called the first DHCP discovery packet. If it is already recorded, the DHCP discovery packet is a non-first DHCP discovery packet sent by the DHCP client. The non-first DHCP discovery packet sent by the DHCP client is called the second DHCP discovery packet.
- step 201 is executed, that is, the first address request packet is generated by using the primary IP address. If the second DHCP discovery packet is received, the process is as follows.
- the DHCP relay may also record the source MAC address of the first DHCP Discovery message (that is, the MAC address of the DHCP client) in the temporary entry, indicating that the source MAC address is currently being used.
- the DHCP client corresponding to the address applies for the IP address.
- the source MAC address is deleted from the temporary entry until the DHCP client successfully obtains an IP address or confirms that the DHCP client cannot apply for an IP address.
- the DHCP relay can query the primary IP address, such as the IP address 3.3.3.1, from the DHCP relay, and add the primary IP address to the first DHCP discovery packet. If the primary IP address is added to the giaddr field of the first DHCP discovery packet, the first address request packet is obtained, and the giaddr field is used to indicate the IP address of the DHCP relay that the first DHCP discovery packet passes. Then, the DHCP relay sends the first address request message to the DHCP server.
- the primary IP address such as the IP address 3.3.3.1
- the IP address of the DHCP server (for example, 64.64.64.2) can be configured on the DHCP relay, and the DHCP relay can use the IP address to send the first address request packet to the DHCP server.
- the DHCP server can parse the primary IP address (such as the IP address 3.3.3.1) from the first address request message, and query the IP address from the DHCP server. Address pool A corresponding to address 3.3.3.1. Then, the DHCP server can determine whether there is an unused IP address in the address pool A; if it exists, select an IP address from the unused IP addresses, mark the IP address as used, and assign the IP address to DHCP client; if it does not exist, that is, all IP addresses in the address range of address pool A (3.3.3.0 to 3.3.18.160) are used, the DHCP server cannot assign an IP address to the DHCP client based on address pool A.
- the primary IP address such as the IP address 3.3.3.1
- the DHCP server can also send a response packet (such as a DHCP RELAY packet) to the DHCP relay agent for the first address request message, and the response packet can be carried.
- a response packet such as a DHCP RELAY packet
- the IP address assigned by the DHCP server to the DHCP client.
- the DHCP relay can forward the response packet to the DHCP client, thereby assigning an IP address to the DHCP client, and the DHCP client uses the IP address to access the network.
- the DHCP server does not send a response packet to the DHCP relay for the first address request message, and the DHCP relay does not receive the response.
- the response packet of the address request message is executed in the subsequent step 202.
- Step 202 If the response packet for the first address request message is not received, generate a second address request message by using all the alternate IP addresses, and send the second address request message to the DHCP server.
- the process of “receiving a response message for the first address request message” includes:
- the DHCP timer can be set for the first address request message. When the timer expires, if the response packet for the first address request message is not received, it can be determined that the response packet for the first address request message is not received. If the response packet to the first address request packet is received, the timer may be deleted, and the response packet for the first address request message is sent to the DHCP client.
- the DHCP relay agent may receive the second DHCP discovery message sent by the DHCP client (that is, the non-first DHCP discovery message sent by the DHCP client). It is determined that the response message for the first address request message is not received.
- the DHCP client can send the DHCP discovery packet again.
- the DHCP relay agent queries whether the source MAC address of the DHCP Discovery message is recorded in the temporary entry. If it is already recorded, the DHCP discovery packet is the second DHCP discovery packet. Therefore, the DHCP relay determines that the response packet for the first address request packet is not received within the preset time.
- the DHCP relay can adopt the following manner.
- these methods are only examples, and no limitation is imposed thereon.
- the DHCP relay agent generates a second address request packet for each of the standby IP addresses, and the second address request packet generated by the standby IP address carries the alternate IP address.
- the DHCP relay can generate the second address request message 1 for the IP address 4.4.4.1, and the second address request Packet 1 carries the IP address 4.4.4.1; the DHCP relay can generate the second address request message 2 for the IP address 5.5.5.1, the second address request message 2 carries the IP address 5.5.5.1; the DHCP relay can be the IP address. 6.6.6.1 Generates a second address request message 3, and the second address request message 3 carries an IP address 6.6.6.1.
- the DHCP relay can add the IP address 4.4.4.1 to the DHCP discovery message (for the above method one,
- the first DHCP discovery packet, in the second mode, refers to the giaddr field of the second DHCP discovery packet, obtains the second address request message 1, and sends the second address request message 1 to the DHCP server.
- the DHCP relay can add the IP address 5.5.5.1 to the giaddr field of the DHCP discovery message, obtain the second address request message 2, and send the second address request message 2 to the DHCP server.
- the DHCP relay can add the IP address 6.6.6.1 to the giaddr field of the DHCP discovery message to obtain the second address request message 3, and send the second address request message 3 to the DHCP server.
- the DHCP server After receiving the second address request message 1, the DHCP server parses the IP address 4.4.4.1 from the second address request message 1, and queries the DHCP server for the address pool B corresponding to the IP address 4.4.4.1. Determine whether there is an unused IP address in address pool B; if it exists, select an IP address from the unused IP address, mark the IP address as used, and assign the IP address to the DHCP client; if it does not exist That is, all IP addresses in the address range of address pool B (4.4.4.0 to 4.4.19.160) are used, and the DHCP server cannot allocate an IP address to the DHCP client based on address pool B.
- the DHCP server can send a response packet (such as a DHCP RELAY packet) to the DHCP relay agent for the second address request message 1.
- the response message is called response message 1.
- the response message 1 can carry the IP address assigned by the DHCP server to the DHCP client.
- the DHCP relay can forward the response packet 1 to the DHCP client to allocate an IP address to the DHCP client. If the DHCP server cannot allocate an IP address to the DHCP client based on the address pool B, the DHCP server does not send a response packet for the second address request message 1 to the DHCP relay.
- the DHCP server sends a response message 1 to the DHCP relay as an example for description.
- the processing flow is similar to the processing process of the second address request message 1, and is not repeated here.
- the DHCP server sends a response message 2 for the second address request message 2 and a response message 3 for the second address request message 3 to the DHCP relay as an example.
- the response message 1 can also carry the IP address 4.4.4.1
- the response message 2 can also carry the IP address 5.5.5.1
- the response message 3 can also carry the IP address 6.6.6.1.
- the DHCP relay generates a second address request message for all the alternate IP addresses, and the second address request message carries all the alternate IP addresses.
- the alternate IP address can include the IP address 4.4.4.1, the IP address 5.5.5.1, and the IP address 6.6.6.1
- the DHCP relay can be the IP address 4.4.4.1, the IP address 5.5.5.1, and the IP address 6.6.6.1.
- a second address request message is generated, and the second address request message carries the IP address 4.4.4.1, the IP address 5.5.5.1, and the IP address 6.6.6.1.
- the DHCP relay can have IP address 4.4.4.1, IP address 5.5.5.1, and IP address 6.6.6.1.
- the second address request message 4 is obtained (hereinafter referred to as the second address request message 4), and the second address request message 4 is sent to the DHCP server.
- the DHCP server can parse the IP address 4.4.4.1, the IP address 5.5.5.1, and the IP address 6.6.6.1 from the second address request message 4. Then, the DHCP server can query the address pool B corresponding to the IP address 4.4.4.1, the address pool C corresponding to the IP address 5.5.5.1, and the address pool C corresponding to the IP address 6.6.6.1.
- the DHCP server determines whether there is an unused IP address in the address pool B; if it exists, selects an IP address from the unused IP address, and the IP address The address is marked as used and the IP address is assigned to the DHCP client; if it does not exist, ie all IP addresses in the address range of address pool B (4.4.4.0 to 4.4.19.160) are used, the DHCP server It is not possible to assign an IP address to a DHCP client based on address pool B.
- the DHCP server may also send a response message (such as a DHCP RELAY message) to the DHCP relay agent for the second address request message 4, in order to The response message is called response message 1.
- the response message 1 carries the IP address assigned by the DHCP server based on the address pool B and the IP address 4.4.4.1.
- the DHCP relay can forward the response packet 1 to the DHCP client to allocate an IP address to the DHCP client. If the DHCP server cannot assign an IP address to the DHCP client based on the address pool B, the DHCP server does not respond.
- the DHCP server sends a response message 1 to the DHCP relay as an example for description.
- the processing flow of the IP address 5.5.5.1 and the IP address 6.6.6.1 in the second address request message 4 is similar to the processing flow of the IP address 4.4.4.1, and is not repeated here.
- the DHCP server sends a response message 2 and a response message 3 to the DHCP relay as an example.
- response message 2 the IP address assigned by the DHCP server based on the address pool C and the IP address 5.5.5.1 are carried, and in the response message 3, the IP address assigned by the DHCP server based on the address pool D and the IP address 6.6.6.1 are carried.
- Step 203 If the response packet for the second address request message is received, the received response message is sent to the DHCP client, where the response message may carry the IP address assigned by the DHCP server to the DHCP client. In this way, you can successfully assign an IP address to the DHCP client.
- the DHCP relay can send the response message to the DHCP client.
- the DHCP relay may send all the received response messages to the DHCP client, or in the DHCP.
- a response message can be selected from multiple response messages, and the selected response message is sent to the DHCP client.
- the DHCP relay can send the response packet 1, the response packet 2, and the response packet 3 to the DHCP client, and the DHCP client.
- the terminal selects a response message (such as response message 1) from the response message 1, the response message 2, and the response message 3, and uses the IP address carried in the selected response message.
- the DHCP relay may select a response message (such as response message 1) from the response message 1, the response message 2, and the response message 3, and send the selected response message 1 to the DHCP client.
- the DHCP client uses the IP address in response message 1.
- the process of selecting a response message from a plurality of response messages by the DHCP relay may include, but is not limited to, the following method: the DHCP relay selects a DHCP relay from multiple response messages. The first response message; or, the DHCP relay randomly selects one response message from multiple response messages.
- the above selection method is only an example, and there is no limitation on the selection method.
- the primary IP address can be updated to the standby IP address, and the alternate IP address carried in the response packet is updated to the new primary IP address. address. If the DHCP relay sends only one response packet to the DHCP client, the standby IP address carried in the response packet is updated to the new primary IP address; if the DHCP relay sends multiple response reports to the DHCP client. For example, the DHCP relay arbitrarily selects a response packet from the plurality of response packets, and updates the alternate IP address carried in the selected response packet to the new primary IP address.
- the IP address 3.3.3.1 (that is, the current primary IP address) can be updated to the standby IP address, and the IP carried in the response message 1 can be carried.
- Address 4.4.4.1 is updated to the new primary IP address. That is, the primary IP address is the IP address 4.4.4.1, and the alternate IP address includes the IP address 3.3.3.1, the IP address 5.5.5.1, and the IP address 6.6.6.1.
- the DHCP server cannot allocate an IP address to the DHCP client based on the address pool B, the address pool C, and the address pool D.
- a response packet for the second address request message is sent to the DHCP relay. If the DHCP relay does not receive the response packet for the second address request message, the DHCP relay determines that there is no available IP address in all the address pools of the DHCP server, and the DHCP client cannot be assigned an IP address.
- the DHCP relay when the address pool corresponding to the primary IP address has no unused IP address, the DHCP relay sends an address request message carrying the alternate IP address to the DHCP server, so that the DHCP server is backed up.
- the IP address corresponding to the IP address is used to select an unused IP address, so that the DHCP client can be assigned an IP address to avoid the DHCP client being unavailable.
- the DHCP relay can send all the alternate IP addresses to the DHCP server, so that the DHCP server can simultaneously select an unused IP address from the address pool corresponding to all the alternate IP addresses, and the IP address.
- the address is assigned to the DHCP client, which speeds up the address allocation.
- the embodiment of the present disclosure further provides an address allocation apparatus, which is applied to a DHCP relay, where the DHCP relay includes a primary IP address and at least one standby IP address, as shown in FIG. 3,
- a structure diagram of the address allocation device, the address distribution device may include:
- the generating module 301 is configured to generate a first address request message by using the primary IP address after receiving the first DHCP discovery packet sent by the DHCP client.
- the sending module 302 is configured to send the generated first address request message to the DHCP server.
- the generating module 301 is further configured to generate a second address request message by using all the alternate IP addresses when the response message for the first address request message is not received;
- the sending module 302 is further configured to: send the generated second address request message to the DHCP server; if the response message for the second address request message is received, send the received response message to the DHCP client.
- the response packet carries an IP address assigned by the DHCP server to the DHCP client.
- the generating module 301 is configured to generate a second address request message for each of the standby IP addresses in the process of generating the second address request message by using all the alternate IP addresses. And the second address request message generated by the standby IP address carries the alternate IP address; or, a second address request message is generated for all the alternate IP addresses, and the second address request message carries all the alternate IP addresses. .
- the sending module 302 is configured to: when receiving the response message for the second address request message, send the received response message to the DHCP client, if the second packet is received A plurality of response messages of the address request message are selected from the plurality of response messages, and the selected response message is sent to the DHCP client.
- the sending module 302 is further configured to: in the process of selecting a response message from the multiple response messages, select, from the multiple response messages, the first response received by the DHCP relay Message.
- the address allocation apparatus further includes (not shown in FIG. 3): a processing module, configured to: after the sending module sends the response message to the DHCP client, the primary IP address Update to the alternate IP address; update the alternate IP address carried in the response message to the new primary IP address.
- the DHCP relay provided in the embodiment of the present disclosure may be as shown in FIG. 4 for a hardware architecture diagram. Includes: a machine readable storage medium and a processor, wherein:
- Machine-readable storage medium Stores an address assignment instruction code.
- Processor Communicates with a machine readable storage medium, reads and executes the instruction code stored in a machine readable storage medium, and implements the address assignment operations disclosed by the above examples of the present disclosure.
- a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth.
- the machine-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid state drive, any type of storage disk. (such as a disc, dvd, etc.), or a similar storage medium, or a combination thereof.
- the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
- a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, and a game control.
- embodiments of the present disclosure can be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware aspects. Moreover, embodiments of the present disclosure may take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- these computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the instruction means implements the functions specified in one or more blocks of the flowchart or in a flow or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
根据本公开的一个实施例,地址分配包括:在接收到DHCP客户端发送的第一DHCP发现报文后,利用主用IP地址生成第一地址请求报文,并将生成的第一地址请求报文发送给DHCP服务器;若未接收到针对第一地址请求报文的响应报文,则利用所有备用IP地址生成第二地址请求报文,并将生成的第二地址请求报文发送给DHCP服务器;若接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,该响应报文携带DHCP服务器为DHCP客户端分配的IP地址。
Description
相关申请的交叉引用
本公开基于并要求2017年8月24日递交的中国专利申请201710734506.9的优先权,其所有内容通过引用包含于此。
当DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)客户端和DHCP服务器处于不同物理网段时,DHCP客户端通过DHCP中继与DHCP服务器通信,从而从DHCP服务器获取到IP地址。例如,DHCP中继收到DHCP客户端发送的地址请求报文时,将DHCP中继的主用IP地址添加到该地址请求报文中并转发给DHCP服务器。DHCP服务器从主用IP地址对应的地址池中选择未使用的IP地址,并通过DHCP中继将该IP地址通知给DHCP客户端,从而成功为DHCP客户端分配IP地址。
为了更加清楚地说明本公开实施例或者现有技术中的技术方案,下面将对本公开实施例或者现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据本公开实施例的这些附图获得其他的附图。
图1是本公开一种实施方式中的应用场景示意图;
图2是本公开一种实施方式中的地址分配方法的流程图;
图3是本公开一种实施方式中的地址分配装置的结构图;
图4是本公开一种实施方式中的DHCP中继的硬件结构图。
在本公开实施例使用的术语仅仅是出于描述特定实施例的目的,而非限制本公开。本公开说明书和权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其它含义。还应当理解,本文中使用的术语“和/或”是指包含一个或多个相关联的列出项目 的任何或所有可能组合。
应当理解,尽管在本公开实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,此外,所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
在为DHCP客户端分配IP地址的过程中,当与主用IP地址对应的地址池中没有未使用的IP地址时,则DHCP服务器可能无法为DHCP客户端分配IP地址,从而导致DHCP客户端不可用。
本公开实施例中提出一种地址分配方法,该方法可以应用于包括DHCP客户端、DHCP中继和DHCP服务器的系统中。参见图1所示,为本公开实施例的应用场景示意图,DHCP客户端和DHCP服务器处于不同的物理网段,且DHCP客户端可以通过DHCP中继与DHCP服务器进行通信,从而从DHCP服务器获取到IP地址。在一个示例中,DHCP客户端可以为终端设备,DHCP中继可以为BRAS(Broadband Remote Access Server,宽带远程接入服务器)设备,DHCP客户端与DHCP中继之间可以通过以太网相连,DHCP客户端可以通过IPOE(IP Protocol over Ethernet,以太网上承载IP协议)方式接入DHCP中继。
在一个例子中,DHCP中继可以配置多个IP地址,IP地址的数量可以根据经验选择,如两个或者两个以上的IP地址,对此IP地址的数量不做限制。
例如,DHCP中继配置的IP地址可以包括3.3.3.1、4.4.4.1、5.5.5.1和6.6.6.1,每个IP地址对应DHCP服务器的一个地址池,如IP地址3.3.3.1对应DHCP服务器的地址池A,IP地址4.4.4.1对应DHCP服务器的地址池B,IP地址5.5.5.1对应DHCP服务器的地址池C,IP地址6.6.6.1对应DHCP服务器的地址池D。
在一个例子中,DHCP服务器可以包括多个地址池,地址池的数量根据经验选择,如地址池的数量与DHCP中继配置的IP地址的数量相同,对此不做限制。如DHCP服务器包括地址池A、地址池B、地址池C、地址池D,地址池A对应IP地址3.3.3.1,地址池A的地址范围是(3.3.3.0至3.3.18.160),该地址范围中的3.3.3.1是禁用IP地址。地址池B对应IP地址4.4.4.1,地址池B的 地址范围是(4.4.4.0至4.4.19.160),该地址范围中的4.4.4.1是禁用IP地址。地址池C对应IP地址5.5.5.1,地址池C的地址范围是(5.5.5.0至5.5.20.160),该地址范围中的5.5.5.1是禁用IP地址。地址池D对应IP地址6.6.6.1,地址池D的地址范围是(6.6.6.0至6.6.21.160),该地址范围中的6.6.6.1是禁用IP地址。
在一个例子中,针对DHCP中继包括的多个IP地址,可以有一个IP地址为主用IP地址,而剩余的IP地址可以为备用IP地址。基于此,DHCP中继可以从多个IP地址中选取出主用IP地址,并将剩余的IP地址选择为备用IP地址。
例如,DHCP中继可以将IP地址3.3.3.1选取为主用IP地址,剩余的IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1,被DHCP中继选择为备用IP地址。
在上述应用场景下,参见图2所示,为本公开实施例中提出的地址分配方法的流程图,该方法可以应用于DHCP中继,该方法可以包括以下步骤:
步骤201,在接收到DHCP客户端发送的第一DHCP发现报文后,利用主用IP地址生成第一地址请求报文,并将第一地址请求报文发送给DHCP服务器。
在一个例子中,针对“利用主用IP地址生成第一地址请求报文”的过程,可以包括:DHCP中继在接收到第一DHCP发现报文后,将主用IP地址添加到第一DHCP发现报文,如添加到第一DHCP发现报文的giaddr(DHCP中继IP地址)字段,从而得到携带主用IP地址的DHCP发现报文,将得到的该DHCP发现报文称为第一地址请求报文。其中,第一DHCP发现报文可以是广播类型的DHCP-DISCOVER报文,第一地址请求报文也可以是DHCP-DISCOVER报文。
例如,当DHCP客户端申请IP地址时,可以发送DHCP发现报文,DHCP中继在接收到该DHCP发现报文后,可以查询临时表项中是否记录了该DHCP发现报文的源MAC地址(即DHCP客户端的MAC地址)。若没有记录,则说明该DHCP发现报文是DHCP客户端发送的首个DHCP发现报文,本文将DHCP客户端发送的首个DHCP发现报文称为第一DHCP发现报文。若已经记录,则说明该DHCP发现报文是DHCP客户端发送的非首个DHCP发现报文,本文将DHCP客户端发送的非首个DHCP发现报文称为第二DHCP发现报文。
若接收到第一DHCP发现报文,则执行步骤201,即利用主用IP地址生成第一地址请求报文。若接收到第二DHCP发现报文,其流程参见后续步骤。
其中,DHCP中继在接收到第一DHCP发现报文后,还可以在临时表项中记录第一DHCP发现报文的源MAC地址(即DHCP客户端的MAC地址),表示当前正在为这个源MAC地址对应的DHCP客户端申请IP地址,一直到成功为该DHCP客户端申请到IP地址或者确认为无法为该DHCP客户端申请到IP地址,才从临时表项中删除这个源MAC地址。
其中,DHCP中继在接收到第一DHCP发现报文后,可以从DHCP中继查询出主用IP地址,如IP地址3.3.3.1,并将主用IP地址添加到第一DHCP发现报文,如将主用IP地址添加到第一DHCP发现报文的giaddr字段,从而得到第一地址请求报文,所述giaddr字段用于表示第一DHCP发现报文经过的DHCP中继的IP地址。然后,DHCP中继将第一地址请求报文发送给DHCP服务器。
其中,可以在DHCP中继上配置DHCP服务器的IP地址(如64.64.64.2),且DHCP中继可以利用该IP地址,将第一地址请求报文发送给DHCP服务器。
在一个例子中,DHCP服务器在接收到第一地址请求报文后,可以从第一地址请求报文中解析出主用IP地址(如IP地址3.3.3.1),并从DHCP服务器查询出与IP地址3.3.3.1对应的地址池A。然后,DHCP服务器可以判断地址池A中是否存在未使用的IP地址;如果存在,则从未使用的IP地址中选择一个IP地址,将该IP地址标记为已使用,并将该IP地址分配给DHCP客户端;如果不存在,即地址池A的地址范围(3.3.3.0至3.3.18.160)中的所有IP地址均为已使用,则DHCP服务器无法基于地址池A为DHCP客户端分配IP地址。
若DHCP服务器将某个IP地址分配给DHCP客户端,则DHCP服务器还可以向DHCP中继发送针对第一地址请求报文的响应报文(如DHCP RELAY报文),且该响应报文可以携带DHCP服务器为DHCP客户端分配的IP地址。DHCP中继在接收到该响应报文后,可以将该响应报文转发给DHCP客户端,从而为DHCP客户端分配IP地址,且DHCP客户端使用该IP地址访问网络。
若DHCP服务器无法基于地址池A为DHCP客户端分配IP地址,则DHCP服务器不会向DHCP中继发送针对第一地址请求报文的响应报文,而且,DHCP中继也不会接收到针对第一地址请求报文的响应报文,执行后续步骤202。
步骤202,若未接收到针对第一地址请求报文的响应报文,则利用所有备用IP地址生成第二地址请求报文,并将第二地址请求报文发送给DHCP服 务器。
其中,针对“未接收到针对第一地址请求报文的响应报文”的过程,包括:
方式一、DHCP中继向DHCP服务器发送第一地址请求报文后,可以为该第一地址请求报文设置定时器。在定时器超时时,若没有接收到针对第一地址请求报文的响应报文,就可以确定未接收到针对第一地址请求报文的响应报文。在定时器超时之前,若接收到针对第一地址请求报文的响应报文,则可以删除定时器,并将针对第一地址请求报文的响应报文发送给DHCP客户端。
方式二、DHCP中继向DHCP服务器发送第一地址请求报文后,若接收到DHCP客户端发送的第二DHCP发现报文(即DHCP客户端发送的非首个DHCP发现报文),则可以确定未接收到针对第一地址请求报文的响应报文。
例如,DHCP客户端发送DHCP发现报文后,若在预设时间内没有接收到针对该DHCP发现报文的响应报文,可以再次发送DHCP发现报文。DHCP中继在接收到DHCP发现报文后,查询临时表项中是否记录了该DHCP发现报文的源MAC地址。若已经记录,则说明DHCP发现报文是第二DHCP发现报文,因此,DHCP中继确定预设时间内未接收到针对第一地址请求报文的响应报文。
在一个例子中,针对“利用所有备用IP地址生成第二地址请求报文”的过程,DHCP中继可以采用如下方式,当然这些方式只是示例,对此不做限制。
方式1、DHCP中继为所有备用IP地址中的每个备用IP地址生成一个第二地址请求报文,且为备用IP地址生成的第二地址请求报文中携带该备用IP地址。
例如,由于备用IP地址包括IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1,因此,DHCP中继可以为IP地址4.4.4.1生成第二地址请求报文1,第二地址请求报文1携带IP地址4.4.4.1;DHCP中继可以为IP地址5.5.5.1生成第二地址请求报文2,第二地址请求报文2携带IP地址5.5.5.1;DHCP中继可以为IP地址6.6.6.1生成第二地址请求报文3,第二地址请求报文3携带IP地址6.6.6.1。
例如,由于备用IP地址为IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1, 因此,DHCP中继可以将IP地址4.4.4.1添加到DHCP发现报文(针对上述方式一,是指第一DHCP发现报文,针对上述方式二,是指第二DHCP发现报文)的giaddr字段,得到第二地址请求报文1,并将所述第二地址请求报文1发送给DHCP服务器。DHCP中继可以将IP地址5.5.5.1添加到DHCP发现报文的giaddr字段,得到第二地址请求报文2,并将所述第二地址请求报文2发送给DHCP服务器。DHCP中继可以将IP地址6.6.6.1添加到DHCP发现报文的giaddr字段,得到第二地址请求报文3,并将所述第二地址请求报文3发送给DHCP服务器。
DHCP服务器在接收到第二地址请求报文1后,从第二地址请求报文1中解析出IP地址4.4.4.1,并从DHCP服务器查询出与IP地址4.4.4.1对应的地址池B。判断地址池B中是否存在未使用的IP地址;如果存在,从未使用的IP地址中选择一个IP地址,将该IP地址标记为已使用,将该IP地址分配给DHCP客户端;如果不存在,即地址池B的地址范围(4.4.4.0至4.4.19.160)中的所有IP地址均为已使用,DHCP服务器无法基于地址池B为DHCP客户端分配IP地址。
若DHCP服务器将某个IP地址分配给DHCP客户端,则DHCP服务器可以向DHCP中继发送针对第二地址请求报文1的响应报文(如DHCP RELAY报文),为了区分方便,可以将该响应报文称为响应报文1,该响应报文1可以携带DHCP服务器为DHCP客户端分配的IP地址。DHCP中继在接收到响应报文1后,可以将响应报文1转发给DHCP客户端,从而为DHCP客户端分配IP地址。若DHCP服务器无法基于地址池B为DHCP客户端分配IP地址,则DHCP服务器不会向DHCP中继发送针对第二地址请求报文1的响应报文。为了方便描述,后续以DHCP服务器向DHCP中继发送响应报文1为例进行说明。
在一个例子中,DHCP服务器在接收到第二地址请求报文2和第二地址请求报文3后,其处理流程与第二地址请求报文1的处理流程类似,在此不再重复赘述,在后续过程中,以DHCP服务器向DHCP中继发送针对第二地址请求报文2的响应报文2和针对第二地址请求报文3的响应报文3为例进行说明。
在一个例子中,上述响应报文1中还可以携带IP地址4.4.4.1,上述响应报文2中还可以携带IP地址5.5.5.1,上述响应报文3中还可以携带IP地址6.6.6.1。
方式2、DHCP中继为所有备用IP地址生成一个第二地址请求报文,且该 第二地址请求报文携带所有备用IP地址。例如,由于备用IP地址可以包括IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1,因此,DHCP中继可以为IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1生成一个第二地址请求报文,且该第二地址请求报文中可以携带IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1。
例如,由于备用IP地址为IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1,因此,DHCP中继可以将IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1均添加到DHCP发现报文的giaddr字段,得到第二地址请求报文(后续将其称为第二地址请求报文4),并将所述第二地址请求报文4发送给DHCP服务器。
在一个例子中,DHCP服务器在接收到第二地址请求报文4后,可以从第二地址请求报文4中解析出IP地址4.4.4.1、IP地址5.5.5.1和IP地址6.6.6.1。然后,DHCP服务器可以从本DHCP服务器查询出与IP地址4.4.4.1对应的地址池B、与IP地址5.5.5.1对应的地址池C、与IP地址6.6.6.1对应的地址池C。
针对第二地址请求报文4中的IP地址4.4.4.1,DHCP服务器判断地址池B中是否存在未使用的IP地址;如果存在,则从未使用的IP地址中选择一个IP地址,将该IP地址标记为已使用,并将该IP地址分配给DHCP客户端;如果不存在,即地址池B的地址范围(4.4.4.0至4.4.19.160)中的所有IP地址均为已使用,则DHCP服务器无法基于地址池B为DHCP客户端分配IP地址。
若DHCP服务器将地址池B中的某个IP地址分配给DHCP客户端,则DHCP服务器还可以向DHCP中继发送针对第二地址请求报文4的响应报文(如DHCP RELAY报文),为了区分方便,可以将该响应报文称为响应报文1,该响应报文1携带DHCP服务器基于地址池B分配的IP地址以及IP地址4.4.4.1。DHCP中继在接收到响应报文1后,可以将该响应报文1转发给DHCP客户端,从而为DHCP客户端分配IP地址。若DHCP服务器无法基于地址池B为DHCP客户端分配IP地址,则DHCP服务器不进行响应。为了方便描述,后续以DHCP服务器向DHCP中继发送响应报文1为例进行说明。
在一个例子中,针对第二地址请求报文4中的IP地址5.5.5.1和IP地址6.6.6.1的处理流程,与IP地址4.4.4.1的处理流程类似,在此不再重复赘述,在后续过程中,以DHCP服务器向DHCP中继发送响应报文2和响应报文3为例进行说明。在响应报文2中,携带DHCP服务器基于地址池C分配的IP地址以及IP地址5.5.5.1,在响应报文3中,携带DHCP服务器基于地址池D分配的 IP地址以及IP地址6.6.6.1。
步骤203,若接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,其中,该响应报文可以携带DHCP服务器为DHCP客户端分配的IP地址,这样,就可以成功为DHCP客户端分配IP地址。
在一个例子中,若DHCP中继只接收到针对第二地址请求报文的一个响应报文,则DHCP中继可以将该响应报文发送给DHCP客户端。在另一个例子中,若DHCP中继接收到针对第二地址请求报文的多个响应报文,则DHCP中继可以将接收到的所有响应报文均发送给DHCP客户端,或者,DHCP中继可以从多个响应报文中选择一个响应报文,并将选择的响应报文发送给DHCP客户端。
例如,DHCP中继在接收到响应报文1、响应报文2和响应报文3后,可以将响应报文1、响应报文2和响应报文3均发送给DHCP客户端,由DHCP客户端从响应报文1、响应报文2和响应报文3中选择一个响应报文(如响应报文1),并使用选择的响应报文中携带的IP地址。或者,DHCP中继可以从响应报文1、响应报文2和响应报文3中选择一个响应报文(如响应报文1),并将选择的响应报文1发送给DHCP客户端,由DHCP客户端使用响应报文1中的IP地址。
在一个例子中,针对“DHCP中继从多个响应报文中选择一个响应报文”的过程,可以包括但不限于如下方式:DHCP中继从多个响应报文中选择DHCP中继接收到的第一个响应报文;或者,DHCP中继随机从多个响应报文中选择一个响应报文。当然,上述选择方式只是一个示例,对此选择方式不做限制。
在一个例子中,DHCP中继将响应报文发送给DHCP客户端之后,还可以将主用IP地址更新为备用IP地址,并将该响应报文携带的备用IP地址更新为新的主用IP地址。其中,若DHCP中继只向DHCP客户端发送一个响应报文,则将该响应报文携带的备用IP地址更新为新的主用IP地址;若DHCP中继向DHCP客户端发送多个响应报文,则DHCP中继从多个响应报文中任意选择一个响应报文,将选择的响应报文携带的备用IP地址更新为新的主用IP地址。
例如,假设DHCP中继是将响应报文1发送给DHCP客户端,则可以将IP地址3.3.3.1(即当前的主用IP地址)更新为备用IP地址,并将响应报文1携带的IP地址4.4.4.1更新为新的主用IP地址。也就是说,主用IP地址为IP地址 4.4.4.1,备用IP地址包括IP地址3.3.3.1、IP地址5.5.5.1和IP地址6.6.6.1。
在一个例子中,若地址池B、地址池C和地址池D不存在未使用的IP地址,则DHCP服务器无法基于地址池B、地址池C和地址池D为DHCP客户端分配IP地址,不会向DHCP中继发送针对第二地址请求报文的响应报文。若DHCP中继没有接收到针对第二地址请求报文的响应报文,则DHCP中继确定DHCP服务器的所有地址池均没有可用的IP地址,DHCP客户端无法分配到IP地址。
基于上述技术方案,本公开实施例中,当主用IP地址对应的地址池没有未使用的IP地址时,DHCP中继将携带备用IP地址的地址请求报文发送给DHCP服务器,使得DHCP服务器从备用IP地址对应的地址池中选择未使用的IP地址,从而成功为DHCP客户端分配IP地址,避免DHCP客户端不可用问题。而且,当存在多个备用IP地址时,DHCP中继可以将所有备用IP地址发送给DHCP服务器,使得DHCP服务器可以同时从所有备用IP地址对应的地址池中选择未使用的IP地址,并将IP地址分配给DHCP客户端,从而加快地址分配速度。
基于与上述方法同样的构思,本公开实施例还提出一种地址分配装置,应用于DHCP中继,所述DHCP中继包括主用IP地址和至少一个备用IP地址,参见图3所示,为该地址分配装置的结构图,该地址分配装置可以包括:
生成模块301,用于在接收到DHCP客户端发送的第一DHCP发现报文后,利用所述主用IP地址生成第一地址请求报文;
发送模块302,用于将生成的第一地址请求报文发送给DHCP服务器;
所述生成模块301,还用于当未接收到针对所述第一地址请求报文的响应报文时,利用所有备用IP地址生成第二地址请求报文;
所述发送模块302,还用于将生成的第二地址请求报文发送给DHCP服务器;若接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,该响应报文携带DHCP服务器为DHCP客户端分配的IP地址。
在一个例子中,所述生成模块301,用于在利用所有备用IP地址生成第二地址请求报文的过程中,为所有备用IP地址中的每个备用IP地址生成一个第二地址请求报文,且为备用IP地址生成的第二地址请求报文中携带该备用 IP地址;或者,为所有备用IP地址生成一个第二地址请求报文,且该第二地址请求报文携带所有备用IP地址。
在一个例子中,所述发送模块302,用于若接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端的过程中,若接收到针对第二地址请求报文的多个响应报文,则从所述多个响应报文中选择一个响应报文,并将选择的响应报文发送给DHCP客户端。
所述发送模块302,还用于在从所述多个响应报文中选择一个响应报文的过程中,从所述多个响应报文中选择所述DHCP中继接收到的第一个响应报文。
在一个例子中,所述地址分配装置还包括(在图3中未示出):处理模块,用于在所述发送模块将响应报文发送给DHCP客户端后,将所述主用IP地址更新为备用IP地址;将所述响应报文携带的备用IP地址更新为新的主用IP地址。
本公开实施例中提供的DHCP中继,从硬件层面而言,其硬件架构示意图具体可以参见图4所示。包括:机器可读存储介质和处理器,其中:
机器可读存储介质:存储地址分配指令代码。
处理器:与机器可读存储介质通信,读取和执行机器可读存储介质中存储的所述指令代码,实现本公开上述示例公开的地址分配操作。
这里,机器可读存储介质可以是任何电子、磁性、光学或其它物理存储装置,可以包含或存储信息,如可执行指令、数据,等等。例如,机器可读存储介质可以是:RAM(Radom Access Memory,随机存取存储器)、易失存储器、非易失性存储器、闪存、存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、dvd等),或者类似的存储介质,或者它们的组合。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本公开时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可以由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其它可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其它可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
而且,这些计算机程序指令也可以存储在能引导计算机或其它可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或者多个流程和/或方框图一个方框或者多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其它可编程数据处理设备上,使得在计算机或者其它可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其它可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述仅为本公开的实施例而已,并不用于限制本公开。对于本领域技术人员来说,本公开可以有各种更改和变化。凡在本公开的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本公开的权利要求范围之内。
Claims (15)
- 一种地址分配方法,应用于DHCP中继,所述DHCP中继包括主用IP地址和至少一个备用IP地址,所述方法包括:在接收到DHCP客户端发送的第一DHCP发现报文后,利用所述主用IP地址生成第一地址请求报文,并将生成的第一地址请求报文发送给DHCP服务器;若未接收到针对第一地址请求报文的响应报文,则利用所有备用IP地址生成第二地址请求报文,并将生成的第二地址请求报文发送给DHCP服务器;若接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,该响应报文携带DHCP服务器为DHCP客户端分配的IP地址。
- 根据权利要求1所述的方法,所述利用所有备用IP地址生成第二地址请求报文的过程,包括:为所有备用IP地址中的每个备用IP地址生成一个第二地址请求报文,且为备用IP地址生成的第二地址请求报文中携带该备用IP地址;或者,为所有备用IP地址生成一个第二地址请求报文,且该第二地址请求报文携带所有备用IP地址。
- 根据权利要求1所述的方法,所述接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,包括:若接收到针对第二地址请求报文的多个响应报文,则从所述多个响应报文中选择一个响应报文,并将选择的响应报文发送给DHCP客户端。
- 根据权利要求3所述的方法,所述从所述多个响应报文中选择一个响应报文的过程,包括:从所述多个响应报文中选择所述DHCP中继接收到的第一个响应报文。
- 根据权利要求3所述的方法,将响应报文发送给DHCP客户端之后,所述方法还包括:将所述主用IP地址更新为备用IP地址;若仅接收到针对第二地址请求报文的一个响应报文,则将接收到的该响应报文携带的备用IP地址更新为新的主用IP地址;若接收到针对第二地址请求报文的多个响应报文,则将所述选择的响应报文携带的备用IP地址更新为新的主用IP地址。
- 一种DHCP中继,具有主用IP地址和至少一个备用IP地址并且包括:处理器;以及存储有地址分配指令代码的机器可读存储介质,其中,所述地址分配指令代码在被读取并执行时,使得所述处理器:在接收到DHCP客户端发送的第一DHCP发现报文后,利用所述主用IP地址生成第一地址请求报文,并将生成的第一地址请求报文发送给DHCP服务器;若未接收到针对第一地址请求报文的响应报文,则利用所有备用IP地址生成第二地址请求报文,并将生成的第二地址请求报文发送给DHCP服务器;若接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,该响应报文携带DHCP服务器为DHCP客户端分配的IP地址。
- 根据权利要求6所述的DHCP中继,为了利用所有备用IP地址生成第二地址请求报文,使得所述处理器:为所有备用IP地址中的每个备用IP地址生成一个第二地址请求报文,且为备用IP地址生成的第二地址请求报文中携带该备用IP地址;或者,为所有备用IP地址生成一个第二地址请求报文,且该第二地址请求报文携带所有备用IP地址。
- 根据权利要求6所述的DHCP中继,为了接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,使得所述处理器:若接收到针对第二地址请求报文的多个响应报文,则从所述多个响应报文中选择一个响应报文,并将选择的响应报文发送给DHCP客户端。
- 根据权利要求8所述的DHCP中继,为了从所述多个响应报文中选择一个响应报文,使得所述处理器:从所述多个响应报文中选择所述DHCP中继接收到的第一个响应报文。
- 根据权利要求8所述的DHCP中继,将响应报文发送给DHCP客户端之后,还使得所述处理器:将所述主用IP地址更新为备用IP地址;若仅接收到针对第二地址请求报文的一个响应报文,则将接收到的该响 应报文携带的备用IP地址更新为新的主用IP地址;若接收到针对第二地址请求报文的多个响应报文,则将所述选择的响应报文携带的备用IP地址更新为新的主用IP地址。
- 一种机器可读存储介质,包括在被具有主用IP地址和至少一个备用IP地址的DHCP中继执行时使所述DHCP中继执行如下操作的指令:在接收到DHCP客户端发送的第一DHCP发现报文后,利用所述主用IP地址生成第一地址请求报文,并将生成的第一地址请求报文发送给DHCP服务器;若未接收到针对第一地址请求报文的响应报文,则利用所有备用IP地址生成第二地址请求报文,并将生成的第二地址请求报文发送给DHCP服务器;若接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,该响应报文携带DHCP服务器为DHCP客户端分配的IP地址。
- 根据权利要求11所述的机器可读存储介质,所述利用所有备用IP地址生成第二地址请求报文的过程,包括:为所有备用IP地址中的每个备用IP地址生成一个第二地址请求报文,且为备用IP地址生成的第二地址请求报文中携带该备用IP地址;或者,为所有备用IP地址生成一个第二地址请求报文,且该第二地址请求报文携带所有备用IP地址。
- 根据权利要求11所述的机器可读存储介质,所述接收到针对第二地址请求报文的响应报文,则将接收到的响应报文发送给DHCP客户端,包括:若接收到针对第二地址请求报文的多个响应报文,则从所述多个响应报文中选择一个响应报文,并将选择的响应报文发送给DHCP客户端。
- 根据权利要求13所述的机器可读存储介质,所述从所述多个响应报文中选择一个响应报文的过程,包括:从所述多个响应报文中选择所述DHCP中继接收到的第一个响应报文。
- 根据权利要求13所述机器可读存储介质,将响应报文发送给DHCP客户端之后,所述指令还使所述DHCP中继执行如下操作:将所述主用IP地址更新为备用IP地址;若仅接收到针对第二地址请求报文的一个响应报文,则将接收到的该响应报文携带的备用IP地址更新为新的主用IP地址;若接收到针对第二地址请求报文的多个响应报文,则将所述选择的响应报文携带的备用IP地址更新为新的主用IP地址。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710734506.9A CN108632399A (zh) | 2017-08-24 | 2017-08-24 | 一种地址分配方法和装置 |
| CN201710734506.9 | 2017-08-24 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019037664A1 true WO2019037664A1 (zh) | 2019-02-28 |
Family
ID=63705750
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/101100 Ceased WO2019037664A1 (zh) | 2017-08-24 | 2018-08-17 | 地址分配 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108632399A (zh) |
| WO (1) | WO2019037664A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115550319A (zh) * | 2022-11-24 | 2022-12-30 | 新华三信息技术有限公司 | 一种地址分配方法及装置 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111629083B (zh) * | 2020-06-01 | 2023-06-27 | 瑞斯康达科技发展股份有限公司 | 一种获取ip地址的方法、装置、存储介质和电子装置 |
| CN111935335B (zh) * | 2020-08-14 | 2023-06-09 | 江苏创通电子股份有限公司 | 一种dhcp地址分配方法及装置 |
| CN113411690A (zh) * | 2021-06-01 | 2021-09-17 | 江西山水光电科技股份有限公司 | 一种otn设备上线管理方法 |
| CN116527635A (zh) * | 2023-04-24 | 2023-08-01 | 苏州浪潮智能科技有限公司 | 一种网络设备下dhcp策略中继的方法 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1949784A (zh) * | 2005-10-12 | 2007-04-18 | 华为技术有限公司 | Dhcp中继为dhcp客户端请求ip地址的方法 |
| US20090037603A1 (en) * | 2005-12-29 | 2009-02-05 | France Telecom | Management of sets of addresses |
| CN101626406A (zh) * | 2009-08-20 | 2010-01-13 | 杭州华三通信技术有限公司 | Dhcp地址池配置方法、dhcp地址分配方法和系统及dhcp服务器 |
| CN102413205A (zh) * | 2011-12-23 | 2012-04-11 | 华为技术有限公司 | 一种ip地址分配方法及相关中继设备、服务器和系统 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101442425B (zh) * | 2007-11-22 | 2012-03-21 | 华为技术有限公司 | 网关的管理方法及装置、系统 |
| CN106331202A (zh) * | 2015-06-30 | 2017-01-11 | 中兴通讯股份有限公司 | 动态主机配置协议dhcp服务器管理方法及装置 |
-
2017
- 2017-08-24 CN CN201710734506.9A patent/CN108632399A/zh active Pending
-
2018
- 2018-08-17 WO PCT/CN2018/101100 patent/WO2019037664A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1949784A (zh) * | 2005-10-12 | 2007-04-18 | 华为技术有限公司 | Dhcp中继为dhcp客户端请求ip地址的方法 |
| US20090037603A1 (en) * | 2005-12-29 | 2009-02-05 | France Telecom | Management of sets of addresses |
| CN101626406A (zh) * | 2009-08-20 | 2010-01-13 | 杭州华三通信技术有限公司 | Dhcp地址池配置方法、dhcp地址分配方法和系统及dhcp服务器 |
| CN102413205A (zh) * | 2011-12-23 | 2012-04-11 | 华为技术有限公司 | 一种ip地址分配方法及相关中继设备、服务器和系统 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115550319A (zh) * | 2022-11-24 | 2022-12-30 | 新华三信息技术有限公司 | 一种地址分配方法及装置 |
| CN115550319B (zh) * | 2022-11-24 | 2023-03-28 | 新华三信息技术有限公司 | 一种地址分配方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108632399A (zh) | 2018-10-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019037664A1 (zh) | 地址分配 | |
| US10257282B2 (en) | Lock management method in cluster, lock server, and client | |
| CN109688235B (zh) | 虚拟网络业务处理方法、装置和系统,控制器,存储介质 | |
| JP2017517171A (ja) | 高速ipアドレス割り当てのための方法および装置 | |
| EP3451592B1 (en) | Packet transmission between vxlan domains | |
| WO2017054526A1 (zh) | 一种arp条目生成方法和装置 | |
| CN106453681B (zh) | 一种ip地址的分配方法和装置 | |
| EP3470984A1 (en) | Method, device, and system for managing disk lock | |
| CN106657434A (zh) | 一种ip地址的查看方法和装置 | |
| CN106953943B (zh) | 适用于交换机通信的方法及装置 | |
| WO2017000565A1 (zh) | 一种用户接入的控制方法、装置、中继设备及服务器 | |
| CN116436843A (zh) | 一种bgp邻居建立方法及装置 | |
| CN111683159A (zh) | Ip地址分配方法、设备、系统及存储介质 | |
| CN108600407B (zh) | 一种ip地址分配方法、装置、设备及机器可读存储介质 | |
| US20200162368A1 (en) | Creating an aggregation group | |
| CN106027354A (zh) | Vpn客户端的回流方法及装置 | |
| US20230004298A1 (en) | Data Processing Method and Device | |
| WO2017219777A1 (zh) | 一种报文处理方法及装置 | |
| CN107547684B (zh) | 一种IPv6地址分配方法和装置 | |
| CN104683490A (zh) | 互联网协议地址的回收方法和装置 | |
| CN115633013B (zh) | 一种地址配置方法、装置、设备及机器可读存储介质 | |
| WO2016177185A1 (zh) | 媒体访问控制mac地址的处理方法及装置 | |
| CN107547286B (zh) | 地址解析协议arp表的生成方法及装置 | |
| CN107547382B (zh) | 一种邻居关系发现方法和装置 | |
| CN106453680B (zh) | 一种ip地址的分配方法和装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18848586 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: 18848586 Country of ref document: EP Kind code of ref document: A1 |