技术领域technical field
本发明涉及通信领域,具体而言,涉及一种动态主机配置协议DHCP服务器管理方法及装置。The invention relates to the communication field, in particular to a dynamic host configuration protocol DHCP server management method and device.
背景技术Background technique
在接入设备工程应用中,用户基本通过动态主机配置协议(Dynamic HostConfiguration Protocol,简称为DHCP)获取IP地址实现上网或者语音业务,而通常DHCP客户端和DHCP服务器不在一个局域网中,则就需要接入设备具有DHCP中继功能。DHCP中继主要完成将收到DHCP客户端发送的请求报文后,转换成单播报文发送给DHCP服务器,同时将DHCP服务器发送的响应报文转发给DHCP客户端,从而DHCP客户端可以成功获取IP地址,实现相关业务。In the application of access device engineering, users basically obtain IP addresses through Dynamic Host Configuration Protocol (DHCP for short) to realize Internet access or voice services. The incoming device has the DHCP relay function. The DHCP relay mainly completes receiving the request message sent by the DHCP client, converting it into a unicast message and sending it to the DHCP server, and at the same time forwarding the response message sent by the DHCP server to the DHCP client, so that the DHCP client can successfully obtain IP address to realize related services.
在相关技术中,在使用DHCP获取IP地址的用户可能因为获取不到IP地址出现上不了网,打不了电话的情况,如果很长时间都得不到恢复,那么用户多半就要投诉了。In related technologies, users who use DHCP to obtain IP addresses may not be able to access the Internet or make phone calls because they cannot obtain IP addresses. If they cannot be recovered for a long time, most users will complain.
针对相关技术中,用户使用DHCP获取不到IP地址的问题,目前尚未提出有效的解决方案。Aiming at the problem in the related technology that the user cannot obtain the IP address by using the DHCP, no effective solution has been proposed yet.
发明内容Contents of the invention
本发明提供了一种动态主机配置协议DHCP服务器管理方法及装置,以至少解决用户使用DHCP获取不到IP地址的问题。The invention provides a dynamic host configuration protocol DHCP server management method and device to at least solve the problem that users cannot obtain IP addresses by using DHCP.
根据本发明的一个方面,提供了一种动态主机配置协议DHCP服务器管理方法,包括:According to one aspect of the present invention, a kind of dynamic host configuration protocol DHCP server management method is provided, comprising:
DHCP中继根据转发策略发送DHCP客户端的请求报文给第一DHCP服务器;The DHCP relay sends the request message of the DHCP client to the first DHCP server according to the forwarding strategy;
在预设时间段和/或预设转发次数内,所述DHCP中继没有收到所述第一DHCP服务器对所述请求报文的响应报文,所述DHCP中继根据所述转发策略将所述第一DHCP服务器切换到第二DHCP服务器。Within the preset time period and/or the preset number of forwarding times, the DHCP relay does not receive a response message from the first DHCP server to the request message, and the DHCP relay sends the request message according to the forwarding policy The first DHCP server switches to the second DHCP server.
进一步地,所述转发策略包括以下至少之一:Further, the forwarding strategy includes at least one of the following:
主备策略,用于所述请求报文发送给主服务器;The active-standby strategy is used to send the request message to the active server;
轮循策略,用于所述请求报文轮循发送给配置的服务器;A round robin strategy, used for sending the request message to the configured server in round robin;
标准策略,用于所述请求报文发送给子网中配置的所有服务器。A standard policy is used to send the request message to all servers configured in the subnet.
进一步地,在预设时间段和/或预设转发次数内,所述DHCP中继没有收到所述第一DHCP服务器发送的对所述请求报文的响应报文之后,所述方法包括:Further, after the DHCP relay does not receive a response message to the request message sent by the first DHCP server within a preset time period and/or a preset number of forwarding times, the method includes:
所述DHCP中继发送告警信息给网管,所述告警信息指示所述第一DHCP服务器不可用。The DHCP relay sends alarm information to the network manager, and the alarm information indicates that the first DHCP server is unavailable.
进一步地,所述DHCP中继发送告警信息给网管之后,所述方法还包括:Further, after the DHCP relay sends the alarm information to the network manager, the method further includes:
所述DHCP中继根据所述转发策略继续发送DHCP客户端所述请求报文给第一DHCP服务器,在收到所述第一DHCP服务器对所述请求报文的响应报文的情况下,通知所述网管告警恢复。The DHCP relay agent continues to send the request message of the DHCP client to the first DHCP server according to the forwarding strategy, and notifies The network management alarm is recovered.
进一步地,在所述转发策略为所述主备策略或者所述轮循策略的情况下,所述告警信息包括所述第一DHCP服务器的网络IP地址;Further, when the forwarding strategy is the active/standby strategy or the round-robin strategy, the alarm information includes the network IP address of the first DHCP server;
在所述转发策略为标准策略的情况下,所述告警信息包括所述第一DHCP服务器所属组的身份识别ID信息。When the forwarding policy is a standard policy, the alarm information includes identification ID information of the group to which the first DHCP server belongs.
进一步地,所述DHCP中继根据所述转发策略将所述第一DHCP服务器切换第二DHCP服务器包括:Further, the DHCP relay switching the first DHCP server to the second DHCP server according to the forwarding policy includes:
在所述转发策略为所述主备策略的情况下,所述DHCP中继将所述第一DHCP服务切换为所述第一DHCP服务器的所述第二DHCP服务器,其中,所述第一DHCP服务器为主服务器,所述第二DHCP服务器为所述主服务器的一个或多个备服务器;In the case where the forwarding policy is the active/standby policy, the DHCP relay switches the first DHCP service to the second DHCP server of the first DHCP server, wherein the first DHCP The server is the main server, and the second DHCP server is one or more backup servers of the main server;
在所述转发策略为所述轮循策略的情况下,所述DHCP中继轮循所述第一DHCP服务器到下一个所述第二DHCP服务器;In the case where the forwarding strategy is the round robin strategy, the DHCP relay rounds the first DHCP server to the next second DHCP server;
在所述转发策略为所述标准策略的情况下,所述DHCP中继将所述请求报文发送给所述第一DHCP服务器所属子网中配置的所有服务器。When the forwarding policy is the standard policy, the DHCP relay sends the request message to all servers configured in the subnet to which the first DHCP server belongs.
进一步地,所述DHCP中继根据所述转发策略将所述第一DHCP服务器切换第二DHCP服务器后,所述方法包括:Further, after the DHCP relay switches the first DHCP server to the second DHCP server according to the forwarding policy, the method includes:
所述DHCP中继配置所述第一DHCP服务器的复活时间,到所述复活时间时,所述DHCP中继确认所述第一DHCP服务器可用;The DHCP relay configures the resurrection time of the first DHCP server, and when the resurrection time arrives, the DHCP relay confirms that the first DHCP server is available;
在所述转发策略为所述主备策略的情况下,所述DHCP中继将所述第一DHCP服务器的备服务器的切换为所述第一DHCP服务器的主服务器;In the case where the forwarding strategy is the active/standby strategy, the DHCP relay switches the standby server of the first DHCP server to the primary server of the first DHCP server;
在所述转发策略为所述轮循策略的情况下,所述DHCP中继将所述第二DHCP服务器轮循到所述第一DHCP服务器;In the case where the forwarding policy is the round robin policy, the DHCP relay rounds the second DHCP server to the first DHCP server;
在所述转发策略为所述标准策略的情况下,所述DHCP中继将所述请求报文发送给所述第一DHCP服务器所属子网中配置的所有服务器。When the forwarding policy is the standard policy, the DHCP relay sends the request message to all servers configured in the subnet to which the first DHCP server belongs.
根据本发明的另一个方面,还提供了一种动态主机配置协议DHCP服务器管理装置,包括:According to another aspect of the present invention, a kind of dynamic host configuration protocol DHCP server management device is also provided, comprising:
发送模块,用于DHCP中继根据转发策略发送DHCP客户端的请求报文给第一DHCP服务器;The sending module is used for the DHCP relay to send the request message of the DHCP client to the first DHCP server according to the forwarding policy;
切换模块,用于在预设时间段和/或预设转发次数内,所述DHCP中继没有收到所述第一DHCP服务器对所述请求报文的响应报文,所述DHCP中继根据所述转发策略将所述第一DHCP服务器切换到第二DHCP服务器。A switching module, configured to, within a preset time period and/or a preset number of forwarding times, if the DHCP relay does not receive a response message from the first DHCP server to the request message, the DHCP relay according to The forwarding policy switches the first DHCP server to the second DHCP server.
进一步地,所述转发策略包括以下至少之一:Further, the forwarding strategy includes at least one of the following:
主备策略,用于所述请求报文发送给主服务器;The active-standby strategy is used to send the request message to the active server;
轮循策略,用于所述请求报文轮循发送给配置的服务器;A round robin strategy, used for sending the request message to the configured server in round robin;
标准策略,用于所述请求报文发送给子网中配置的所有服务器。A standard policy is used to send the request message to all servers configured in the subnet.
进一步地,所述装置包括:Further, the device includes:
告警模块,用于所述DHCP中继发送告警信息给网管,所述告警信息指示所述第一DHCP服务器不可用。An alarm module, configured for the DHCP relay to send alarm information to a network manager, where the alarm information indicates that the first DHCP server is unavailable.
进一步地,所述装置还包括:Further, the device also includes:
告警恢复模块,用于所述DHCP中继根据所述转发策略继续发送DHCP客户端所述请求报文给第一DHCP服务器,在收到所述第一DHCP服务器对所述请求报文的响应报文的情况下,通知所述网管告警恢复。The alarm recovery module is used for the DHCP relay to continue sending the request message of the DHCP client to the first DHCP server according to the forwarding strategy, and after receiving the response report of the first DHCP server to the request message In the case of a file, notify the network manager that the alarm is recovered.
进一步地,所述切换模块包括:Further, the switching module includes:
第一切换单元,用于在所述转发策略为所述主备策略的情况下,所述DHCP中继将所述第一DHCP服务切换为所述第一DHCP服务器的所述第二DHCP服务器,其中,所述第一DHCP服务器为主服务器,所述第二DHCP服务器为所述主服务器的一个或多个备服务器;a first switching unit, configured to switch, by the DHCP relay agent, the first DHCP service to the second DHCP server of the first DHCP server when the forwarding strategy is the active/standby strategy, Wherein, the first DHCP server is a master server, and the second DHCP server is one or more standby servers of the master server;
第二切换单元,用于在所述转发策略为所述轮循策略的情况下,所述DHCP中继轮循所述第一DHCP服务器到下一个所述第二DHCP服务器;The second switching unit is configured to, when the forwarding strategy is the round-robin strategy, the DHCP relay round-robin the first DHCP server to the next second DHCP server;
第三切换单元,用于在所述转发策略为所述标准策略的情况下,所述DHCP中继将所述请求报文发送给所述第一DHCP服务器所属子网中配置的所有服务器。A third switching unit, configured to, when the forwarding policy is the standard policy, send the request message to all servers configured in the subnet to which the first DHCP server belongs, by the DHCP relay agent.
通过本发明,DHCP中继根据转发策略发送DHCP客户端的请求报文给第一DHCP服务器,在预设时间段和/或预设转发次数内,该DHCP中继没有收到该第一DHCP服务器对该请求报文的响应报文,该DHCP中继根据该转发策略将该第一DHCP服务器切换到第二DHCP服务器,解决了用户使用DHCP获取不到IP地址的问题,提高了系统的可维护性和纠错性。Through the present invention, the DHCP relay sends the request message of the DHCP client to the first DHCP server according to the forwarding policy, and within the preset time period and/or preset times of forwarding, the DHCP relay does not receive the request message from the first DHCP server. For the response message of the request message, the DHCP relay switches the first DHCP server to the second DHCP server according to the forwarding strategy, which solves the problem that the user cannot obtain an IP address by using DHCP, and improves the maintainability of the system and error correction.
附图说明Description of drawings
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention and constitute a part of the application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations to the present invention. In the attached picture:
图1是根据本发明实施例的一种动态主机配置协议DHCP服务器管理方法的流程图;Fig. 1 is a flow chart of a dynamic host configuration protocol DHCP server management method according to an embodiment of the present invention;
图2是根据本发明实施例的一种动态主机配置协议DHCP服务器管理装置的结构框图;Fig. 2 is a structural block diagram of a dynamic host configuration protocol DHCP server management device according to an embodiment of the present invention;
图3是根据本优选实施例的一种接入设备中使用DHCP服务器的方法的流程图。Fig. 3 is a flowchart of a method for using a DHCP server in an access device according to this preferred embodiment.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the present invention will be described in detail with reference to the drawings and examples. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first" and "second" in the description and claims of the present invention and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence.
在本实施例中提供了一种动态主机配置协议DHCP服务器管理方法,图1是根据本发明实施例的一种动态主机配置协议DHCP服务器管理方法的流程图,如图1所示,该流程包括如下步骤:A kind of dynamic host configuration protocol DHCP server management method is provided in the present embodiment, Fig. 1 is the flow chart of a kind of dynamic host configuration protocol DHCP server management method according to the embodiment of the present invention, as shown in Fig. 1, this process includes Follow the steps below:
步骤S102,DHCP中继根据转发策略发送DHCP客户端的请求报文给第一DHCP服务器;Step S102, the DHCP relay sends the request message of the DHCP client to the first DHCP server according to the forwarding policy;
步骤S104,在预设时间段和/或预设转发次数内,该DHCP中继没有收到该第一DHCP服务器对该请求报文的响应报文,该DHCP中继根据该转发策略将该第一DHCP服务器切换到第二DHCP服务器。Step S104, within the preset time period and/or preset times of forwarding, if the DHCP relay does not receive a response message from the first DHCP server to the request message, the DHCP relay sends the first DHCP server the first DHCP server according to the forwarding strategy. One DHCP server switches to the second DHCP server.
通过上述步骤,DHCP中继根据转发策略发送DHCP客户端的请求报文给第一DHCP服务器,在预设时间段和/或预设转发次数内,该DHCP中继没有收到该第一DHCP服务器对该请求报文的响应报文,该DHCP中继根据该转发策略将该第一DHCP服务器切换到第二DHCP服务器,解决了用户使用DHCP获取不到IP地址的问题,提高了系统的可维护性和纠错性。Through the above steps, the DHCP relay agent sends the request message of the DHCP client to the first DHCP server according to the forwarding policy, and within the preset time period and/or preset forwarding times, the DHCP relay agent does not receive the request message from the first DHCP server. For the response message of the request message, the DHCP relay switches the first DHCP server to the second DHCP server according to the forwarding strategy, which solves the problem that the user cannot obtain an IP address by using DHCP, and improves the maintainability of the system and error correction.
上述实施例中,该转发策略包括以下至少之一:In the above embodiment, the forwarding strategy includes at least one of the following:
主备策略,用于该请求报文发送给主服务器;Active/standby strategy, used to send the request message to the active server;
轮循策略,用于该请求报文轮循发送给配置的服务器;Round robin strategy, used to send the request message to the configured server in round robin;
标准策略,用于该请求报文发送给子网中配置的所有服务器。Standard policy, used to send the request packet to all servers configured in the subnet.
在本实施例中,在预设时间段和/或预设转发次数内,该DHCP中继没有收到该第一DHCP服务器发送的对该请求报文的响应报文之后,该第一DHCP服务器发送告警信息给网管,该告警信息指示该第一DHCP服务器不可用。并且在该DHCP中继根据该转发策略继续发送DHCP客户端该请求报文给第一DHCP服务器,在收到该第一DHCP服务器对该请求报文的响应报文的情况下,通知该网管告警恢复。In this embodiment, after the DHCP relay does not receive the response message to the request message sent by the first DHCP server within the preset time period and/or preset times of forwarding, the first DHCP server An alarm message is sent to the network manager, where the alarm message indicates that the first DHCP server is unavailable. And continue to send the request message of the DHCP client to the first DHCP server according to the forwarding strategy at the DHCP relay, and notify the network manager of the alarm when receiving the response message of the first DHCP server to the request message recover.
在本实施例中,在该转发策略为该主备策略或者该轮循策略的情况下,该告警信息包括该第一DHCP服务器的网络IP地址;In this embodiment, when the forwarding strategy is the active/standby strategy or the round-robin strategy, the alarm information includes the network IP address of the first DHCP server;
在该转发策略为标准策略的情况下,该告警信息包括该第一DHCP服务器所属组的身份识别ID信息。In the case that the forwarding policy is a standard policy, the alarm information includes identification ID information of the group to which the first DHCP server belongs.
在本实施例中,该DHCP中继根据该转发策略将该第一DHCP服务器切换第二DHCP服务器有多种方式,其中,可以包括以下几种方式:In this embodiment, there are multiple ways for the DHCP relay to switch the first DHCP server to the second DHCP server according to the forwarding policy, which may include the following ways:
在该转发策略为该主备策略的情况下,该DHCP中继将该第一DHCP服务器的主服务器切换为该第一DHCP服务器的备服务器;In the case where the forwarding strategy is the active/standby strategy, the DHCP relay switches the primary server of the first DHCP server to the standby server of the first DHCP server;
在该转发策略为该轮循策略的情况下,该DHCP中继轮循该第一DHCP服务器到下一个该第二DHCP服务器;In the case where the forwarding strategy is the round robin strategy, the DHCP relay rounds the first DHCP server to the next second DHCP server;
在该转发策略为该标准策略的情况下,该DHCP中继将该请求报文发送给该第一DHCP服务器所属子网中配置的所有服务器。If the forwarding policy is the standard policy, the DHCP relay agent sends the request message to all servers configured in the subnet to which the first DHCP server belongs.
在本实施例中,该DHCP中继根据该转发策略将该第一DHCP服务器切换第二DHCP服务器后,该方法包括:In this embodiment, after the DHCP relay switches the first DHCP server to the second DHCP server according to the forwarding policy, the method includes:
该DHCP中继配置该第一DHCP服务器的复活时间,到该复活时间时,该DHCP中继确认该第一DHCP服务器可用;The DHCP relay configures the resurrection time of the first DHCP server, and when the resurrection time arrives, the DHCP relay confirms that the first DHCP server is available;
在该转发策略为该主备策略的情况下,该DHCP中继将该第一DHCP服务切换为该第一DHCP服务器的该第二DHCP服务器,其中,该第一DHCP服务器为主服务器,该第二DHCP服务器为该主服务器的一个或多个备服务器;In the case where the forwarding strategy is the master/standby strategy, the DHCP relay switches the first DHCP service to the second DHCP server of the first DHCP server, wherein the first DHCP server is the master server, and the second DHCP server is the master server. 2. The DHCP server is one or more standby servers of the primary server;
在该转发策略为该轮循策略的情况下,该DHCP中继将该第二DHCP服务器轮循到该第一DHCP服务器;In the case where the forwarding strategy is the round-robin strategy, the DHCP relay rotates the second DHCP server to the first DHCP server;
在该转发策略为该标准策略的情况下,该DHCP中继将该请求报文发送给该第一DHCP服务器所属子网中配置的所有服务器。If the forwarding policy is the standard policy, the DHCP relay agent sends the request message to all servers configured in the subnet to which the first DHCP server belongs.
在本实施例中还提供了一种动态主机配置协议DHCP服务器管理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides a dynamic host configuration protocol DHCP server management device, which is used to implement the above embodiments and preferred implementation modes, and those that have already been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
图2是根据本发明实施例的一种动态主机配置协议DHCP服务器管理装置的结构框图,如图2所示,该装置包括Fig. 2 is a structural block diagram of a dynamic host configuration protocol DHCP server management device according to an embodiment of the present invention, as shown in Fig. 2, the device includes
发送模块22,用于DHCP中继根据转发策略发送DHCP客户端的请求报文给第一DHCP服务器;The sending module 22 is used for the DHCP relay to send the request message of the DHCP client to the first DHCP server according to the forwarding policy;
切换模块24,用于在预设时间段和/或预设转发次数内,该DHCP中继没有收到该第一DHCP服务器对该请求报文的响应报文,该DHCP中继根据该转发策略将该第一DHCP服务器切换到第二DHCP服务器。The switching module 24 is configured to, within a preset time period and/or a preset number of times of forwarding, if the DHCP relay does not receive a response message from the first DHCP server to the request message, the DHCP relay forwards according to the forwarding strategy Switch the first DHCP server to the second DHCP server.
通过上述装置,DHCP中继根据转发策略发送DHCP客户端的请求报文给第一DHCP服务器,在预设时间段和/或预设转发次数内,该DHCP中继没有收到该第一DHCP服务器对该请求报文的响应报文,该DHCP中继根据该转发策略将该第一DHCP服务器切换到第二DHCP服务器,解决了用户使用DHCP获取不到IP地址的问题,提高了系统的可维护性和纠错性。Through the above-mentioned device, the DHCP relay sends the request message of the DHCP client to the first DHCP server according to the forwarding policy, and within the preset time period and/or preset forwarding times, the DHCP relay does not receive the request message from the first DHCP server. For the response message of the request message, the DHCP relay switches the first DHCP server to the second DHCP server according to the forwarding strategy, which solves the problem that the user cannot obtain an IP address by using DHCP, and improves the maintainability of the system and error correction.
在本实施例中,该转发策略包括以下至少之一:In this embodiment, the forwarding strategy includes at least one of the following:
主备策略,用于该请求报文发送给主服务器;Active/standby strategy, used to send the request message to the active server;
轮循策略,用于该请求报文轮循发送给配置的服务器;Round robin strategy, used to send the request message to the configured server in round robin;
标准策略,用于该请求报文发送给子网中配置的所有服务器。Standard policy, used to send the request packet to all servers configured in the subnet.
在本实施例中,该装置还包括:In this embodiment, the device also includes:
告警模块,用于该第一DHCP服务器发送告警信息给网管,该告警信息指示该第一DHCP服务器不可用。The alarm module is used for the first DHCP server to send alarm information to the network manager, and the alarm information indicates that the first DHCP server is unavailable.
在本实施例中,该装置还包括:告警恢复模块,用于该DHCP中继根据该转发策略继续发送DHCP客户端该请求报文给第一DHCP服务器,在收到该第一DHCP服务器对该请求报文的响应报文的情况下,通知该网管告警恢复。In this embodiment, the device also includes: an alarm recovery module, used for the DHCP relay to continue to send the request message of the DHCP client to the first DHCP server according to the forwarding policy, and after receiving the request message of the first DHCP server In the case of a response message to the request message, the network manager is notified of the alarm recovery.
在本实施例中,该切换模块24包括:In this embodiment, the switching module 24 includes:
第一切换单元,用于在该转发策略为该主备策略的情况下,该DHCP中继将该第一DHCP服务切换为该第一DHCP服务器的该第二DHCP服务器,其中,该第一DHCP服务器为主服务器,该第二DHCP服务器为该主服务器的一个或多个备服务器;The first switching unit is configured to switch the first DHCP service to the second DHCP server of the first DHCP server by the DHCP relay agent when the forwarding strategy is the active/standby strategy, wherein the first DHCP The server is the master server, and the second DHCP server is one or more backup servers of the master server;
第二切换单元,用于在该转发策略为该轮循策略的情况下,该DHCP中继轮循该第一DHCP服务器到下一个该第二DHCP服务器;The second switching unit is configured to, when the forwarding strategy is the round-robin strategy, the DHCP relay round-robin the first DHCP server to the next second DHCP server;
第三切换单元,用于在该转发策略为该标准策略的情况下,该DHCP中继将该请求报文发送给该第一DHCP服务器所属子网中配置的所有服务器。The third switching unit is configured to send the request message to all servers configured in the subnet to which the first DHCP server belongs when the forwarding policy is the standard policy.
下面结合优选实施例和实施方式对本发明进行详细说明。The present invention will be described in detail below in combination with preferred embodiments and implementation modes.
本优选实施例在接入设备启用DHCP中继的场景下,如果正在使用的外接DHCP服务器出现问题,可通过告警的方式快速通知设备维护人员,且能够根据系统提供的如何使用DHCP服务器的转发策略,快速切换到其它可用DHCP服务器上,提高了系统的可维护性和用户的满意度。In this preferred embodiment, in the scenario where the DHCP relay is enabled on the access device, if there is a problem with the external DHCP server being used, the device maintenance personnel can be quickly notified by means of an alarm, and the forwarding strategy of how to use the DHCP server provided by the system can be used , and quickly switch to other available DHCP servers, which improves system maintainability and user satisfaction.
图3是根据本优选实施例的一种接入设备中使用DHCP服务器的方法的流程图,如图3所示,包括以下步骤:Fig. 3 is a flow chart of a method for using a DHCP server in an access device according to this preferred embodiment, as shown in Fig. 3, including the following steps:
步骤S302,DHCP中继根据转发策略发送DHCP客户端请求报文给DHCP服务器;Step S302, the DHCP relay sends the DHCP client request message to the DHCP server according to the forwarding strategy;
步骤S304,DHCP中继转发多次客户端的请求报文且一定时间内,没有收到DHCP服务器响应报文,则产生告警发送给网管,提示当前服务器不可用,并配置此服务器的复活时间;Step S304, the DHCP relay forwards the request message of the client multiple times and does not receive the DHCP server response message within a certain period of time, then generates an alarm and sends it to the network management, prompting that the current server is unavailable, and configuring the resurrection time of the server;
步骤S306,DHCP中继根据转发策略切换到可用服务器;Step S306, the DHCP relay switches to an available server according to the forwarding strategy;
步骤S308,不可用DHCP服务器复活时间到后,DHCP中继根据转发策略切换到此服务器;Step S308, after the resurrection time of the unavailable DHCP server is up, the DHCP relay switches to this server according to the forwarding strategy;
步骤S310,产生告警的DHCP服务器响应DHCP中继发送的请求报文后,告警恢复。Step S310, after the DHCP server that generated the alarm responds to the request message sent by the DHCP relay agent, the alarm is restored.
所述方法,其中:所述步骤S302中,转发策略为如何使用DHCP服务的策略,方法包括:The method, wherein: in the step S302, the forwarding policy is a policy on how to use the DHCP service, and the method includes:
主备策略:请求报文一直发送给主服务器,除非主服务器不可用;Active/standby strategy: Request messages are always sent to the active server unless the active server is unavailable;
轮循策略:请求报文轮循发送给配置的服务器;Round robin strategy: the request message is sent to the configured server in round robin;
标准策略:请求报文发送给子网中配置的所有服务器;Standard policy: the request message is sent to all servers configured in the subnet;
所述方法,其中:所述步骤S304中,DHCP中继转发多次客户端的请求报文且一定时间内,没有收到DHCP服务器响应报文,其中次数和时间可配,且第二步中提到的复活时间也可以配置;The method, wherein: in the step S304, the DHCP relay forwards the request message of the client multiple times and within a certain period of time, the DHCP server response message is not received, wherein the number of times and the time are configurable, and the second step provides The resurrection time can also be configured;
所述第二步种的DHCP中继发送的告警信息根据转发策略信息有所不同,具体信息如下:The alarm information sent by the DHCP relay in the second step is different according to the forwarding policy information, and the specific information is as follows:
如果转发策略为主备或者轮循策略,则告警信息中包括不可用服务器的IP地址;If the forwarding strategy is active/standby or round robin, the alarm information includes the IP address of the unavailable server;
如果转发策略为标准策略,则告警信息中包括服务器所在的组ID信息If the forwarding policy is a standard policy, the alarm information includes the group ID information of the server
所述方法,其中:所述步骤S306中,切换到可用服务器的策略如下:Said method, wherein: in said step S306, the strategy of switching to an available server is as follows:
主备策略:主服务器不可用时,切换到可用的备服务器;Active/standby strategy: When the primary server is unavailable, switch to the available standby server;
轮循策略:如果轮循到的这个服务器不可用,则使用下一个可用服务器;Round robin strategy: if the round robin server is unavailable, use the next available server;
标准策略:请求报文发送给子网中配置的所有服务器,如果所有的服务器都不可用,则仍然发送给所有的服务器;Standard strategy: the request message is sent to all servers configured in the subnet, if all servers are unavailable, it is still sent to all servers;
在所述步骤S308中,不可用服务器有一个复活时间,在复活时间到后,DHCP中继认为此服务器可用,又可以根据转发策略向此服务器发送请求报文,具体实施如下:In said step S308, the unavailable server has a resurrection time. After the resurrection time is up, the DHCP relay agent thinks that the server is available, and can send a request message to the server according to the forwarding strategy. The specific implementation is as follows:
主备策略:如果主服务器可用时,则请求报文报文切换到此主服务器上;Active/standby strategy: If the active server is available, the request message is switched to the active server;
轮循策略:如果服务器复活后,下次轮循到此服务器时,报文会发给此服务器;Round robin strategy: If the server is revived, the message will be sent to the server the next time it is round robin;
标准策略:请求报文始终发送给子网中配置的所有服务器,不管是否可用;Standard policy: request packets are always sent to all servers configured in the subnet, regardless of whether they are available or not;
所述方法,其中:所述步骤S310,DHCP中继再次发送请求报文给曾经没有响应的DHCP服务器时,如果此时有响应了,则通知网管告警恢复;Said method, wherein: said step S310, when the DHCP relay sends the request message to the DHCP server that has not responded once again, if there is a response at this time, the network management is notified of the alarm recovery;
通过上述技术方案,本优选实施例实现了如下技术效果。DHCP中继根据自身服务器转发策略,认定哪些服务器可用,哪些服务器不可用,对于不可用的服务器产生告警,通知设备管理员当前哪个服务器可能出了问题,可以及时地查出问题,解决问题。并能切换到可用服务器上。在不可用服务器恢复后,产生告警恢复,提高了系统的可维护性和纠错性。同时提高了用户的满意度。Through the above technical solutions, this preferred embodiment achieves the following technical effects. The DHCP relay determines which servers are available and which servers are unavailable based on its own server forwarding policy, generates an alarm for the unavailable server, and notifies the device administrator of which server may have a problem, so that the problem can be detected and solved in a timely manner. And can switch to the available server. After the unavailable server recovers, an alarm recovery is generated, which improves the maintainability and error correction of the system. At the same time improve user satisfaction.
本优选实施例用来实现接入设备中如何使用DHCP服务器实现方法,提高了系统的可维护性和纠错性。同时提高了用户的满意度。This preferred embodiment is used to implement the method of how to use the DHCP server in the access device, which improves the maintainability and error correction of the system. At the same time improve user satisfaction.
如图3所示,步骤S302,DHCP中继根据转发策略发送DHCP客户端请求报文给DHCP服务器;As shown in Figure 3, step S302, the DHCP relay sends the DHCP client request message to the DHCP server according to the forwarding strategy;
DHCP客户端和DHCP服务器不在同一网段时,需要通信设备起用DHCP中继功能,DHCP中继转发DHCP客户端发送的请求报文给DHCP服务器,同时转发DHCP服务器响应报文给DHCP客户端,在转发DHCP客户端发送的请求报文给DHCP服务器时,选择哪些服务器,有很多策略,包括主备策略,轮循策略和标准策略。可通过网管操作界面配置转发策略和服务器地址。When the DHCP client and the DHCP server are not on the same network segment, the communication device needs to enable the DHCP relay function. The DHCP relay forwards the request message sent by the DHCP client to the DHCP server, and forwards the response message from the DHCP server to the DHCP client at the same time. When forwarding the request message sent by the DHCP client to the DHCP server, there are many strategies for selecting which servers, including active/standby strategies, round-robin strategies, and standard strategies. The forwarding policy and server address can be configured through the network management interface.
步骤S304,DHCP中继转发多次客户端的请求报文且一定时间内,没有收到DHCP服务器响应报文,则发送告警给网管,提示当前服务器不可用,并配置不可用服务器的复活时间;Step S304, the DHCP relay forwards the request message of the client multiple times and does not receive the DHCP server response message within a certain period of time, then sends an alarm to the network management, prompting that the current server is unavailable, and configures the resurrection time of the unavailable server;
通常DHCP客户端发送请求报文一段时间后,没有收到DHCP服务器的响应报文,会重发请求报文,DHCP中继收到多次DHCP客户端发送的请求报文转发给当前服务器,如果次数超过了配置的发送次数,且配置的时间也已经到达,则认为此服务器不可用,同时发送告警给网管,提示当前服务器不可用。不可用服务器并不是一直不可用,在复活时间到后,会认为此服务器又可用。DHCP中继按照转发策略使用可用服务器Usually after the DHCP client sends the request message for a period of time, if it does not receive the response message from the DHCP server, it will resend the request message, and the DHCP relay agent will forward the request message sent by the DHCP client to the current server. If the number of sending times exceeds the configured sending times, and the configured time has also been reached, the server is considered unavailable, and an alarm is sent to the network management to indicate that the current server is unavailable. An unavailable server is not always unavailable. After the resurrection time is up, the server will be considered available again. DHCP relay uses available servers according to forwarding policy
步骤S306,DHCP中继根据转发策略切换到可用服务器;Step S306, the DHCP relay switches to an available server according to the forwarding strategy;
如果当前转发策略为主备策略,且主服务器已经标志为不可用,那么下次客户端再发来的请求报文,DHCP中继会发送到下一个备用服务器,如果此备用服务器行为同主服务器,则此备用服务器也被标志为不可用,下次客户端再发来的请求报文会发送到此备用服务器的下一个备用服务器,如果没有下一个备用服务器,则直接唤醒主服务器,发送给主服务器;如果DHCP中继当前转发策略为轮循策略,DHCP中继轮循发送DHCP客户端的请求报文,如果所有的服务器都不可用了,则唤醒第一个配置的服务器;如果当前转发策略为标准策略,则每次都发送给所有的服务器If the current forwarding strategy is active/standby, and the primary server has been marked as unavailable, the next time the client sends a request message, the DHCP relay agent will send it to the next standby server. If the standby server behaves the same as the primary server , the standby server is also marked as unavailable, and the request message sent by the client next time will be sent to the next standby server of this standby server. If there is no next standby server, it will directly wake up the main server and send it to Master server; if the current forwarding strategy of the DHCP relay is a round-robin strategy, the DHCP relay sends the request message of the DHCP client in turn, and if all servers are unavailable, wake up the first configured server; if the current forwarding strategy is a standard policy, it is sent to all servers every time
步骤S308,不可用DHCP服务器复活时间到后,DHCP中继根据转发策略切换到此服务器;Step S308, after the resurrection time of the unavailable DHCP server is up, the DHCP relay switches to this server according to the forwarding strategy;
DHCP服务器被标志为不可用后,并不是一直不可用,在复活时间到后,自动转为可用状态,转发策略参考步骤S306After the DHCP server is marked as unavailable, it is not always unavailable. After the resurrection time is up, it will automatically become available. For the forwarding strategy, refer to step S306
步骤S310,产生告警的DHCP服务器响应DHCP中继发送的请求报文后,告警恢复;Step S310, after the DHCP server that generates the alarm responds to the request message sent by the DHCP relay agent, the alarm is restored;
DHCP服务器在不可用后,DHCP中继模块会发送告警给网管,网管维护人员则直到当前哪个服务器可能出了问题,会排查故障,是链路出了问题,还是服务器本身除了问题,问题排除后,且DHCP中继发送给此服务器的请求报文得到及时的响应,则系统告警恢复。告知网管维护人员当前服务器已经恢复正常使用。After the DHCP server is unavailable, the DHCP relay module will send an alarm to the network management, and the network management maintenance personnel will find out which server may have a problem, and will troubleshoot the problem. Is there a problem with the link or the server itself? After the problem is eliminated , and the request message sent by the DHCP relay agent to the server gets a timely response, the system alarm is restored. Inform the network management and maintenance personnel that the current server has resumed normal use.
通过本优选实施例,如果用户获取不到IP地址,因为DHCP服务器的原因,且接入设备不能快速通知设备维护人员,某个服务器出了问题,且在有备用服务器的场景下,能够快速切换到备用服务器上,则可以大大提高系统的可维护性和纠错性。同时提高了用户的满意度,满足运营商的需求。Through this preferred embodiment, if the user cannot obtain an IP address, because of the DHCP server, and the access device cannot quickly notify the device maintenance personnel that a certain server has a problem, and in the scenario where there is a backup server, it can be quickly switched To the standby server, the maintainability and error correction of the system can be greatly improved. At the same time, user satisfaction is improved to meet the needs of operators.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。It should be noted that each of the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following manner, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in multiple in the processor.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行上述方法步骤的程序代码:The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the above-mentioned storage medium may be configured to store program codes for executing the above-mentioned method steps:
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the above-mentioned storage medium may include but not limited to: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk Various media that can store program codes such as discs or optical discs.
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行上述实施例的方法步骤。Optionally, in this embodiment, the processor executes the method steps of the foregoing embodiments according to the program code stored in the storage medium.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each module or each step of the above-mentioned present invention can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network formed by multiple computing devices Alternatively, they may be implemented in program code executable by a computing device so that they may be stored in a storage device to be executed by a computing device, and in some cases, in an order different from that shown here The steps shown or described are carried out, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510375729.1ACN106331202A (en) | 2015-06-30 | 2015-06-30 | Dynamic host configuration protocol DHCP server management method and device |
| PCT/CN2016/079088WO2017000625A1 (en) | 2015-06-30 | 2016-04-12 | Dynamic host configuration protocol (dhcp) server management method and apparatus |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510375729.1ACN106331202A (en) | 2015-06-30 | 2015-06-30 | Dynamic host configuration protocol DHCP server management method and device |
| Publication Number | Publication Date |
|---|---|
| CN106331202Atrue CN106331202A (en) | 2017-01-11 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510375729.1APendingCN106331202A (en) | 2015-06-30 | 2015-06-30 | Dynamic host configuration protocol DHCP server management method and device |
| Country | Link |
|---|---|
| CN (1) | CN106331202A (en) |
| WO (1) | WO2017000625A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108259636A (en)* | 2017-09-29 | 2018-07-06 | 新华三技术有限公司 | A kind of message processing method and device |
| CN108632399A (en)* | 2017-08-24 | 2018-10-09 | 新华三技术有限公司 | A kind of address distribution method and device |
| CN110601786A (en)* | 2019-09-24 | 2019-12-20 | 瑞斯康达科技发展股份有限公司 | Time synchronization method, relay equipment and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111147617B (en)* | 2019-12-20 | 2022-08-12 | 互联网域名系统北京市工程研究中心有限公司 | Method and system for distributing addresses based on DHCP server cluster load |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101197811A (en)* | 2006-12-04 | 2008-06-11 | 中兴通讯股份有限公司 | Method for improving server reliability in dynamic main unit configuration protocol under proxy mode |
| US7882169B1 (en)* | 2003-02-13 | 2011-02-01 | Cisco Technology, Inc. | Method and apparatus for configuring relay processes used for dynamically configuring hosts in network communications |
| CN102404146A (en)* | 2011-11-17 | 2012-04-04 | 福建星网锐捷网络有限公司 | Master-slave switching method, network equipment and DHCP server |
| CN103944867A (en)* | 2013-01-23 | 2014-07-23 | 华为技术有限公司 | Dynamic host configuration protocol (DHCP) message processing method, device and system |
| CN104253874A (en)* | 2013-06-27 | 2014-12-31 | 华为技术有限公司 | Message sending and processing method, device and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7882169B1 (en)* | 2003-02-13 | 2011-02-01 | Cisco Technology, Inc. | Method and apparatus for configuring relay processes used for dynamically configuring hosts in network communications |
| CN101197811A (en)* | 2006-12-04 | 2008-06-11 | 中兴通讯股份有限公司 | Method for improving server reliability in dynamic main unit configuration protocol under proxy mode |
| CN102404146A (en)* | 2011-11-17 | 2012-04-04 | 福建星网锐捷网络有限公司 | Master-slave switching method, network equipment and DHCP server |
| CN103944867A (en)* | 2013-01-23 | 2014-07-23 | 华为技术有限公司 | Dynamic host configuration protocol (DHCP) message processing method, device and system |
| CN104253874A (en)* | 2013-06-27 | 2014-12-31 | 华为技术有限公司 | Message sending and processing method, device and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108632399A (en)* | 2017-08-24 | 2018-10-09 | 新华三技术有限公司 | A kind of address distribution method and device |
| CN108259636A (en)* | 2017-09-29 | 2018-07-06 | 新华三技术有限公司 | A kind of message processing method and device |
| CN108259636B (en)* | 2017-09-29 | 2021-11-02 | 新华三技术有限公司 | Message processing method and device |
| CN110601786A (en)* | 2019-09-24 | 2019-12-20 | 瑞斯康达科技发展股份有限公司 | Time synchronization method, relay equipment and device |
| CN110601786B (en)* | 2019-09-24 | 2020-12-22 | 瑞斯康达科技发展股份有限公司 | Time synchronization method, relay equipment and device |
| Publication number | Publication date |
|---|---|
| WO2017000625A1 (en) | 2017-01-05 |
| Publication | Publication Date | Title |
|---|---|---|
| JP5727055B2 (en) | System and method for session resiliency in a geographically redundant gateway | |
| JP7438202B2 (en) | UE migration methods, devices, systems, and storage media | |
| CN110535676B (en) | SMF dynamic disaster tolerance realization method, device, equipment and storage medium | |
| CN101646270B (en) | Method, system, mobility management entity and memory device for maintaining service continuity | |
| KR102392120B1 (en) | Processing method, device and system for nf component abnormality | |
| US7848338B2 (en) | Network-based reliability of mobility gateways | |
| WO2011140951A1 (en) | Method, device and system for load balancing | |
| EP3425850B1 (en) | Method and device for processing communication path | |
| CN106878072B (en) | Message transmission method and device | |
| CN102694664B (en) | Multicast method and multicast equipment | |
| CN106331202A (en) | Dynamic host configuration protocol DHCP server management method and device | |
| EP3622670B1 (en) | Connectivity monitoring for data tunneling between network device and application server | |
| US20190036793A1 (en) | Network service implementation method, service controller, and communications system | |
| JP2021512512A (en) | Service activation and deactivation methods, equipment, computer storage media | |
| WO2021129754A1 (en) | Message processing method and device, and storage medium | |
| CN108234358B (en) | Multicast message transmission method, device and machine readable storage medium | |
| CN102946348B (en) | VRRPE message processing method and equipment in a kind of double layer network | |
| CN116744352A (en) | Network disaster recovery method, device and storage medium | |
| CN104283720A (en) | Dialing method and system applied to mobile Internet and user device | |
| CN109257444B (en) | Load sharing method, device and system | |
| CN103138953A (en) | Method and system of massively texting multimedia information | |
| WO2009015613A1 (en) | Method and device for implementing disaster recovery | |
| CN109660378A (en) | A kind of method, apparatus, equipment and storage medium keeping home gateway normal communication | |
| CN118802462A (en) | Abnormal status notification method, device, equipment and readable storage medium | |
| CN106375266A (en) | Service monitoring control method and device |
| 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 | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20170111 | |
| RJ01 | Rejection of invention patent application after publication |