[go: up one dir, main page]

CN115499414A - Address allocation method and device - Google Patents

Address allocation method and device Download PDF

Info

Publication number
CN115499414A
CN115499414A CN202210972334.XA CN202210972334A CN115499414A CN 115499414 A CN115499414 A CN 115499414A CN 202210972334 A CN202210972334 A CN 202210972334A CN 115499414 A CN115499414 A CN 115499414A
Authority
CN
China
Prior art keywords
address
network segment
sub
segment
subnet
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.)
Granted
Application number
CN202210972334.XA
Other languages
Chinese (zh)
Other versions
CN115499414B (en
Inventor
李方园
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN202210972334.XA priority Critical patent/CN115499414B/en
Publication of CN115499414A publication Critical patent/CN115499414A/en
Application granted granted Critical
Publication of CN115499414B publication Critical patent/CN115499414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供一种地址分配方法及装置,该方法包括:当接收到第一DHCP客户端发送的第一DHCP Discover报文时,判断本地是否存在第一子网段;若未存在,则判断是否能够从第一网段内划分出第一子网段;若是,则创建第一子网段,并获取第一地址;当确定第一DHCP客户端使用第一地址上线后,向从设备发送第一同步报文,第一同步报文包括第一子网段的网段信息以及第一DHCP客户端的第一表项,以使得从设备判断本地是否存在对应的第一子网段,若存在,则从第一子网段内剔除第一地址,并生成第一表项;若未存在,则根据第一子网段的网段信息,从第二网段内创建第一子网段,从第一子网段内剔除第一地址,并生成第一表项。

Figure 202210972334

The present application provides an address allocation method and device, the method comprising: when receiving the first DHCP Discover message sent by the first DHCP client, judging whether the first subnet segment exists locally; if not, judging whether The first subnet segment can be divided from the first network segment; if so, the first subnet segment is created and the first address is obtained; when it is determined that the first DHCP client uses the first address to go online, the slave device sends the first subnet segment A synchronization message, the first synchronization message includes the network segment information of the first subnet segment and the first entry of the first DHCP client, so that the slave device can determine whether there is a corresponding first subnet segment locally, if it exists, Then remove the first address from the first subnet segment, and generate the first entry; if it does not exist, create the first subnet segment from the second network segment according to the network segment information of the first subnet segment, and create the first subnet segment from the The first address is removed from the first subnet segment, and the first entry is generated.

Figure 202210972334

Description

地址分配方法及装置Address allocation method and device

技术领域technical field

本申请涉及通信技术领域,尤其涉及一种地址分配方法及装置。The present application relates to the technical field of communications, and in particular to an address allocation method and device.

背景技术Background technique

分布式弹性网络互联(英文:Distributed Resilient Network Interconnect,简称:DRNI)是一种跨设备链路聚合技术,其将多台物理设备在聚合层面上虚拟为一台网络设备,实现跨设备链路聚合,从而提供设备级冗余保护和流量负载分担。Distributed Resilient Network Interconnect (English: Distributed Resilient Network Interconnect, referred to as: DRNI) is a cross-device link aggregation technology, which virtualizes multiple physical devices into one network device at the aggregation level to achieve cross-device link aggregation , thus providing device-level redundancy protection and traffic load sharing.

如图1所示,图1为DRNI网络模型示意图。在图1中,网络设备(Device A)与网络设备B互为邻居,网络设备A为主设备,网络设备B为从设备。主从设备形成负载分担,共同对主机发送的业务流量转发。当其中一台网络设备故障时,业务流量可快速由另一台网络设备转发,保证业务流量的正常运行。As shown in Figure 1, Figure 1 is a schematic diagram of the DRNI network model. In FIG. 1 , a network device (Device A) and a network device B are neighbors to each other, network device A is a master device, and network device B is a slave device. The master and slave devices form load sharing and jointly forward the business traffic sent by the master. When one of the network devices fails, the service traffic can be quickly forwarded by the other network device to ensure the normal operation of the service traffic.

动态主机配置协议(英文:Dynamic Host Configuration Protocol,简称:DHCP)采用客户端(Client)/服务器(Server)模式,由服务器为网络设备动态地分配IP地址、默认网关等网络配置参数。Dynamic Host Configuration Protocol (English: Dynamic Host Configuration Protocol, referred to as: DHCP) adopts the client (Client)/server (Server) mode, and the server dynamically assigns network configuration parameters such as IP addresses and default gateways to network devices.

如图2所示,图2为DHCP基本组网示意图。在图2中,当DHCP客户端与多个DHCP服务器处于相同物理网段时,DHCP客户端对外广播发送DHCP发现(Discover)报文。每个DHCP服务器接收到DHCP Discover报文后,根据接收DHCP Discover报文的接口的地址查找相同网段的地址池,并从地址池中选择一个地址分配给该DHCP客户端。每个DHCP服务器向客户端发送DHCP提供(Offer)报文,该DHCP Offer报文包括该DHCP服务器为DHCP客户端分配的地址、默认网关地址、DNS服务器地址等信息。As shown in FIG. 2 , FIG. 2 is a schematic diagram of a basic DHCP network. In FIG. 2, when the DHCP client and multiple DHCP servers are in the same physical network segment, the DHCP client broadcasts and sends a DHCP discovery (Discover) message. After each DHCP server receives the DHCP Discover message, it searches for an address pool on the same network segment according to the address of the interface receiving the DHCP Discover message, and selects an address from the address pool to assign to the DHCP client. Each DHCP server sends a DHCP offer (Offer) message to the client, and the DHCP Offer message includes information such as an address allocated by the DHCP server to the DHCP client, a default gateway address, and a DNS server address.

DHCP客户端可能收到多个DHCP Offer报文后,并对最先接收到的第一DHCP Offer报文进行处理,该第一DHCP Offer报文包括一个DHCP服务器的地址。DHCP客户端广播发送DHCP请求(Request)报文,该DHCP Request报文包括DHCP客户端选择的该DHCP服务端地址。被选择的该DHCP服务端向DHCP客户端发送DHCP确认(Ack)报文,该DHCP Ack报文包括DHCP服务端分配的地址的租期。至此,DHCP客户端与DHCP服务端之间的交互过程完成。After receiving multiple DHCP Offer messages, the DHCP client may process the first received first DHCP Offer message, where the first DHCP Offer message includes an address of a DHCP server. The DHCP client broadcasts and sends a DHCP request (Request) message, and the DHCP Request message includes the DHCP server address selected by the DHCP client. The selected DHCP server sends a DHCP acknowledgment (Ack) message to the DHCP client, and the DHCP Ack message includes the lease period of the address allocated by the DHCP server. So far, the interaction process between the DHCP client and the DHCP server is completed.

DHCP客户端接收到DHCP ACK报文后,检查该DHCP服务端分配的地址是否能够使用。若可以使用,则DHCP客户端成功获取地址并根据地址的租期自动启动续延过程;若不可以使用,则DHCP客户端向该DHCP服务端发送DHCP拒绝(Decline)报文,以通知DHCP服务端禁用该地址。DHCP客户端再次启动新的地址申请过程。After receiving the DHCP ACK message, the DHCP client checks whether the address assigned by the DHCP server can be used. If it can be used, the DHCP client successfully obtains the address and automatically starts the renewal process according to the lease period of the address; if it cannot be used, the DHCP client sends a DHCP rejection (Decline) message to the DHCP server to notify the DHCP service end to disable the address. The DHCP client starts a new address application process again.

由于DHCP是被广泛使用的地址分配、管理技术,而DRNI的使用范围也越来越广,因此,如何在DRNI环境下支持DHCP是当前需要解决的问题。Since DHCP is a widely used address allocation and management technology, and DRNI is also widely used, how to support DHCP in the DRNI environment is a problem that needs to be solved at present.

目前,在DRNI环境下支持DHCP可通过下述方式实现:Currently, DHCP support in the DRNI environment can be implemented in the following ways:

在主从设备内同时配置DHCP服务端,但两台网络设备内地址池的可分配地址段不重叠。例如,网络设备A与网络设备B内均配置地址池test_pool,该地址池的网段是20.0.0.0/24。但,网络设备A能够分配的地址段为20.0.0.1-20.0.0.125,网络设备B能够分配的地址段是20.0.0.126-20.0.0.254。Configure the DHCP server in the master and slave devices at the same time, but the assignable address segments of the address pools in the two network devices do not overlap. For example, address pool test_pool is configured in network device A and network device B, and the network segment of the address pool is 20.0.0.0/24. However, the address segment that network device A can allocate is 20.0.0.1-20.0.0.125, and the address segment that network device B can allocate is 20.0.0.126-20.0.0.254.

每个网络设备接收到DHCP客户端发送的DHCP Discover报文后,可使用自身配置的地址段独立为DHCP客户端分配地址,并在分配地址后,将本地生成的客户端表项同步至对端,保证DHCP客户端可在任一台网络设备上完成续约、下线等操作。After each network device receives the DHCP Discover message sent by the DHCP client, it can use its own configured address segment to independently assign an address to the DHCP client, and after assigning the address, synchronize the locally generated client entry to the peer end , to ensure that the DHCP client can complete operations such as contract renewal and offline on any network device.

但是,在上述实现方式中,主从设备为未实现地址的集中管理、分配。例如,网络设备A内地址段使用完后,即使网络设备B内的地址段中仍存在可用的地址,DHCP客户端也无法从网络设备A处上线成功。However, in the above implementation manners, the master and slave devices do not implement centralized management and allocation of addresses. For example, after the address segment in network device A is used up, even if there are still available addresses in the address segment in network device B, the DHCP client cannot successfully go online from network device A.

发明内容Contents of the invention

有鉴于此,本申请提供了一种地址分配方法及装置,用以解决现有DRNI环境下支持DHCP的实现方式中,主从设备无法实现对地址的集中管理、分配,导致DHCP客户端无法在DRNI环境下任一网络设备处上线的问题。In view of this, the present application provides an address allocation method and device to solve the problem that the master-slave equipment cannot implement centralized management and allocation of addresses in the existing DRNI environment to support DHCP, resulting in the inability of the DHCP client to be in the The problem of going online at any network device in the DRNI environment.

第一方面,本申请提供了一种地址分配方法,所述方法应用于主设备,所述主设备处于DRNI组网内,所述DRNI组网还包括从设备,所述主设备内配置第一地址池,所述第一地址池具有对应的第一网段,所述从设备内配置第二地址池,所述第二地址池具有对应的第二网段,所述方法包括:In the first aspect, the present application provides an address allocation method, the method is applied to a master device, the master device is in the DRNI network, and the DRNI network also includes a slave device, and the master device is configured with a first An address pool, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, and the second address pool has a corresponding second network segment, the method includes:

当接收到第一DHCP客户端发送的第一DHCP Discover报文时,判断本地是否存在可用于分配地址的第一子网段;When receiving the first DHCP Discover message sent by the first DHCP client, determine whether there is a first subnet segment that can be used to assign addresses locally;

若未存在,则判断是否能够从所述第一网段内划分出所述第一子网段;If it does not exist, judging whether the first subnet segment can be divided from the first network segment;

若是,则创建所述第一子网段,并从所述第一子网段内获取第一地址;If so, create the first subnet segment, and obtain the first address from the first subnet segment;

向所述第一DHCP客户端发送第一DHCP Offer报文,所述第一DHCP Offer报文包括所述第一地址;sending a first DHCP Offer message to the first DHCP client, where the first DHCP Offer message includes the first address;

当确定所述第一DHCP客户端使用所述第一地址上线后,向所述从设备发送第一同步报文,所述第一同步报文包括所述第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一地址,以使得从设备判断本地是否存在对应的第一子网段,若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;若未存在,则根据所述第一子网段的网段信息,从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项;After determining that the first DHCP client uses the first address to go online, send a first synchronization message to the slave device, the first synchronization message includes network segment information of the first subnet segment and The first entry of the first DHCP client, the first entry includes the first address, so that the slave device judges whether there is a corresponding first subnet segment locally, and if it exists, from the first subnet Eliminate the first address from the segment, and generate the first entry; if it does not exist, create the first subnet from the second subnet according to the network segment information of the first subnet a network segment, removing the first address from the first subnet segment, and generating the first entry;

其中,所述第一地址池与所述第二地址池相同,所述第一网段与所述第二网段相同。Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.

第二方面,本申请提供了一种地址分配方法,所述方法应用于从设备,所述从设备处于DRNI组网内,所述DRNI组网还包括主设备,所述主设备内配置第一地址池,所述第一地址池具有对应的第一网段,所述从设备内配置第二地址池,所述第二地址池具有对应的第二网段,所述方法包括:In a second aspect, the present application provides an address allocation method, the method is applied to a slave device, the slave device is in the DRNI network, and the DRNI network also includes a master device, and the master device is configured with a first An address pool, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, and the second address pool has a corresponding second network segment, the method includes:

接收所述主设备发送的第一同步报文,所述第一同步报文包括所述主设备在所述第一网段内创建的第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一DHCP客户端的第一地址;Receive a first synchronization message sent by the master device, where the first synchronization message includes the network segment information of the first subnet segment created by the master device in the first network segment and the first DHCP client's a first entry, where the first entry includes the first address of the first DHCP client;

根据所述第一子网段的网段信息,判断本地是否存在对应的第一子网段;According to the network segment information of the first subnet segment, determine whether there is a corresponding first subnet segment locally;

若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;If it exists, removing the first address from the first subnet segment, and generating the first entry;

若未存在,则从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项;If it does not exist, create the first subnet segment from the second network segment, remove the first address from the first subnet segment, and generate the first entry;

其中,所述第一地址池与所述第二地址池相同,所述第一网段与所述第二网段相同。Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.

第三方面,本申请提供了一种地址分配装置,所述装置应用于主设备,所述主设备处于DRNI组网内,所述DRNI组网还包括从设备,所述主设备内配置第一地址池,所述第一地址池具有对应的第一网段,所述从设备内配置第二地址池,所述第二地址池具有对应的第二网段,所述装置包括:In a third aspect, the present application provides an address allocation device, the device is applied to a master device, the master device is in the DRNI network, the DRNI network also includes a slave device, and the master device is configured with a first An address pool, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, the second address pool has a corresponding second network segment, and the device includes:

第一判断单元,用于当接收到第一DHCP客户端发送的第一DHCP Discover报文时,判断本地是否存在可用于分配地址的第一子网段;The first judging unit is configured to judge whether there is a first subnet segment locally available for address allocation when receiving the first DHCP Discover message sent by the first DHCP client;

第二判断单元,用于若未存在,则判断是否能够从所述第一网段内划分出所述第一子网段;A second judging unit, configured to judge whether the first subnet segment can be divided from the first subnet segment if it does not exist;

获取单元,用于若是,则创建所述第一子网段,并从所述第一子网段内获取第一地址;The obtaining unit is configured to, if yes, create the first subnet segment, and obtain the first address from the first subnet segment;

发送单元,用于向所述第一DHCP客户端发送第一DHCP Offer报文,所述第一DHCPOffer报文包括所述第一地址;a sending unit, configured to send a first DHCP Offer message to the first DHCP client, where the first DHCP Offer message includes the first address;

所述发送单元还用于,当确定所述第一DHCP客户端使用所述第一地址上线后,向所述从设备发送第一同步报文,所述第一同步报文包括所述第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一地址,以使得从设备判断本地是否存在对应的第一子网段,若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;若未存在,则根据所述第一子网段的网段信息,从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项;The sending unit is further configured to, when it is determined that the first DHCP client uses the first address to go online, send a first synchronization message to the slave device, the first synchronization message includes the first The network segment information of the subnet segment and the first entry of the first DHCP client, the first entry includes the first address, so that the slave device determines whether there is a corresponding first subnet segment locally, and if so, Then remove the first address from the first subnet segment, and generate the first table entry; if it does not exist, according to the network segment information of the first subnet segment, from the second network segment creating the first subnet segment in the segment, removing the first address from the first subnet segment, and generating the first entry;

其中,所述第一地址池与所述第二地址池相同,所述第一网段与所述第二网段相同。Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.

第四方面,本申请提供了一种地址分配装置,所述装置应用于从设备,所述从设备处于DRNI组网内,所述DRNI组网还包括主设备,所述主设备内配置第一地址池,所述第一地址池具有对应的第一网段,所述从设备内配置第二地址池,所述第二地址池具有对应的第二网段,所述装置包括:In a fourth aspect, the present application provides an address allocation device, the device is applied to a slave device, the slave device is in a DRNI network, and the DRNI network also includes a master device, and the master device is configured with a first An address pool, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, the second address pool has a corresponding second network segment, and the device includes:

接收单元,用于接收所述主设备发送的第一同步报文,所述第一同步报文包括所述主设备在所述第一网段内创建的第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一DHCP客户端的第一地址;a receiving unit, configured to receive a first synchronization message sent by the master device, where the first synchronization message includes network segment information of a first subnet segment created by the master device in the first network segment; A first entry of the first DHCP client, where the first entry includes a first address of the first DHCP client;

第一判断单元,用于根据所述第一子网段的网段信息,判断本地是否存在对应的第一子网段;A first judging unit, configured to judge whether there is a corresponding first subnet segment locally according to the network segment information of the first subnet segment;

剔除单元,用于若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;an elimination unit, configured to, if present, exclude the first address from the first subnet segment, and generate the first entry;

创建单元,用于若未存在,则从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项;A creating unit, configured to create the first subnet segment from the second network segment if it does not exist, remove the first address from the first subnet segment, and generate the first table item;

其中,所述第一地址池与所述第二地址池相同,所述第一网段与所述第二网段相同。Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.

第五方面,本申请提供了一种网络设备,包括处理器和机器可读存储介质,机器可读存储介质存储有能够被处理器执行的机器可执行指令,处理器被机器可执行指令促使执行本申请第一方面所提供的方法。In a fifth aspect, the present application provides a network device, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted to execute by the machine-executable instructions The method provided in the first aspect of the present application.

第六方面,本申请提供了一种网络设备,包括处理器和机器可读存储介质,机器可读存储介质存储有能够被处理器执行的机器可执行指令,处理器被机器可执行指令促使执行本申请第二方面所提供的方法。In a sixth aspect, the present application provides a network device, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted to execute by the machine-executable instructions The method provided by the second aspect of the present application.

因此,通过应用本申请提供的地址分配方法及装置,当主设备接收到第一DHCP客户端发送的第一DHCP Discover报文时,主设备判断本地是否存在可用于分配地址的第一子网段;若未存在,则主设备判断是否能够从第一网段内划分出第一子网段;若是,则主设备创建第一子网段,并从第一子网段内获取第一地址;主设备向第一DHCP客户端发送第一DHCP Offer报文,该第一DHCP Offer报文包括第一地址;当主设备确定第一DHCP客户端使用第一地址上线后,主设备向从设备发送第一同步报文,该第一同步报文包括第一子网段的网段信息以及第一DHCP客户端的第一表项,该第一表项包括第一地址,以使得从设备判断本地是否存在第一地址归属的第一子网段,若存在,则从设备从第一子网段内剔除第一地址,并生成第一表项;若未存在,则从设备根据第一子网段的网段信息,从第二网段内创建第一子网段,从第一子网段内剔除第一地址,并生成第一表项;其中,第一地址池与第二地址池相同,第一网段与第二网段相同。Therefore, by applying the address assignment method and device provided by the present application, when the master device receives the first DHCP Discover message sent by the first DHCP client, the master device judges whether there is a first subnet segment that can be used to assign addresses locally; If it does not exist, the master device judges whether the first subnet segment can be divided from the first network segment; if so, the master device creates the first subnet segment and obtains the first address from the first subnet segment; The device sends the first DHCP Offer message to the first DHCP client, and the first DHCP Offer message includes the first address; when the master device determines that the first DHCP client uses the first address to go online, the master device sends the first DHCP Offer message to the slave device. Synchronization message, the first synchronization message includes the network segment information of the first subnet segment and the first entry of the first DHCP client, the first entry includes the first address, so that the slave device can determine whether there is a second The first subnet segment to which an address belongs, if it exists, the slave device will remove the first address from the first subnet segment and generate the first entry; if it does not exist, the slave device will Segment information, create the first subnet segment from the second network segment, remove the first address from the first subnet segment, and generate the first entry; wherein, the first address pool is the same as the second address pool, and the first The network segment is the same as the second network segment.

如此,主从设备共享相同的总网段,从设备上的子网段由主设备分配,但每个设备独享本地的子网段并为在自身上线的DHCP客户端分配地址,既实现了地址的集中管理,又避免了多设备同时分配地址时的冲突。解决了现有DRNI环境下支持DHCP的实现方式中,主从设备无法实现对地址的集中管理、分配,导致DHCP客户端无法在DRNI环境下任一网络设备处上线的问题。实现了降低网络设备的性能压力,提高DHCP客户端的上线速率。In this way, the master and slave devices share the same total network segment, and the subnet segment on the slave device is allocated by the master device, but each device exclusively enjoys the local subnet segment and assigns addresses to the DHCP clients that go online on itself, which realizes The centralized management of addresses avoids conflicts when multiple devices assign addresses at the same time. It solves the problem that in the existing implementation mode of supporting DHCP in the DRNI environment, the master and slave devices cannot realize the centralized management and allocation of addresses, which leads to the problem that the DHCP client cannot go online at any network device in the DRNI environment. Realized reducing the performance pressure of network equipment and increasing the online rate of DHCP clients.

附图说明Description of drawings

图1为DRNI网络模型示意图;Figure 1 is a schematic diagram of the DRNI network model;

图2为DHCP基本组网示意图;Fig. 2 is a schematic diagram of DHCP basic networking;

图3为本申请实施例提供的一种地址分配方法的流程图;FIG. 3 is a flow chart of an address allocation method provided in an embodiment of the present application;

图4为本申请实施例提供的另一种地址分配方法的流程图;FIG. 4 is a flow chart of another address allocation method provided in the embodiment of the present application;

图5为本申请实施例提供的一种地址分配装置结构图;FIG. 5 is a structural diagram of an address allocation device provided by an embodiment of the present application;

图6为本申请实施例提供的另一种地址分配装置结构图;FIG. 6 is a structural diagram of another address allocation device provided by the embodiment of the present application;

图7为本申请实施例提供的网络设备硬件结构体。FIG. 7 is a hardware structure of a network device provided by an embodiment of the present application.

具体实施方式detailed description

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施例并不代表与本申请相一致的所有实施例。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present application as recited in the appended claims.

在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相对应的列出项目的任何或所有可能组合。The terminology used in this application is for the purpose of describing particular embodiments only, and is not intended to limit the application. As used in this application and the appended claims, the singular forms "a", "the", and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more corresponding listed items.

应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present application, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "at" or "when" or "in response to a determination."

下面对本申请实施例提供的一种地址分配方法进行详细地说明。参见图3,图3为本申请实施例提供的一种地址分配方法的流程图。该方法应用于主设备。本申请实施例提供的地址分配方法可包括如下所示步骤。An address allocation method provided by the embodiment of the present application will be described in detail below. Referring to FIG. 3 , FIG. 3 is a flowchart of an address allocation method provided by an embodiment of the present application. This method is applied to the master device. The address allocation method provided in the embodiment of the present application may include the following steps.

步骤310、当接收到第一DHCP客户端发送的第一DHCP Discover报文时,判断本地是否存在可用于分配地址的第一子网段。Step 310: When receiving the first DHCP Discover message sent by the first DHCP client, determine whether there is a first subnet segment available locally for address allocation.

具体地,如图1所示,DRNI组网内包括主设备、从设备,主从设备与同一个交换设备连接,并通过该交换设备接收主机发送的报文,或者,主从设备通过该交换设备向主机发送报文。主从设备之间已建立IPL链路。主从设备形成负载分担,共同对主机发送的业务流量转发。当其中一台网络设备故障时,业务流量可快速由另一台网络设备转发,保证业务流量的正常运行。Specifically, as shown in Figure 1, the DRNI network includes a master device and a slave device. The master and slave devices are connected to the same switching device and receive messages sent by the host through the switching device, or the master and slave devices pass through the switch The device sends a message to the host. An IPL link has been established between the master and slave devices. The master and slave devices form load sharing and jointly forward the business traffic sent by the master. When one of the network devices fails, the service traffic can be quickly forwarded by the other network device to ensure the normal operation of the service traffic.

在本申请实施例中,主从设备内均已配置相同的地址池,每个地址池可分配的地址段完全相同。主从设备内已配置DHCP服务端功能,均可独立接收DHCP客户端发送的DHCP报文,并为DHCP客户端分配地址。In the embodiment of this application, the same address pool has been configured in the master and slave devices, and the address segments that can be allocated by each address pool are exactly the same. The DHCP server function has been configured in the master and slave devices, which can independently receive the DHCP message sent by the DHCP client and assign addresses to the DHCP client.

进一步地,主设备内配置第一地址池,第一地址池具有对应的第一网段,从设备内配置第二地址池,第二地址池具有对应的第二网段。其中,第一地址池与第二地址池相同,第一网段与第二网段相同。例如,第一网段、第二网段均为20.0.0.0/16。Further, a first address pool is configured in the master device, and the first address pool has a corresponding first network segment, and a second address pool is configured in the slave device, and the second address pool has a corresponding second network segment. Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment. For example, both the first network segment and the second network segment are 20.0.0.0/16.

当主设备接收到第一DHCP客户端发送的第一DHCP Discover报文时,主设备判断本地是否存在可用于分配地址的第一子网段。若本地未存在第一子网段,则主设备执行步骤320。When the main device receives the first DHCP Discover message sent by the first DHCP client, the main device judges whether there is a first subnet segment that can be used for address allocation locally. If the first subnet segment does not exist locally, the master device executes step 320 .

在本申请实施例中,第一网段可被划分为多个子网段,例如,20.0.1.0/24、20.0.2.0/24、20.0.3.0/24等等。作为一种实现方式,主设备内当前可用于分配地址的第一子网段未存在,也即是,当前已存在的子网段内,未存在剩余地址,即未分配地址数量为0,剩余的网段还未被划分;或者,第一网段未被划分。In the embodiment of the present application, the first network segment may be divided into multiple subnet segments, for example, 20.0.1.0/24, 20.0.2.0/24, 20.0.3.0/24 and so on. As an implementation method, the first subnet segment currently available for address allocation in the master device does not exist, that is, there are no remaining addresses in the currently existing subnet segment, that is, the number of unallocated addresses is 0, and the remaining The network segment of has not been divided; or, the first network segment has not been divided.

步骤320、若未存在,则判断是否能够从所述第一网段内划分出所述第一子网段。Step 320, if not, judge whether the first sub-network segment can be divided from the first network segment.

具体地,根据步骤310的判断,若未存在第一子网段,则主设备继续判断是否能够从第一网段内划分出第一子网段。若第一网段内能够划分出第一子网段,则主设备执行步骤330;若第一网段内未能够划分出第一子网段,则主设备生成并向第一DHCP客户端发送第一通知报文,以提示第一DHCP客户端分配地址失败。Specifically, according to the determination in step 310, if the first subnet segment does not exist, the master device continues to determine whether the first subnet segment can be divided from the first network segment. If the first subnet segment can be divided in the first network segment, the master device executes step 330; if the first subnet segment cannot be divided in the first network segment, the master device generates and sends the first subnet segment to the first DHCP client. The first notification message is used to prompt the first DHCP client that the address allocation fails.

其中,第一网段内未能够划分出第一子网段,也即是,第一网段内已无剩余网段进行划分。Wherein, the first sub-network segment cannot be divided into the first network segment, that is, there is no remaining network segment in the first network segment to be divided.

步骤330、若是,则创建所述第一子网段,并从所述第一子网段内获取第一地址。Step 330, if yes, create the first subnet segment, and obtain the first address from the first subnet segment.

具体地,根据步骤330的判断,若第一网段内能够划分出第一子网段,则主设备创建一个子网段,即第一子网段,并从第一子网段内获取第一地址。该第一地地址。Specifically, according to the judgment in step 330, if the first subnet segment can be divided into the first network segment, the master device creates a subnet segment, that is, the first subnet segment, and obtains the first subnet segment from the first subnet segment. an address. the address of the first place.

需要说明的是,尽管主设备从可用子网段中为DHCP客户端分配地址,但为客户端分配的掩码还是第一网段的掩码(即,前面的例子中为16),而不是子网段的掩码(即,前面的例子中为24)。It should be noted that although the master device assigns addresses to DHCP clients from available subnets, the mask assigned to clients is still the mask of the first network segment (that is, 16 in the previous example), not The mask of the subnet segment (ie, 24 in the previous example).

主设备可参考现有为DHCP客户端分配地址的过程,从第一子网段内获取第一地址,在此不再复述。The main device can refer to the existing process of assigning addresses to DHCP clients, and obtain the first address from the first subnet segment, which will not be repeated here.

步骤340、向所述第一DHCP客户端发送第一DHCP Offer报文,所述第一DHCP Offer报文包括所述第一地址。Step 340: Send a first DHCP Offer message to the first DHCP client, where the first DHCP Offer message includes the first address.

具体地,根据步骤330的描述,主设备为第一DHCP客户端分配地址后,其依照现有DHCP规定,生成第一DHCP Offer报文,该第一DHCP Offer报文包括yiaddr字段以及siaddr字段。yiaddr字段承载第一地址,siaddr字段承载主设备地址。Specifically, according to the description of step 330, after the master device assigns an address to the first DHCP client, it generates a first DHCP Offer message according to existing DHCP regulations, and the first DHCP Offer message includes a yiaddr field and a siaddr field. The yiaddr field carries the first address, and the siaddr field carries the master device address.

主设备向第一DHCP客户端发送第一DHCP Offer报文。第一DHCP客户端接收到第一DHCP Offer报文后,从中获取第一地址以及主设备地址,确定主设备为自身分配第一地址。The master device sends the first DHCP Offer message to the first DHCP client. After receiving the first DHCP Offer message, the first DHCP client obtains the first address and the address of the master device therefrom, and determines that the master device assigns the first address to itself.

可以理解的是,按照现有DHCP规定,主设备为第一DHCP客户端分配第一地址后,还将已分配的第一地址与第一DHCP客户端对应记录。It can be understood that, according to existing DHCP regulations, after assigning the first address to the first DHCP client, the main device also records the assigned first address corresponding to the first DHCP client.

步骤350、当确定所述第一DHCP客户端使用所述第一地址上线后,向所述从设备发送第一同步报文,所述第一同步报文包括所述第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一地址,以使得从设备判断本地是否存在对应的第一子网段,若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;若未存在,则根据所述第一子网段的网段信息,从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项。Step 350, when it is determined that the first DHCP client uses the first address to go online, send a first synchronization message to the slave device, the first synchronization message includes the network address of the first subnet segment Segment information and the first entry of the first DHCP client, the first entry includes the first address, so that the slave device determines whether there is a corresponding first subnet segment locally, and if it exists, from the first address Eliminate the first address in a subnet segment, and generate the first entry; if it does not exist, create the address from the second network segment according to the network segment information of the first subnet segment The first subnet segment, removing the first address from the first subnet segment, and generating the first entry.

具体地,根据步骤340的描述,第一DHCP客户端接收到第一DHCP Offer报文后,依照现有DHCP规定,选择DHCP服务端发送的地址、广播发送DHCP Request报文、验证地址是否可用等过程。同时,作为DHCP服务端的主设备,也继续与第一DHCP客户端进行DHCP交互。Specifically, according to the description of step 340, after the first DHCP client receives the first DHCP Offer message, according to the existing DHCP regulations, select the address sent by the DHCP server, broadcast and send the DHCP Request message, verify whether the address is available, etc. process. At the same time, as the master device of the DHCP server, it also continues to perform DHCP interaction with the first DHCP client.

待第一DHCP客户端成功将第一地址作为自身的地址时,主设备生成第一DHCP客户端的第一表项。该第一表项包括第一DHCP客户端标识、第一地址,第一地址的租约信息等内容。When the first DHCP client successfully uses the first address as its own address, the main device generates a first entry of the first DHCP client. The first entry includes the first DHCP client identifier, the first address, the lease information of the first address, and the like.

主设备生成并通过IPL链路,向从设备发送第一同步报文。该第一同步报文包括第一子网段的网段信息以及第一表项。The master device generates and sends the first synchronization message to the slave device through the IPL link. The first synchronization message includes network segment information of the first subnet segment and a first entry.

从设备接收到第一同步报文后,从中获取第一子网段的网段信息以及第一表项。从设备判断本地是否存在对应的第一子网段。After receiving the first synchronization message, the slave device acquires the network segment information of the first subnet segment and the first table entry therefrom. The slave device judges whether there is a corresponding first subnet segment locally.

可以理解的是,若第一DHCP客户端为第一子网段内上线的首个客户端,则主设备向从设备同步网段信息以及DHCP客户端表项时,从设备内未存在对应的第一子网段。此时,从设备根据第一子网段的网段信息,从第二网段内创建第一子网段,并从第一子网段内剔除第一地址。从设备也在本地生成第一表项。如此,主从设备实现DHCP客户端表项的同步。It can be understood that if the first DHCP client is the first client to go online in the first subnet segment, when the master device synchronizes the network segment information and DHCP client entries with the slave device, there is no corresponding DHCP client in the slave device. The first subnet segment. At this time, the slave device creates the first subnet segment from the second network segment according to the network segment information of the first subnet segment, and removes the first address from the first subnet segment. The slave device also locally generates the first entry. In this way, the master and slave devices realize the synchronization of DHCP client entries.

若第一DHCP客户端为第一子网段内上线的非首个客户端,则主设备向从设备同步网段信息以及DHCP客户端表项时,从设备内应存在对应的第一子网段。此时,从设备从第一子网段内剔除第一地址。从设备也在本地生成第一表项。如此,主从设备实现DHCP客户端表项的同步。If the first DHCP client is not the first client to go online in the first subnet segment, when the master device synchronizes the network segment information and DHCP client entries with the slave device, there should be a corresponding first subnet segment in the slave device . At this time, the slave device removes the first address from the first subnet segment. The slave device also locally generates the first entry. In this way, the master and slave devices realize the synchronization of DHCP client entries.

上述从设备从第一子网段内剔除第一地址,也即是,从设备将第一地址记录为已分配地址,并将第一地址与第一DHCP客户端对应记录。The aforementioned slave device removes the first address from the first subnet segment, that is, the slave device records the first address as an allocated address, and records the first address corresponding to the first DHCP client.

因此,通过应用本申请提供的地址分配方法,当主设备接收到第一DHCP客户端发送的第一DHCP Discover报文时,主设备判断本地是否存在可用于分配地址的第一子网段;若未存在,则主设备判断是否能够从第一网段内划分出第一子网段;若是,则主设备创建第一子网段,并从第一子网段内获取第一地址;主设备向第一DHCP客户端发送第一DHCPOffer报文,该第一DHCP Offer报文包括第一地址;当主设备确定第一DHCP客户端使用第一地址上线后,主设备向从设备发送第一同步报文,该第一同步报文包括第一子网段的网段信息以及第一DHCP客户端的第一表项,该第一表项包括第一地址,以使得从设备判断本地是否存在第一地址归属的第一子网段,若存在,则从设备从第一子网段内剔除第一地址,并生成第一表项;若未存在,则从设备根据第一子网段的网段信息,从第二网段内创建第一子网段,从第一子网段内剔除第一地址,并生成第一表项;其中,第一地址池与第二地址池相同,第一网段与第二网段相同。Therefore, by applying the address allocation method provided by this application, when the master device receives the first DHCP Discover message sent by the first DHCP client, the master device judges whether there is a first subnet segment available for address allocation locally; if not exists, the master device judges whether the first subnet segment can be divided from the first network segment; if so, the master device creates the first subnet segment and obtains the first address from the first subnet segment; The first DHCP client sends the first DHCPOffer message, the first DHCP Offer message includes the first address; when the master device determines that the first DHCP client uses the first address to go online, the master device sends the first synchronization message to the slave device , the first synchronization message includes the network segment information of the first subnet segment and the first entry of the first DHCP client, and the first entry includes the first address, so that the slave device can determine whether there is a first address belonging to the local If it exists, the slave device will remove the first address from the first subnet segment and generate the first table entry; if it does not exist, the slave device will, according to the network segment information of the first subnet segment, Create the first subnet segment from the second network segment, remove the first address from the first subnet segment, and generate the first entry; wherein, the first address pool is the same as the second address pool, and the first network segment and The second network segment is the same.

如此,主从设备共享相同的总网段,从设备上的子网段由主设备分配,但每个设备独享本地的子网段并为在自身上线的DHCP客户端分配地址,既实现了地址的集中管理,又避免了多设备同时分配地址时的冲突。解决了现有DRNI环境下支持DHCP的实现方式中,主从设备无法实现对地址的集中管理、分配,导致DHCP客户端无法在DRNI环境下任一网络设备处上线的问题。实现了降低网络设备的性能压力,提高DHCP客户端的上线速率。In this way, the master and slave devices share the same total network segment, and the subnet segment on the slave device is allocated by the master device, but each device exclusively enjoys the local subnet segment and assigns addresses to the DHCP clients that go online on itself, which realizes The centralized management of addresses avoids conflicts when multiple devices assign addresses at the same time. It solves the problem that in the existing implementation mode of supporting DHCP in the DRNI environment, the master and slave devices cannot realize the centralized management and allocation of addresses, which leads to the problem that the DHCP client cannot go online at any network device in the DRNI environment. Realized reducing the performance pressure of network equipment and increasing the online rate of DHCP clients.

可选地,在本申请实施例中还包括:主设备本地存在第一子网段后,主设备为第一DHCP客户端分配地址的过程。Optionally, the embodiment of the present application further includes: after the master device locally exists the first subnet segment, the master device assigns an address to the first DHCP client.

具体地,若本地存在第一子网段,则主设备从第一子网段内获取第一地址。该第一地址即为主设备为第一DHCP客户端分配的地址。Specifically, if the first subnet segment exists locally, the main device obtains the first address from the first subnet segment. The first address is the address allocated by the master device to the first DHCP client.

可以理解的是,主设备为第一DHCP客户端分配地址后,可重复执行步骤340-步骤350,在此不再复述。It can be understood that after the master device assigns an address to the first DHCP client, steps 340 to 350 may be performed repeatedly, which will not be repeated here.

在本申请实施例中,由于第一网段可被划分为多个子网段,作为一种实现方式,主设备内当前可用于分配地址的第一子网段通常为一个,也就是说,当前能够提供未分配地址的子网段为一个。In the embodiment of this application, since the first network segment can be divided into multiple subnet segments, as an implementation method, there is usually one first subnet segment currently available for address allocation in the main device, that is, the current There is only one subnet segment that can provide unassigned addresses.

当然,在另一种实现方式中,主设备内用于分配地址的子网段也可存在多个,也就是说,当前能够提供未分配地址的子网段为多个。若本地存在多个子网段,则主设备可通过接收DHCP Discover报文的接口的接口地址,确定该接口地址归属的子网段,并在该子网段内获取地址。Of course, in another implementation manner, there may also be multiple subnet segments for address allocation in the main device, that is to say, currently there are multiple subnet segments that can provide unallocated addresses. If there are multiple subnet segments locally, the master device can determine the subnet segment to which the interface address belongs through the interface address of the interface receiving the DHCP Discover message, and obtain an address in the subnet segment.

本申请实施例以当前能够提供未分配地址的子网段数量为一个进行后续说明,子网段数量为多个的情况相同。In this embodiment of the present application, the number of subnetwork segments that can currently provide unallocated addresses is taken as one for subsequent descriptions, and the case of multiple subnetwork segments is the same.

可选地,在本申请实施例中还包括:从设备无法为第二DHCP客户端分配地址,并向主设备申请子网段的过程。Optionally, the embodiment of the present application also includes: the slave device cannot assign an address to the second DHCP client, and applies for a subnet segment from the master device.

具体地,当从设备接收到第二DHCP客户端发送的第二DHCP Discover报文时,从设备判断本地是否存在可用于分配地址的子网段,例如,第二子网段(为了与前述实施例中的子网段进行区分,在此称之为第二子网段)。Specifically, when the slave device receives the second DHCP Discover message sent by the second DHCP client, the slave device judges whether there is a subnet segment that can be used to assign addresses locally, for example, the second subnet segment (in order to be consistent with the aforementioned implementation The subnet segment in the example is distinguished, which is called the second subnet segment here).

若存在第二子网段,则从设备从第二子网段内获取第一地址。该第二地址即为从设备为第二DHCP客户端分配的地址。If there is a second subnet segment, the slave device obtains the first address from the second subnet segment. The second address is the address allocated by the slave device to the second DHCP client.

可以理解的是,从设备为第二DHCP客户端分配地址后,可重复执行前述主设备执行步骤340-步骤350相同的过程,在此不再复述。It can be understood that, after the slave device assigns an address to the second DHCP client, it may repeat the same process as the master device performs step 340-step 350, which will not be repeated here.

若未存在第二子网段,则从设备通过IPL链路,向主设备发送第二DHCP Discover报文。If there is no second subnet segment, the slave device sends a second DHCP Discover message to the master device through the IPL link.

可以理解的是,从设备内当前可用于分配地址的第二子网段未存在,也即是,当前已存在的子网段内,未存在剩余地址,即未分配地址数量为0,剩余的网段还未被划分;或者,第二网段未被划分。It can be understood that the second subnet segment currently available for address allocation in the slave device does not exist, that is, there are no remaining addresses in the currently existing subnet segment, that is, the number of unallocated addresses is 0, and the remaining The network segment has not been divided; or, the second network segment has not been divided.

主设备接收到第二DHCP Discover报文后,判断是否能够从第一网段中划分出第二子网段。若第一网段内能够划分出第二子网络,则主设备创建第二子网段,并从第二子网段内获取第二地址,该第二地址为主设备为第二DHCP客户端分配的地址。其中,第二子网段不与主设备内已创建的其他子网段重叠,以避免地址冲突。After receiving the second DHCP Discover message, the master device judges whether the second subnet segment can be divided from the first network segment. If the second subnet can be divided in the first network segment, the master device creates the second subnet segment and obtains the second address from the second subnet segment, and the second address is the second DHCP client for the master device assigned address. Wherein, the second subnet segment does not overlap with other subnet segments created in the master device, so as to avoid address conflicts.

若第一网段内未能够划分出第二子网段,则主设备生成并向从设备发送DHCP NAK报文,以提示从设备为第二DHCP客户端分配地址失败。从设备生成并向第二DHCP客户端发送第二通知报文,以提示第二DHCP客户端分配地址失败。If the second subnet segment cannot be divided in the first network segment, the master device generates and sends a DHCP NAK message to the slave device to prompt the slave device to fail to allocate an address for the second DHCP client. The slave device generates and sends a second notification message to the second DHCP client, to prompt the second DHCP client that the address allocation fails.

其中,第一网段内未能够划分出第二子网段,也即是,第一网段内已无剩余网段进行划分。Wherein, the second sub-network segment cannot be divided in the first network segment, that is, there is no remaining network segment in the first network segment for division.

主设备为第二DHCP客户端分配地址后,生成第二DHCP Offer报文,该第二DHCPOffer报文包括yiaddr字段以及siaddr字段。yiaddr字段承载第二地址,siaddr字段承载主设备地址。After assigning the address to the second DHCP client, the master device generates a second DHCP Offer message, where the second DHCP Offer message includes a yiaddr field and a siaddr field. The yiaddr field carries the second address, and the siaddr field carries the primary device address.

主设备向从设备发送第二DHCP Offer报文。从设备接收到第二DHCP Offer报文后,从中获取第二地址。根据第二地址,从设备在第二网段内创建第二子网段。从设备将第二DHCP Offer报文包括的siaddr字段承载的主设备地址更新为从设备地址,并向第二DHCP客户端发送第二DHCP Offer报文。第二DHCP客户端接收到第二DHCP Offer报文后,从中获取第二地址以及从设备地址,确定从设备为自身分配第二地址。The master device sends the second DHCP Offer message to the slave device. After receiving the second DHCP Offer message, the slave device acquires the second address therefrom. According to the second address, the slave device creates a second subnet segment in the second network segment. The slave device updates the master device address carried in the siaddr field included in the second DHCP Offer message to the slave device address, and sends the second DHCP Offer message to the second DHCP client. After receiving the second DHCP Offer message, the second DHCP client obtains the second address and the address of the slave device, and determines that the slave device allocates the second address for itself.

可以理解的是,按照现有DHCP规定,从设备还将已分配的第二地址与第二DHCP客户端对应记录。同时,待第二DHCP客户端成功将第二地址作为自身的地址时,从设备也生成第二客户端的第二表项,该第二表项包括第二DHCP客户端标识、第二地址,第二地址的租约信息等内容。It can be understood that, according to existing DHCP regulations, the slave device also records the assigned second address corresponding to the second DHCP client. At the same time, when the second DHCP client successfully uses the second address as its own address, the slave device also generates a second entry of the second client. The second entry includes the second DHCP client identifier, the second address, and the second entry. Lease information of the second address, etc.

从设备生成并通过IPL链路,向主设备发送第二同步报文。第二同步报文包括第二子网段的网段信息以及第二表项。The slave device generates and sends the second synchronization message to the master device through the IPL link. The second synchronization message includes network segment information of the second subnet segment and a second entry.

主设备接收到第二同步报文后,从中获取第二子网段的网段信息以及第二表项。根据第二子网段的网段信息以及第二地址,主设备从第二子网段内剔除第二地址。主设备也在本地生成第二表项。如此,主从设备实现DHCP客户端表项的同步。After receiving the second synchronization message, the master device acquires the network segment information of the second subnet segment and the second table entry therefrom. According to the network segment information of the second subnet segment and the second address, the master device removes the second address from the second subnet segment. The master device also locally generates the second entry. In this way, the master and slave devices realize the synchronization of DHCP client entries.

上述主设备从第二子网段内剔除第二地址,也即是,主设备将第二地址记录为已分配地址,并将第二地址与第二DHCP客户端对应记录。The main device removes the second address from the second subnet segment, that is, the main device records the second address as an allocated address, and records the second address corresponding to the second DHCP client.

可选地,在本申请实施例中还包括:主从设备回收已分配地址,并同步至对端的过程。Optionally, the embodiment of the present application also includes: a process in which the master and slave devices reclaim the allocated addresses and synchronize to the peer end.

具体地,依据现有DHCP规定,DHCP客户端在成功获取地址后,可随时通过发送DHCPRelease报文释放自身的地址。DHCP服务端接收到DHCP Release报文后,将回收相应的地址并重新分配。Specifically, according to existing DHCP regulations, after successfully obtaining an address, the DHCP client can release its own address at any time by sending a DHCPRelease message. After receiving the DHCP Release message, the DHCP server will recycle the corresponding address and reassign it.

主设备接收到第三DHCP客户端发送的DHCP Release报文后,回收已为第三DHCP客户端分配的第三地址。同时,主设备删除本地记录的第三地址与第三DHCP客户端对应关系,以及第三DHCP客户端的相关表项。After receiving the DHCP Release message sent by the third DHCP client, the master device reclaims the third address allocated to the third DHCP client. At the same time, the master device deletes the locally recorded correspondence between the third address and the third DHCP client, and related entries of the third DHCP client.

主设备生成并通过IPL链路,向从设备发送第三同步报文,该第三同步报文包括第三地址以及第三子网段的网段信息。The master device generates and sends a third synchronization message to the slave device through the IPL link, where the third synchronization message includes the third address and network segment information of the third subnet segment.

从设备接收到第三同步报文后,从中获取第三地址以及第三子网段的网段信息。从设备从第三子网段内回收第三地址。同时,从设备删除本地记录的第三地址与第三DHCP客户端对应关系,以及第三DHCP客户端的相关表项。从设备还判断第三子网段内包括的全部地址是否均已回收,若是,则从设备删除第三子网段。After receiving the third synchronization message, the slave device obtains the third address and network segment information of the third subnet segment. The slave device reclaims the third address from the third subnet segment. At the same time, the slave device deletes the correspondence between the locally recorded third address and the third DHCP client, and the related entries of the third DHCP client. The slave device also judges whether all addresses included in the third subnet segment have been recycled, and if so, deletes the third subnet segment from the device.

同理,主设备也判断第三子网段内包括的全部地址是否均已回收,若是,则主设备删除第三子网段,该第三子网段后续可再被重复划分。Similarly, the master device also judges whether all the addresses included in the third subnet segment have been recycled, and if so, the master device deletes the third subnet segment, and the third subnet segment can be repeatedly divided later.

进一步地,若第四DHCP客户端在从设备处上线,则第四DHCP客户端释放自身的第四地址时,其可通过IPL链路向从设备发送DHCP Release报文。Further, if the fourth DHCP client goes online at the slave device, when the fourth DHCP client releases its own fourth address, it may send a DHCP Release message to the slave device through the IPL link.

从设备接收到DHCP Release报文后,也执行前述主设备回收地址、删除本地记录、发送同步报文、删除子网段的全部过程;同理,主设备也执行前述从设备回收地址、删除本地记录以及删除子网段的全部过程,在此仅简单说明。After the slave device receives the DHCP Release message, it also executes the above-mentioned process of reclaiming the address of the master device, deleting the local record, sending the synchronization message, and deleting the subnet segment; The entire process of recording and deleting subnet segments is only briefly described here.

主设备接收从设备发送的第四同步报文,该第四同步报文包括第四地址以及所述第四地址归属的第四子网段的网段信息。根据第四子网段的网段信息以及第四地址,主设备从第四子网段内回收第四地址。主设备判断第四子网段内包括的全部地址是否均已回收;若是,则主设备删除第四子网段,该第四子网段后续可再被重复划分。The master device receives the fourth synchronization message sent by the slave device, where the fourth synchronization message includes the fourth address and network segment information of the fourth subnet segment to which the fourth address belongs. According to the network segment information of the fourth subnet segment and the fourth address, the master device reclaims the fourth address from the fourth subnet segment. The master device judges whether all the addresses included in the fourth subnet segment have been recycled; if so, the master device deletes the fourth subnet segment, and the fourth subnet segment can be repeatedly divided subsequently.

可选地,在本申请实施例中还包括:主从设备倒换后,新主设备向新从设备同步信息的过程。Optionally, the embodiment of the present application further includes: after the master-slave device is switched, the new master device synchronizes information with the new slave device.

具体地,若主设备故障,则主设备进行重启,并在重启后主从设备进行角色倒换,主设备降级为新从设备,从设备升级为新主设备。Specifically, if the master device fails, the master device restarts, and after the restart, the master and slave devices perform role switching, the master device is downgraded to a new slave device, and the slave device is upgraded to a new master device.

新主设备将为对端状态的本地子网段的网段状态更新为本端状态,而为本端状态的子网段的网段状态保持不变。新主设备生成并通过IPL链路,向新从设备发送第五同步报文,该第五同步报文包括新主设备内已存在的全部子网段的网段信息以及已上线的全部DHCP客户端的第三表项,第三表项包括每个DHCP客户端的第五地址。The new master device will update the network segment status of the local subnet segment in the peer state to the local state, while the network segment status of the local subnet segment remains unchanged. The new master device generates and sends the fifth synchronization message to the new slave device through the IPL link. The fifth synchronization message includes the network segment information of all subnet segments existing in the new master device and all DHCP clients that have gone online. The third entry of the client, the third entry includes the fifth address of each DHCP client.

新从设备接收到第五同步报文后,从中获取新主设备内已存在的全部子网段的网段信息以及已上线的全部DHCP客户端的第三表项。根据全部子网段的网段信息,新从设备在第一网段内创建对应的子网段。After the new slave device receives the fifth synchronization message, it obtains the network segment information of all existing subnet segments in the new master device and the third entries of all the online DHCP clients. According to the network segment information of all subnet segments, the new slave device creates corresponding subnet segments in the first network segment.

根据第五地址,新从设备从对应的子网段内剔除第五地址;同时,新从设备还生成第三表项。According to the fifth address, the new slave device removes the fifth address from the corresponding subnet segment; at the same time, the new slave device also generates a third entry.

可以理解的是,在前述实施例中,已详细说明设备从子网段内剔除地址、生成DHCP客户端表项的过程,在此不再复述。It can be understood that, in the foregoing embodiments, the process of the device removing addresses from the subnet segment and generating DHCP client entries has been described in detail, and will not be repeated here.

可选地,在本申请实施例中还包括:主设备在本地网段内创建子网段后,记录创建的子网段的网段状态的过程。Optionally, the embodiment of the present application further includes: after the master device creates a subnet segment in the local network segment, it records the network segment status of the created subnet segment.

具体地,主设备创建第一子网段之后,主设备记录第一子网段的网段状态为本端状态,也即是在主设备在本地第一网段内创建的第一子网段,该第一子网段内的地址仅可由主设备进行分配。同时,从设备内也创建第一子网段,并记录第一子网段的网段状态为对端状态,该第一子网段内的地址从设备不可进行分配。Specifically, after the master device creates the first subnet segment, the master device records the network segment status of the first subnet segment as the local state, that is, the first subnet segment created by the master device in the first local network segment , the addresses in the first subnet segment can only be allocated by the master device. At the same time, the first subnet segment is also created in the slave device, and the status of the first subnet segment is recorded as the peer state, and the address in the first subnet segment cannot be allocated by the slave device.

主设备创建第二子网段之后,主设备记录第二子网段的网段状态为对端状态,也即是主设备在第一网段内为从设备创建的第二子网段,该第二子网段内的地址仅可由从设备进行分配,主设备不可进行分配。After the master device creates the second subnet segment, the master device records the status of the second subnet segment as the peer state, that is, the master device creates the second subnet segment for the slave device in the first network segment. The addresses in the second subnet segment can only be assigned by the slave device, not the master device.

新从设备,即原主设备创建第五子网段,主从设备倒换之后,新从设备记录第五子网段的网段状态为对端状态,也即是,该第五子网段内的地址仅可由新主设备,即原从设备进行分配,新从设备不可进行分配。The new slave device, that is, the original master device creates the fifth subnet segment. After the master-slave device is switched over, the new slave device records the status of the fifth subnet segment as the peer state, that is, the network segment in the fifth subnet segment The address can only be assigned by the new master device, that is, the original slave device, and the new slave device cannot be assigned.

例如,主设备故障前,主设备内已存在的子网段包括第一子网段20.0.2.0/24(本端状态)、第二子网段20.0.4.0/24(对端状态),备设备内已存在的子网段包括第一子网段20.0.2.0/24(对端状态)、第二子网段20.0.4.0/24(本端状态)。For example, before the failure of the primary device, the existing subnet segments in the primary device include the first subnet segment 20.0.2.0/24 (local status), the second subnet segment 20.0.4.0/24 (peer status), and the backup The existing subnet segments in the device include the first subnet segment 20.0.2.0/24 (peer state) and the second subnet segment 20.0.4.0/24 (local state).

主设备重启后,从设备升级为新主设备,主设备降级为新从设备。新主设备将为对端状态的本地子网段的网段状态更新为本端状态,而为本端状态的子网段的网段状态保持不变。After the master device restarts, the slave device is upgraded to the new master device, and the master device is downgraded to the new slave device. The new master device will update the network segment status of the local subnet segment in the peer state to the local state, while the network segment status of the local subnet segment remains unchanged.

新主设备生成并通过IPL链路,向新从设备发送第五同步报文。如此,主从设备倒换后,新主设备内包括第一子网段20.0.2.0/24(本端状态)、第二子网段20.0.4.0/24(本端状态);新从设备内包括第一子网段20.0.2.0/24(对端状态)、第二子网段20.0.4.0/24(对端状态)。The new master device generates and sends the fifth synchronization message to the new slave device through the IPL link. In this way, after the master-slave device is switched over, the new master device includes the first subnet segment 20.0.2.0/24 (local status), the second subnet segment 20.0.4.0/24 (local status); the new slave device includes The first subnet segment is 20.0.2.0/24 (peer state), and the second subnet segment is 20.0.4.0/24 (peer state).

需要说明的是,在前述实施例中,上述同步报文可采用下述报文实现,一种为借用DHCP协议报文实现,另一种为各厂商自行定义的私网报文实现。It should be noted that, in the foregoing embodiments, the above-mentioned synchronization message can be realized by using the following messages, one is realized by borrowing DHCP protocol messages, and the other is realized by private network messages defined by each manufacturer.

下面对本申请实施例提供的另一种地址分配方法进行详细地说明。参见图4,图4为本申请实施例提供的另一种地址分配方法的流程图。该方法应用于从设备。本申请实施例提供的地址分配方法可包括如下所示步骤。Another address allocation method provided by the embodiment of the present application will be described in detail below. Referring to FIG. 4, FIG. 4 is a flow chart of another address allocation method provided by the embodiment of the present application. This method is applied to slave devices. The address allocation method provided in the embodiment of the present application may include the following steps.

步骤410、接收所述主设备发送的第一同步报文,所述第一同步报文包括所述主设备在所述第一网段内创建的第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一DHCP客户端的第一地址。Step 410: Receive a first synchronization packet sent by the master device, where the first synchronization packet includes the network segment information of the first subnet segment created by the master device in the first network segment and the first A first entry of the DHCP client, where the first entry includes the first address of the first DHCP client.

具体地,主从设备内均已配置相同的地址池,每个地址池可分配的地址段完全相同。主从设备内已配置DHFP服务端功能,均可独立接收DHCP客户端发送的DHCP报文,并为DHCP客户端分配地址。Specifically, the same address pool has been configured in the master and slave devices, and the address segments that can be allocated by each address pool are exactly the same. The DHCP server function has been configured in the master and slave devices, which can independently receive the DHCP message sent by the DHCP client and assign addresses to the DHCP client.

进一步地,主设备内配置第一地址池,第一地址池具有对应的第一网段,从设备内配置第二地址池,第二地址池具有对应的第二网段。其中,第一地址池与第二地址池相同,第一网段与第二网段相同。例如,第一网段、第二网段均为20.0.0.0/16。Further, a first address pool is configured in the master device, and the first address pool has a corresponding first network segment, and a second address pool is configured in the slave device, and the second address pool has a corresponding second network segment. Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment. For example, both the first network segment and the second network segment are 20.0.0.0/16.

根据前述实施例可知,主设备为第一DHCP客户端分配地址,待第一DHCP客户端成功将第一地址作为自身的地址时,主设备生成第一DHCP客户端的第一表项。主设备生成并通过IPL链路,向从设备发送第一同步报文。该第一同步报文包括第一子网段的网段信息以及第一表项。According to the foregoing embodiments, it can be seen that the master device assigns an address to the first DHCP client, and when the first DHCP client successfully uses the first address as its own address, the master device generates a first entry of the first DHCP client. The master device generates and sends the first synchronization message to the slave device through the IPL link. The first synchronization message includes network segment information of the first subnet segment and a first entry.

从设备接收到第一同步报文后,从中获取第一子网段的网段信息以及第一表项。After receiving the first synchronization message, the slave device acquires the network segment information of the first subnet segment and the first table entry therefrom.

步骤420、根据所述第一子网段的网段信息,判断本地是否存在对应的第一子网段。Step 420, according to the network segment information of the first subnet segment, determine whether there is a corresponding first subnet segment locally.

具体地,根据步骤410的描述,从设备获取到第一子网段的网段信息后,判断本地是否存在对应的第一子网段。Specifically, according to the description of step 410, after obtaining the network segment information of the first subnet segment from the device, it is determined whether there is a corresponding first subnet segment locally.

若本地存在第一子网段,则从设备执行步骤430;若本地未存在第一子网段,则从设备执行步骤440。If the first subnet segment exists locally, the slave device executes step 430; if the first subnet segment does not exist locally, the slave device executes step 440.

步骤430、若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项。Step 430, if it exists, remove the first address from the first subnet segment, and generate the first entry.

具体地,根据步骤420的判断,从设备本地存在第一子网段,从设备从第一子网段内剔除第一地址。从设备也在本地生成第一表项。如此,主从设备实现DHCP客户端表项的同步。Specifically, according to the judgment in step 420, the slave device locally has the first subnet segment, and the slave device removes the first address from the first subnet segment. The slave device also locally generates the first entry. In this way, the master and slave devices realize the synchronization of DHCP client entries.

步骤440、若未存在,则从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项。Step 440: If it does not exist, create the first subnet segment from the second network segment, remove the first address from the first subnet segment, and generate the first entry.

具体地,根据步骤420的判断,从设备本地未存在第一子网段,从设备根据第一子网段的网段信息,从第二网段内创建第一子网段,并从第一子网段内剔除第一地址。从设备也在本地生成第一表项。如此,主从设备实现DHCP客户端表项的同步。Specifically, according to the judgment in step 420, the first subnet segment does not exist locally in the slave device, and the slave device creates the first subnet segment from the second network segment according to the network segment information of the first subnet segment, and creates the first subnet segment from the first subnet segment. Eliminate the first address in the subnet segment. The slave device also locally generates the first entry. In this way, the master and slave devices realize the synchronization of DHCP client entries.

因此,通过应用本申请提供的地址分配方法,从设备接收主设备发送的第一同步报文,该第一同步报文包括主设备在第一网段内创建的第一子网段的网段信息以及第一DHCP客户端的第一表项,该第一表项包括第一DHCP客户端的第一地址;根据第一子网段的网段信息,从设备判断本地是否存在对应的第一子网段;若存在,则从设备从第一子网段内剔除第一地址,并生成第一表项;若未存在,则从设备从第二网段内创建第一子网段,从第一子网段内剔除第一地址,并生成第一表项。Therefore, by applying the address allocation method provided by this application, the slave device receives the first synchronization message sent by the master device, and the first synchronization message includes the network segment of the first subnet segment created by the master device in the first network segment Information and the first entry of the first DHCP client, the first entry includes the first address of the first DHCP client; according to the network segment information of the first subnet segment, the slave device determines whether there is a corresponding first subnet locally segment; if it exists, the slave device will remove the first address from the first subnet segment and generate the first entry; if it does not exist, the slave device will create the first subnet segment from the second The first address is removed from the subnet segment, and the first entry is generated.

如此,主从设备共享相同的总网段,从设备上的子网段由主设备分配,但每个设备独享本地的子网段并为在自身上线的DHCP客户端分配地址,既实现了地址的集中管理,又避免了多设备同时分配地址时的冲突。解决了现有DRNI环境下支持DHCP的实现方式中,主从设备无法实现对地址的集中管理、分配,导致DHCP客户端无法在DRNI环境下任一网络设备处上线的问题。实现了降低网络设备的性能压力,提高DHCP客户端的上线速率。In this way, the master and slave devices share the same total network segment, and the subnet segment on the slave device is allocated by the master device, but each device exclusively enjoys the local subnet segment and assigns addresses to the DHCP clients that go online on itself, which realizes The centralized management of addresses avoids conflicts when multiple devices assign addresses at the same time. It solves the problem that in the existing implementation mode of supporting DHCP in the DRNI environment, the master and slave devices cannot realize the centralized management and allocation of addresses, which leads to the problem that the DHCP client cannot go online at any network device in the DRNI environment. Realized reducing the performance pressure of network equipment and increasing the online rate of DHCP clients.

可选地,在本申请实施例中还包括:从设备无法为第二DHCP客户端分配地址,并向主设备申请子网段的过程。Optionally, the embodiment of the present application also includes: the slave device cannot assign an address to the second DHCP client, and applies for a subnet segment from the master device.

具体地,当从设备接收到第二DHCP客户端发送的第二DHCP Discover报文时,从设备判断本地是否存在可用于分配地址的子网段,例如,第二子网段(为了与前述实施例中的子网段进行区分,在此称之为第二子网段)。Specifically, when the slave device receives the second DHCP Discover message sent by the second DHCP client, the slave device judges whether there is a subnet segment that can be used to assign addresses locally, for example, the second subnet segment (in order to be consistent with the aforementioned implementation The subnet segment in the example is distinguished, which is called the second subnet segment here).

若存在第二子网段,则从设备从第二子网段内获取第一地址。该第二地址即为从设备为第二DHCP客户端分配的地址。If there is a second subnet segment, the slave device obtains the first address from the second subnet segment. The second address is the address allocated by the slave device to the second DHCP client.

可以理解的是,从设备为第二DHCP客户端分配地址后,可重复执行前述主设备执行步骤340-步骤350相同的过程,在此不再复述。It can be understood that, after the slave device assigns an address to the second DHCP client, it may repeat the same process as the master device performs step 340-step 350, which will not be repeated here.

若未存在第二子网段,则从设备通过IPL链路,向主设备发送第二DHCP Discover报文。If there is no second subnet segment, the slave device sends a second DHCP Discover message to the master device through the IPL link.

主设备接收到第二DHCP Discover报文后,判断是否能够从第一网段中划分出第二子网段。若第一网段内能够划分出第二子网络,则主设备创建第二子网段,并从第二子网段内获取第二地址,该第二地址为主设备为第二DHCP客户端分配的地址。其中,第二子网段不与主设备内已创建的其他子网段重叠,以避免地址冲突。After receiving the second DHCP Discover message, the master device judges whether the second subnet segment can be divided from the first network segment. If the second subnet can be divided in the first network segment, the master device creates the second subnet segment and obtains the second address from the second subnet segment, and the second address is the second DHCP client for the master device assigned address. Wherein, the second subnet segment does not overlap with other subnet segments created in the master device, so as to avoid address conflicts.

若第一网段内未能够划分出第二子网段,则主设备生成并向从设备发送DHCP NAK报文,以提示从设备为第二DHCP客户端分配地址失败。从设备生成并向第二DHCP客户端发送第二通知报文,以提示第二DHCP客户端分配地址失败。If the second subnet segment cannot be divided in the first network segment, the master device generates and sends a DHCP NAK message to the slave device to prompt the slave device to fail to allocate an address for the second DHCP client. The slave device generates and sends a second notification message to the second DHCP client, to prompt the second DHCP client that the address allocation fails.

主设备为第二DHCP客户端分配地址后,生成第一DHCP Offer报文,该第一DHCPOffer报文包括yiaddr字段以及siaddr字段。yiaddr字段承载第二地址,siaddr字段承载主设备地址。After assigning the address to the second DHCP client, the master device generates a first DHCP Offer message, where the first DHCP Offer message includes a yiaddr field and a siaddr field. The yiaddr field carries the second address, and the siaddr field carries the primary device address.

主设备向从设备发送第一DHCP Offer报文。从设备接收到第一DHCP Offer报文后,从中获取第二地址。根据第二地址,从设备在第二网段内创建第二子网段。从设备将第一DHCP Offer报文包括的siaddr字段承载的主设备地址更新为从设备地址,得到第二DHCPOffer报文。The master device sends the first DHCP Offer message to the slave device. After receiving the first DHCP Offer message, the slave device acquires the second address therefrom. According to the second address, the slave device creates a second subnet segment in the second network segment. The slave device updates the master device address carried in the siaddr field included in the first DHCP Offer message to the slave device address to obtain the second DHCP Offer message.

从设备向第二DHCP客户端发送第二DHCP Offer报文。第二DHCP客户端接收到第二DHCP Offer报文后,从中获取第二地址以及从设备地址,确定从设备为自身分配第二地址。Send the second DHCP Offer message from the device to the second DHCP client. After receiving the second DHCP Offer message, the second DHCP client obtains the second address and the address of the slave device, and determines that the slave device allocates the second address for itself.

可以理解的是,按照现有DHCP规定,从设备还将已分配的第二地址与第二DHCP客户端对应记录。同时,待第二DHCP客户端成功将第二地址作为自身的地址时,从设备也生成第二客户端的第二表项,该第二表项包括第二DHCP客户端标识、第二地址,第二地址的租约信息等内容。It can be understood that, according to existing DHCP regulations, the slave device also records the assigned second address corresponding to the second DHCP client. At the same time, when the second DHCP client successfully uses the second address as its own address, the slave device also generates a second entry of the second client. The second entry includes the second DHCP client identifier, the second address, and the second entry. Lease information of the second address, etc.

从设备生成并通过IPL链路,向主设备发送第二同步报文。第二同步报文包括第二子网段的网段信息以及第二表项。The slave device generates and sends the second synchronization message to the master device through the IPL link. The second synchronization message includes network segment information of the second subnet segment and a second entry.

主设备接收到第二同步报文后,从中获取第二子网段的网段信息以及第二表项。根据第二子网段的网段信息以及第二地址,主设备从第二子网段内剔除第二地址。主设备也在本地生成第二表项。如此,主从设备实现DHCP客户端表项的同步。After receiving the second synchronization message, the master device acquires the network segment information of the second subnet segment and the second table entry therefrom. According to the network segment information of the second subnet segment and the second address, the master device removes the second address from the second subnet segment. The master device also locally generates the second entry. In this way, the master and slave devices realize the synchronization of DHCP client entries.

可选地,在本申请实施例中还包括:主从设备回收已分配地址,并同步至对端的过程。Optionally, the embodiment of the present application also includes: a process in which the master and slave devices reclaim the allocated addresses and synchronize to the peer end.

具体地,依据现有DHCP规定,DHCP客户端在成功获取地址后,可随时通过发送DHCPRelease报文释放自身的地址。DHCP服务端接收到DHCP Release报文后,将回收相应的地址并重新分配。Specifically, according to existing DHCP regulations, after successfully obtaining an address, the DHCP client can release its own address at any time by sending a DHCPRelease message. After receiving the DHCP Release message, the DHCP server will recycle the corresponding address and reassign it.

主设备接收到第三DHCP客户端发送的DHCP Release报文后,回收已为第三DHCP客户端分配的第三地址。同时,主设备删除本地记录的第三地址与第三DHCP客户端对应关系,以及第三DHCP客户端的相关表项。After receiving the DHCP Release message sent by the third DHCP client, the master device reclaims the third address allocated to the third DHCP client. At the same time, the master device deletes the locally recorded correspondence between the third address and the third DHCP client, and related entries of the third DHCP client.

主设备生成并通过IPL链路,向从设备发送第三同步报文,该第三同步报文包括第三地址以及第三子网段的网段信息。The master device generates and sends a third synchronization message to the slave device through the IPL link, where the third synchronization message includes the third address and network segment information of the third subnet segment.

从设备接收到第三同步报文后,从中获取第三地址以及第三子网段的网段信息。从设备从第三子网段内回收第三地址。同时,从设备删除本地记录的第三地址与第三DHCP客户端对应关系,以及第三DHCP客户端的相关表项。从设备还判断第三子网段内包括的全部地址是否均已回收,若是,则从设备删除第三子网段,该第三子网段后续可再被分配。After receiving the third synchronization message, the slave device obtains the third address and network segment information of the third subnet segment. The slave device reclaims the third address from the third subnet segment. At the same time, the slave device deletes the correspondence between the locally recorded third address and the third DHCP client, and the related entries of the third DHCP client. The slave device also judges whether all the addresses included in the third subnet segment have been reclaimed, and if so, deletes the third subnet segment from the device, and the third subnet segment can be redistributed later.

同理,主设备也判断第三子网段内包括的全部地址是否均已回收,若是,则主设备删除第三子网段。Similarly, the master device also judges whether all addresses included in the third subnet segment have been recycled, and if so, the master device deletes the third subnet segment.

进一步地,若第四DHCP客户端在从设备处上线,则第四DHCP客户端释放自身的第四地址时,其可通过IPL链路向从设备发送DHCP Release报文。Further, if the fourth DHCP client goes online at the slave device, when the fourth DHCP client releases its own fourth address, it may send a DHCP Release message to the slave device through the IPL link.

从设备接收到DHCP Release报文后,也执行前述主设备回收地址、删除本地记录、发送同步报文、删除子网段的全部过程;同理,主设备也执行前述从设备回收地址、删除本地记录以及删除子网段的全部过程,在此仅简单说明。After the slave device receives the DHCP Release message, it also executes the above-mentioned process of reclaiming the address of the master device, deleting the local record, sending the synchronization message, and deleting the subnet segment; The entire process of recording and deleting subnet segments is only briefly described here.

从设备生成并通过IPL链路,向主设备发送第四同步报文,该第四同步报文包括第四地址以及所述第四地址归属的第四子网段的网段信息。The slave device generates and sends a fourth synchronization message to the master device through the IPL link, where the fourth synchronization message includes the fourth address and network segment information of the fourth subnet segment to which the fourth address belongs.

主设备接收到第四同步报文后,根据第四子网段的网段信息以及第四地址,主设备从第四子网段内回收第四地址。主设备判断第四子网段内包括的全部地址是否均已回收;若是,则主设备删除第四子网段。After the master device receives the fourth synchronization message, according to the network segment information of the fourth subnet segment and the fourth address, the master device recovers the fourth address from the fourth subnet segment. The master device judges whether all addresses included in the fourth subnet segment have been recycled; if yes, the master device deletes the fourth subnet segment.

同理,从设备也判断第四子网段内包括的全部地址是否均已回收,若是,则从设备删除第四子网段。Similarly, the slave device also judges whether all addresses included in the fourth subnet segment have been recycled, and if so, deletes the fourth subnet segment from the device.

可选地,在本申请实施例中还包括:主从设备倒换后,新主设备向新从设备同步信息的过程。Optionally, the embodiment of the present application further includes: after the master-slave device is switched, the new master device synchronizes information with the new slave device.

具体地,若主设备故障,则主设备进行重启,并在重启后主从设备进行角色倒换,主设备降级为新从设备,从设备升级为新主设备。Specifically, if the master device fails, the master device restarts, and after restarting, the master and slave devices perform role switching, the master device is downgraded to a new slave device, and the slave device is upgraded to a new master device.

新主设备将为对端状态的本地子网段的网段状态更新为本端状态,而为本端状态的子网段的网段状态保持不变。新主设备生成并通过IPL链路,向新从设备发送第五同步报文,该第五同步报文包括新主设备内已存在的全部子网段的网段信息以及已上线的全部DHCP客户端的第三表项,第三表项包括每个DHCP客户端的第五地址。The new master device will update the network segment status of the local subnet segment in the peer state to the local state, while the network segment status of the local subnet segment remains unchanged. The new master device generates and sends the fifth synchronization message to the new slave device through the IPL link. The fifth synchronization message includes the network segment information of all subnet segments existing in the new master device and all DHCP clients that have gone online. The third entry of the client, the third entry includes the fifth address of each DHCP client.

新从设备接收到第五同步报文后,从中获取新主设备内已存在的全部子网段的网段信息以及已上线的全部DHCP客户端的第三表项。根据全部子网段的网段信息,新从设备在第一网段内创建对应的子网段。After the new slave device receives the fifth synchronization message, it obtains the network segment information of all existing subnet segments in the new master device and the third entries of all the online DHCP clients. According to the network segment information of all subnet segments, the new slave device creates corresponding subnet segments in the first network segment.

根据第五地址,新从设备从对应的子网段内剔除第五地址;同时,新从设备还生成第三表项。According to the fifth address, the new slave device removes the fifth address from the corresponding subnet segment; at the same time, the new slave device also generates a third entry.

可选地,在本申请实施例中还包括:从设备在本地网段内创建子网段后,记录创建的子网段的网段状态的过程。Optionally, the embodiment of the present application further includes: after the slave device creates a subnet segment in the local network segment, a process of recording the network segment status of the created subnet segment.

具体地,从设备创建第一子网段之后,从设备记录第一子网段的网段状态为对端状态,也即是,该第一子网段内的地址从设备不可进行分配,仅可由主设备进行分配。Specifically, after the slave device creates the first subnet segment, the slave device records the network segment status of the first subnet segment as the peer state, that is, the address in the first subnet segment cannot be allocated by the slave device, only can be assigned by the master device.

从设备创建第二子网段之后,从设备记录第二子网段的网段状态为本端状态,该第二子网段内的地址从设备仅可由进行分配,主设备不可进行分配。After the slave device creates the second subnet segment, the slave device records the network segment status of the second subnet segment as the local state, and the address in the second subnet segment can only be allocated by the slave device, but not by the master device.

需要说明的是,在前述实施例中,上述同步报文可采用下述报文实现,一种为借用DHCP协议报文实现,另一种为各厂商自行定义的私网报文实现。It should be noted that, in the foregoing embodiments, the above-mentioned synchronization message can be realized by using the following messages, one is realized by borrowing DHCP protocol messages, and the other is realized by private network messages defined by each manufacturer.

基于同一发明构思,本申请实施例还提供了与地址分配方法对应的一种地址分配装置。参见图5,图5为本申请实施例提供的一种地址分配装置,所述装置应用于主设备,所述主设备处于DRNI组网内,所述DRNI组网还包括从设备,所述主设备内配置第一地址池,所述第一地址池具有对应的第一网段,所述从设备内配置第二地址池,所述第二地址池具有对应的第二网段,所述装置包括:Based on the same inventive concept, the embodiment of the present application also provides an address allocation device corresponding to the address allocation method. Referring to Fig. 5, Fig. 5 is an address allocation device provided by an embodiment of the present application, the device is applied to a master device, the master device is in the DRNI network, and the DRNI network also includes slave devices, the master device A first address pool is configured in the device, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, the second address pool has a corresponding second network segment, and the device include:

第一判断单元510,用于当接收到第一DHCP客户端发送的第一DHCP Discover报文时,判断本地是否存在可用于分配地址的第一子网段;The first judging unit 510 is configured to, when receiving the first DHCP Discover message sent by the first DHCP client, judge whether there is a first subnet segment available locally for address allocation;

第二判断单元520,用于若未存在,则判断是否能够从所述第一网段内划分出所述第一子网段;The second judging unit 520 is configured to judge whether the first subnet segment can be divided from the first subnet segment if it does not exist;

获取单元530,用于若是,则创建所述第一子网段,并从所述第一子网段内获取第一地址;The obtaining unit 530 is configured to, if yes, create the first subnet segment, and obtain the first address from the first subnet segment;

发送单元540,用于向所述第一DHCP客户端发送第一DHCP Offer报文,所述第一DHCP Offer报文包括所述第一地址;A sending unit 540, configured to send a first DHCP Offer message to the first DHCP client, where the first DHCP Offer message includes the first address;

所述发送单元540还用于,当确定所述第一DHCP客户端使用所述第一地址上线后,向所述从设备发送第一同步报文,所述第一同步报文包括所述第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一地址,以使得从设备判断本地是否存在对应的第一子网段,若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;若未存在,则根据所述第一子网段的网段信息,从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项;The sending unit 540 is further configured to, when it is determined that the first DHCP client uses the first address to go online, send a first synchronization message to the slave device, the first synchronization message includes the first The network segment information of a subnet segment and the first entry of the first DHCP client, the first entry includes the first address, so that the slave device can determine whether there is a corresponding first subnet segment locally, if there is , remove the first address from the first subnet segment and generate the first entry; if it does not exist, according to the network segment information of the first subnet segment, from the Create the first subnet segment in the network segment, remove the first address from the first subnet segment, and generate the first entry;

其中,所述第一地址池与所述第二地址池相同,所述第一网段与所述第二网段相同。Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.

可选地,所述获取单元530还用于,若存在,则从所述第一子网段内获取第一地址;Optionally, the acquiring unit 530 is further configured to, if it exists, acquire the first address from the first subnet segment;

所述发送单元540还用于,向所述第一DHCP客户端发送第一DHCP Offer报文,所述第一DHCP Offer报文包括获取的第一地址;The sending unit 540 is further configured to send a first DHCP Offer message to the first DHCP client, where the first DHCP Offer message includes the obtained first address;

所述发送单元540还用于,当确定所述第一DHCP客户端使用所述第一地址上线后,向所述从设备发送第一同步报文,所述第一同步报文包括所述第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一地址,以使得从设备判断本地是否存在对应的第一子网段,若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;若未存在,则根据所述第一子网段的网段信息,在所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项。The sending unit 540 is further configured to, when it is determined that the first DHCP client uses the first address to go online, send a first synchronization message to the slave device, the first synchronization message includes the first The network segment information of a subnet segment and the first entry of the first DHCP client, the first entry includes the first address, so that the slave device can determine whether there is a corresponding first subnet segment locally, if there is , then remove the first address from the first subnet segment and generate the first entry; if it does not exist, according to the network segment information of the first subnet segment, in the second The first subnet segment is created in the network segment, the first address is removed from the first subnet segment, and the first entry is generated.

可选地,所述第二判断单元520还用于,当接收到所述从设备发送的第二DHCPDiscover报文时,判断是否能够从所述第一网段中划分出第二子网段;Optionally, the second judging unit 520 is further configured to, when receiving the second DHCPDiscover message sent by the slave device, judge whether the second subnet segment can be divided from the first network segment;

所述获取单元530还用于,若是,则创建所述第二子网段,并从所述第二子网段内获取第二地址,所述第二地址为所述主设备为发送所述第二DHCP Discover报文的第二DHCP客户端分配的地址;The obtaining unit 530 is further configured to, if yes, create the second subnet segment, and obtain a second address from the second subnet segment, the second address is for the master device to send the The address assigned by the second DHCP client of the second DHCP Discover message;

所述发送单元540还用于,向所述从设备发送第二DHCP Offer报文,所述第二DHCPOffer报文包括所述第二地址,以使得所述从设备根据所述第二地址,在所述第二网段内创建所述第二子网段;The sending unit 540 is further configured to send a second DHCP Offer message to the slave device, where the second DHCP Offer message includes the second address, so that the slave device, according to the second address, creating the second subnet segment in the second network segment;

所述装置还包括:接收单元(图中未示出),用于接收所述从设备发送的第二同步报文,所述第二同步报文包括所述第二子网段的网段信息以及所述第二DHCP客户端的第二表项,所述第二表项包括所述第二地址;The device also includes: a receiving unit (not shown in the figure), configured to receive the second synchronization message sent by the slave device, the second synchronization message including the network segment information of the second subnet segment and a second entry of the second DHCP client, where the second entry includes the second address;

剔除单元(图中未示出),用于根据所述第二子网段的网段信息以及所述第二地址,从所述第二子网段内剔除所述第二地址;an elimination unit (not shown in the figure), configured to eliminate the second address from the second subnet segment according to the network segment information of the second subnet segment and the second address;

生成单元(图中未示出),用于生成所述第二表项;a generating unit (not shown in the figure), configured to generate the second entry;

其中,所述第二子网段不与所述主设备内已创建的其他子网段重叠。Wherein, the second subnet segment does not overlap with other subnet segments created in the master device.

可选地,所述发送单元540还用于,若第三子网段内包括的第三地址已回收,则向所述从设备发送第三同步报文,所述第三同步报文包括所述第三地址以及所述第三子网段的网段信息,以使得所述从设备从所述第三子网段内回收所述第三地址,并在确定所述第三子网段内包括的全部地址均已回收后,删除所述第三子网段;Optionally, the sending unit 540 is further configured to send a third synchronization message to the slave device if the third address included in the third subnet segment has been recovered, and the third synchronization message includes the The third address and the network segment information of the third subnet segment, so that the slave device reclaims the third address from the third subnet segment, and determines the third subnet segment After all the included addresses have been recycled, delete the third subnet segment;

所述装置还包括:删除单元(图中未示出),用于若所述第三子网段内包括的全部地址均已回收,则删除所述第三子网段;The device also includes: a deletion unit (not shown in the figure), configured to delete the third subnet segment if all addresses included in the third subnet segment have been recovered;

其中,所述第三地址为第三DHCP客户端的地址。Wherein, the third address is the address of the third DHCP client.

可选地,所述接收单元(图中未示出)还用于,接收所述从设备发送的第四同步报文,所述第四同步报文包括第四地址以及所述第四地址归属的第四子网段的网段信息;Optionally, the receiving unit (not shown in the figure) is further configured to receive a fourth synchronization message sent by the slave device, the fourth synchronization message includes a fourth address and the fourth address belongs to The network segment information of the fourth subnet segment;

所述装置还包括:回收单元(图中未示出),用于根据所述第四子网段的网段信息以及所述第四地址,从所述第四子网段内回收所述第四地址;The device further includes: a reclaiming unit (not shown in the figure), configured to reclaim the first subnetwork segment from the fourth subnetwork segment according to the network segment information of the fourth subnetwork segment and the fourth address. Four addresses;

第三判断单元(图中未示出),用于判断所述第四子网段内包括的全部地址是否均已回收;A third judging unit (not shown in the figure), configured to judge whether all addresses included in the fourth subnet segment have been recycled;

所述删除单元(图中未示出)还用于,若是,则删除所述第四子网段;The deletion unit (not shown in the figure) is also used to, if yes, delete the fourth subnet segment;

其中,所述第四地址为第四DHCP客户端的地址。Wherein, the fourth address is the address of the fourth DHCP client.

可选地,当所述主设备降级为新从设备且所述从设备升级为新主设备时,所述接收单元(图中未示出)还用于,接收所述新主设备发送的第五同步报文,所述第五同步报文包括所述新主设备内已存在的全部子网段的网段信息以及已上线的全部DHCP客户端的第三表项,所述第三表项包括每个DHCP客户端的第五地址;Optionally, when the master device is downgraded to a new slave device and the slave device is upgraded to a new master device, the receiving unit (not shown in the figure) is further configured to receive the first Five synchronization messages, the fifth synchronization message includes the network segment information of all existing subnet segments in the new master device and the third entry of all DHCP clients that have gone online, and the third entry includes a fifth address for each DHCP client;

所述剔除单元(图中未示出)还用于,根据所述全部子网段的网段信息以及所述第五地址,在所述第一网段内创建对应的子网段,并从对应的子网段内剔除所述第五地址;The eliminating unit (not shown in the figure) is further configured to, according to the network segment information of all the subnet segments and the fifth address, create corresponding subnet segments in the first network segment, and from Removing the fifth address from the corresponding subnet segment;

所述生成单元(图中未示出)还用于,生成所述第三表项。The generating unit (not shown in the figure) is further configured to generate the third entry.

可选地,所述装置还包括:记录单元(图中未示出),用于记录所述第一子网段的网段状态为本地状态;Optionally, the device further includes: a recording unit (not shown in the figure), configured to record the network segment state of the first subnet segment as a local state;

所述记录单元(图中未示出)还用于,记录所述第二子网段的网段状态为对端状态;The recording unit (not shown in the figure) is also used to record the network segment status of the second subnet segment as the opposite end status;

所述记录单元(图中未示出)还用于,记录所述第五子网段的网段状态为对端状态。The recording unit (not shown in the figure) is further configured to record the network segment state of the fifth subnetwork segment as the opposite end state.

基于同一发明构思,本申请实施例还提供了与地址分配方法对应的一种地址分配装置。参见图6,图6为本申请实施例提供的另一种地址分配装置,所述装置应用于从设备,所述从设备处于DRNI组网内,所述DRNI组网还包括主设备,所述主设备内配置第一地址池,所述第一地址池具有对应的第一网段,所述从设备内配置第二地址池,所述第二地址池具有对应的第二网段,所述装置包括:Based on the same inventive concept, the embodiment of the present application also provides an address allocation device corresponding to the address allocation method. Referring to Fig. 6, Fig. 6 is another address allocation device provided by the embodiment of the present application, the device is applied to a slave device, the slave device is in the DRNI network, and the DRNI network also includes a master device, the A first address pool is configured in the master device, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, the second address pool has a corresponding second network segment, and the Devices include:

接收单元610,用于接收所述主设备发送的第一同步报文,所述第一同步报文包括所述主设备在所述第一网段内创建的第一子网段的网段信息以及第一DHCP客户端的第一表项,所述第一表项包括所述第一DHCP客户端的第一地址;A receiving unit 610, configured to receive a first synchronization message sent by the master device, where the first synchronization message includes network segment information of a first subnet segment created by the master device in the first network segment and a first entry of the first DHCP client, where the first entry includes the first address of the first DHCP client;

第一判断单元620,用于根据所述第一子网段的网段信息,判断本地是否存在对应的第一子网段;The first judging unit 620 is configured to judge whether there is a corresponding first subnet segment locally according to the network segment information of the first subnet segment;

剔除单元630,用于若存在,则从所述第一子网段内剔除所述第一地址,并生成所述第一表项;The elimination unit 630 is configured to, if it exists, eliminate the first address from the first subnet segment, and generate the first entry;

创建单元640,用于若未存在,则从所述第二网段内创建所述第一子网段,从所述第一子网段内剔除所述第一地址,并生成所述第一表项;The creation unit 640 is configured to create the first subnet segment from the second network segment if it does not exist, remove the first address from the first subnet segment, and generate the first subnet segment. entry;

其中,所述第一地址池与所述第二地址池相同,所述第一网段与所述第二网段相同。Wherein, the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.

可选地,第二判断单元(图中未示出),用于当接收到第二DHCP客户端发送的第二DHCP Discover报文时,判断本地是否存在可用于分配地址的第二子网段;Optionally, the second judging unit (not shown in the figure) is configured to judge whether there is a second subnet segment locally available for address allocation when receiving the second DHCP Discover message sent by the second DHCP client ;

所述装置还包括:发送单元(图中未示出),用于若未存在,则向所述主设备发送所述第二DHCP Discover报文;The device further includes: a sending unit (not shown in the figure), configured to send the second DHCP Discover message to the master device if it does not exist;

所述接收单元610还用于,接收所述主设备发送的第一DHCP Offer报文,所述第一DHCP Offer报文包括第二地址,所述第二地址为所述主设备从本地创建的第二子网段内为所述第二DHCP客户端分配的地址;The receiving unit 610 is further configured to receive a first DHCP Offer message sent by the master device, the first DHCP Offer message includes a second address, and the second address is locally created by the master device The address assigned to the second DHCP client in the second subnet segment;

所述创建单元640还用于,根据所述第二地址,在所述第二网段内创建所述第二子网段;The creating unit 640 is further configured to create the second subnet segment in the second network segment according to the second address;

所述发送单元(图中未示出)还用于,向所述第二DHCP客户端发送第二DHCP Offer报文,所述第二DHCP Offer报文包括所述第二地址;The sending unit (not shown in the figure) is further configured to send a second DHCP Offer message to the second DHCP client, where the second DHCP Offer message includes the second address;

所述发送单元(图中未示出)还用于,当确定所述第二DHCP客户端使用所述第二地址上线后,向所述主设备发送第二同步报文,所述第二同步报文包括所述第二子网段的网段信息以及所述第二DHCP客户端的第二表项,所述第二表项包括所述第二地址,以使得所述主设备从本地创建的所述第二子网段内剔除所述第二地址,并生成所述第二表项。The sending unit (not shown in the figure) is further configured to, when it is determined that the second DHCP client uses the second address to go online, send a second synchronization message to the master device, and the second synchronization The message includes the network segment information of the second subnet segment and the second entry of the second DHCP client, and the second entry includes the second address, so that the master device obtains from the locally created Eliminate the second address from the second subnet segment, and generate the second entry.

可选地,所述接收单元610还用于,接收所述主设备发送的第三同步报文,所述第三同步报文包括第三地址以及所述第三地址归属的第三子网段的网段信息;Optionally, the receiving unit 610 is further configured to receive a third synchronization message sent by the master device, where the third synchronization message includes a third address and a third subnet segment to which the third address belongs network segment information;

所述装置还包括:回收单元(图中未示出),用于根据所述第三子网段的网段信息以及所述第三地址,从所述第三子网段内回收所述第三地址;The device further includes: a recovery unit (not shown in the figure), configured to recover the first subnetwork segment from the third subnetwork segment according to the network segment information of the third subnetwork segment and the third address. Three addresses;

第三判断单元(图中未示出),用于判断所述第三子网段内包括的全部地址是否均已回收;A third judging unit (not shown in the figure), configured to judge whether all addresses included in the third subnet segment have been recycled;

删除单元(图中未示出),用于若是,则删除所述第三子网段;A deletion unit (not shown in the figure), configured to delete the third subnet segment if so;

其中,所述第三地址为第三DHCP客户端的地址。Wherein, the third address is the address of the third DHCP client.

可选地,所述发送单元(图中未示出)还用于,若第四子网段内包括的第四地址已回收,则向所述主设备发送第四同步报文,所述第四同步报文包括所述第四地址以及所述第四子网段的网段信息,以使得所述主设备从所述第四子网段内回收所述第四地址,并在确定所述第四子网段内包括的全部地址均已回收后,删除所述第四子网段;Optionally, the sending unit (not shown in the figure) is further configured to send a fourth synchronization message to the master device if the fourth address included in the fourth subnet segment has been recycled, and the first The four synchronization messages include the fourth address and network segment information of the fourth subnet segment, so that the master device reclaims the fourth address from the fourth subnet segment, and determines the After all the addresses included in the fourth subnet segment have been recycled, delete the fourth subnet segment;

所述删除单元(图中未示出)还用于,若所述第四子网段内包括的全部地址均已回收,则删除所述第四子网段;The deletion unit (not shown in the figure) is also used to delete the fourth subnet segment if all addresses included in the fourth subnet segment have been recovered;

其中,所述第四地址为第四DHCP客户端的地址。Wherein, the fourth address is the address of the fourth DHCP client.

可选地,当所述主设备降级为新从设备且所述从设备升级为新主设备时,所述方法还包括:Optionally, when the master device is downgraded to a new slave device and the slave device is upgraded to a new master device, the method further includes:

所述装置还包括:更新单元(图中未示出),用于将为对端状态的本地子网段的网段状态更新为本端状态;The device also includes: an updating unit (not shown in the figure), which is used to update the state of the network segment of the local subnet segment that will be the state of the opposite end to the state of the local end;

所述发送单元(图中未示出)还用于,向所述新从设备发送第五同步报文,所述第五同步报文包括所述新主设备内已存在的全部子网段的网段状态以及已上线的全部DHCP客户端的第三表项,所述第三表项包括每个DHCP客户端的第五地址,以使得所述新从设备根据所述全部子网段的网段信息,创建对应的子网段,从对应的子网段内剔除所述第五地址,并生成所述第三表项。The sending unit (not shown in the figure) is further configured to send a fifth synchronization message to the new slave device, and the fifth synchronization message includes all existing subnet segments in the new master device Network segment status and the third entry of all DHCP clients that have been online, the third entry includes the fifth address of each DHCP client, so that the new slave device can , creating a corresponding subnet segment, removing the fifth address from the corresponding subnet segment, and generating the third entry.

可选地,所述装置还包括:记录单元(图中未示出),用于记录所述第一子网段的网段状态为对端状态;Optionally, the device further includes: a recording unit (not shown in the figure), configured to record the network segment status of the first subnet segment as the opposite end status;

所述记录单元(图中未示出)还用于,记录所述第二子网段的网段状态为本端状态。The recording unit (not shown in the figure) is further configured to record the network segment state of the second subnetwork segment as the local state.

因此,通过应用本申请提供的地址分配装置,当主设备接收到第一DHCP客户端发送的第一DHCP Discover报文时,主设备判断本地是否存在可用于分配地址的第一子网段;若未存在,则主设备判断是否能够从第一网段内划分出第一子网段;若是,则主设备创建第一子网段,并从第一子网段内获取第一地址;主设备向第一DHCP客户端发送第一DHCPOffer报文,该第一DHCP Offer报文包括第一地址;当主设备确定第一DHCP客户端使用第一地址上线后,主设备向从设备发送第一同步报文,该第一同步报文包括第一子网段的网段信息以及第一DHCP客户端的第一表项,该第一表项包括第一地址,以使得从设备判断本地是否存在第一地址归属的第一子网段,若存在,则从设备从第一子网段内剔除第一地址,并生成第一表项;若未存在,则从设备根据第一子网段的网段信息,从第二网段内创建第一子网段,从第一子网段内剔除第一地址,并生成第一表项;其中,第一地址池与第二地址池相同,第一网段与第二网段相同。Therefore, by applying the address allocation device provided by the present application, when the master device receives the first DHCP Discover message sent by the first DHCP client, the master device judges whether there is a first subnet segment available for address allocation locally; if not exists, the master device judges whether the first subnet segment can be divided from the first network segment; if so, the master device creates the first subnet segment and obtains the first address from the first subnet segment; The first DHCP client sends the first DHCPOffer message, the first DHCP Offer message includes the first address; when the master device determines that the first DHCP client uses the first address to go online, the master device sends the first synchronization message to the slave device , the first synchronization message includes the network segment information of the first subnet segment and the first entry of the first DHCP client, and the first entry includes the first address, so that the slave device can determine whether there is a first address belonging to the local If it exists, the slave device will remove the first address from the first subnet segment and generate the first table entry; if it does not exist, the slave device will, according to the network segment information of the first subnet segment, Create the first subnet segment from the second network segment, remove the first address from the first subnet segment, and generate the first entry; wherein, the first address pool is the same as the second address pool, and the first network segment and The second network segment is the same.

如此,主从设备共享相同的总网段,从设备上的子网段由主设备分配,但每个设备独享本地的子网段并为在自身上线的DHCP客户端分配地址,既实现了地址的集中管理,又避免了多设备同时分配地址时的冲突。解决了现有DRNI环境下支持DHCP的实现方式中,主从设备无法实现对地址的集中管理、分配,导致DHCP客户端无法在DRNI环境下任一网络设备处上线的问题。实现了降低网络设备的性能压力,提高DHCP客户端的上线速率。In this way, the master and slave devices share the same total network segment, and the subnet segment on the slave device is allocated by the master device, but each device exclusively enjoys the local subnet segment and assigns addresses to the DHCP clients that go online on itself, which realizes The centralized management of addresses avoids conflicts when multiple devices assign addresses at the same time. It solves the problem that in the existing implementation mode of supporting DHCP in the DRNI environment, the master and slave devices cannot realize the centralized management and allocation of addresses, which leads to the problem that the DHCP client cannot go online at any network device in the DRNI environment. Realized reducing the performance pressure of network equipment and increasing the online rate of DHCP clients.

基于同一发明构思,本申请实施例还提供了一种网络设备,如图7所示,包括处理器710、收发器720和机器可读存储介质730,机器可读存储介质730存储有能够被处理器710执行的机器可执行指令,处理器710被机器可执行指令促使执行本申请实施例所提供的地址分配方法。前述图5、图6所示的地址分配装置,可采用如图7所示的网络设备硬件结构实现。Based on the same inventive concept, the embodiment of the present application also provides a network device, as shown in FIG. 7 , including a processor 710, a transceiver 720, and a machine-readable storage medium 730. The processor 710 executes the machine-executable instructions, and the processor 710 is prompted by the machine-executable instructions to execute the address allocation method provided in the embodiment of the present application. The aforementioned address allocation devices shown in FIG. 5 and FIG. 6 can be realized by using the hardware structure of the network equipment shown in FIG. 7 .

上述计算机可读存储介质730可以包括随机存取存储器(英文:Random AccessMemory,简称:RAM),也可以包括非易失性存储器(英文:Non-volatile Memory,简称:NVM),例如至少一个磁盘存储器。可选的,计算机可读存储介质730还可以是至少一个位于远离前述处理器710的存储装置。The above-mentioned computer-readable storage medium 730 may include a random access memory (English: Random Access Memory, abbreviated as RAM), and may also include a non-volatile memory (English: Non-volatile Memory, abbreviated: NVM), such as at least one disk memory . Optionally, the computer-readable storage medium 730 may also be at least one storage device located away from the aforementioned processor 710 .

上述处理器710可以是通用处理器,包括中央处理器(英文:Central ProcessingUnit,简称:CPU)、网络处理器(英文:Network Processor,简称:NP)等;还可以是数字信号处理器(英文:Digital Signal Processor,简称:DSP)、专用集成电路(英文:ApplicationSpecific Integrated Circuit,简称:ASIC)、现场可编程门阵列(英文:Field-Programmable Gate Array,简称:FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor 710 may be a general-purpose processor, including a central processing unit (English: Central Processing Unit, referred to as: CPU), a network processor (English: Network Processor, referred to as: NP), etc.; it may also be a digital signal processor (English: Digital Signal Processor (abbreviation: DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, abbreviation: ASIC), field programmable gate array (English: Field-Programmable Gate Array, abbreviation: FPGA) or other programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.

本申请实施例中,处理器710通过读取机器可读存储介质730中存储的机器可执行指令,被机器可执行指令促使能够实现处理器710自身以及调用收发器720执行前述本申请实施例描述的地址分配方法。In the embodiment of the present application, the processor 710 reads the machine-executable instructions stored in the machine-readable storage medium 730, and is prompted by the machine-executable instructions to implement the processor 710 itself and call the transceiver 720 to execute the foregoing description of the embodiment of the present application. address allocation method.

另外,本申请实施例提供了一种机器可读存储介质730,机器可读存储介质730存储有机器可执行指令,在被处理器710调用和执行时,机器可执行指令促使处理器710自身以及调用收发器720执行前述本申请实施例描述的地址分配方法。In addition, the embodiment of the present application provides a machine-readable storage medium 730. The machine-readable storage medium 730 stores machine-executable instructions. When called and executed by the processor 710, the machine-executable instructions prompt the processor 710 itself and The transceiver 720 is invoked to execute the address allocation method described in the foregoing embodiments of the present application.

上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For the implementation process of the functions and effects of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method for details, and will not be repeated here.

对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment. The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this application. It can be understood and implemented by those skilled in the art without creative effort.

对于地址分配装置以及机器可读存储介质实施例而言,由于其涉及的方法内容基本相似于前述的方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the embodiment of the address allocation device and the machine-readable storage medium, since the content of the method involved is basically similar to the foregoing method embodiment, the description is relatively simple. For relevant details, please refer to the part of the description of the method embodiment.

以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above is only a preferred embodiment of the application, and is not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application should be included in the application. within the scope of protection.

Claims (15)

1. An address allocation method applied to a master device, wherein the master device is in a DRNI mesh network, the DRNI mesh network further includes a slave device, a first address pool is configured in the master device, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, the second address pool has a corresponding second network segment, and the method includes:
when a first DHCP Discover message sent by a first DHCP client is received, judging whether a first sub-network segment which can be used for distributing addresses exists locally;
if not, judging whether the first sub-network segment can be divided from the first network segment or not;
if so, creating the first sub-network segment, and acquiring a first address from the first sub-network segment;
sending a first DHCP Offer message to the first DHCP client, wherein the first DHCP Offer message comprises the first address;
when the first DHCP client is determined to use the first address to be on-line, sending a first synchronization message to the slave device, wherein the first synchronization message comprises network segment information of the first sub-network segment and a first table entry of the first DHCP client, and the first table entry comprises the first address, so that the slave device judges whether a corresponding first sub-network segment exists locally, if so, the first address is removed from the first sub-network segment, and the first table entry is generated; if the first sub-network segment does not exist, the first sub-network segment is created from the second network segment according to the network segment information of the first sub-network segment, the first address is removed from the first sub-network segment, and the first table entry is generated;
the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.
2. The method of claim 1, further comprising:
if yes, acquiring a first address from the first sub-network segment;
sending a first DHCP Offer message to the first DHCP client, wherein the first DHCP Offer message comprises the acquired first address;
when the first DHCP client is determined to use the first address to be on-line, sending a first synchronization message to the slave device, wherein the first synchronization message comprises network segment information of the first sub-network segment and a first table entry of the first DHCP client, and the first table entry comprises the first address, so that the slave device judges whether a corresponding first sub-network segment exists locally, if so, the first address is removed from the first sub-network segment, and the first table entry is generated; if the first sub-network segment does not exist, the first sub-network segment is created in the second network segment according to the network segment information of the first sub-network segment, the first address is removed from the first sub-network segment, and the first table entry is generated.
3. The method of claim 1, further comprising:
when a second DHCP Discover message sent by the slave equipment is received, judging whether a second sub-network segment can be divided from the first network segment or not;
if so, creating the second sub-network segment, and acquiring a second address from the second sub-network segment, wherein the second address is an address allocated by the main device for a second DHCP client side which sends the second DHCP Discover message;
sending a second DHCP Offer message to the slave device, the second DHCP Offer message including the second address, so that the slave device creates the second sub-network segment within the second network segment according to the second address;
receiving a second synchronization message sent by the slave device, where the second synchronization message includes network segment information of the second subnet segment and a second entry of the second DHCP client, and the second entry includes the second address;
according to the network segment information of the second sub-network segment and the second address, the second address is removed from the second sub-network segment;
generating the second table entry;
wherein the second sub-network segment does not overlap with other sub-network segments already created within the master device.
4. The method of claim 1, further comprising:
if a third address included in a third subnet section is recovered, sending a third synchronous message to the slave device, wherein the third synchronous message includes the third address and the network segment information of the third subnet section, so that the slave device recovers the third address from the third subnet section, and deletes the third subnet section after determining that all the addresses included in the third subnet section are recovered;
if all the addresses included in the third subnet section are recovered, deleting the third subnet section;
and the third address is the address of a third DHCP client.
5. The method of claim 1, further comprising:
receiving a fourth synchronous message sent by the slave device, wherein the fourth synchronous message comprises a fourth address and network segment information of a fourth sub-network segment to which the fourth address belongs;
recovering the fourth address from the fourth sub-network segment according to the network segment information of the fourth sub-network segment and the fourth address;
judging whether all the addresses included in the fourth subnet section are recycled;
if yes, deleting the fourth sub-network segment;
and the fourth address is the address of a fourth DHCP client.
6. The method of claim 1, wherein when the master device is downgraded to a new slave device and the slave device is upgraded to a new master device, the method further comprises:
receiving a fifth synchronization message sent by the new master device, where the fifth synchronization message includes network segment information of all existing sub-network segments in the new master device and third entries of all online DHCP clients, and the third entries include a fifth address of each DHCP client;
creating a corresponding subnet section in the first network segment according to the network segment information of all the subnet segments and the fifth address, and removing the fifth address from the corresponding subnet section;
and generating the third table entry.
7. The method of any of claims 1, 3 or 6, wherein after the creating the first subnet fragment, the method further comprises:
recording the network segment state of the first sub-network segment as a local state;
after the creating the second subnet segment, the method further comprises:
recording the network segment state of the second sub-network segment as an opposite terminal state;
after the creating the fifth subnet segment, the method further comprises:
and recording the network segment state of the fifth sub-network segment as an opposite terminal state.
8. An address allocation method applied to a slave device, wherein the slave device is in a DRNI networking, the DRNI networking further includes a master device, a first address pool is configured in the master device, the first address pool has a corresponding first network segment, a second address pool is configured in the slave device, the second address pool has a corresponding second network segment, and the method includes:
receiving a first synchronization message sent by the master device, where the first synchronization message includes network segment information of a first sub-network segment created in the first network segment by the master device and a first entry of a first DHCP client, and the first entry includes a first address of the first DHCP client;
judging whether a corresponding first sub-network segment exists locally according to the network segment information of the first sub-network segment;
if the first address exists, the first address is removed from the first sub-network segment, and the first table entry is generated;
if the address does not exist in the second network segment, the first sub-network segment is created from the second network segment, the first address is removed from the first sub-network segment, and the first table entry is generated;
the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.
9. The method of claim 8, further comprising:
when a second DHCP Discover message sent by a second DHCP client is received, judging whether a second sub-network segment which can be used for distributing addresses exists locally;
if the second DHCP Discover message does not exist, the second DHCP Discover message is sent to the main equipment;
receiving a first DHCP Offer message sent by the main device, wherein the first DHCP Offer message comprises a second address, and the second address is an address allocated to the second DHCP client side by the main device from a second sub-network segment created locally;
creating the second sub-network segment in the second network segment according to the second address;
sending a second DHCP Offer message to the second DHCP client, the second DHCP Offer message including the second address;
and after determining that the second address used by the second DHCP client is on line, sending a second synchronization message to the main device, wherein the second synchronization message comprises network segment information of the second sub-network segment and a second table entry of the second DHCP client, and the second table entry comprises the second address, so that the main device removes the second address from the second sub-network segment which is created locally, and generates the second table entry.
10. The method of claim 8, further comprising:
receiving a third synchronous message sent by the master device, wherein the third synchronous message comprises a third address and network segment information of a third sub-network segment to which the third address belongs;
according to the network segment information of the third sub-network segment and the third address, the third address is recovered from the third sub-network segment;
judging whether all the addresses included in the third subnet section are recycled;
if yes, deleting the third sub-network segment;
and the third address is the address of a third DHCP client.
11. The method of claim 8, further comprising:
if a fourth address included in a fourth subnet section is recovered, sending a fourth synchronous message to the master device, wherein the fourth synchronous message includes the fourth address and the network segment information of the fourth subnet section, so that the master device recovers the fourth address from the fourth subnet section, and deletes the fourth subnet section after determining that all the addresses included in the fourth subnet section are recovered;
if all the addresses included in the fourth subnet section are recovered, deleting the fourth subnet section;
and the fourth address is the address of a fourth DHCP client.
12. The method of claim 8, wherein when the master device is downgraded to a new slave device and the slave device is upgraded to a new master device, the method further comprises:
updating the network segment state of the local sub-network segment in the opposite terminal state into the local terminal state;
and sending a fifth synchronous message to the new slave device, wherein the fifth synchronous message comprises network segment states of all existing sub-network segments in the new master device and third table entries of all online DHCP clients, and the third table entry comprises a fifth address of each DHCP client, so that the new slave device creates a corresponding sub-network segment according to the network segment information of all sub-network segments, removes the fifth address from the corresponding sub-network segment, and generates the third table entry.
13. The method of any of claims 8 or 9, wherein after the creating the first subnet fragment, the method further comprises:
recording the network segment state of the first sub-network segment as an opposite terminal state;
after the creating the second subnet segment, the method further comprises:
and recording the network segment state of the second sub-network segment as the home terminal state.
14. An address allocation apparatus, applied to a master device, the master device being in a DRNI mesh network, the DRNI mesh network further including a slave device, a first address pool being configured in the master device, the first address pool having a corresponding first network segment, a second address pool being configured in the slave device, the second address pool having a corresponding second network segment, the apparatus comprising:
the first judging unit is used for judging whether a first sub-network segment which can be used for distributing addresses exists locally or not when a first DHCP Discover message sent by a first DHCP client side is received;
a second judging unit, configured to judge whether the first sub-network segment can be divided from the first network segment if the first sub-network segment does not exist;
the acquisition unit is used for creating the first sub-network segment and acquiring a first address from the first sub-network segment if the first address is the first address;
a sending unit, configured to send a first DHCP Offer packet to the first DHCP client, where the first DHCP Offer packet includes the first address;
the sending unit is further configured to send a first synchronization packet to the slave device after it is determined that the first DHCP client uses the first address to go online, where the first synchronization packet includes network segment information of the first subnet segment and a first entry of the first DHCP client, and the first entry includes the first address, so that the slave device determines whether a corresponding first subnet segment exists locally, and if so, removes the first address from the first subnet segment, and generates the first entry; if the first sub-network segment does not exist, the first sub-network segment is created from the second network segment according to the network segment information of the first sub-network segment, the first address is removed from the first sub-network segment, and the first table entry is generated;
the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.
15. An address allocation apparatus, applied to a slave device, the slave device being in a DRNI networking, the DRNI networking further including a master device, a first address pool being configured in the master device, the first address pool having a corresponding first network segment, a second address pool being configured in the slave device, the second address pool having a corresponding second network segment, the apparatus comprising:
a receiving unit, configured to receive a first synchronization packet sent by the master device, where the first synchronization packet includes network segment information of a first subnet segment created in the first network segment by the master device and a first entry of a first DHCP client, and the first entry includes a first address of the first DHCP client;
the first judgment unit is used for judging whether a corresponding first sub-network segment exists locally or not according to the network segment information of the first sub-network segment;
the removing unit is used for removing the first address from the first sub-network segment and generating the first table entry if the first address exists;
a creating unit, configured to create the first sub-network segment from the second network segment if the first sub-network segment does not exist, remove the first address from the first sub-network segment, and generate the first entry;
the first address pool is the same as the second address pool, and the first network segment is the same as the second network segment.
CN202210972334.XA 2022-08-15 2022-08-15 Address allocation method and device Active CN115499414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210972334.XA CN115499414B (en) 2022-08-15 2022-08-15 Address allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210972334.XA CN115499414B (en) 2022-08-15 2022-08-15 Address allocation method and device

Publications (2)

Publication Number Publication Date
CN115499414A true CN115499414A (en) 2022-12-20
CN115499414B CN115499414B (en) 2025-03-04

Family

ID=84466323

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210972334.XA Active CN115499414B (en) 2022-08-15 2022-08-15 Address allocation method and device

Country Status (1)

Country Link
CN (1) CN115499414B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116192801A (en) * 2023-02-17 2023-05-30 浪潮思科网络科技有限公司 DHCP (dynamic host configuration protocol) table entry synchronization method, equipment and medium based on MLAG (media-based access control) environment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857587A (en) * 2012-08-17 2013-01-02 福建三元达通讯股份有限公司 Method and system for sharing dynamic address pool in multi-virtual local area network (VLAN) environment
US20160277497A1 (en) * 2015-03-17 2016-09-22 Panzura, Inc. Facilitating access to remote cloud services
WO2020088343A1 (en) * 2018-11-01 2020-05-07 中兴通讯股份有限公司 Address pool centralized management method and device, and storage medium
CN111698338A (en) * 2019-03-15 2020-09-22 华为技术有限公司 Data transmission method and computer system
US20210014192A1 (en) * 2019-07-10 2021-01-14 Vmware, Inc. Address resolution handling at logical distributed routers
WO2021115183A1 (en) * 2019-12-12 2021-06-17 中兴通讯股份有限公司 Address management method, server and computer-readable storage medium
CN114124812A (en) * 2021-11-22 2022-03-01 迈普通信技术股份有限公司 Method and device for maintaining consistency of table items and electronic equipment
CN114553761A (en) * 2022-01-14 2022-05-27 新华三技术有限公司合肥分公司 Exception handling method, exception handling device, network equipment and storage medium
CN114598681A (en) * 2020-11-30 2022-06-07 华为技术有限公司 Address allocation processing method and equipment
CN114844863A (en) * 2021-02-02 2022-08-02 中兴通讯股份有限公司 Method for dynamically allocating access equipment address to multiple DHCP server networks and gateway equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857587A (en) * 2012-08-17 2013-01-02 福建三元达通讯股份有限公司 Method and system for sharing dynamic address pool in multi-virtual local area network (VLAN) environment
US20160277497A1 (en) * 2015-03-17 2016-09-22 Panzura, Inc. Facilitating access to remote cloud services
WO2020088343A1 (en) * 2018-11-01 2020-05-07 中兴通讯股份有限公司 Address pool centralized management method and device, and storage medium
CN111698338A (en) * 2019-03-15 2020-09-22 华为技术有限公司 Data transmission method and computer system
US20210014192A1 (en) * 2019-07-10 2021-01-14 Vmware, Inc. Address resolution handling at logical distributed routers
WO2021115183A1 (en) * 2019-12-12 2021-06-17 中兴通讯股份有限公司 Address management method, server and computer-readable storage medium
CN114598681A (en) * 2020-11-30 2022-06-07 华为技术有限公司 Address allocation processing method and equipment
CN114844863A (en) * 2021-02-02 2022-08-02 中兴通讯股份有限公司 Method for dynamically allocating access equipment address to multiple DHCP server networks and gateway equipment
CN114124812A (en) * 2021-11-22 2022-03-01 迈普通信技术股份有限公司 Method and device for maintaining consistency of table items and electronic equipment
CN114553761A (en) * 2022-01-14 2022-05-27 新华三技术有限公司合肥分公司 Exception handling method, exception handling device, network equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
李明亮;: "关于动态主机地址分配的协议方案", 宝鸡文理学院学报(自然科学版), no. 03, 15 September 2010 (2010-09-15) *
陈广宇;葛冬梅;: "网络管理中IP地址冲突的解决", 黑龙江科技信息, no. 04, 15 February 2003 (2003-02-15) *
黄彩凤;: "DHCP基本原理及配置", 铁道通信信号, no. 07, 17 July 2009 (2009-07-17) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116192801A (en) * 2023-02-17 2023-05-30 浪潮思科网络科技有限公司 DHCP (dynamic host configuration protocol) table entry synchronization method, equipment and medium based on MLAG (media-based access control) environment
CN116192801B (en) * 2023-02-17 2024-03-26 浪潮思科网络科技有限公司 DHCP (dynamic host configuration protocol) table entry synchronization method, equipment and medium based on MLAG (media-based access control) environment

Also Published As

Publication number Publication date
CN115499414B (en) 2025-03-04

Similar Documents

Publication Publication Date Title
CN101330531B (en) Method for processing DHCP address allocation and DHCP relay
US7263559B2 (en) Method for preventing IP address cheating in dynamic address allocation
CN102025798B (en) Address allocation processing method, device and system
US6880000B1 (en) Automatic address management method
US6697360B1 (en) Method and apparatus for auto-configuring layer three intermediate computer network devices
CN111277674B (en) Managing address space across network elements
WO2014094633A1 (en) Method, relay device, and system for acquiring internet protocol address in network
JP2009239931A (en) Method and system for automatic allocation of resources in communication network
CN102299932B (en) Backup method for DHCP (Dynamic Host Configuration Protocol) server and DHCP server
WO2012109841A1 (en) Method and apparatus for keeping network connection alive under a dynamic address configuration
CN103945016B (en) A kind of method and system of Dynamic Host Configuration Protocol server master-slave redundancy
JP2008028914A (en) Device and method for reducing communication load, and program
EP2888863B1 (en) Method and apparatus for configuring dhcp client
JP3948278B2 (en) Setting information allocation method for external network connection
CN108429824B (en) Address allocation method and device
CN101237460B (en) Processing method, system and device when DHCP server end lease state changes
CN113347282A (en) IP address distribution and duplicate checking method and system for satellite internet
CN115499414A (en) Address allocation method and device
CN104410727A (en) Address distributing method, client terminal, server and address distributing system
CN104092561B (en) 4over6 dynamic address distribution server failure backup method
Ou et al. Automatically configuring the IP addresses for mobile network in collaborative network
CN114448942B (en) A DHCP message processing method, device, electronic equipment and storage medium
CN118264645B (en) Method and system for distributing address of router down-hanging device based on DHCP
JP4305202B2 (en) Address management server, system, and server program
KR100377628B1 (en) Implementation method of simultaneously working DHCP server and BOOTP relay agent

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant