Specified repeater election method, system and network equipment
By performing DF elections in EVPN, the problem of multiple network devices in the redundant group being DF or all devices being BDF at the same time is solved, and the stability of network transmission is improved.
Patent Information
- Application Number
- CN202510749780.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-06-05
AI Technical Summary
In EVPN, there are situations in which multiple network devices are DF or all devices are BDF at the same time, resulting in redundant forwarding or forwarding of packets, affecting network transmission stability.
DF elections are performed through the first and second network devices interactively routing information and effective timestamps to ensure that resource allocation is carried out according to the election results when the effective timestamp arrives, and avoid the problem of multiple DFs or all devices being BDFs at the same time.
Improve the stability of network transmission, ensure that network equipment is correctly configured as DF or BDF at the same time, and avoid packet loss caused by network equipment failure.
Smart Images

Figure CN120455232A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a method, system and network device for selecting a designated forwarder. Background Art
[0002] Ethernet Virtual Private Network (EVPN) is an efficient Layer 2 network virtualization technology widely used in data centers and wide area networks to achieve flexible connectivity in multi-tenant environments. EVPN supports the configuration of redundancy groups, which consist of multiple network devices connected to the same terminal. All network devices in the redundancy group are capable of forwarding packets for the terminal, so failure of some network devices in the group will not affect normal packet forwarding.
[0003] Network devices in a redundancy group are divided into DFs (Designated Forwarders) and BDFs (Backup Designated Forwarders). When each network device is operating normally, the DF forwards packets. If the original DF fails, the backup BDF can re-elect a new DF to replace it for packet forwarding. According to the EVPN protocol, each network device in the redundancy group performs DF election to determine whether it is the DF or the BDF.
[0004] However, if there are multiple network devices in the redundant group that are all DFs at the same time, then multiple network devices that serve as DFs will forward messages, resulting in redundant message forwarding problems. Or if all network devices in the redundant group are BDFs at the same time, no network device will forward messages, resulting in message forwarding failure and packet loss, which in turn leads to unstable network transmission. Summary of the Invention
[0005] The purpose of the embodiments of the present application is to provide a designated forwarder election method, system, and network device to improve the stability of network transmission. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a designated forwarder election method, applied to a first network device, the method comprising:
[0007] receiving first routing information sent by the second network device;
[0008] Performing a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result;
[0009] Sending the second routing information and the effective timestamp to the second network device, so that the second network device performs a DF election based on the first routing information, the second routing information, and the preset DF election rule, obtains a second election result, and configures resources according to the second election result when the effective timestamp is reached, where the effective timestamp is a timestamp a preset time after the first network device starts the DF election;
[0010] When the effective timestamp is reached, resources are configured according to the first election result.
[0011] In one embodiment of the present application, the performing of resource allocation according to the first election result when the effective timestamp is reached includes:
[0012] The first election result and the effective timestamp are delivered to a first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached.
[0013] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of a second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located; and performing DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result includes:
[0014] If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and preset DF election rules to obtain a first election result.
[0015] In one embodiment of the present application, the first network device is connected to a clock source, and the method further includes:
[0016] receiving a time reference signal sent by the clock source;
[0017] calibrating a clock of the first network device according to the time reference signal;
[0018] Based on the timing of the clock of the first network device, a validity timestamp is generated, and it is determined whether the validity timestamp has been reached.
[0019] In a second aspect, an embodiment of the present application provides a designated forwarder election method, which is applied to a second network device, and the method includes:
[0020] Sending first routing information to a first network device, so that the first network device performs a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule, obtains a first election result, and configures resources according to the first election result when an effective timestamp is reached, where the effective timestamp is a timestamp a preset time after the first network device starts the DF election;
[0021] Receiving the second routing information and the effective timestamp sent by the first network device;
[0022] Performing a DF election based on the first routing information, the second routing information, and the preset DF election rule to obtain a second election result;
[0023] When the effective timestamp is reached, resources are configured according to the second election result.
[0024] In one embodiment of the present application, performing resource configuration according to the second DF election result when the effective timestamp is reached includes:
[0025] The second election result and the effective timestamp are delivered to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
[0026] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of a second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located; and performing DF election based on the first routing information, the second routing information, and the preset DF election rule to obtain a second election result includes:
[0027] If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
[0028] In one embodiment of the present application, the second network device is connected to a clock source, and the method further includes:
[0029] receiving a time reference signal sent by the clock source;
[0030] calibrating a clock of the second network device according to the time reference signal;
[0031] Based on the timing of the clock of the second network device, it is determined whether the validity timestamp has been reached.
[0032] In a third aspect, an embodiment of the present application provides a designated forwarder election system, the system comprising: a first network device and a second network device;
[0033] The second network device is configured to send the first routing information to the first network device;
[0034] The first network device is configured to perform a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result; send the second routing information and an effective timestamp to the second network device; and perform resource allocation according to the first election result when the effective timestamp is reached;
[0035] The second network device is further configured to perform DF election based on the first routing information, the second routing information and a preset DF election rule; and configure resources according to the second election result when the effective timestamp is reached.
[0036] In one embodiment of the present application, the first network device is specifically configured to:
[0037] Sending the first election result and the effective timestamp to a first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached;
[0038] The second network device is specifically configured to:
[0039] The second election result and the effective timestamp are delivered to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
[0040] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located;
[0041] The first network device is specifically configured to:
[0042] If the Ethernet segments indicated by the first Ethernet segment information and the second Ethernet segment information are the same, performing a DF election based on the first DF election information, the second DF election information, and a preset DF election rule to obtain a first election result;
[0043] The second network device is specifically configured to:
[0044] If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
[0045] In one embodiment of the present application, the first network device and the second network device are connected to the same clock source;
[0046] The first network device is further configured to:
[0047] receiving a time reference signal sent by the clock source; calibrating the clock of the first network device according to the time reference signal; generating a valid timestamp based on the timing of the clock of the first network device, and determining whether the valid timestamp has been reached;
[0048] The second network device is further configured to:
[0049] Receive a time reference signal sent by the clock source; calibrate the clock of the second network device according to the time reference signal; and determine whether the effective timestamp is reached based on the timing of the clock of the second network device.
[0050] In a fourth aspect, an embodiment of the present application provides a network device, the network device comprising:
[0051] processor;
[0052] transceiver;
[0053] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, wherein the machine-executable instructions prompt the processor to execute the method steps described in any one of the first aspect or the second aspect.
[0054] In a fifth aspect, an embodiment of the present application provides a designated forwarder election device, applied to a first network device, the device comprising:
[0055] A first information receiving module, configured to receive first routing information sent by a second network device;
[0056] A first election module is configured to perform a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result;
[0057] a second information sending module, configured to send the second routing information and an effective timestamp to the second network device, so that the second network device performs a DF election based on the first routing information, the second routing information, and the preset DF election rule, obtains a second election result, and performs resource allocation according to the second election result when the effective timestamp is reached, where the effective timestamp is a timestamp after a preset time period from when the first network device starts the DF election;
[0058] The first resource configuration module is configured to perform resource configuration according to the first election result when the effective timestamp is reached.
[0059] In one embodiment of the present application, the first resource configuration module is specifically configured to:
[0060] The first election result and the effective timestamp are delivered to a first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached.
[0061] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of a second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located; and the first election module is specifically configured to:
[0062] If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and preset DF election rules to obtain a first election result.
[0063] In one embodiment of the present application, the first network device is connected to a clock source, and the apparatus further includes:
[0064] A first reference signal receiving module, configured to receive a time reference signal sent by the clock source;
[0065] A first clock calibration module, configured to calibrate the clock of the first network device according to the time reference signal;
[0066] The first timestamp determination module is configured to generate a valid timestamp based on the timing of a clock of the first network device, and determine whether the valid timestamp has been reached.
[0067] In a sixth aspect, an embodiment of the present application provides a designated forwarder election device, applied to a second network device, the device comprising:
[0068] a first information sending module, configured to send first routing information to a first network device, so that the first network device performs a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule, obtains a first election result, and configures resources according to the first election result when an effective timestamp is reached, where the effective timestamp is a timestamp after a preset period of time from when the first network device starts the DF election;
[0069] A second information receiving module, configured to receive the second routing information and the effective timestamp sent by the first network device;
[0070] A second election module is configured to perform a DF election based on the first routing information, the second routing information, and the preset DF election rule to obtain a second election result;
[0071] The second resource configuration module is configured to perform resource configuration according to the second election result when the effective timestamp is reached.
[0072] In one embodiment of the present application, the second resource configuration module is specifically configured to:
[0073] The second election result and the effective timestamp are delivered to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
[0074] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of a second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located; and the second election module is specifically configured to:
[0075] If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
[0076] In one embodiment of the present application, the second network device is connected to a clock source, and the apparatus further includes:
[0077] A second reference signal receiving module, configured to receive a time reference signal sent by the clock source;
[0078] a second clock calibration module, configured to calibrate the clock of the second network device according to the time reference signal;
[0079] The second timestamp determination module is configured to determine whether the valid timestamp has been reached based on the timing of the clock of the second network device.
[0080] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of the first aspect or the second aspect are implemented.
[0081] In an eighth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the methods described in the first or second aspect above.
[0082] Beneficial effects of the embodiments of the present application:
[0083] In the solution provided by the embodiment of the present application, both the first network device and the second network device perform DF elections, and the two exchange effective timestamps. Both perform resource configuration according to their respective election results when the effective timestamp is reached. The effective timestamp is a timestamp that occurs after a preset period of time from the time the first network device begins to perform DF elections. Therefore, before the effective timestamp arrives, the first network device is provided with time to perform DF elections and send the first election results to the hardware in preparation for resource configuration. It also provides time for the first network device to send the second routing information to the second network device, the second network device to perform DF elections after receiving the second routing information, and send the second election results to the hardware in preparation for resource configuration. In other words, the first network device and the second network device can theoretically complete the pre-preparation for resource configuration before the effective timestamp arrives, and jointly perform resource configuration at the effective timestamp, so that the time when the two perform resource configuration is the same, and theoretically, the two can be configured as DF and BDF respectively at the same time, so that there will be no problem of multiple DFs in the redundant group at the same time or all network devices in the redundant group being BDFs at the same time, thereby improving the stability of network transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0085] Figure 1 A flowchart of the first designated forwarder election method provided in an embodiment of the present application;
[0086] Figure 2 A schematic diagram of a network structure provided in an embodiment of the present application;
[0087] Figure 3 A flowchart of the second designated forwarder election method provided in an embodiment of the present application;
[0088] Figure 4 A flowchart of the third designated forwarder election method provided in an embodiment of the present application;
[0089] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0090] Figure 6 A schematic diagram of the structure of a first designated forwarder election device provided in an embodiment of the present application;
[0091] Figure 7 A schematic structural diagram of the second designated repeater election device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0092] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of this application.
[0093] In order to highlight the difference between the embodiments of the present application and the related art, the related art is first described.
[0094] RFC8584 specifies the DF election mechanism in EVPN, defining a timer-based DF election delay mechanism. This mechanism allows network nodes to delay DF election for a specified period (default 3 seconds) after receiving new routing information. This prevents frequent network state changes over a period of time, which can lead to frequent receipt of new routing information, frequent DF elections, and frequent resource allocation based on DF election results, which can impact network stability. Furthermore, because this delay provides time for network devices to exchange routing information, they maintain consistent routing information during DF elections. Elections based on consistent routing information can prevent conflicts in DF election results among network devices in a redundant group.
[0095] However, if the above mechanism is used, after network device 1 receives routing information from network device 2, it sends its routing information to network device 2 and then performs a DF election after a certain delay. After receiving routing information from network device 1, network device 2 also delays and performs a DF election. However, after receiving routing information from network device 2, network device 1 begins counting the delay and sends routing information to network device 2. The routing information takes some time to be sent to network device 2. Therefore, the delay starts at different times for network devices 1 and 2, resulting in different times for network devices 1 and 2 to reach their respective timings and start DF elections at different times. Network device 1 will likely complete the DF election before network device 2, causing network device 1 to change its DF or BDF configuration first, while network device 2 has not yet changed. This can lead to multiple network devices in the redundancy group being DFs, or all devices being BDFs, at the same time.
[0096] To address the above issues, related technologies have further proposed a timestamp-based fast DF election mechanism. As in the scenario described above, after network device 1 receives routing information from network device 2, it calculates the time delay from time A to time B, starting from the time A when the routing information was received. It then sends the routing information and the timestamp of time B to network device B. Both network devices A and B begin DF election at time B.
[0097] Using timestamps allows network device 1 and network device 2 to start DF election at the same time, avoiding inconsistent DF election times due to the time-consuming transmission of routing information. This improves DF election accuracy and enhances network stability and efficiency. Furthermore, network device 2 can start DF election without waiting for the entire delay, which increases the speed and accuracy of DF elections.
[0098] However, network device 1 and network device 2 have different computing resources, so the time required for DF election may differ between them. Furthermore, after the election results are received, they must be sent to the hardware driver for configuration before they take effect. This process may also take different amounts of time for the two devices to be sent to the hardware driver. Therefore, the time at which the election results take effect may differ. This can lead to multiple network devices in the redundancy group being DFs, or all devices being BDFs, at the same time.
[0099] Therefore, in order to improve network stability, the embodiments of the present application provide a designated forwarder election method, system and network device.
[0100] See also Figure 1 , a flowchart of a first designated forwarder election method provided in an embodiment of the present application, applied to a first network device, where the first network device is any network device in a redundancy group in an EVPN network, where the redundancy group includes at least two network devices. The above method includes the following steps S101-S104.
[0101] S101: Receive first routing information sent by a second network device.
[0102] During DF election, multiple network devices interact with each other, and all network devices in the redundancy group except the first network device will act as second network devices and send their first routing information to the first network device. The second network device will send its first routing information to the first network device after determining that the network environment has changed.
[0103] The first network device and the second network device are BGP (Border Gateway Protocol) neighbors and exchange routing information based on the BGP protocol.
[0104] S102: Based on the first routing information, the second routing information of the first network device, and a preset designated forwarder election rule, a designated forwarder election is performed to obtain a first election result.
[0105] In one embodiment of the present application, the first network device may perform DF election based on a hash algorithm or priority rule. For example, when the first routing information and the second routing information contain the priority of the network interface of the network device, the node with the highest priority of the network interface is selected as the DF node. When the first routing information and the second routing information contain the IP address of the network device, the node with the largest IP address is selected as the DF node. Based on the same preset DF election rules, the network nodes in the redundancy group can elect the same network node as the DF node through a consistency algorithm, and the other nodes are BDF nodes. That is, the election results of different network nodes in the redundancy group are the same.
[0106] In another embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located. The second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located. Step S102 can be implemented by following step A.
[0107] Step A: If the Ethernet segment represented by the first Ethernet segment information is the same as the Ethernet segment represented by the second Ethernet segment information, a DF election is performed based on the first DF election information, the second DF election information and preset DF election rules to obtain a first election result.
[0108] If the first and second Ethernet segment information are identical, the first and second network devices are located on the same Ethernet segment and are therefore in the same redundancy group. Therefore, the first network device can determine that the routing information of the second network device in the same redundancy group has changed and re-select a DF.
[0109] The first DF election information may include the IP address of the second network device, the priority of the network interface, etc. The second DF election information may include the IP address of the first network device, the priority of the network interface, etc.
[0110] The first Ethernet segment information and the second Ethernet segment information may be ESI (Ethernet Segment Identifier).
[0111] For the specific DF election method, please refer to the relevant technology and will not be described in detail here.
[0112] S103: Send the second routing information and the effective timestamp to the second network device, so that the second network device performs designated forwarder election based on the first routing information, the second routing information and the preset designated forwarder election rule, obtains a second election result, and performs resource configuration according to the second election result when the effective timestamp is reached.
[0113] The effective timestamp is a timestamp after a preset time period from when the first network device starts the DF election.
[0114] Specifically, the above-mentioned preset duration can be determined based on the duration required for the first network device to send the second routing information to the second network device, the duration required for the first network device and the second network device to perform DF election, and the duration required for the first network device and the second network device to send the election results to the hardware driver. Based on the above durations in the historical data, the first historical duration required from the first network device starting the DF election to the first network device sending the election results to the hardware driver can be determined, and the second historical duration required from the first network device starting the DF election to the second network device sending the election results to the hardware driver can be determined.
[0115] The first historical duration is the duration required for the first network device to perform the DF election plus the duration required for the first network device to send the first election result to the hardware driver.
[0116] The second historical duration is the duration required for the first network device to send the second routing information to the second network device + the duration required for the second network device to perform DF election + the duration required for the second network device to send the second election result to the hardware driver.
[0117] The longest historical duration between the first historical duration and the second historical duration is selected as the preset duration, and an effective timestamp is determined, so that when the effective timestamp is reached, both the first network device and the second network device can send the election result to the hardware driver as much as possible.
[0118] Alternatively, if the longest historical duration is used as the preset duration, in most cases, the first and second network devices will not take such a long time to send the election results to the hardware driver. This will result in an excessively long wait time between the first and second network devices sending the election results to the hardware driver and the election results taking effect. Therefore, the preset duration can be obtained by multiplying the longest historical duration by a preset ratio. For example, the preset ratio can be 80%, 75%, etc.
[0119] According to experience, the preset duration can be set to 3s, 3.5s, 4s, etc.
[0120] S104: When the effective timestamp is reached, resources are configured according to the first election result.
[0121] In one embodiment of the present application, step S104 is implemented by following step B.
[0122] Step B: Sending the first election result and the effective timestamp to the first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached.
[0123] In one embodiment of the present application, the first hardware driver may call an SDK (Software Development Kit) for performing resource configuration to perform resource configuration.
[0124] Specifically, if the first network device is a DF, resource configuration is performed to enable network resources for message forwarding, and if the first network device is a BDF, resource configuration is performed to disable network resources for message forwarding.
[0125] In one embodiment of the present application, in order to further ensure that the first network device and the second network device can configure resources at the same time, the first network device is connected to a clock source, and the first network device further performs the following steps C-E.
[0126] Step C: Receive the time reference signal sent by the above clock source.
[0127] Step D: Calibrate the clock of the first network device according to the time reference signal.
[0128] Step E: Generate a valid timestamp based on the timing of the clock of the first network device, and determine whether the valid timestamp has been reached.
[0129] That is, the clock of the first network device is synchronized with the clock of the clock source.
[0130] Furthermore, the first network device and the second network device are both connected to a clock source, and the first network device and the second network device both determine the time based on the time reference signal generated by the clock source, and adopt a precise time synchronization protocol (NTP, Network Time Protocol) to synchronize the time of the first network device and the second network device.
[0131] As can be seen above, the first network device and the second network device both perform DF elections and exchange effective timestamps. When the effective timestamp is reached, both perform resource configuration according to their respective election results. The effective timestamp is a timestamp that occurs a preset amount of time after the first network device begins DF election. Therefore, before the effective timestamp arrives, the first network device has time to perform DF elections and send the first election results to the hardware in preparation for resource configuration. It also provides time for the first network device to send second routing information to the second network device, for the second network device to perform DF elections after receiving the second routing information, and for the second network device to send the second election results to the hardware in preparation for resource configuration. In other words, the first network device and the second network device can theoretically complete pre-configuration preparations for resource configuration before the effective timestamp arrives. By jointly performing resource configuration at the effective timestamp, the first and second network devices can perform resource configuration at the same time. Consequently, they can theoretically be configured as DF and BDF, respectively, at the same time. This eliminates the issue of multiple DFs in the redundancy group at the same time, or the issue of all network devices in the redundancy group being BDFs at the same time, thereby improving network transmission stability.
[0132] See also Figure 2 , is a schematic diagram of a network structure provided in an embodiment of the present application.
[0133] The diagram includes PE 1, PE 2, and PE 3. PE 1 is connected to CED 1 and is located on Ethernet segment 1. PE 2 and PE 3 are connected to CED 2 and belong to the same redundancy group, both located on Ethernet segment 2. Communication between PE 1 and PE 2, and between PE 1 and PE 3, is based on the Internetwork Protocol / Multiprotocol Label Switching (IPLS) protocol.
[0134] The clocks of PE devices 1, 2, and 3 in the network are synchronized. If PE device 2 recovers after a failure, a BGP neighbor relationship is established between PE device 2, PE device 1, and PE device 3.
[0135] PE 2, as the first network device, receives first routing information sent by PE 1 and PE 3 (with PE 1 and PE 3 serving as the second network device). PE 2 determines that the first Ethernet segment information carried in the first routing information sent by PE 3 is identical to the second Ethernet segment information in PE 2's own second routing information. Therefore, PE 3 and PE 2 are on the same Ethernet segment. PE 2's election conditions are met. PE 2 then initiates a DF election based on the first routing information sent by PE 3 and the second routing information of PE 2, obtaining a first election result. PE 2 then sends the first routing information and an effective timestamp to PE 3, serving as the second network device. When the effective timestamp arrives, PE 2 configures resources based on the first election result. PE 2 also determines that the first Ethernet segment information carried in the first routing information sent by PE 1 is different from the second Ethernet segment information in PE 2's own second routing information. Therefore, PE 3 and PE 2 are on different Ethernet segments, and no DF election is required between PE 2 and PE 1.
[0136] The provider edge device 3 performs DF election based on the second routing information received from the provider edge device 2 and its own first routing information to obtain a second election result, and configures resources based on the second election result when the effective timestamp arrives.
[0137] Corresponding to the aforementioned designated forwarder election method applied to the first network device, an embodiment of the present application also provides a designated forwarder election method applied to the second network device.
[0138] See also Figure 3 , which is a flow chart of the second designated forwarder election method provided in an embodiment of the present application, applied to a second network device, and the method includes the following steps S301-S304.
[0139] S301: Send first routing information to a first network device, so that the first network device performs a designated forwarder election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder election rule, obtains a first election result, and performs resource configuration according to the first election result when an effective timestamp is reached.
[0140] The above-mentioned effective timestamp is a timestamp after a preset period of time from the first network device starting the DF election.
[0141] S302: Receive the second routing information and the effectiveness timestamp sent by the first network device.
[0142] S303: Perform designated forwarder election based on the first routing information, the second routing information, and the preset designated forwarder election rule to obtain a second election result.
[0143] S304: When the effective timestamp is reached, resources are configured according to the second election result.
[0144] As can be seen above, the first network device and the second network device both perform DF elections and exchange effective timestamps. When the effective timestamp is reached, both perform resource configuration according to their respective election results. The effective timestamp is a timestamp that occurs a preset amount of time after the first network device begins DF election. Therefore, before the effective timestamp arrives, the first network device has time to perform DF elections and send the first election results to the hardware in preparation for resource configuration. It also provides time for the first network device to send second routing information to the second network device, for the second network device to perform DF elections after receiving the second routing information, and for the second network device to send the second election results to the hardware in preparation for resource configuration. In other words, the first network device and the second network device can theoretically complete pre-configuration preparations for resource configuration before the effective timestamp arrives. By jointly performing resource configuration at the effective timestamp, the first and second network devices can perform resource configuration at the same time. Consequently, they can theoretically be configured as DF and BDF, respectively, at the same time. This eliminates the issue of multiple DFs in the redundancy group at the same time, or the issue of all network devices in the redundancy group being BDFs at the same time, thereby improving network transmission stability.
[0145] In one embodiment of the present application, the above step S304 is implemented by the following step F.
[0146] Step F: Sending the second election result and the effective timestamp to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
[0147] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment on which the second network device resides. The second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment on which the first network device resides. Step S303 can be implemented by following Step G.
[0148] Step G: If the first Ethernet segment information and the second Ethernet segment information represent the same Ethernet segment, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
[0149] In one embodiment of the present application, the second network device is connected to a clock source, and the method further includes the following steps H-J.
[0150] Step H: Receive the time reference signal sent by the above clock source.
[0151] Step I: calibrate the clock of the second network device according to the time reference signal.
[0152] Step J: Based on the timing of the clock of the second network device, determine whether the validity timestamp has been reached.
[0153] Corresponding to the aforementioned designated forwarder election method, an embodiment of the present application also provides a designated forwarder election system.
[0154] See also Figure 4 , which is a flow chart of the third designated forwarder election method provided in an embodiment of the present application, including the following steps S401-S406.
[0155] S401: The second network device sends first routing information to the first network device.
[0156] S402: The first network device performs designated forwarder election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder election rule to obtain a first election result.
[0157] S403: The first network device sends the second routing information and the effective timestamp to the second network device.
[0158] S404: The first network device performs resource configuration according to the first election result when the effective timestamp is reached.
[0159] S405: The second network device performs designated forwarder election based on the first routing information, the second routing information and a preset DF election rule.
[0160] S406: When the second network device reaches the effective timestamp, the second network device performs resource configuration according to the second election result.
[0161] As can be seen above, the first network device and the second network device both perform designated forwarder elections and exchange effective timestamps. Upon reaching the effective timestamp, both perform resource configuration according to their respective election results. The effective timestamp is a timestamp that occurs a preset amount of time after the first network device begins performing DF elections. Therefore, before the effective timestamp arrives, the first network device has time to perform DF elections and send the first election results to the hardware in preparation for resource configuration. It also provides time for the first network device to send second routing information to the second network device, for the second network device to perform DF elections after receiving the second routing information, and for the second network device to send the second election results to the hardware in preparation for resource configuration. In other words, the first network device and the second network device can theoretically complete resource configuration preparatory preparations before the effective timestamp arrives. By jointly performing resource configuration at the effective timestamp, the first and second network devices can perform resource configuration at the same time. Consequently, they can theoretically be configured as DF and BDF, respectively, at the same time. This eliminates the issue of multiple DFs in the redundancy group at the same time, or the issue of all network devices in the redundancy group being BDFs at the same time, thereby improving network transmission stability.
[0162] In one embodiment of the present application, the first network device is specifically configured to:
[0163] Sending the first election result and the effective timestamp to the first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached;
[0164] The second network device is specifically configured to:
[0165] The second election result and the effective timestamp are sent to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
[0166] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located;
[0167] The first network device is specifically configured to:
[0168] If the first Ethernet segment information and the second Ethernet segment information represent the same Ethernet segment, a DF election is performed based on the first DF election information, the second DF election information, and a preset DF election rule to obtain a first election result.
[0169] The second network device is specifically configured to:
[0170] If the first Ethernet segment information and the second Ethernet segment information represent the same Ethernet segment, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
[0171] In one embodiment of the present application, the first network device and the second network device are connected to the same clock source;
[0172] The first network device is further configured to:
[0173] receiving a time reference signal sent by the clock source; calibrating the clock of the first network device according to the time reference signal; generating an effective timestamp based on the timing of the clock of the first network device, and determining whether the effective timestamp has been reached;
[0174] The second network device is further configured to:
[0175] Receive a time reference signal sent by the clock source; calibrate the clock of the second network device according to the time reference signal; and determine whether the effective timestamp has been reached based on the timing of the clock of the second network device.
[0176] As can be seen from the above, the clocks of the first network device and the second network device are kept synchronized, which can further ensure that the first network device and the second network device can configure resources at the same time.
[0177] Corresponding to the aforementioned designated forwarder election method, an embodiment of the present application also provides a network device.
[0178] See also Figure 5 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device comprising:
[0179] Processor 501;
[0180] transceiver 504;
[0181] A machine-readable storage medium 502 stores machine-executable instructions that can be executed by the processor 501, and the machine-executable instructions prompt the processor 501 to execute the above-mentioned designated forwarder election method applied to the first network device or the designated forwarder election method applied to the second network device.
[0182] like Figure 5 As shown, the network device may further include a communication bus 503. The processor 501, the machine-readable storage medium 502, and the transceiver 504 communicate with each other via the communication bus 503. The communication bus 503 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 503 may be divided into an address bus, a data bus, a control bus, and the like.
[0183] The transceiver 504 may be a wireless communication module. Under the control of the processor 501 , the transceiver 504 exchanges data with other devices.
[0184] The machine-readable storage medium 502 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the machine-readable storage medium 502 may be at least one storage device located remote from the processor.
[0185] The processor 501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0186] As can be seen above, the first network device and the second network device both perform DF elections and exchange effective timestamps. When the effective timestamp is reached, both perform resource configuration according to their respective election results. The effective timestamp is a timestamp that occurs a preset amount of time after the first network device begins DF election. Therefore, before the effective timestamp arrives, the first network device has time to perform DF elections and send the first election results to the hardware in preparation for resource configuration. It also provides time for the first network device to send second routing information to the second network device, for the second network device to perform DF elections after receiving the second routing information, and for the second network device to send the second election results to the hardware in preparation for resource configuration. In other words, the first network device and the second network device can theoretically complete pre-configuration preparations for resource configuration before the effective timestamp arrives. By jointly performing resource configuration at the effective timestamp, the first and second network devices can perform resource configuration at the same time. Consequently, they can theoretically be configured as DF and BDF, respectively, at the same time. This eliminates the issue of multiple DFs in the redundancy group at the same time, or the issue of all network devices in the redundancy group being BDFs at the same time, thereby improving network transmission stability.
[0187] Corresponding to the aforementioned designated forwarder election method applied to the first network device, an embodiment of the present application further provides a designated forwarder election device applied to the first network device.
[0188] See also Figure 6 , is a structural diagram of a first designated forwarder election device provided in an embodiment of the present application, applied to a first network device, the device comprising:
[0189] A first information receiving module 601 is configured to receive first routing information sent by a second network device;
[0190] A first election module 602 is configured to perform a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result;
[0191] a second information sending module 603, configured to send the second routing information and an effective timestamp to the second network device, so that the second network device performs a DF election based on the first routing information, the second routing information, and the preset DF election rule, obtains a second election result, and performs resource allocation according to the second election result when the effective timestamp is reached, where the effective timestamp is a timestamp after a preset time period from when the first network device starts the DF election;
[0192] The first resource configuration module 604 is configured to perform resource configuration according to the first election result when the effective timestamp is reached.
[0193] As can be seen above, the first network device and the second network device both perform DF elections and exchange effective timestamps. When the effective timestamp is reached, both perform resource configuration according to their respective election results. The effective timestamp is a timestamp that occurs a preset amount of time after the first network device begins DF election. Therefore, before the effective timestamp arrives, the first network device has time to perform DF elections and send the first election results to the hardware in preparation for resource configuration. It also provides time for the first network device to send second routing information to the second network device, for the second network device to perform DF elections after receiving the second routing information, and for the second network device to send the second election results to the hardware in preparation for resource configuration. In other words, the first network device and the second network device can theoretically complete pre-configuration preparations for resource configuration before the effective timestamp arrives. By jointly performing resource configuration at the effective timestamp, the first and second network devices can perform resource configuration at the same time. Consequently, they can theoretically be configured as DF and BDF, respectively, at the same time. This eliminates the issue of multiple DFs in the redundancy group at the same time, or the issue of all network devices in the redundancy group being BDFs at the same time, thereby improving network transmission stability.
[0194] In one embodiment of the present application, the first resource configuration module 604 is specifically configured to:
[0195] The first election result and the effective timestamp are delivered to a first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached.
[0196] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located;
[0197] The first election module 602 is specifically configured to:
[0198] If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and preset DF election rules to obtain a first election result.
[0199] In one embodiment of the present application, the first network device is connected to a clock source, and the apparatus further includes:
[0200] A first reference signal receiving module, configured to receive a time reference signal sent by the clock source;
[0201] A first clock calibration module, configured to calibrate the clock of the first network device according to the time reference signal;
[0202] The first timestamp determination module is configured to generate a valid timestamp based on the timing of a clock of the first network device, and determine whether the valid timestamp has been reached.
[0203] Corresponding to the aforementioned designated forwarder election method applied to the second network device, an embodiment of the present application further provides a designated forwarder election device applied to the second network device.
[0204] See also Figure 7 , is a structural diagram of a second designated forwarder election device provided in an embodiment of the present application, applied to a second network device, the device comprising:
[0205] A first information sending module 701 is configured to send first routing information to a first network device, so that the first network device performs a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule, obtains a first election result, and configures resources according to the first election result when an effective timestamp is reached. The effective timestamp is a timestamp that is a preset time after the first network device starts the DF election.
[0206] A second information receiving module 702 is configured to receive the second routing information and the effective timestamp sent by the first network device;
[0207] A second election module 703 is configured to perform a DF election based on the first routing information, the second routing information, and the preset DF election rule to obtain a second election result;
[0208] The second resource configuration module 704 is configured to perform resource configuration according to the second election result when the effective timestamp is reached.
[0209] As can be seen above, the first network device and the second network device both perform DF elections and exchange effective timestamps. When the effective timestamp is reached, both perform resource configuration according to their respective election results. The effective timestamp is a timestamp that occurs a preset amount of time after the first network device begins DF election. Therefore, before the effective timestamp arrives, the first network device has time to perform DF elections and send the first election results to the hardware in preparation for resource configuration. It also provides time for the first network device to send second routing information to the second network device, for the second network device to perform DF elections after receiving the second routing information, and for the second network device to send the second election results to the hardware in preparation for resource configuration. In other words, the first network device and the second network device can theoretically complete pre-configuration preparations for resource configuration before the effective timestamp arrives. By jointly performing resource configuration at the effective timestamp, the first and second network devices can perform resource configuration at the same time. Consequently, they can theoretically be configured as DF and BDF, respectively, at the same time. This eliminates the issue of multiple DFs in the redundancy group at the same time, or the issue of all network devices in the redundancy group being BDFs at the same time, thereby improving network transmission stability.
[0210] In one embodiment of the present application, the second resource configuration module 704 is specifically configured to:
[0211] The second election result and the effective timestamp are delivered to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
[0212] In one embodiment of the present application, the first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located. The second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located. The second election module 703 is specifically configured to:
[0213] If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
[0214] In one embodiment of the present application, the second network device is connected to a clock source, and the apparatus further includes:
[0215] A second reference signal receiving module, configured to receive a time reference signal sent by the clock source;
[0216] a second clock calibration module, configured to calibrate the clock of the second network device according to the time reference signal;
[0217] The second timestamp determination module is configured to determine whether the valid timestamp has been reached based on the timing of the clock of the second network device.
[0218] In another embodiment provided in the present application, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, it implements any step of the above-mentioned designated forwarder election method applied to the first network device or the second network device.
[0219] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the designated forwarder election methods applied to the first network device or the second network device in the above embodiments.
[0220] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0221] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0222] Each embodiment in this specification is described in a related manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system, network device, apparatus, and computer-readable storage medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.
[0223] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the scope of protection of the present application.
Claims
1. A designated forwarder election method, characterized in that: Applied to a first network device, the method includes: receiving first routing information sent by the second network device; Performing a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result; Sending the second routing information and the effective timestamp to the second network device, so that the second network device performs a DF election based on the first routing information, the second routing information, and the preset DF election rule, obtains a second election result, and configures resources according to the second election result when the effective timestamp is reached, where the effective timestamp is a timestamp a preset time after the first network device starts the DF election; When the effective timestamp is reached, resources are configured according to the first election result.
2. The method according to claim 1, characterized in that The performing resource allocation according to the first election result when the effective timestamp is reached includes: The first election result and the effective timestamp are delivered to a first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached.
3. The method according to claim 1, characterized in that The first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located; The step of performing a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result includes: If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and preset DF election rules to obtain a first election result.
4. The method according to any one of claims 1 to 3, characterized in that The first network device is connected to a clock source, and the method further includes: receiving a time reference signal sent by the clock source; calibrating a clock of the first network device according to the time reference signal; Based on the timing of the clock of the first network device, a validity timestamp is generated, and it is determined whether the validity timestamp has been reached.
5. A designated forwarder election method, characterized in that: Applied to the second network device, the method includes: Sending first routing information to a first network device, so that the first network device performs a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule, obtains a first election result, and configures resources according to the first election result when an effective timestamp is reached, where the effective timestamp is a timestamp a preset time after the first network device starts the DF election; Receiving the second routing information and the effective timestamp sent by the first network device; Performing a DF election based on the first routing information, the second routing information, and the preset DF election rule to obtain a second election result; When the effective timestamp is reached, resources are configured according to the second election result.
6. The method according to claim 5, characterized in that The performing resource configuration according to the second DF election result when the effective timestamp is reached includes: The second election result and the effective timestamp are delivered to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
7. The method according to claim 5, characterized in that The first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located; The performing DF election based on the first routing information, the second routing information, and the preset DF election rule to obtain a second election result includes: If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
8. The method according to any one of claims 5 to 7, characterized in that The second network device is connected to a clock source, and the method further includes: receiving a time reference signal sent by the clock source; calibrating a clock of the second network device according to the time reference signal; Based on the timing of the clock of the second network device, it is determined whether the validity timestamp has been reached.
9. A designated forwarder election system, characterized in that: The system includes: a first network device and a second network device; The second network device is configured to send the first routing information to the first network device; The first network device is configured to perform a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result; send the second routing information and an effective timestamp to the second network device; and perform resource allocation according to the first election result when the effective timestamp is reached; The second network device is further configured to perform DF election based on the first routing information, the second routing information and a preset DF election rule; and configure resources according to the second election result when the effective timestamp is reached.
10. The system according to claim 9, characterized in that The first network device is specifically configured to: Sending the first election result and the effective timestamp to a first hardware driver of the first network device, so that the first hardware driver performs resource configuration according to the first election result when the effective timestamp is reached; The second network device is specifically configured to: The second election result and the effective timestamp are delivered to the second hardware driver of the second network device, so that the second hardware driver performs resource configuration according to the second election result when the effective timestamp is reached.
11. The system according to claim 9, wherein: The first routing information includes first DF election information and first Ethernet segment information of the second network device, where the first Ethernet segment information indicates the Ethernet segment where the second network device is located; the second routing information includes second DF election information and second Ethernet segment information of the first network device, where the second Ethernet segment information indicates the Ethernet segment where the first network device is located; The first network device is specifically configured to: If the Ethernet segments indicated by the first Ethernet segment information and the second Ethernet segment information are the same, performing a DF election based on the first DF election information, the second DF election information, and a preset DF election rule to obtain a first election result; The second network device is specifically configured to: If the Ethernet segments represented by the first Ethernet segment information and the second Ethernet segment information are the same, a DF election is performed based on the first DF election information, the second DF election information and the preset DF election rule to obtain a second election result.
12. The system according to any one of claims 9 to 11, characterized in that The first network device and the second network device are connected to the same clock source; The first network device is further configured to: receiving a time reference signal sent by the clock source; calibrating the clock of the first network device according to the time reference signal; generating a valid timestamp based on the timing of the clock of the first network device, and determining whether the valid timestamp has been reached; The second network device is further configured to: Receive a time reference signal sent by the clock source; calibrate the clock of the second network device according to the time reference signal; and determine whether the effective timestamp is reached based on the timing of the clock of the second network device.
13. A network device, characterized in that: The network equipment includes: processor; transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, wherein the machine-executable instructions prompt the processor to perform the method steps described in any one of claims 1-4 or 5-8.
14. A designated repeater election device, characterized in that: Applied to a first network device, the apparatus includes: A first information receiving module, configured to receive first routing information sent by a second network device; A first election module is configured to perform a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule to obtain a first election result; a second information sending module, configured to send the second routing information and an effective timestamp to the second network device, so that the second network device performs a DF election based on the first routing information, the second routing information, and the preset DF election rule, obtains a second election result, and performs resource allocation according to the second election result when the effective timestamp is reached, where the effective timestamp is a timestamp after a preset time period from when the first network device starts the DF election; The first resource configuration module is configured to perform resource configuration according to the first election result when the effective timestamp is reached.
15. A designated repeater election device, characterized in that: Applied to a second network device, the apparatus includes: a first information sending module, configured to send first routing information to a first network device, so that the first network device performs a DF election based on the first routing information, the second routing information of the first network device, and a preset designated forwarder DF election rule, obtains a first election result, and configures resources according to the first election result when an effective timestamp is reached, where the effective timestamp is a timestamp after a preset time period from when the first network device starts the DF election; A second information receiving module, configured to receive the second routing information and the effective timestamp sent by the first network device; A second election module is configured to perform a DF election based on the first routing information, the second routing information, and the preset DF election rule to obtain a second election result; The second resource configuration module is configured to perform resource configuration according to the second election result when the effective timestamp is reached.