CN102571594B - Method of relay configuration, network node and system - Google Patents

Method of relay configuration, network node and system Download PDF

Info

Publication number
CN102571594B
CN102571594B CN201210021061.7A CN201210021061A CN102571594B CN 102571594 B CN102571594 B CN 102571594B CN 201210021061 A CN201210021061 A CN 201210021061A CN 102571594 B CN102571594 B CN 102571594B
Authority
CN
China
Prior art keywords
relay
network node
dhcp
message
election
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.)
Active
Application number
CN201210021061.7A
Other languages
Chinese (zh)
Other versions
CN102571594A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210021061.7A priority Critical patent/CN102571594B/en
Publication of CN102571594A publication Critical patent/CN102571594A/en
Application granted granted Critical
Publication of CN102571594B publication Critical patent/CN102571594B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method of relay configuration, a network node and a system. The method comprises the following steps: acquiring route information of a DHCP server; starting a first timer, and intercepting a first relay declaration message and a first relay vote message in a subnet scope; if the first timer exceeds time and the first relay declaration message or the first relay vote message is not received, starting a second timer and broadcasting a second relay vote message to the subnet scope, wherein the second relay vote message comprises vote information of a present network node; if the second timer exceeds time, the first relay declaration message is not received, and the first relay vote message which comprises vote information of a second network node whose priority is higher than priority of the present network is not received, broadcasting a second relay declaration message to the subnet scope, wherein the second relay declaration message is used for notifying the present network node as a DHCP relay. According to the method, the network node and the system, efficiency of configuring the DHCP relay is raised.

Description

Relay configuration method, network node and system
Technical Field
The embodiments of the present invention relate to communication technologies, and in particular, to a method, a network node, and a system for relay configuration.
Background
The Dynamic Host Configuration Protocol (DHCP) works using a User Datagram Protocol (UDP), and may automatically assign an IP address to a client that logs in to a Transmission control Protocol/Internet Protocol (TCP/IP) network. The DHCP protocol is based on applications above the UDP layer, with the DHCP server using a UDP port number of 67 and the DHCP client using a UDP port number of 68.
The DHCP client and the DHCP server may be located in the same broadcast domain, and in this case, the DHCP broadcast message may be directly transmitted and received between the DHCP server and the DHCP client. Or, the DHCP client and the DHCP server are located in different broadcast domains, in this case, a DHCP broadcast message sent by the DHCP client needs to be forwarded to the DHCP server through another network node of the subnet where the DHCP client is located, and the network node is called a DHCP relay. In the prior art, a DHCP relay needs to be manually configured in a subnet; if a plurality of network nodes capable of being used as DHCP relays exist in a subnet, one of the network nodes needs to be manually designated as the DHCP relay.
The existing DHCP relay needs manual configuration, and after the configured DHCP relay exits from the subnet, a new DHCP relay needs to be reconfigured, so that the operation of the DHCP relay configuration process is complex; in addition, after a certain DHCP relay configuration is completed, an operator needs to frequently detect whether the DHCP relay is online, and if it cannot be known that the configured DHCP relay exits from the subnet, the network configuration for the DHCP client in the subnet may not be performed due to that the subnet is not configured with the DHCP relay.
Disclosure of Invention
The embodiment of the invention provides a relay configuration method, a network node and a system, which are used for improving the efficiency of DHCP relay configuration.
The embodiment of the invention provides a relay configuration method, which comprises the following steps:
acquiring routing information of a DHCP server;
starting a first timer, and monitoring a first relay declaration message and a first relay election message in a subnet range; the first relay declaration message is sent by a first network node serving as a DHCP relay in a subnet; the DHCP relay is used for relaying and transmitting data exchanged between the DHCP server and a DHCP client in the subnet according to the routing information of the DHCP server; the first relay election message is sent by a second network node meeting DHCP relay election conditions in the subnet, and comprises election information of the second network node;
if the first timer is overtime and the first relay announcement message or the first relay election message is not received, starting a second timer and broadcasting a second relay election message to the subnet range; the second relay election message comprises election information of the current network node;
if the second timer is overtime, the first relay announcement message is not received, and the first relay election message comprising election information of a second network node with priority higher than that of the current network node is not received, broadcasting a second relay announcement message to the subnet range; the second relay announcement message is used for announcing the current network node as the DHCP relay.
An embodiment of the present invention further provides a network node, including:
the server information acquisition module is used for acquiring the routing information of the DHCP server;
the relay message interception module is used for starting a first timer and intercepting a first relay declaration message and a first relay election message in a subnet range; the first relay declaration message is sent by a first network node serving as a DHCP relay in a subnet; the DHCP relay is used for relaying and transmitting data exchanged between the DHCP server and a DHCP client in the subnet according to the routing information of the DHCP server; the first relay election message is sent by a second network node meeting DHCP relay election conditions in the subnet, and comprises election information of the second network node;
the relay election processing module is used for starting a second timer and broadcasting a second relay election message to the subnet range; the second relay election message comprises election information of the current network node;
a relay announcement processing module, configured to broadcast a second relay announcement message to the subnet range if the second timer is overtime, and the first relay announcement message is not received, and the first relay election message including election information of a second network node having a higher priority than the current network node is not received; the second relay announcement message is used for announcing the current network node as the DHCP relay.
The embodiment of the present invention further provides a DHCP relay configuration system, including: the system comprises a DHCP client, a first DHCP relay and a first DHCP server; the DHCP client and the first DHCP relay are located in the same subnet;
the first DHCP relay is generated by election of a plurality of network nodes included in the subnet and used for relaying and transmitting data exchanged by the DHCP server and the DHCP client; the network node participating in election of the first DHCP relay is the network node provided by the embodiment of the present invention.
According to the relay configuration method, the network node and the system provided by the embodiment of the invention, the network node can acquire the routing information of the DHCP server, and the online condition of the first network node which is currently used as the DHCP relay in the subnet where the DHCP client is located is determined by monitoring the announcement message of the first relay; acquiring the condition that a second network node in the subnet participates in DHCP relay election by monitoring a first relay election message; the DHCP relay election can be participated by broadcasting the second relay election message, and the DHCP relay is bootstrapped by broadcasting the second relay announcement message, so that the automatic configuration of the DHCP relay is realized in the subnet, the complexity of manual configuration is saved, the efficiency of DHCP relay configuration is improved, and the cost required for configuring the DHCP relay is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a relay configuration method according to an embodiment of the present invention;
fig. 2a is a first application scenario example of a relay configuration method according to an embodiment of the present invention;
fig. 2b is a second application scenario example of the method for configuring a relay according to the embodiment of the present invention;
fig. 3a is a first schematic diagram illustrating state control of a state machine operating inside a network node according to a second embodiment of the present invention;
fig. 3b is a schematic diagram illustrating state control of a state machine operating inside a network node according to a second embodiment of the present invention;
fig. 3c is a schematic diagram illustrating state control of a state machine operating inside a network node according to the second embodiment of the present invention;
FIG. 3d is an illustration of various schematic diagrams provided by a second embodiment of the present invention;
fig. 4 is a format example of a message related to DHCP relay auto-configuration according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a network node according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a relay configuration system according to a fifth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
The numbers of the following embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Fig. 1 is a flowchart of a relay configuration method according to an embodiment of the present invention. The execution main body of the embodiment can be: a certain network node within the subnet where the DHCP client is located, i.e., the current network node described below. The method shown in fig. 1 comprises:
11: and acquiring the routing information of the DHCP server.
The routing information of the DHCP server may include: address information of a DHCP server, next hop address information of the DHCP server, and the like; wherein, the number of the DHCP servers can be one or more. In the embodiment of the present invention, the DHCP server and the DHCP client are not in the same broadcast domain, for example: the DHCP server is located in a public network, or the DHCP server is located in other subnets except the subnet where the DHCP client is located, and the like. If the DHCP server is located in another subnet, the routing information of the DHCP server may further include: information of the subnet where the DHCP server is located, and the like.
The obtaining mode of the routing information of the DHCP server is not limited, for example: the routing information of the DHCP server can be configured on the current network node in advance; or, the routing information of the DHCP server may be acquired according to a received broadcast message including the routing information of the DHCP server; the broadcast message includes: the first relay declaring message or other DHCP messages except the first relay declaring message.
12: starting a first timer, and monitoring a first relay declaration message and a first relay election message in a subnet range; the first relay declaration message is sent by a first network node serving as a DHCP relay in a subnet; the DHCP relay is used for relaying and transmitting data exchanged between the DHCP server and a DHCP client in the subnet according to the routing information of the DHCP server; and the first relay election message is sent by a second network node meeting the DHCP relay election condition in the subnet, and comprises election information of the second network node.
In a subnet range where the DHCP client is located, a first network node which is currently used as a DHCP relay can periodically broadcast a first relay declaration message to the subnet range with a first preset time as an interval; the first relay announcement message is used for announcing that the first network node is the DHCP relay.
A second network node within the subnet that meets DHCP relay election conditions may send a first relay election message for participating in the election of the DHCP relay within the subnet. And the second network node can periodically broadcast the first relay election message to the subnet by taking the second preset time length as an interval. When a first network node serving as a DHCP relay exists in the subnet, the first network node broadcasts a first relay announcement message to the subnet, and the first relay announcement message is used for announcing the first network node serving as the DHCP relay.
Optionally, if the first relay announcement message or the first relay election message is received within the timing range of the first timer, the first timer is restarted.
13: if the first timer is overtime and the first relay announcement message or the first relay election message is not received, starting a second timer and broadcasting a second relay election message to the subnet range; the second relay election message includes election information of the current network node.
The current network node may broadcast a second relay election message to a subnet for participating in election of a DHCP relay in the subnet. Optionally, the current network node may periodically broadcast the second relay election packet to the subnet with a second preset time period as an interval.
14: if the second timer is overtime, the first relay announcement message is not received, and the first relay election message comprising election information of a second network node with priority higher than that of the current network node is not received, broadcasting a second relay announcement message to the subnet range; the second relay announcement message is used for announcing the current network node as the DHCP relay.
Optionally, if the first relay announcement packet is received within the timing range of the second timer, or a first relay election packet including election information of a second network node higher in priority than the current network node is received, steps 12 and 13 may be performed.
Optionally, the election information of the second network node is a second identifier of the second network node. Before broadcasting the second relay announcement message within the subnet, the method may further include: determining the first relay election message received in the timing range of the second timer; acquiring a second identification code of the second network node included in the determined first relay election message; and determining the priority level of the second network node and the priority level of the first network node by comparing the sizes of the second identification code and the first identification code. For example: comparing a second identifier of the second network node with the first identifier of the current network node; and determining whether the priority of the election information of the second network node is higher than the priority of the election information of the current network node according to a preset judgment criterion.
The first identification code, the second identification code and the judgment criterion may be set according to actual needs, and the embodiment of the present invention is not limited. An alternative implementation is for example:
judgment criterion 1: MAC addresses are small in preference. The second identifier of the second network node is: a second MAC address of a second network node; the first identification code of the current network node is: a first MAC address of the current network node. If the second MAC address of the second network node is smaller than the first MAC address of the current network node, the priority of the election information of the second network node is higher than that of the election information of the current network node; otherwise, the priority of the election information of the second network node is lower than that of the election information of the current network node.
Judgment criterion 2: MAC addresses are large priority. If the second MAC address of the second network node is larger than the first MAC address of the current network node, the priority of the election information of the second network node is higher than that of the election information of the current network node; otherwise, the priority of the election information of the second network node is lower than that of the election information of the current network node.
Judgment criterion 3: the priority is that the random number is large. The second identifier of the second network node is: a second random number generated by the second network node; the first identification code of the current network node is: a generated first random number of a current network node. If the second random number of the second network node is smaller than the first random number of the current network node, the priority of the election information of the second network node is higher than the priority of the election information of the current network node; otherwise, the priority of the election information of the second network node is lower than that of the election information of the current network node.
Judgment criterion 4: the priority is that the random number is large. If the second random number of the second network node is larger than the first random number of the current network node, the priority of the election information of the second network node is higher than the priority of the election information of the current network node; otherwise, the priority of the election information of the second network node is lower than that of the election information of the current network node.
It should be understood that the above identification codes and judgment criteria are only optional examples, and should not be construed as limiting the technical solution of the embodiment of the present invention.
Optionally, after the current network node broadcasts the second relay announcement packet to a subnet range, other network nodes in the subnet determine that the current network node is the DHCP relay; because the current network node acquires the routing information of the DHCP server, after the current network node is used as the DHCP relay, data exchange can be carried out between the DHCP client and the DHCP server within the subnet range through the DHCP relay.
In the method provided by this embodiment, a network node in a subnet where a DHCP client is located may obtain routing information of a DHCP server, and determine an online condition of a first network node currently serving as a DHCP relay in the subnet by intercepting a first relay announcement message; acquiring the condition that a second network node in the subnet participates in DHCP relay election by monitoring a first relay election message; and can participate in DHCP relay election by broadcasting the second relay election message, and bootstrap as DHCP relay by broadcasting the second relay announcement message, thereby implementing automatic configuration of DHCP relay in the subnet.
By adopting the technical scheme provided by the embodiment, under the conditions of subnet capacity expansion, evolution upgrade or failure and the like, a DHCP relay can be generated through election among network nodes, and the DHCP relay forwards exchange data for a DHCP server and a DHCP client in the subnet, so that network configuration information of the DHCP client is obtained. According to the embodiment, the DHCP relay does not need manual configuration, the efficiency of DHCP relay configuration is improved, and the cost for configuring the DHCP relay is reduced.
Fig. 2a and fig. 2b are two application scenario examples of the DHCP relay configuration method provided by the embodiment of the present invention. As shown in fig. 2a, in the subnet where the DHCP client is located, the network node as the DHCP relay is integrated with a gateway function, and the DHCP client directly interacts with the DHCP server through the DHCP relay. As shown in fig. 2b, in the subnet where the DHCP client is located, the network node as the DHCP relay is separated from the gateway functional entity, and the DHCP client interacts with the DHCP server through the DHCP relay and through the gateway. The above two application scenarios are only application scenario examples of the embodiment of the present invention, and the DHCP relay and the gateway may be integrated into one device entity or may be separated into different device entities. The embodiment of the invention only explains the function of the DHCP relay, and does not limit whether the DHCP relay is integrated with the gateway function.
Fig. 3a is a first schematic diagram illustrating state control of a state machine operating inside a network node according to a second embodiment of the present invention. The meaning of the legend used in fig. 3a is shown in fig. 3d, and the meaning of the states in which the network node is located, the operation of the network node in the states, and the specification of the conditions to be met for the network node to transition between the different states are shown in table 1.
TABLE 1
And in the subnet range, the DHCP relay manually configured by the user is the formal DHCP relay. The formal DHCP relay 2 state shown in fig. 3a and table 1 represents an application scenario in which DCHP relay auto-configuration and user configuration are compatible. A network node in any state other than the formal DHCP relay 2 state in the subnet may be configured as a formal DHCP relay, and the network node further transitions to the formal DHCP relay 2 state, and an example of a state machine of the network node is shown in fig. 3 b.
And the network node in the formal DHCP relay 2 state can also start or close the DHCP relay automatic configuration function. And if the network node configured as the formal DHCP relay closes the DHCP relay automatic configuration function, not processing the message related to the DHCP relay automatic configuration. If the network node configured as the formal DHCP relay starts the automatic configuration function of the DHCP relay, the network node can be used as a common network node to participate in the automatic configuration flow of the DHCP relay besides the basic function of the network node as the formal DHCP relay.
Optionally, a network node in any state other than the termination 6 state in the subnet may close the DHCP relay auto-configuration function of the network node, and the network node further transitions to the termination 6 state, where an example of a state machine of the network node is shown in fig. 3 c.
Optionally, the network node in the configuration 1 state reads configuration data, where the configuration data may include: information whether to start a DHCP relay automatic configuration function; the method can also comprise the following steps: whether the information of the formal DHCP relay, the timing duration of the first timer, the timing duration of the second timer, the first preset duration, the second preset duration and the like are configured or not. The various types of time length information can be pre-configured through different values of configuration parameters of the network nodes. The names, values and meanings of the configuration parameters are shown in table 2.
TABLE 2
Optionally, the DHCP relay automatically configures related messages, such as a relay announcement message, a relay election message, and the like, and may adopt a format of an Address Resolution Protocol (ARP) broadcast message. Bits 28-44 of the existing ARP broadcast message are reserved bits, and the meaning of the DHCP relay auto-configuration related message can be defined based on the extension of these bits.
Fig. 4 is a format example of a message related to DHCP relay auto-configuration according to a third embodiment of the present invention. In the ARP message shown in fig. 4:
the 28 th to 32 th bytes are message type identifiers: these bytes may be populated with a message identification code, such as an ASCII code populated with "dardardardardar," for identifying the message as one associated with DHCP relay auto-configuration.
Bytes 36-44 are options (Option), including: a Type (Type) option, a payload Length (Length) option, a Value (Value) option, etc. If a certain ARP broadcast message does not carry an Option (Option), all bytes of the Option (Option) are filled with 0; if the value of the Type (Type) option is equal to 0, the Type (Type) option is represented as an invalid option; the Length option of the payload Length takes a byte as a unit and can take a value of 0-8, and when the Length option of the payload Length is greater than 8, the Length option of the payload Length is represented as an invalid option; the Value length of the Value (Value) option is 0-8 bytes, and if the Value length of the Value (Value) option is less than 8, the tail of the Value (Value) option is filled with 0.
The meaning of the different values of each specific Option in the above options (options) is shown in table 3.
TABLE 3
Optionally, in table 3 above: the options carrying the routing information of the DHCP server, such as the address of the DHCP server and the next hop address reaching the DHCP server, can be carried in the DHCP relay announcement message and sent; the option carrying the election information of the network node, such as a software or hardware identifier, or a random number, may be carried in the DHCP relay election message and sent.
Optionally, in order to prevent abnormal refreshing of the neighbor table entry of the network neighbor, the text part of the ARP broadcast message shown in fig. 4 conforms to the collision detection message format of RFC 5227, that is: the values of the source IP address (SPA) domain and the source MAC address domain (SHA) are not matched, and the values of the destination IP address (TPA) domain and the destination MAC address domain (THA) are not matched. The values of these fields are for example:
source IP address (SPA) field 0.0.0.0;
the source MAC address field (SHA) field is the interface MAC address of the network node that sent the packet;
the destination IP address (SPA) field is the interface IP address of the network node that sent the message;
the source MAC address field (SHA) field is 0x 000000000000.
If the values of the source IP address (SPA) domain and the source MAC address domain (SHA) are not matched and the values of the destination IP address (TPA) domain and the destination MAC address domain (THA) are not matched in the ARP broadcast message received by the network node, the network node does not refresh the neighbor table entry of the network node after receiving the ARP broadcast message, thereby avoiding error information possibly introduced by the ARP broadcast message to the neighbor table entry maintained by the network node, and being beneficial to realizing the compatibility with the existing system.
Fig. 5 is a schematic structural diagram of a network node according to a fourth embodiment of the present invention. The network node as shown in fig. 5 comprises: a server information acquisition module 51, a relay message interception module 52, a relay election processing module 54 and a relay announcement processing module 55.
The server information obtaining module 51 may be configured to obtain the routing information of the DHCP server.
The relay message interception module 52 may be configured to start a first timer, and intercept the first relay announcement message and the first relay election message in the subnet range; the first relay declaration message is sent by a first network node serving as a DHCP relay in a subnet; the DHCP relay is used for relaying and transmitting data exchanged between the DHCP server and a DHCP client in the subnet according to the routing information of the DHCP server; and the first relay election message is sent by a second network node meeting the DHCP relay election condition in the subnet, and comprises election information of the second network node.
The relay election processing module 54 may be configured to start a second timer and broadcast a second relay election packet to the subnet range; the second relay election message includes election information of the current network node.
The relay announcement processing module 55 may be configured to broadcast a second relay announcement message to the subnet range if the second timer expires, and the first relay announcement message is not received and the first relay election message including election information of a second network node having a higher priority than the current network node is not received; the second relay announcement message is used for announcing the current network node as the DHCP relay.
Optionally, the relay message interception module 52 may be further configured to restart the first timer if the first relay announcement message or the first relay election message is received within the timing range of the first timer.
Optionally, the server information obtaining module 51 has different specific functions according to different obtaining manners of the routing information of the DHCP server. For example: the server information obtaining module 51 may be specifically configured to pre-configure the routing information of the DHCP server on the current network node. Or, the server information obtaining module 51 may be specifically configured to obtain the routing information of the DHCP server according to a received broadcast packet including the routing information of the DHCP server; the broadcast message includes: the first relay announcement message or other DHCP messages except the first relay announcement message.
Optionally, the network node provided in this embodiment may further include: an election message determining module 531, a message election information obtaining module 532 and a priority determining module 533.
The election packet determining module 531 may be configured to determine the first relay election packet received within the timing range of the second timer.
The message election information obtaining module 532 may be configured to obtain the determined election information of the second network node included in the first relay election message, where the election information of the second network node is the second identifier of the second network node.
The priority determining module 533 is configured to determine the priority of the second network node and the priority of the first network node by comparing the sizes of the second identification code and the first identification code, for example: and when the second identification code is smaller than or larger than the first identification code of the current network node, determining that the priority of the election information of the second network node is lower than that of the current network node.
The network node provided by this embodiment can obtain the routing information of the DHCP server, and determine the online condition of the first network node currently serving as the DHCP relay in the subnet where the DHCP client is located by intercepting the first relay announcement message; acquiring the condition that a second network node in the subnet participates in DHCP relay election by monitoring a first relay election message; the DHCP relay election can be participated by broadcasting the second relay election message, and the DHCP relay is bootstrapped by broadcasting the second relay announcement message, so that the automatic configuration of the DHCP relay is realized in the subnet, the complexity of manual configuration is saved, the efficiency of DHCP relay configuration is improved, and the cost required for configuring the DHCP relay is reduced.
Fig. 6 is a schematic structural diagram of a relay configuration system according to a fifth embodiment of the present invention. The system shown in fig. 6 comprises: a DHCP client 61, a first DHCP relay 62 and a DHCP server 63. The DHCP client 61 and the first DHCP relay 62 are located within a subnet, and the DHCP server 63 is located outside the subnet. Wherein the first DHCP relay 62 is elected by a plurality of network nodes included in the subnet, and is used for relaying data exchanged by the DHCP server and the DHCP client; the network node participating in the election of the first DHCP relay has the structure of the network node according to the corresponding embodiment of fig. 5.
Optionally, the system shown in fig. 6 may further include: a second DHCP relay 64. The function of the second DHCP relay 64 may be the same as that of the first DHCP relay 61, i.e. for relaying data exchanged by the DHCP server 63 and the DHCP client 61 (as shown in fig. 6); alternatively, the function of the second DHCP relay 64 may also be different from that of the first DHCP relay 61, i.e., for relaying data exchanged between the transmission client and another DHCP server other than the DHCP server 63 shown in fig. 6. The second DHCP relay 64 is generated by manually configuring any network node of the plurality of network nodes included in the subnet, and as the network node of the second DHCP relay, does not participate in the election of the first DHCP relay, and its working mechanism may refer to corresponding record of "formal DHCP relay" in fig. 5, which is not described herein again.
Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
Those of ordinary skill in the art will understand that: the modules in the network node in the embodiments may be distributed in the network node in the embodiments according to the description of the embodiments, or may be located in one or more network nodes different from the embodiments with corresponding changes. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (13)

1. A method of relay configuration, comprising:
the current network node acquires the routing information of a Dynamic Host Configuration Protocol (DHCP) server; the current network node refers to a certain network node in a subnet where the DHCP client is located;
the current network node starts a first timer and monitors a first relay declaration message and a first relay election message in a subnet range; the first relay declaration message is sent by a first network node serving as a DHCP relay in a subnet, and the DHCP relay is used for relaying and transmitting data exchanged between the DHCP server and a DHCP client in the subnet according to the routing information of the DHCP server; the first relay election message is sent by a second network node meeting DHCP relay election conditions in the subnet, and comprises election information of the second network node;
if the first timer is overtime and the first relay announcement message or the first relay election message is not received, the current network node starts a second timer and broadcasts a second relay election message to the subnet range; the second relay election message comprises election information of the current network node;
if the second timer is overtime, the first relay announcement message is not received, and the first relay election message comprising election information of a second network node with priority higher than that of the current network node is not received, the current network node broadcasts the second relay announcement message to the subnet range; the second relay announcement message is used for announcing the current network node as the DHCP relay.
2. The method of claim 1, further comprising:
and restarting the first timer if the first relay announcement message or the first relay election message is received within the timing range of the first timer.
3. The method of claim 1,
the election information of the second network node is a second identification code of the second network node;
before broadcasting the second relay announcement message within the subnet range, the method further includes: determining the first relay election message received in the timing range of the second timer; acquiring a second identification code of the second network node included in the determined first relay election message; and determining the priority level of the second network node and the priority level of the first network node by comparing the second identification code with the first identification code of the current network node.
4. The method of claim 3,
the second identification code is a second MAC address of the second network node, and the first identification code is a first MAC address of the current network node; or,
the second identification code is a second random number generated by the second network node, and the first identification code is a first random number generated by the current network node.
5. The method according to any of claims 1 to 4, wherein the obtaining routing information of the DHCP server comprises:
pre-configuring the routing information of the DHCP server on the current network node; or,
acquiring the routing information of the DHCP server according to the received broadcast message comprising the routing information of the DHCP server; the broadcast message includes: the first relay announcement message or other DHCP messages except the first relay announcement message.
6. The method according to any of claims 1 to 4, wherein said broadcasting a second relay announcement message to the subnet range comprises periodically broadcasting the second relay announcement message to the subnet range at intervals of a first preset duration.
7. The method of any of claims 1 to 4, further comprising periodically broadcasting the second relay election message to the subnet range at intervals of a second predetermined duration.
8. A network node, comprising:
the server information acquisition module is used for acquiring the routing information of a Dynamic Host Configuration Protocol (DHCP) server;
the relay message interception module is used for starting a first timer and intercepting a first relay declaration message and a first relay election message in a subnet range; the first relay declaration message is sent by a first network node serving as a DHCP relay in a subnet; the DHCP relay is used for relaying and transmitting data exchanged between the DHCP server and a DHCP client in the subnet according to the routing information of the DHCP server; the first relay election message is sent by a second network node meeting DHCP relay election conditions in the subnet, and comprises election information of the second network node;
the relay election processing module is used for starting a second timer and broadcasting a second relay election message to the subnet range; the second relay election message comprises election information of the current network node; the current network node refers to a certain network node in a subnet where the DHCP client is located;
a relay announcement processing module, configured to broadcast a second relay announcement message to the subnet range if the second timer is overtime, and the first relay announcement message is not received, and the first relay election message including election information of a second network node having a higher priority than the current network node is not received; the second relay announcement message is used for announcing the current network node as the DHCP relay.
9. The network node of claim 8,
the relay message interception module is further configured to restart the first timer if the first relay announcement message or the first relay election message is received within the timing range of the first timer.
10. The network node of claim 8, further comprising:
an election message determining module, configured to determine the first relay election message received within the timing range of the second timer;
a message election information obtaining module, configured to obtain election information of the second network node included in the determined first relay election message, where the election information of the second network node is a second identifier of the second network node;
and the priority determining module is used for determining the priority of the second network node and the priority of the first network node by comparing the second identification code with the first identification code of the current network node.
11. The network node according to any of claims 8-10,
the server information acquisition module is specifically configured to pre-configure the routing information of the DHCP server on the current network node;
or,
the server information obtaining module is specifically configured to obtain the routing information of the DHCP server according to a received broadcast message that includes the routing information of the DHCP server; the broadcast message includes: the first relay announcement message or other DHCP messages except the first relay announcement message.
12. A system for relay configuration, comprising:
the system comprises a DHCP client, a first DHCP relay and a DHCP server; the DHCP client and the first DHCP relay are positioned in a subnet, and the DHCP server is positioned outside the subnet;
the first DHCP relay is generated by election of a plurality of network nodes included in the subnet and used for relaying and transmitting data exchanged by the DHCP server and the DHCP client; the network node participating in the election of the first DHCP relay is the network node according to any one of claims 8 to 11.
13. The system of claim 12, further comprising:
the second DHCP relay is used for relaying and transmitting the data exchanged by the DHCP server and the DHCP client;
the second DHCP relay is generated by any one of a plurality of network nodes included in the subnet through manual configuration, and does not participate in election of the first DHCP relay as a network node of the second DHCP relay.
CN201210021061.7A 2012-01-30 2012-01-30 Method of relay configuration, network node and system Active CN102571594B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210021061.7A CN102571594B (en) 2012-01-30 2012-01-30 Method of relay configuration, network node and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210021061.7A CN102571594B (en) 2012-01-30 2012-01-30 Method of relay configuration, network node and system

Publications (2)

Publication Number Publication Date
CN102571594A CN102571594A (en) 2012-07-11
CN102571594B true CN102571594B (en) 2015-04-15

Family

ID=46416095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210021061.7A Active CN102571594B (en) 2012-01-30 2012-01-30 Method of relay configuration, network node and system

Country Status (1)

Country Link
CN (1) CN102571594B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131027A (en) * 2018-10-31 2020-05-08 中兴通讯股份有限公司 Mapping server processing method, device and storage medium
CN111447568A (en) * 2020-03-27 2020-07-24 深圳桔子智能科技发展有限公司 Gateway competition method, system and gateway
CN114827003B (en) * 2022-03-21 2024-05-14 浪潮思科网络科技有限公司 Topology election method, device, equipment and medium of distributed system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335652A (en) * 2007-06-29 2008-12-31 华为技术有限公司 Status detection method, apparatus and system of dynamic host configuring protocol

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335652A (en) * 2007-06-29 2008-12-31 华为技术有限公司 Status detection method, apparatus and system of dynamic host configuring protocol

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Linux系统的VRRP for IPv6的研究与实现;刘永刚;《吉林大学硕士学位论文》;20041215;第13页第2段至第4段、第22页至第25页 *

Also Published As

Publication number Publication date
CN102571594A (en) 2012-07-11

Similar Documents

Publication Publication Date Title
US8331245B2 (en) Method and system for IP session keepalive monitoring, home gateway and network device
JP5488642B2 (en) Portable network connection device, setting method thereof, computer program, and recording medium
US11153207B2 (en) Data link layer-based communication method, device, and system
US20100313265A1 (en) Method and Apparatus for Preventing Spoofed Packet Attacks
US8054839B2 (en) Apparatus and method of processing stateful address auto-configuration protocol in IPv6 network
WO2017153093A1 (en) Building technology device communication system with iot-network devices
CN102186261B (en) Implementation method and device for IPv6 (Internet Protocol Version 6) neighbor discovery protocol in WLAN (Wireless Local Area Network)
US20140108597A1 (en) Interface directionality assignment
CN102271050A (en) Method and system for automatically configuring network equipment in Internet protocol version 6 (IPv6) network, and network equipment
US20140082158A1 (en) Method, apparatus and system for configuring network device
CN112654049B (en) Method, system, node and medium for configuring a wireless communication coverage extension system
CN102118453B (en) Method, service device, client and communication system for automatic configuration of IP address
CN102571594B (en) Method of relay configuration, network node and system
US20120269092A1 (en) Auto-configuration of network devices
CN103516599A (en) Host finding method, network device, and host
WO2018006684A1 (en) Message processing method and device, and router
WO2016192407A1 (en) Domain name system address configuration method and apparatus, and computer storage medium
EP2345230B1 (en) Method and apparatus for allocating network resources from one address realm to clients in a different address realm
EP2566139A1 (en) Method and device for obtaining remote ip address
CN111225080B (en) Method for acquiring gateway down-hanging equipment information
CN116489068A (en) Automatic discovery of route reflection peer endpoints
CN114303346A (en) Method for managing at least one communication of a terminal device in a communication network, method for processing a communication established with a terminal device in a communication network, corresponding device, terminal device, proxy device and computer program
WO2017101028A1 (en) Data transmission method, m2m server, pgw, sgw and serving network node
CN103036648A (en) Control and provisioning of wireless access point (CAPWAP) message processing method and processing device
US20160182691A1 (en) System and Method for Operating Dual-Stack Devices

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant