WO2018205520A1 - Dr device selection method and apparatus based on ospf protocol, and storage medium - Google Patents

Dr device selection method and apparatus based on ospf protocol, and storage medium Download PDF

Info

Publication number
WO2018205520A1
WO2018205520A1 PCT/CN2017/109724 CN2017109724W WO2018205520A1 WO 2018205520 A1 WO2018205520 A1 WO 2018205520A1 CN 2017109724 W CN2017109724 W CN 2017109724W WO 2018205520 A1 WO2018205520 A1 WO 2018205520A1
Authority
WO
WIPO (PCT)
Prior art keywords
routing device
designated
routing
priority
network
Prior art date
Application number
PCT/CN2017/109724
Other languages
French (fr)
Chinese (zh)
Inventor
李晓龙
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018205520A1 publication Critical patent/WO2018205520A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/03Topology update or discovery by updating link state protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/124Shortest path evaluation using a combination of metrics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/48Routing tree calculation
    • H04L45/488Routing tree calculation using root node determination

Definitions

  • the embodiments of the present invention relate to, but are not limited to, the field of communications, and in particular, to a method and apparatus for selecting a DR and a storage medium based on an Open Shortest Path First (OSPF) protocol.
  • OSPF Open Shortest Path First
  • the highest OSPF priority (the preferred level) is the DR (Designated Router). If the device is configured with the ip ospf priority command, the routing device with the highest router ID is elected as the DR (the router-id is the largest interface IP address. If loopback is configured) If the address is back, the loopback address is used as the router ID. If multiple loopback addresses are configured, the highest loopback address is used as the router ID. You can also use the router-id ⁇ address> routing device configuration command to force an IP address. Router ID of the routing device. It should be noted that:
  • the selection of the BDR is the routing device whose priority is second only to the DR.
  • the election is BDR.
  • the routing device does not act as the DR. Or BDR, called DRother (other than DR and BDR).
  • the default priority of the routing device in OSPF is 1. In this case, if all routing devices do not change the priority, all routing devices have a priority of 1. In this case, you need to look at the router-id.
  • the router-id is large as a DR routing device.
  • the DR device is used to limit OSPF flooding.
  • OSPF ASs Autonomous System
  • All entries related to OSPF routing information are sent to the DR/BDR.
  • the DR advertises network information to all routing devices in the AS.
  • the election of the DR is based only on the routing device interface priority and the router-id.
  • the selection method is relatively simple, the elected DR device is not optimal, and the DR device advertises the network information to the DR device.
  • the path loss used is not the minimum for all routing devices in the AS.
  • routing device A is 8
  • the priority of the routing device B is 6,
  • the priority of the routing device C is 3.
  • routing device A will be selected as the DR device
  • route B will be selected as the BDR device.
  • Embodiments of the present invention provide a method and apparatus for selecting a DR device based on an OSPF protocol, and a storage medium, to ensure that the total loss in the link is the smallest.
  • a method for selecting a designated routing device based on an open shortest path first OSPF protocol include:
  • the pseudo-designated routing device collects the sum of the path loss values of all the routing devices in the network, and elects the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
  • each routing device in the indication network determines the shortest path tree by using itself as a root node, and further includes:
  • the routing device in the network is instructed to determine the shortest path tree after receiving the handshake message of the election designated routing device sent by the pseudo designated routing device.
  • the indicating that the pseudo-designated routing device and each routing device in the network respectively determine the sum of the path loss values according to the path loss values of the respective branches of the shortest path tree further includes: Instructing the pseudo-designated routing device and each routing device in the network to determine respective priorities according to a sum of path loss values,
  • instructing the pseudo-designated routing device to elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values including: instructing the pseudo-designated routing device to elect a specified route according to the priority of all routing devices in the network Device and backup specify the routing device.
  • the instructing the pseudo-designated routing device to elect a designated routing device and a backup designated routing device according to the priority of all routing devices in the network including:
  • the routing device with the highest priority is elected as the designated routing device, and the routing device with the lower priority is elected as the backup routing device. If there are multiple routing devices with the highest priority, the routing device is elected according to the size of the routing identifier. And back up the specified routing device.
  • the indication is The preceding designated routing device sends a handshake packet to the new routing device to elect a routing device, and obtains the priority of the new routing device to perform the routing device election.
  • the obtaining the priority of the new routing device to perform the routing of the specified routing device includes:
  • the new routing device is elected as a new designated routing device.
  • the current designated routing device when it is detected that the network topology changes, is configured to send a handshake packet for re-determining the priority request to each routing device in the network, and re-prioritize according to the newly determined priority.
  • Level election specifies the routing device and backups the specified routing device.
  • the re-routing the designated routing device and the backup designated routing device according to the newly determined priority are as follows:
  • routing device is the same as the routing device.
  • the routing device with the largest number of the routing device is the designated routing device. ;
  • the routing device has the largest number of routing devices, and one of the routing devices is the current routing device, the current routing device is elected as the designated routing device. Back up the specified routing device.
  • An apparatus for selecting a designated routing device based on an OSPF protocol including:
  • the primary selection module is configured to use the designated routing device determined by the specified protocol as a pseudo-designated routing device
  • a determining module configured to indicate that the pseudo-designated routing device and each routing device in the network respectively determine a shortest path tree by using the root node as a root node, and determine respective path loss values according to path loss values of the respective branches of the shortest path tree.
  • An election module configured to instruct the pseudo-designated routing device to collect all routing devices in the network
  • the information about the sum of the path loss values is used to elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
  • the determining module is further configured to: after each routing device in the network receives the handshake message of the election designated routing device sent by the pseudo-designated routing device, start determining the shortest path tree.
  • the determining module is further configured to instruct the pseudo-designated routing device and each routing device in the network to determine respective priorities according to a sum of path loss values
  • the election module is further configured to instruct the pseudo-designated routing device to elect a designated routing device and a backup designated routing device according to priorities of all routing devices in the network.
  • the election module is configured to elect the routing device with the highest priority as the designated routing device, and the routing device with the lower priority is elected as the backup routing device; If there are multiple, the specified routing device and the backup designated routing device are elected according to the size of the route identifier.
  • the election module is further configured to: if a new routing device is added to the network, instructing the current designated routing device to send a handshake packet of the specified routing device to the new routing device, and obtain The priority of the new routing device is used to perform routing device election.
  • the election module is further configured to elect the new routing device as a new designated route when the priority of the current designated routing device is less than a specified proportion of the priority of the new routing device. device.
  • the election module is further configured to: when detecting that the network topology changes, instructing the current designated routing device to send a handshake message for re-determining the priority request to each routing device in the network, The designated routing device and the backup designated routing device are elected according to the newly determined priority.
  • the election module is further configured to: if the newly determined priority is the most If there are multiple routing devices, the routing device is identified.
  • the routing device with the largest number of routing devices is the designated routing device.
  • the routing device that elects the routing device is the backup routing device. For example, the routing device identifier.
  • the maximum number of routing devices is multiple, and one of the routing devices is the current designated routing device.
  • the current routing device is elected as the designated routing device.
  • the routing device is elected to the routing device.
  • An apparatus for selecting a routing device including a memory and a processor, wherein
  • the memory stores the following instructions: the designated routing device determined by the specified protocol is used as a pseudo-designated routing device; and the pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node.
  • the path loss values of the respective branches of the shortest path tree respectively determine the sum of the respective path loss values; and the information indicating that the pseudo designated routing device collects the sum of the path loss values of all the routing devices in the network, according to the path loss value And related information to elect a designated routing device and backup designated routing device;
  • the processor is configured to execute an instruction to store the memory.
  • a computer storage medium storing a computer program configured to perform the above-described method of selecting a DR device based on an OSPF protocol.
  • the embodiments of the present invention provide a method, a device, and a storage medium for selecting a DR device based on an OSPF protocol, which can ensure that the total loss in the link is the smallest.
  • 1 is a routing topology diagram of a related art
  • FIG. 2 is a network topology diagram of the routing device A in FIG. 1 according to the Dijkstra algorithm of OSPF;
  • FIG. 3 is a network topology diagram of the routing device B in FIG. 1 according to the Dijkstra algorithm of OSPF;
  • FIG. 4 is a network topology diagram of the routing device C in FIG. 1 according to the Dijkstra algorithm of OSPF;
  • FIG. 5 is a flowchart of a method for selecting a designated routing device based on an OSPF protocol according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a hello packet according to an embodiment of the present invention.
  • FIG. 7A, FIG. 7B and FIG. 7C are schematic diagrams showing the shortest path tree when the routing devices A, B, and C in the third embodiment of the present invention respectively serve as root nodes;
  • 8A, 8B, 8C, and 8D are schematic diagrams showing the shortest path tree when the A, B, C, and D routing devices in the fourth embodiment of the present invention are used as root nodes;
  • FIG. 9A, FIG. 9C, and FIG. 9D are schematic diagrams showing the shortest path tree when the A, C, and D routing devices in the fifth embodiment of the present invention are used as root nodes;
  • FIG. 10 is a schematic diagram of a shortest path first tree with A, B, and D as root nodes in Embodiment 6 of the present invention.
  • Figure 11 is a relatively complex network topology diagram
  • FIG. 13 is a schematic diagram of an apparatus for selecting a designated routing device based on an OSPF protocol according to an embodiment of the invention.
  • FIG. 5 is a flowchart of a method for selecting a designated routing device based on an OSPF protocol according to an embodiment of the present invention. As shown in FIG. 5, the method in this embodiment includes the following steps:
  • Step 11 The designated routing device determined by the specified protocol is used as a pseudo designated routing device.
  • Step 12 The pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node, and determine the sum of the respective path loss values according to the path loss values of the respective branches of the shortest path tree.
  • Step 13 The pseudo designated routing device collects path loss values of all routing devices in the network. The information related to the sum is selected based on the information of the sum of the path loss values to elect the designated routing device and the backup designated routing device.
  • the embodiment of the present invention adopts different design schemes to optimize the selection of the DR device in the OSPF protocol by the RFC 2328, and uses the DR selected in the RFC 2328 as a pseudo DR, and then uses the pseudo DR to obtain the shortest path tree of all the routing devices in the network. Calculate the corresponding path loss and deserve the true DR device and transfer the ownership of the DR device to this real DR device.
  • pseudo-DR devices The following are definitions of pseudo-DR devices, pseudo BDR devices, and election principles.
  • Pseudo-DR device It is the DR device elected in the original RFC2328 protocol, and adds the corresponding routing table statistics function.
  • the routing device selected as the pseudo-DR device will first be based on its shortest path network. Send hello packets to request the shortest path first tree of all routing devices in the network. After obtaining the shortest path first tree of all routing devices, calculate the cost and the value (that is, the sum of the cost values of all links in the shortest path first tree), and use the routing device with the lowest cost as the DR device of the network, and the pseudo DR. The device then exists as a BDR device with this network.
  • Pseudo BDR device It is the BDR device elected in the original RFC2328 protocol. It is used only as a backup device when the original DR device is not elected.
  • the routing device that performs the calculation is referred to as X, and a list of routing devices on the network that have established two-way communication is checked.
  • This routing device list is exactly the same as the neighboring device (on the network) whose routing device X reaches at least 2-Way (the two-way) state, and the routing device X itself is also considered to be on the list. Exclude the routing devices that cannot become DRs (the routing devices with the routing device priority 0 cannot become the DR) from the list. According to the remaining list, perform the following steps:
  • Step 101 Record the current DR and BDR values on the network for later comparison.
  • Step 102 Calculate a pseudo BDR on the network as follows:
  • routing devices on the list only those who do not declare themselves to be DRs may become BDRs. If one or more such routing devices declare themselves to be BDRs (that is, list themselves as BDRs instead of DRs in their Hello packets), select the one with the highest routing device priority to become a pseudo BDR; if the same , select the one with the largest routing device ID. If no routing device declares itself to be a BDR, the routing device in the selection list has the highest priority and becomes a pseudo BDR. (Also excludes the routing device that declares itself as a DR.) If the same, the device ID is based on the routing device.
  • Step 103 Calculate the pseudo DR on the network as follows:
  • routing devices If one or more routing devices declare themselves to be DRs (that is, list themselves as DRs in their Hello packets), select the ones that have the highest routing device priority to become pseudo-DRs; if they are the same, choose to have the largest routing devices. logo. If no routing device declares itself to be a DR, the newly elected pseudo BDR is set to a pseudo DR.
  • routing device X newly becomes a pseudo DR or a pseudo BDR, or is no longer a pseudo DR or a pseudo BDR, steps 102 and 103 are repeated, a pseudo DR or a pseudo BDR device is elected, and then step 104 is performed. Assuming that the routing device X has recently become a pseudo DR, it will not participate in the pseudo BDR election when the step 102 is repeated. This is to ensure that the routing device does not simultaneously declare itself as a pseudo DR and a pseudo BDR.
  • the routing device may become a pseudo DR or a pseudo BDR. If the routing device becomes a pseudo-DR, the pseudo-DR routing device sends a hello packet request to the network.
  • the hello packet In the hello packet, the IP address of the specified DR in the Designated Router field and the pointer in the Backup Designated Router.
  • the IP address of the BDR interface is set to 255.255.255.255.
  • the packet structure is shown in Figure 6.
  • the other routing devices After receiving the hello packet, the other routing devices are determined to be request packets sent by the pseudo-DR in the network to request the routing device to calculate the sum of the branches of the shortest path tree. All the routing devices receive the hello report. After the text, the shortest path calculated according to the Dijkstra algorithm Trail tree. Calculate the sum of the cost values of the devices based on the cost of each branch of the shortest path tree. Because of the hello packets in OSPF, the priority station is 1 byte and there are 256 levels. Therefore, the ⁇ 256/shortest path is used. The tree cost and value ⁇ derives a new priority and rounds it up and sets the device's new priority.
  • Step 105 After calculating the new priority, each routing device sends a hello packet with a new priority to the pseudo-DR device.
  • the pseudo-DR device elects the routing device with the largest new priority as the DR device, and the secondary priority route. The device is elected as a BDR device.
  • the pseudo DR device and the pseudo BDR device are canceled and re-used as DR other devices.
  • the new routing device In the case of a dynamic route addition, if a new routing device is added to the network topology, the new routing device automatically calculates its own shortest path tree, and also calculates the new priority ⁇ 256/the shortest path tree cost and value ⁇ , and sends a hello message. To the DR device, if the priority of the DR device is less than the priority of the new device, the DR device is re-elected.
  • the DR device when the priority of the DR is less than the specified proportion of the priority of the new routing device (for example, one-half or less), the DR device is re-elected, so that frequent DR changes can be avoided.
  • the device causes instability of the shortest path first tree network topology.
  • the BDR device can be replaced.
  • Step 201 In this scenario, there are only three routing devices: A (priority: 8, router-id: 2), B (priority: 6, router-id: 4), and C (priority: 3, router-id: 5). Among them, the path loss between A-B is 3, the path loss between A-C is 10, and the path loss between B-C is 2.
  • the DR device election method in the RFC2328 protocol since the priority of A is 8, B The device priority is 6, and the C device priority is 3.
  • the A device is elected as a pseudo DR device, and the B device is a pseudo BDR device.
  • the pseudo-DR device (that is, the device A) sends a hello packet request in the network.
  • the IP address of the DR interface and the Backup Designated Router in the Designated Router field are included.
  • the IP address of the BDR interface in the standby designated routing device is set to 255.255.255.255. (This 255.255.255.255 is the default value, of course, it can be set to other values).
  • Step 203 The B routing device and the C routing device receive the hello packet sent by the A routing device, and determine that the packet is a pseudo DR device according to the 255.255.255.255 in the Designated Router field and the Backup Designated Router field. A device) sends a new priority calculation request message.
  • Step 204, A, B, and C routing devices begin to perform new priority calculations.
  • Figures 7A, 7B, and 7C are the shortest path trees when the A, B, and C routing devices respectively act as root nodes.
  • the sum of the cost values of the routing devices is the same as that of the routing device.
  • the sum is 5, and the sum of the cost values of the C routing devices is 12.
  • Each routing device then uses ⁇ 256/shortest path tree cost and value ⁇ to derive a new priority, round up and set the routing device's new priority.
  • the new priority of the A routing device is 19, the new priority of the B device is 51, and the new priority of the C device is 21.
  • Steps 205, B, and C The routing device sends a hello packet with a new priority to the pseudo-DR device (A device). After receiving the packet sent by the B and C routing devices, the A routing device extracts the new priority. Compare with its new priority;
  • the new priority of the B routing device is 51, and the election wins.
  • B route at this time The device will act as the final DR device.
  • the C-router with the lower priority is used as the BDR device.
  • the router-id in the B and C routing devices is compared.
  • the router-id is elected as the DR device and the other is the BDR device.
  • the new routing device joins, D routing device (priority: 10, router-id: 4), the path loss between A-D is 1, and the path loss between D-C is 1.
  • D routing device priority: 10, router-id: 4
  • the new DR device is elected.
  • the current DR device sends a hello packet to the D-route device to perform DR device election.
  • the priority of the D-route device is higher than that of the current DR device.
  • the D routing device is elected as the new DR device, and the D routing device sends the same hello packet sent by the A routing device in step 202.
  • the A, B, and C routing devices After receiving the hello message, the A, B, and C routing devices start to perform new priority calculation. At the same time, the D routing device also performs new priority calculation.
  • the routing devices A, B, C, and D respectively use themselves as the root node to calculate the shortest path tree according to the Dijkstra algorithm.
  • Figure 8A, Figure 8B, Figure 8C, and Figure 8D show the A, B, C, and D routing devices. In the case of a network topology, the shortest path tree as the root node, respectively.
  • the sum of the cost values of the devices based on the cost of each branch of the shortest path tree.
  • the sum of the cost values of the A routing device is 14 and the cost of the routing device is the same.
  • C routing device is 13, and the D routing device is 4.
  • Each routing device then uses ⁇ 256 divided by the shortest path tree cost and value ⁇ to derive a new priority, round up and set the device's new priority.
  • the new priority of the routing device is 18, the new priority of the B routing device is 42, the new priority of the C routing device is 19, and the new priority of the D routing device is 63.
  • the routing device of the A, B, and C sends the new priority to the D-route device through the hello packet.
  • the new routing device is elected as the new DR device and the B-route device is elected as the BDR device.
  • the new device in order to avoid frequent changes to the DR device, when the new device joins, when the device has a new priority of more than 2 times (or other multiples) of the original DR device in the new topology network, The change of the DR device occurs. Periodic DR device elections can also be performed to ensure that the network is as optimal as the DR device.
  • the B routing device is removed, and only the routing devices A, C, and D are left in the network topology.
  • the DR device that is, the D routing device detects that the network topology changes, and sends the hello report in step 202.
  • the file is given to the A and C routing devices for new DR device elections.
  • the shortest path first tree with A, C, and D as the root node is as shown in FIG. 9A, FIG. 9C, and FIG. 9D.
  • the sum of the cost values of the A routing device is 11, and the new priority is calculated as twenty three.
  • the sum of the cost values of the C routing device is 11, and the new priority is calculated to be 23.
  • the sum of the cost values of the D routing device is 2, and the new priority is calculated to be 127.
  • the D routing device still acts as the DR device.
  • the C routing device is removed. Only the A, B, and D devices are left in the network topology.
  • the DR device that is, the D routing device, detects that the network topology changes, and sends the hello packet in step 202.
  • the A and B routing devices are used to perform new DR device elections.
  • the shortest path first tree with A, B, and D as the root nodes is shown in Figure 10.
  • the network topology map with A, B, and D as the root nodes respectively. The same is true, then the cost value and the priority of each root node are the same, respectively cost 4, and the new priority is 63.
  • the A and B routing devices send the new priority to the D-route device through the hello packet.
  • the router-id is compared.
  • the router-id of the D device is large but the same.
  • the D device since the D device is the DR device before, the D device still acts as a network path to reduce the change of the shortest path tree. DR device.
  • the embodiment of the invention can be applied not only to the OSPF protocol of the system-level routing device, but also has a good implementation purpose in the Internet of Things device:
  • Such a scenario In an industrial IoT device, the administrator manages all IoT devices across the enterprise, so when the administrator sends a broadcast message (such as open, close, or a collective operation), one of the devices is placed. Broadcast transmission is performed as the shortest path tree calculated by the root node. In this way, the transmission of the message can be broadcast in the shortest time and with the least loss, and the selection of this root node is crucial.
  • a broadcast message such as open, close, or a collective operation
  • the selection scheme of the DR device in the embodiment of the present invention can complete the selection scenario of the root node well.
  • a relatively complex network topology diagram the administrator needs to control these IoT devices, then the administrator should send a broadcast message to select which device to use as the root node?
  • the root node elected according to the algorithm in the original RFC2328 is Route E, this node is not optimal.
  • Step 301 The device E acts as a pseudo-DR device and sends a hello packet to all the Internet of Things devices in the network topology.
  • Step 302 At this time, all the IoT devices perform the topology calculation of the shortest path tree according to the Dijkstra algorithm as the root node.
  • the Cost and the value of the A device can be: 15, the Cost and the value of the B device: 16 Cost and value of C device: 15, Cost and value of D device: 12, Cost and value of E device: 14, Cost and value of F device: 14, Cost and value of G device: 14, Cost of H device And value: 15.
  • the administrator should select the D device to be elected as the DR device and use it as the root node to send broadcast packets. This will minimize the overall path loss of broadcast packets in the IoT device.
  • DR related devices in the OSPF network have the following functions:
  • the DR which is elected as the sender of the LSDB (Link State Data Base) broadcast, plans the topology for other routing devices in the network).
  • BDR in this state, it is quite a candidate for DR, and acts as a DR after the DR hangs).
  • DROther (forms adjacency with DR and BDR, and only sends HELLO information with other DROther roles).
  • the DR device acts as the sender of the LSDB broadcast.
  • the DR device sends the LSDB broadcast according to its shortest path tree.
  • This shortest path tree is the shortest path tree with the DR device as the root node, but not in this network.
  • the shortest path tree with the lowest cost value of all routing devices can be linked.
  • the total cost value of the LSDB broadcast is sent as the root node according to the existing DRC2328. It is much higher than the DR equipment elected according to the method in this patent. In the case of a large number of broadcast messages, this consumption cannot be underestimated. Optimize DR selection, reduce the cost loss of redundant packets in the network topology, and improve network communication efficiency as much as possible.
  • the embodiment of the present invention further provides a storage medium storing computer executable instructions, and when the computer executable instructions are executed, implementing the OSPF protocol-based method for selecting a routing device.
  • FIG. 13 is a diagram of selecting a designated routing device based on an OSPF protocol according to an embodiment of the present invention. As shown in FIG. 13, the apparatus of this embodiment includes:
  • the primary selection module 1301 is configured to use the designated routing device determined by the specified protocol as a pseudo-designated routing device
  • the determining module 1302 is configured to instruct the pseudo-designated routing device and each routing device in the network to determine the shortest path tree by using the root node as the root node, and determine the path loss respectively according to the path loss values of the branches of the shortest path tree. The sum of the values;
  • the election module 1303 is configured to instruct the pseudo-designated routing device to collect information about a sum of path loss values of all routing devices in the network, and elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
  • the determining module 1302 is further configured to: after each routing device in the network receives the handshake message of the election designated routing device sent by the pseudo-designated routing device, start determining the shortest path tree. .
  • the determining module 1302 is further configured to instruct the pseudo-designated routing device and each routing device in the network to determine respective priorities according to a sum of path loss values.
  • the election module 1303 is further configured to instruct the pseudo-designated routing device to elect a designated routing device and a backup designated routing device according to priorities of all routing devices in the network.
  • the election module 1303 is further configured to elect the routing device with the highest priority as the designated routing device, and elect the routing device with the lower priority as the backup designated routing device; If there are multiple devices, the specified routing device and the backup designated routing device are elected according to the size of the route identifier.
  • the election module 1303 is further configured to: if a new routing device is added to the network, instructing the current designated routing device to send a handshake message of the specified routing device to the new routing device. Obtain the priority of the new routing device to perform the routing device election.
  • the election module 1303 is further configured to use the current designated route.
  • the new routing device is elected as a new designated routing device.
  • the election module 1303 is further configured to: when detecting that the network topology changes, instructing the current designated routing device to send a handshake message for re-determining the priority request to each routing device in the network, The specified routing device and the backup designated routing device are re-elected according to the newly determined priority.
  • the election module 1303 is further configured to: if there are multiple routing devices with the highest priority, the identifier of the routing device is compared, and the routing device with the largest identifier of the routing device is the designated routing device.
  • the routing device that is elected to the routing device is the routing device for the backup. If the routing device has the largest number of routing devices, and one of the routing devices is the current routing device, the current routing device is still elected. Specifies the routing device to elect the backup routing device in the other routing device with the largest identifier of the routing device.
  • the OSPF protocol-based selection specifies that the functions implemented by each unit in the device of the routing device can be a central processing unit (CPU, Central Processing Unit) located in the device that selects the routing device based on the OSPF protocol. , or a microprocessor (MPU, Micro Processor Unit), or a digital signal processor (DSP, Digital Signal Processor), or a Field Programmable Gate Array (FPGA).
  • CPU Central Processing Unit
  • MPU Micro Processor Unit
  • DSP Digital Signal Processor
  • FPGA Field Programmable Gate Array
  • An embodiment of the present invention further provides an apparatus for selecting a designated routing device based on an OSPF protocol, including a memory and a processor, where
  • the memory stores the following instructions: the designated routing device determined by the specified protocol is used as a pseudo-designated routing device; and the pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node.
  • the path loss values of the respective branches of the shortest path tree respectively determine the sum of the respective path loss values; and the information indicating that the pseudo designated routing device collects the sum of the path loss values of all the routing devices in the network, according to the path loss value And related information to elect a designated routing device and backup designated routing device;
  • the processor is configured to execute an instruction to store the memory.
  • the designated routing device determined by the specified protocol is used as the pseudo-designated routing device; and the pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node, according to the The path loss values of the respective branches of the shortest path tree respectively determine the sum of the respective path loss values; the information indicating that the pseudo designated routing device collects the sum of the path loss values of all routing devices in the network, according to the sum of the path loss values The relevant information is elected to the designated routing device and the backup designated routing device, thus ensuring that the total loss in the link is minimal.

Abstract

Disclosed is a DR device selection method based on an OSPF protocol, comprising: taking a designated router determined by means of a designated protocol as a false designated router; instructing the false designated router and each router in a network to determine the shortest path tree by respectively taking themselves as root nodes, and to respectively determine the sum of path loss values thereof according to path loss values of branches of the shortest path tree; and instructing the false designated router to collect relevant information about the sums of path loss values of all the routers in the network, and to select, according to the relevant information about the sums of the path loss values, a designated router and a backup designated router. Further disclosed are a DR device selection apparatus based on an OSPF protocol, and a storage medium.

Description

基于OSPF协议的选择DR设备的方法及装置、存储介质Method and device for selecting DR device based on OSPF protocol, storage medium
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201710330958.0、申请日为2017年05月11日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is filed on the basis of the Chinese Patent Application No. PCT Application No. PCT Application No.
技术领域Technical field
本发明实施例涉及但不限于通信领域,尤指一种基于OSPF(Open Shortest Path First,开放式最短路径优先)协议的选择DR的方法及装置、存储介质。The embodiments of the present invention relate to, but are not limited to, the field of communications, and in particular, to a method and apparatus for selecting a DR and a storage medium based on an Open Shortest Path First (OSPF) protocol.
背景技术Background technique
OSPF标准协议RFC(Remote Function Call,远程函数调用)2328中,在对DR设备的选择时,可概述OSPF priority(优选级)最高者为DR(Designated Router,指定路由设备)(缺省所有OSPF路由设备为1,通过ip ospf priority接口配置命令更改),如果优选级相同,则具有最高的Router-ID的路由设备被选举为DR(Router-Id为最大的接口IP地址,如果配置了loopback(环回)地址,则使用loopback地址作为Router-ID,如果配置有多个loopback地址,则以最高的loopback地址为Router ID,也可以通过router-id<address>路由设备配置命令强制某个IP地址作为路由设备的Router ID。需要说明的是:In the OSPF standard protocol RFC (Remote Function Call) 2328, when the DR device is selected, the highest OSPF priority (the preferred level) is the DR (Designated Router). If the device is configured with the ip ospf priority command, the routing device with the highest router ID is elected as the DR (the router-id is the largest interface IP address. If loopback is configured) If the address is back, the loopback address is used as the router ID. If multiple loopback addresses are configured, the highest loopback address is used as the router ID. You can also use the router-id<address> routing device configuration command to force an IP address. Router ID of the routing device. It should be noted that:
1、其中BDR(Backup Designated Router,指定路由设备)的选择,是优先级仅次于DR的路由设备,选举为BDR。1. The selection of the BDR (Backup Designated Router) is the routing device whose priority is second only to the DR. The election is BDR.
2、如果路由设备的OSPF优先级设为“0”,则该路由设备不作为DR 或BDR,称为DRother(DR及BDR以外)。2. If the OSPF priority of the routing device is set to 0, the routing device does not act as the DR. Or BDR, called DRother (other than DR and BDR).
3、OSPF中的路由设备的默认的优先级是1,这样在所有的路由设备都没有修改优先级的情况下,所有的路由设备的优先级都为1,这时就需要看router-id了,router-id大的作为DR路由设备。3. The default priority of the routing device in OSPF is 1. In this case, if all routing devices do not change the priority, all routing devices have a priority of 1. In this case, you need to look at the router-id. The router-id is large as a DR routing device.
已有技术存在以下缺点:The prior art has the following disadvantages:
DR设备的产生是用于限制OSPF的泛洪,OSPF的AS(自治系统)内部DRother路由设备之间不能互相传递OSPF报文,所有有关OSPF路由信息的条目都是发送给DR/BDR,之后由DR将网络信息通告给AS内的所有路由设备。而在标准协议RFC2328中对DR的选举仅仅是基于路由设备接口优先级以及router-id,而这种选择方式虽然相对简单,但选举出来的DR设备并非是最优,在DR设备通告网络信息给AS内所有的路由设备时,所用的路径损耗也不是最小值。The DR device is used to limit OSPF flooding. OSPF ASs (Autonomous System) internal DRother routing devices cannot forward OSPF packets to each other. All entries related to OSPF routing information are sent to the DR/BDR. The DR advertises network information to all routing devices in the AS. In the standard protocol RFC2328, the election of the DR is based only on the routing device interface priority and the router-id. However, although the selection method is relatively simple, the elected DR device is not optimal, and the DR device advertises the network information to the DR device. The path loss used is not the minimum for all routing devices in the AS.
简单举个例子,如图1所示,如果根据RFC2328来进行DR设备选择,路由设备(route)A的优先级是8,路由设备B的优先级是6,路由设备C的优先级是3,可以得出路由设备A会被选为DR设备,route B会被选为BDR设备。但此时根据OSPF的Dijkstra(迪杰斯特拉)算法得出route A的网络拓扑如图2所示,可以得出设备A的路径损耗之和为cost=13,如图3所示,对于设备B的路径损耗之和为cost=5,如图4所示,对于C设备的路径损耗之和为cost=12。由此可以清楚的得出结论当route A作为DR设备时,链路中总损耗不一定是最小的,这就导致在DR设备进行网络信息通告时,延迟也不一定是最小。For example, as shown in FIG. 1, if DR device selection is performed according to RFC 2328, the priority of the routing device (route A) is 8, the priority of the routing device B is 6, and the priority of the routing device C is 3. It can be concluded that routing device A will be selected as the DR device, and route B will be selected as the BDR device. However, according to the Dijkstra algorithm of OSPF, the network topology of route A is shown in Figure 2. It can be concluded that the sum of the path loss of device A is cost=13, as shown in Figure 3. The sum of the path loss of the device B is cost=5. As shown in FIG. 4, the sum of the path losses for the C device is cost=12. Therefore, it can be clearly concluded that when route A is used as a DR device, the total loss in the link is not necessarily the smallest, which causes the delay of the DR device to be notified when the network information is not necessarily minimized.
发明内容Summary of the invention
本发明实施例提供一种基于OSPF协议的选择DR设备的方法及装置、存储介质,以确保链路中总损耗是最小的。Embodiments of the present invention provide a method and apparatus for selecting a DR device based on an OSPF protocol, and a storage medium, to ensure that the total loss in the link is the smallest.
一种基于开放式最短路径优先OSPF协议的选择指定路由设备的方法, 包括:A method for selecting a designated routing device based on an open shortest path first OSPF protocol, include:
将通过指定协议确定的指定路由设备作为伪指定路由设备;Specifying a specified routing device determined by the specified protocol as a pseudo-designated routing device;
指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;Instructing the pseudo-designated routing device and each routing device in the network to determine the shortest path tree by using the root node as the root node, and determining the sum of the respective path loss values according to the path loss values of the respective branches of the shortest path tree;
指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备。And the information indicating that the pseudo-designated routing device collects the sum of the path loss values of all the routing devices in the network, and elects the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
本发明一实施方式中,所述指示网络中各路由设备分别以自己作为根节点确定最短路径树,还包括:In an embodiment of the present invention, each routing device in the indication network determines the shortest path tree by using itself as a root node, and further includes:
指示所述网络中各路由设备在接收到所述伪指定路由设备发送的选举指定路由设备的握手报文后,开始确定最短路径树。The routing device in the network is instructed to determine the shortest path tree after receiving the handshake message of the election designated routing device sent by the pseudo designated routing device.
本发明一实施方式中,所述指示所述伪指定路由设备及网络中各路由设备根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和之后,还包括:指示所述伪指定路由设备及网络中各路由设备根据路径损耗值之和确定各自的优先级,In an embodiment of the present invention, the indicating that the pseudo-designated routing device and each routing device in the network respectively determine the sum of the path loss values according to the path loss values of the respective branches of the shortest path tree, further includes: Instructing the pseudo-designated routing device and each routing device in the network to determine respective priorities according to a sum of path loss values,
所述指示所述伪指定路由设备根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备,包括:指示所述伪指定路由设备根据网络中所有路由设备的优先级来选举指定路由设备和备份指定路由设备。And the instructing the pseudo-designated routing device to elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values, including: instructing the pseudo-designated routing device to elect a specified route according to the priority of all routing devices in the network Device and backup specify the routing device.
本发明一实施方式中,所述指示所述伪指定路由设备根据网络中所有路由设备的优先级来选举指定路由设备和备份指定路由设备,包括:In an embodiment of the present invention, the instructing the pseudo-designated routing device to elect a designated routing device and a backup designated routing device according to the priority of all routing devices in the network, including:
将优先级最大的路由设备选举为指定路由设备,将优先级次之的路由设备选举为备份指定路由设备;如果优先级最大的路由设备有多个,则根据路由标识的大小来选举指定路由设备和备份指定路由设备。The routing device with the highest priority is elected as the designated routing device, and the routing device with the lower priority is elected as the backup routing device. If there are multiple routing devices with the highest priority, the routing device is elected according to the size of the routing identifier. And back up the specified routing device.
本发明一实施方式中,如果所述网络中添加了新路由设备,则指示当 前的指定路由设备向所述新路由设备发送选举指定路由设备的握手报文,获取所述新路由设备的优先级进行指定路由设备选举。In an embodiment of the present invention, if a new routing device is added to the network, the indication is The preceding designated routing device sends a handshake packet to the new routing device to elect a routing device, and obtains the priority of the new routing device to perform the routing device election.
本发明一实施方式中,所述获取所述新路由设备的优先级进行指定路由设备选举,包括:In an embodiment of the present invention, the obtaining the priority of the new routing device to perform the routing of the specified routing device includes:
当当前的指定路由设备的优先级小于所述新路由设备的优先级的指定比例时,将所述新路由设备选举为新的指定路由设备。When the priority of the current designated routing device is smaller than the specified proportion of the priority of the new routing device, the new routing device is elected as a new designated routing device.
本发明一实施方式中,当检测到网络拓扑发生变化时,指示当前的指定路由设备向所述网络中各路由设备发送重新确定优先级请求的握手报文,重新根据收集到的新确定的优先级选举指定路由设备和备份指定路由设备。In an embodiment of the present invention, when it is detected that the network topology changes, the current designated routing device is configured to send a handshake packet for re-determining the priority request to each routing device in the network, and re-prioritize according to the newly determined priority. Level election specifies the routing device and backups the specified routing device.
本发明一实施方式中,所述重新根据收集到的新确定的优先级选举指定路由设备和备份指定路由设备包括:In an embodiment of the present invention, the re-routing the designated routing device and the backup designated routing device according to the newly determined priority are as follows:
若新确定的优先级最大的路由设备有多个,则比较路由设备的标识,选举路由设备的标识最大的路由设备为指定路由设备,选举路由设备的标识次之的路由设备为备份指定路由设备;If there are multiple routing devices with the highest priority, the routing device is the same as the routing device. The routing device with the largest number of the routing device is the designated routing device. ;
如路由设备的标识最大的路由设备为多个,且其中一个路由设备为当前的指定路由设备,则仍选举当前的指定路由设备为指定路由设备,在路由设备的标识最大的其他路由设备中选举备份指定路由设备。If the routing device has the largest number of routing devices, and one of the routing devices is the current routing device, the current routing device is elected as the designated routing device. Back up the specified routing device.
一种基于OSPF协议的选择指定路由设备的装置,包括:An apparatus for selecting a designated routing device based on an OSPF protocol, including:
初选模块,配置为将通过指定协议确定的指定路由设备作为伪指定路由设备;The primary selection module is configured to use the designated routing device determined by the specified protocol as a pseudo-designated routing device;
确定模块,配置为指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;a determining module, configured to indicate that the pseudo-designated routing device and each routing device in the network respectively determine a shortest path tree by using the root node as a root node, and determine respective path loss values according to path loss values of the respective branches of the shortest path tree. Sum;
选举模块,配置为指示所述伪指定路由设备收集网络中所有路由设备 的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备。An election module, configured to instruct the pseudo-designated routing device to collect all routing devices in the network The information about the sum of the path loss values is used to elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
本发明一实施方式中,所述确定模块,还配置为指示所述网络中各路由设备在接收到所述伪指定路由设备发送的选举指定路由设备的握手报文后,开始确定最短路径树。In an embodiment of the present invention, the determining module is further configured to: after each routing device in the network receives the handshake message of the election designated routing device sent by the pseudo-designated routing device, start determining the shortest path tree.
本发明一实施方式中,所述确定模块,还配置为指示所述伪指定路由设备及网络中各路由设备根据路径损耗值之和确定各自的优先级,In an embodiment of the present invention, the determining module is further configured to instruct the pseudo-designated routing device and each routing device in the network to determine respective priorities according to a sum of path loss values,
所述选举模块,还配置为指示所述伪指定路由设备根据网络中所有路由设备的优先级来选举指定路由设备和备份指定路由设备。The election module is further configured to instruct the pseudo-designated routing device to elect a designated routing device and a backup designated routing device according to priorities of all routing devices in the network.
本发明一实施方式中,所述选举模块,还配置为将优先级最大的路由设备选举为指定路由设备,将优先级次之的路由设备选举为备份指定路由设备;如果优先级最大的路由设备有多个,则根据路由标识的大小来选举指定路由设备和备份指定路由设备。In an embodiment of the present invention, the election module is configured to elect the routing device with the highest priority as the designated routing device, and the routing device with the lower priority is elected as the backup routing device; If there are multiple, the specified routing device and the backup designated routing device are elected according to the size of the route identifier.
本发明一实施方式中,所述选举模块,还配置为如果所述网络中添加了新路由设备,则指示当前的指定路由设备向所述新路由设备发送选举指定路由设备的握手报文,获取所述新路由设备的优先级进行指定路由设备选举。In an embodiment of the present invention, the election module is further configured to: if a new routing device is added to the network, instructing the current designated routing device to send a handshake packet of the specified routing device to the new routing device, and obtain The priority of the new routing device is used to perform routing device election.
本发明一实施方式中,所述选举模块,还配置为当当前的指定路由设备的优先级小于所述新路由设备的优先级的指定比例时,将所述新路由设备选举为新的指定路由设备。In an embodiment of the present invention, the election module is further configured to elect the new routing device as a new designated route when the priority of the current designated routing device is less than a specified proportion of the priority of the new routing device. device.
本发明一实施方式中,所述选举模块,还配置为当检测到网络拓扑发生变化时,指示当前的指定路由设备向所述网络中各路由设备发送重新确定优先级请求的握手报文,重新根据收集到的新确定的优先级选举指定路由设备和备份指定路由设备。In an embodiment of the present invention, the election module is further configured to: when detecting that the network topology changes, instructing the current designated routing device to send a handshake message for re-determining the priority request to each routing device in the network, The designated routing device and the backup designated routing device are elected according to the newly determined priority.
本发明一实施方式中,所述选举模块,还配置为若新确定的优先级最 大的路由设备有多个,则比较路由设备的标识,选举路由设备的标识最大的路由设备为指定路由设备,选举路由设备的标识次之的路由设备为备份指定路由设备;如路由设备的标识最大的路由设备为多个,且其中一个路由设备为当前的指定路由设备,则仍选举当前的指定路由设备为指定路由设备,在路由设备的标识最大的其他路由设备中选举备份指定路由设备。In an embodiment of the present invention, the election module is further configured to: if the newly determined priority is the most If there are multiple routing devices, the routing device is identified. The routing device with the largest number of routing devices is the designated routing device. The routing device that elects the routing device is the backup routing device. For example, the routing device identifier. The maximum number of routing devices is multiple, and one of the routing devices is the current designated routing device. The current routing device is elected as the designated routing device. The routing device is elected to the routing device.
一种OSPF协议的选择指定路由设备的装置,包括存储器和处理器,其中,An apparatus for selecting a routing device, including a memory and a processor, wherein
所述存储器,存储有以下指令:将通过指定协议确定的指定路由设备作为伪指定路由设备;指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备;The memory stores the following instructions: the designated routing device determined by the specified protocol is used as a pseudo-designated routing device; and the pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node. The path loss values of the respective branches of the shortest path tree respectively determine the sum of the respective path loss values; and the information indicating that the pseudo designated routing device collects the sum of the path loss values of all the routing devices in the network, according to the path loss value And related information to elect a designated routing device and backup designated routing device;
所述处理器,配置为执行所述存储器的存储的指令。The processor is configured to execute an instruction to store the memory.
一种计算机存储介质,该计算机存储介质存储有计算机程序,该计算机程序配置为执行上述基于OSPF协议的选择DR设备的方法。A computer storage medium storing a computer program configured to perform the above-described method of selecting a DR device based on an OSPF protocol.
综上,本发明实施例提供一种基于OSPF协议的选择DR设备的方法及装置、存储介质,可以确保链路中总损耗是最小的。In summary, the embodiments of the present invention provide a method, a device, and a storage medium for selecting a DR device based on an OSPF protocol, which can ensure that the total loss in the link is the smallest.
附图说明DRAWINGS
图1为相关技术的路由拓扑图;1 is a routing topology diagram of a related art;
图2为根据OSPF的Dijkstra算法得出图1中路由设备A的网络拓扑图;2 is a network topology diagram of the routing device A in FIG. 1 according to the Dijkstra algorithm of OSPF;
图3为根据OSPF的Dijkstra算法得出图1中路由设备B的网络拓扑图;3 is a network topology diagram of the routing device B in FIG. 1 according to the Dijkstra algorithm of OSPF;
图4为根据OSPF的Dijkstra算法得出图1中路由设备C的网络拓扑图;4 is a network topology diagram of the routing device C in FIG. 1 according to the Dijkstra algorithm of OSPF;
图5为本发明实施例的一种基于OSPF协议的选择指定路由设备的方法的流程图; FIG. 5 is a flowchart of a method for selecting a designated routing device based on an OSPF protocol according to an embodiment of the present invention;
图6为本发明实施例的hello报文的结构示意图;FIG. 6 is a schematic structural diagram of a hello packet according to an embodiment of the present invention;
图7A、图7B和图7C分别为发明实施例三中的A、B、C路由设备分别作为根节点时的最短路径树的示意图;7A, FIG. 7B and FIG. 7C are schematic diagrams showing the shortest path tree when the routing devices A, B, and C in the third embodiment of the present invention respectively serve as root nodes;
图8A、图8B、图8C、图8D分别为发明实施例四中的A、B、C、D路由设备作为根节点时的最短路径树的示意图;8A, 8B, 8C, and 8D are schematic diagrams showing the shortest path tree when the A, B, C, and D routing devices in the fourth embodiment of the present invention are used as root nodes;
图9A、图9C、图9D分别为发明实施例五中的A、C、D路由设备作为根节点时的最短路径树的示意图;9A, FIG. 9C, and FIG. 9D are schematic diagrams showing the shortest path tree when the A, C, and D routing devices in the fifth embodiment of the present invention are used as root nodes;
图10为发明实施例六中的以A、B、D为根节点的最短路径优先树的示意图;10 is a schematic diagram of a shortest path first tree with A, B, and D as root nodes in Embodiment 6 of the present invention;
图11为一相对复杂的网络拓扑图;Figure 11 is a relatively complex network topology diagram;
图12为发明实施例七的网络拓扑图;12 is a network topology diagram of Embodiment 7 of the present invention;
图13为发明实施例的一种基于OSPF协议的选择指定路由设备的装置的示意图。FIG. 13 is a schematic diagram of an apparatus for selecting a designated routing device based on an OSPF protocol according to an embodiment of the invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
实施例一Embodiment 1
图5为本发明实施例的一种基于OSPF协议的选择指定路由设备的方法的流程图,如图5所示,本实施例的方法包括以下步骤:FIG. 5 is a flowchart of a method for selecting a designated routing device based on an OSPF protocol according to an embodiment of the present invention. As shown in FIG. 5, the method in this embodiment includes the following steps:
步骤11、将通过指定协议确定的指定路由设备作为伪指定路由设备;Step 11: The designated routing device determined by the specified protocol is used as a pseudo designated routing device.
步骤12、所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;Step 12: The pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node, and determine the sum of the respective path loss values according to the path loss values of the respective branches of the shortest path tree.
步骤13、所述伪指定路由设备收集网络中所有路由设备的路径损耗值 之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备。 Step 13. The pseudo designated routing device collects path loss values of all routing devices in the network. The information related to the sum is selected based on the information of the sum of the path loss values to elect the designated routing device and the backup designated routing device.
本发明实施例采用不同的设计方案,来优化RFC2328对OSPF协议中DR设备的选择,将RFC2328中选择出来的DR作为一个伪DR,再利用这个伪DR获取网络中所有路由设备的最短路径树,计算相应的路径损耗和值得出真正的DR设备,并将DR设备所有权转交给此真正的DR设备。The embodiment of the present invention adopts different design schemes to optimize the selection of the DR device in the OSPF protocol by the RFC 2328, and uses the DR selected in the RFC 2328 as a pseudo DR, and then uses the pseudo DR to obtain the shortest path tree of all the routing devices in the network. Calculate the corresponding path loss and deserve the true DR device and transfer the ownership of the DR device to this real DR device.
实施例二Embodiment 2
如下是伪DR设备、伪BDR设备的定义以及选举原则。The following are definitions of pseudo-DR devices, pseudo BDR devices, and election principles.
伪DR设备:就是原有RFC2328协议中选举出来的DR设备,并添加相应的路由表统计功能,在OSPF网络中,选为伪DR设备的路由设备,在网络中会首先根据自己的最短路径网络,发送hello报文请求网络中所有路由设备自身的最短路径优先树。获得所有路由设备的最短路径优先树之后,进行cost和值(即最短路径优先树中所有链路cost值之和)的计算,将cost值最小的路由设备作为此网络的DR设备,而伪DR设备则作为BDR设备存在与此网络中。Pseudo-DR device: It is the DR device elected in the original RFC2328 protocol, and adds the corresponding routing table statistics function. In the OSPF network, the routing device selected as the pseudo-DR device will first be based on its shortest path network. Send hello packets to request the shortest path first tree of all routing devices in the network. After obtaining the shortest path first tree of all routing devices, calculate the cost and the value (that is, the sum of the cost values of all links in the shortest path first tree), and use the routing device with the lowest cost as the DR device of the network, and the pseudo DR. The device then exists as a BDR device with this network.
伪BDR设备:是原有RFC2328协议中选举出来的BDR设备。只作为备份设备,当原有DR设备未选举出来时使用。Pseudo BDR device: It is the BDR device elected in the original RFC2328 protocol. It is used only as a backup device when the original DR device is not elected.
网络上的路由设备第一次运行选举算法的时候,把网络上的DR和BDR都初始为0.0.0.0,这说明DR和BDR都不存在。DR的选举算法按如下进行:将执行计算的路由设备称为X,并检查该网络上已经建立了双向通讯的路由设备列表。这个路由设备列表与路由设备X至少达到2-Way(双路)状态的邻居(在该网络上)正好相同,路由设备X自己也被认为在列表上。从列表上排除那些不能成为DR的路由设备(路由设备优先级为0的路由设备,不能成为DR),根据剩余的列表,执行下面的步骤:When the routing device on the network runs the election algorithm for the first time, the DR and BDR on the network are both initial 0.0.0.0, which means that neither DR nor BDR exists. The DR election algorithm is performed as follows: The routing device that performs the calculation is referred to as X, and a list of routing devices on the network that have established two-way communication is checked. This routing device list is exactly the same as the neighboring device (on the network) whose routing device X reaches at least 2-Way (the two-way) state, and the routing device X itself is also considered to be on the list. Exclude the routing devices that cannot become DRs (the routing devices with the routing device priority 0 cannot become the DR) from the list. According to the remaining list, perform the following steps:
步骤101、记录网络上当前的DR和BDR的数值,以用于以后的比较。 Step 101: Record the current DR and BDR values on the network for later comparison.
步骤102、按如下计算网络上的伪BDR:Step 102: Calculate a pseudo BDR on the network as follows:
列表上的路由设备中,只有那些不宣告自己为DR的才可能成为BDR。如果有一台或多台这样的路由设备宣告自己为BDR(也就是说,在其Hello包中将自己列为BDR,而不是DR),选择其中拥有最高路由设备优先级的成为伪BDR;如果相同,选择拥有最大路由设备标识的。如果没有路由设备宣告自己为BDR,选择列表中路由设备拥有最高优先级的成为伪BDR,(同样排除宣告自己为DR的路由设备),如果相同,再根据路由设备标识。Among the routing devices on the list, only those who do not declare themselves to be DRs may become BDRs. If one or more such routing devices declare themselves to be BDRs (that is, list themselves as BDRs instead of DRs in their Hello packets), select the one with the highest routing device priority to become a pseudo BDR; if the same , select the one with the largest routing device ID. If no routing device declares itself to be a BDR, the routing device in the selection list has the highest priority and becomes a pseudo BDR. (Also excludes the routing device that declares itself as a DR.) If the same, the device ID is based on the routing device.
步骤103、按如下计算网络上的伪DR:Step 103: Calculate the pseudo DR on the network as follows:
如果有一台或多台路由设备宣告自己为DR(也就是说,在其Hello包中将自己列为DR),选择其中拥有最高路由设备优先级的成为伪DR;如果相同,选择拥有最大路由设备标识的。如果没有路由设备宣告自己为DR,将新选举出的伪BDR设定为伪DR。If one or more routing devices declare themselves to be DRs (that is, list themselves as DRs in their Hello packets), select the ones that have the highest routing device priority to become pseudo-DRs; if they are the same, choose to have the largest routing devices. Logo. If no routing device declares itself to be a DR, the newly elected pseudo BDR is set to a pseudo DR.
如果路由设备X新近成为伪DR或伪BDR,或者不再成为伪DR或伪BDR,重复步骤102和103,选举出伪DR或伪BDR设备,然后执行步骤104。假设路由设备X新近成为伪DR,在重复步骤102时就不再参与伪BDR选举,这样做是为了确保路由设备不会同时宣告自己为伪DR和伪BDR。If the routing device X newly becomes a pseudo DR or a pseudo BDR, or is no longer a pseudo DR or a pseudo BDR, steps 102 and 103 are repeated, a pseudo DR or a pseudo BDR device is elected, and then step 104 is performed. Assuming that the routing device X has recently become a pseudo DR, it will not participate in the pseudo BDR election when the step 102 is repeated. This is to ensure that the routing device does not simultaneously declare itself as a pseudo DR and a pseudo BDR.
步骤104,作为选举结果,路由设备可能成为伪DR或伪BDR。如果路由设备成为伪DR,此时,伪DR路由设备在网络中发送hello报文请求(此处的hello报文中,将Designated Router字段中的指定DR的接口IP地址以及Backup Designated Router中的指点BDR的接口IP地址均置为255.255.255.255,报文结构如图6所示。In step 104, as a result of the election, the routing device may become a pseudo DR or a pseudo BDR. If the routing device becomes a pseudo-DR, the pseudo-DR routing device sends a hello packet request to the network. In the hello packet, the IP address of the specified DR in the Designated Router field and the pointer in the Backup Designated Router. The IP address of the BDR interface is set to 255.255.255.255. The packet structure is shown in Figure 6.
当其余路由设备收到此hello报文后,经解析认为是网络中伪DR发送的请求各个路由设备计算自身最短路径树各枝干cost之和的请求报文,所有路由设备接收到此hello报文后,各自根据Dijkstra算法计算出的最短路 径树。根据最短路径树各个枝干的cost值计算出设备自己的cost值之和,由于在OSPF中的hello报文,优先级站位为1字节,共有256个等级,故使用{256/最短路径树cost和值}得出新的优先级并进行取整并设置设备新的优先级。After receiving the hello packet, the other routing devices are determined to be request packets sent by the pseudo-DR in the network to request the routing device to calculate the sum of the branches of the shortest path tree. All the routing devices receive the hello report. After the text, the shortest path calculated according to the Dijkstra algorithm Trail tree. Calculate the sum of the cost values of the devices based on the cost of each branch of the shortest path tree. Because of the hello packets in OSPF, the priority station is 1 byte and there are 256 levels. Therefore, the {256/shortest path is used. The tree cost and value} derives a new priority and rounds it up and sets the device's new priority.
步骤105,各个路由设备计算完新优先级后,发送带有新优先级的hello报文给伪DR设备,伪DR设备将具有最大新优先级的路由设备选举为DR设备,次优先级的路由设备选举为BDR设备。伪DR设备和伪BDR设备则取消,重新作为DR other设备。Step 105: After calculating the new priority, each routing device sends a hello packet with a new priority to the pseudo-DR device. The pseudo-DR device elects the routing device with the largest new priority as the DR device, and the secondary priority route. The device is elected as a BDR device. The pseudo DR device and the pseudo BDR device are canceled and re-used as DR other devices.
如果具有两个或两个以上最大优先级的路由设备,则选择其中router-id(路由标识)最大的路由设备为DR设备,将路由标识次之的路由设备选为BDR。If there are two or more routing devices with the highest priority, select the routing device with the largest router-id (route ID) as the DR device and the routing device with the routing identifier as the BDR.
对于动态路由添加的情形下,如果网络拓扑中新添加了路由设备,则新路由设备自动计算自身的最短路径树,同样算出新优先级{256/最短路径树cost和值},发送hello报文给DR设备,如果DR设备的优先级小于此新设备的优先级则重新进行DR设备的选举。In the case of a dynamic route addition, if a new routing device is added to the network topology, the new routing device automatically calculates its own shortest path tree, and also calculates the new priority {256/the shortest path tree cost and value}, and sends a hello message. To the DR device, if the priority of the DR device is less than the priority of the new device, the DR device is re-elected.
在一可选实施例中,当DR的优先级小于新路由设备的优先级的指定比例(例如,二分之一或更小)时再重新进行DR设备的选举,这样可以避免频繁的变更DR设备,导致最短路径优先树网络拓扑的不稳定。In an optional embodiment, when the priority of the DR is less than the specified proportion of the priority of the new routing device (for example, one-half or less), the DR device is re-elected, so that frequent DR changes can be avoided. The device causes instability of the shortest path first tree network topology.
如果DR设备移除网络拓扑,则BDR设备顶替即可。If the DR device removes the network topology, the BDR device can be replaced.
实施例三Embodiment 3
以下根据附图中的简单场景图对DR设备的选举流程进行描述:The following describes the election process of the DR device according to the simple scenario diagram in the figure:
步骤201、本场景中只有A(priority:8、router-id:2)、B(priority:6、router-id:4)、C(priority:3、router-id:5)三个路由设备。其中,A-B之间的路径损耗为3,A-C之间的路径损耗为10,B-C之间的路径损耗为2。Step 201: In this scenario, there are only three routing devices: A (priority: 8, router-id: 2), B (priority: 6, router-id: 4), and C (priority: 3, router-id: 5). Among them, the path loss between A-B is 3, the path loss between A-C is 10, and the path loss between B-C is 2.
根据RFC2328协议中的DR设备选举方法,由于A的优先级是8,B 设备优先级是6,C设备优先级是3,则选举出A设备为伪DR设备,B设备为伪BDR设备。According to the DR device election method in the RFC2328 protocol, since the priority of A is 8, B The device priority is 6, and the C device priority is 3. The A device is elected as a pseudo DR device, and the B device is a pseudo BDR device.
步骤202、此时伪DR设备(即A设备)在网络中发送hello报文请求,此处的hello报文中,将Designated Router(指定路由设备)字段中的DR的接口IP地址以及Backup Designated Router(备用指定路由设备)中的BDR的接口IP地址均置为255.255.255.255。(此255.255.255.255为默认值,当然可以设置为其它值)。In step 202, the pseudo-DR device (that is, the device A) sends a hello packet request in the network. In the hello packet, the IP address of the DR interface and the Backup Designated Router in the Designated Router field are included. The IP address of the BDR interface in the standby designated routing device is set to 255.255.255.255. (This 255.255.255.255 is the default value, of course, it can be set to other values).
步骤203、B路由设备、C路由设备接收到A路由设备发送的hello报文,并且根据其中Designated Router字段以及Backup Designated Router字段中均伪255.255.255.255判断出,此报文是伪DR设备(即A设备)发送的新优先级计算的请求报文。Step 203: The B routing device and the C routing device receive the hello packet sent by the A routing device, and determine that the packet is a pseudo DR device according to the 255.255.255.255 in the Designated Router field and the Backup Designated Router field. A device) sends a new priority calculation request message.
步骤204、A、B、C路由设备开始进行新的优先级计算。Step 204, A, B, and C routing devices begin to perform new priority calculations.
A、B、C路由设备分别将自己作为根节点根据Dijkstra算法计算出的最短路径树,图7A、图7B和图7C分别为A、B、C路由设备分别作为根节点时的最短路径树。The A, B, and C routing devices respectively use themselves as the root node to calculate the shortest path tree according to the Dijkstra algorithm. Figures 7A, 7B, and 7C are the shortest path trees when the A, B, and C routing devices respectively act as root nodes.
根据最短路径树各个枝干的cost值计算出路由设备自己的cost值之和,此时A路由设备为根节点时的自身计算自己的cost值之和为13,同理B路由设备为cost值之和为5,C路由设备cost值之和为12。然后各个路由设备使用{256/最短路径树cost和值}得出新的优先级,进行取整并设置路由设备新的优先级。A路由设备新优先级为19,B设备新优先级为51,C设备新优先级为21。Calculate the sum of the cost values of the routing devices based on the cost of each branch of the shortest path tree. The sum of the cost values of the routing device is the same as that of the routing device. The sum is 5, and the sum of the cost values of the C routing devices is 12. Each routing device then uses {256/shortest path tree cost and value} to derive a new priority, round up and set the routing device's new priority. The new priority of the A routing device is 19, the new priority of the B device is 51, and the new priority of the C device is 21.
步骤205、B、C路由设备发送带有新优先级的hello报文给伪DR设备(A设备),A路由设备接收到B、C路由设备发送的报文后,提取其中的新优先级,跟自身的新优先级进行比较;Steps 205, B, and C: The routing device sends a hello packet with a new priority to the pseudo-DR device (A device). After receiving the packet sent by the B and C routing devices, the A routing device extracts the new priority. Compare with its new priority;
此例中可以看出B路由设备的新优先级为51,选举胜出。此时B路由 设备就会作为最终的DR设备。优先级次之的C路由设备则作为BDR设备。In this example, it can be seen that the new priority of the B routing device is 51, and the election wins. B route at this time The device will act as the final DR device. The C-router with the lower priority is used as the BDR device.
特殊情形,假如B、C路由设备的新优先级相同,则比较B、C路由设备中的router-id,router-id较大者则会被选举为DR设备,另一个则为BDR设备。In the special case, if the new priorities of the B and C routing devices are the same, the router-id in the B and C routing devices is compared. The router-id is elected as the DR device and the other is the BDR device.
实施例四Embodiment 4
新路由设备加入,D路由设备(priority:10、router-id:4),A-D之间的路径损耗为1,D-C之间的路径损耗为1。D路由设备加入后,宣告进行新的DR设备选举,此时,当前的DR设备给D路由设备发送hello报文进行DR设备选举,当D路由设备的优先级比当前的DR设备的优先级高时,选举D路由设备为新的DR设备,此时D路由设备发送与步骤202中A路由设备发送的同样的hello报文。The new routing device joins, D routing device (priority: 10, router-id: 4), the path loss between A-D is 1, and the path loss between D-C is 1. After the D-route device is added, the new DR device is elected. In this case, the current DR device sends a hello packet to the D-route device to perform DR device election. The priority of the D-route device is higher than that of the current DR device. The D routing device is elected as the new DR device, and the D routing device sends the same hello packet sent by the A routing device in step 202.
A、B、C路由设备接收到此hello报文之后开始进行新的优先级计算,与此同时D路由设备也会进行新优先级的计算。A、B、C、D路由设备分别将自己作为根节点根据Dijkstra算法计算出的最短路径树,如图8A、图8B、图8C、图8D分别为A、B、C、D路由设备在此时网络拓扑的情况下分别作为根节点时的最短路径树。After receiving the hello message, the A, B, and C routing devices start to perform new priority calculation. At the same time, the D routing device also performs new priority calculation. The routing devices A, B, C, and D respectively use themselves as the root node to calculate the shortest path tree according to the Dijkstra algorithm. Figure 8A, Figure 8B, Figure 8C, and Figure 8D show the A, B, C, and D routing devices. In the case of a network topology, the shortest path tree as the root node, respectively.
根据最短路径树各个枝干的cost值计算出设备自己的cost值之和,此时A路由设备为根节点时的自身计算自己的cost值之和为14,同理B路由设备为cost值之和为6,C路由设备为13,D路由设备为4。然后各个路由设备使用{256除以最短路径树cost和值}得出新的优先级,进行取整并设置设备新的优先级。A路由设备新优先级为18,B路由设备新优先级为42,C路由设备新优先级为19,D路由设备的新优先级为63。Calculate the sum of the cost values of the devices based on the cost of each branch of the shortest path tree. The sum of the cost values of the A routing device is 14 and the cost of the routing device is the same. For the 6, C routing device is 13, and the D routing device is 4. Each routing device then uses {256 divided by the shortest path tree cost and value} to derive a new priority, round up and set the device's new priority. The new priority of the routing device is 18, the new priority of the B routing device is 42, the new priority of the C routing device is 19, and the new priority of the D routing device is 63.
A、B、C路由设备将新优先级通过hello报文发送给D路由设备,此时由于D路由设备的新优先级最高,则选举为新的DR设备,B路由设备则选为BDR设备。 The routing device of the A, B, and C sends the new priority to the D-route device through the hello packet. The new routing device is elected as the new DR device and the B-route device is elected as the BDR device.
当然,在一可选实施例中,为避免频繁的改变DR设备,当新设备加入时,应当在新的拓扑网络中设备新优先级大于2倍(或其他倍数)的原有DR设备时,才发生DR设备的易主。也可以进行周期性的DR设备选举以确保网络尽可能的以最优的设备作为DR设备。Of course, in an optional embodiment, in order to avoid frequent changes to the DR device, when the new device joins, when the device has a new priority of more than 2 times (or other multiples) of the original DR device in the new topology network, The change of the DR device occurs. Periodic DR device elections can also be performed to ensure that the network is as optimal as the DR device.
网络拓扑中设备移出存在以下情形:The following situations occur when a device moves out of the network topology:
实施例五Embodiment 5
在此网络拓扑中B路由设备移出,网络拓扑中只剩下A、C、D三个路由设备,此时DR设备即D路由设备检测到网络拓扑发生变化,同样会发送步骤202中的hello报文给A、C路由设备来进行新的DR设备选举。以A、C、D为根节点的最短路径优先树如图9A、图9C、图9D所示,同样可以得出,A路由设备的cost值之和为11,计算出自己的新优先级为23。C路由设备的cost值之和为11,计算出自己的新优先级为23。D路由设备的cost值之和为2,计算出自己的新优先级为127。此时由于D路由设备的优先级仍然为最高,所以此时D路由设备仍会作为DR设备。In this network topology, the B routing device is removed, and only the routing devices A, C, and D are left in the network topology. At this time, the DR device, that is, the D routing device detects that the network topology changes, and sends the hello report in step 202. The file is given to the A and C routing devices for new DR device elections. The shortest path first tree with A, C, and D as the root node is as shown in FIG. 9A, FIG. 9C, and FIG. 9D. Similarly, the sum of the cost values of the A routing device is 11, and the new priority is calculated as twenty three. The sum of the cost values of the C routing device is 11, and the new priority is calculated to be 23. The sum of the cost values of the D routing device is 2, and the new priority is calculated to be 127. At this time, since the priority of the D routing device is still the highest, the D routing device still acts as the DR device.
实施例六Embodiment 6
在此网络拓扑中C路由设备移出,网络拓扑中只剩下A、B、D三个设备,此时DR设备即D路由设备检测到网络拓扑发生变化,同样会发送步骤202中的hello报文给A、B路由设备来进行新的DR设备选举,以A、B、D为根节点的最短路径优先树如图10所示,此时分别以A、B、D为根节点的网络拓扑图均一样,那么以各自为根节点的cost值以及优先级也一样,分别为cost=4,新优先级为63。In this network topology, the C routing device is removed. Only the A, B, and D devices are left in the network topology. In this case, the DR device, that is, the D routing device, detects that the network topology changes, and sends the hello packet in step 202. The A and B routing devices are used to perform new DR device elections. The shortest path first tree with A, B, and D as the root nodes is shown in Figure 10. The network topology map with A, B, and D as the root nodes respectively. The same is true, then the cost value and the priority of each root node are the same, respectively cost=4, and the new priority is 63.
A、B路由设备将新优先级通过hello报文发送给D路由设备,此时由于A、B、D三个设备的优先级均一样,则会进行router-id的比较,根据比较结果发现B、D设备的router-id较大但是一样,则此时由于D设备之前就是DR设备,所以为减少网络最短路径树的变化,D设备仍然会作为 DR设备。The A and B routing devices send the new priority to the D-route device through the hello packet. At this time, because the priorities of the three devices A, B, and D are the same, the router-id is compared. The router-id of the D device is large but the same. At this time, since the D device is the DR device before, the D device still acts as a network path to reduce the change of the shortest path tree. DR device.
实施例七Example 7
应用场景实施例,此发明实施例不仅可应用与系统级的路由设备的OSPF协议中,在物联网设备中仍然具有很好的实施用途:In the embodiment of the application scenario, the embodiment of the invention can be applied not only to the OSPF protocol of the system-level routing device, but also has a good implementation purpose in the Internet of Things device:
如此场景:工业物联网设备中,管理员管理整个企业的所有物联网设备,那么当管理员发送一个广播报文(如开启、关闭或是某项集体操作)的时候,就将其中的一个设备作为根节点计算出的最短路径树来进行广播发送。这样能够最短的时间,最少的损耗来广播报文的发送,其中这个根节点的选择就至关重要。Such a scenario: In an industrial IoT device, the administrator manages all IoT devices across the enterprise, so when the administrator sends a broadcast message (such as open, close, or a collective operation), one of the devices is placed. Broadcast transmission is performed as the shortest path tree calculated by the root node. In this way, the transmission of the message can be broadcast in the shortest time and with the least loss, and the selection of this root node is crucial.
而本发明实施例中的DR设备的选择方案就能够很好的完成这个根节点的选择场景。如图11所示是一个相对复杂的网络拓扑图,管理员需要操控这些物联网设备,那么此时管理员发送一个广播报文应该选择使用哪个设备作为根节点?此时如果依照原有RFC2328中的算法选举出来的根节点为Route E,但这个跟节点却不是最优的。The selection scheme of the DR device in the embodiment of the present invention can complete the selection scenario of the root node well. As shown in Figure 11, a relatively complex network topology diagram, the administrator needs to control these IoT devices, then the administrator should send a broadcast message to select which device to use as the root node? At this time, if the root node elected according to the algorithm in the original RFC2328 is Route E, this node is not optimal.
依照本发明实施例里中的算法:An algorithm in accordance with an embodiment of the invention:
步骤301、设备E作为了伪DR设备,发送hello报文给网络拓扑中的所有物联网设备。Step 301: The device E acts as a pseudo-DR device and sends a hello packet to all the Internet of Things devices in the network topology.
步骤302、此时所有的物联网设备都会以自作为根节点根据Dijkstra算法来进行最短路径树的拓扑计算,此时可以的到A设备的Cost和值:15,B设备的Cost和值:16,C设备的Cost和值:15,D设备的Cost和值:12,E设备的Cost和值:14,F设备的Cost和值:14,G设备的Cost和值:14,H设备的Cost和值:15。此时管理员应该选择D设备被选举为DR设备,作为根节点来进行广播报文的发送,这样会使物联网设备中的广播报文输出达到最小的总体路径损耗。Step 302: At this time, all the IoT devices perform the topology calculation of the shortest path tree according to the Dijkstra algorithm as the root node. At this time, the Cost and the value of the A device can be: 15, the Cost and the value of the B device: 16 Cost and value of C device: 15, Cost and value of D device: 12, Cost and value of E device: 14, Cost and value of F device: 14, Cost and value of G device: 14, Cost of H device And value: 15. At this point, the administrator should select the D device to be elected as the DR device and use it as the root node to send broadcast packets. This will minimize the overall path loss of broadcast packets in the IoT device.
最终在此网络拓扑中最优化的最短路径优先树,以D设备为根节点如 图12所示。The shortest path first tree that is optimized in this network topology, with the D device as the root node. Figure 12 shows.
在OSPF网络中DR相关设备有如下作用:DR related devices in the OSPF network have the following functions:
1、DR(被选举出来作为LSDB(Link State DataBase,链路状态数据库)广播的发送者,为网络中的其他路由设备规划拓扑)。1. The DR (which is elected as the sender of the LSDB (Link State Data Base) broadcast, plans the topology for other routing devices in the network).
2、BDR(在这种状态下相当被DR的备选者,在DR挂掉后充当DR的角色)。2. BDR (in this state, it is quite a candidate for DR, and acts as a DR after the DR hangs).
3、DROther(与DR和BDR形成邻接关系,与其他DROther角色只发送HELLO信息)。3. DROther (forms adjacency with DR and BDR, and only sends HELLO information with other DROther roles).
DR设备作为LSDB广播的发送者,在OSPF网络中,DR设备会根据自身的最短路径树来发送LSDB广播,这个最短路径树是以DR设备为根节点的最短路径树,而并非是此网络中能够链接所有路由设备的cost值最小的最短路径树,再第四部分已有技术方案中可以明显看出如果根据现有RFC2328计算出的DR设备来作为根节点发送LSDB广播所消耗的总cost值,要比根据本专利中方法选举出来的DR设备消耗要高很多。在大量的广播报文的时候,此消耗不可小视。优化DR选择,降低网络拓扑中多余的报文cost损耗,尽可能的提升网络通讯效率。The DR device acts as the sender of the LSDB broadcast. In the OSPF network, the DR device sends the LSDB broadcast according to its shortest path tree. This shortest path tree is the shortest path tree with the DR device as the root node, but not in this network. The shortest path tree with the lowest cost value of all routing devices can be linked. In the fourth part of the prior art, it is obvious that the total cost value of the LSDB broadcast is sent as the root node according to the existing DRC2328. It is much higher than the DR equipment elected according to the method in this patent. In the case of a large number of broadcast messages, this consumption cannot be underestimated. Optimize DR selection, reduce the cost loss of redundant packets in the network topology, and improve network communication efficiency as much as possible.
其次所有邻居只和DR/BDR同步LSA(链路状态广播)条目,当仅仅根据优先级选出来的DR设备到不同邻居的距离是最优,但这种最优仅仅建立在确定DR设备,而不是网络中的最优。如果根据本专利的方法得出的DR设备则是网络中最优的DR设备。在所有邻居与DR同步LSA条目时,路径cost值之和将是最小的。Secondly, all neighbors only synchronize the LSA (Link State Broadcast) entry with the DR/BDR. When only the DR device selected according to the priority is optimally distanced to different neighbors, the optimality is only established in determining the DR device. Not the best in the network. If the DR device derived according to the method of this patent is the optimal DR device in the network. When all neighbors synchronize the LSA entries with the DR, the sum of the path cost values will be the smallest.
本发明实施例还提供了一种存储介质,其存储有计算机可执行指令,所述计算机可执行指令被执行时实现所述基于OSPF协议的选择指定路由设备的方法。The embodiment of the present invention further provides a storage medium storing computer executable instructions, and when the computer executable instructions are executed, implementing the OSPF protocol-based method for selecting a routing device.
图13为本发明实施例的一种基于OSPF协议的选择指定路由设备的装 置的示意图,如图13所示,本实施例的装置包括:FIG. 13 is a diagram of selecting a designated routing device based on an OSPF protocol according to an embodiment of the present invention; As shown in FIG. 13, the apparatus of this embodiment includes:
初选模块1301,配置为将通过指定协议确定的指定路由设备作为伪指定路由设备;The primary selection module 1301 is configured to use the designated routing device determined by the specified protocol as a pseudo-designated routing device;
确定模块1302,配置为指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;The determining module 1302 is configured to instruct the pseudo-designated routing device and each routing device in the network to determine the shortest path tree by using the root node as the root node, and determine the path loss respectively according to the path loss values of the branches of the shortest path tree. The sum of the values;
选举模块1303,配置为指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备。The election module 1303 is configured to instruct the pseudo-designated routing device to collect information about a sum of path loss values of all routing devices in the network, and elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
本发明一实施方式中,所述确定模块1302,还配置为指示所述网络中各路由设备在接收到所述伪指定路由设备发送的选举指定路由设备的握手报文后,开始确定最短路径树。In an embodiment of the present invention, the determining module 1302 is further configured to: after each routing device in the network receives the handshake message of the election designated routing device sent by the pseudo-designated routing device, start determining the shortest path tree. .
本发明一实施方式中,所述确定模块1302,还配置为指示所述伪指定路由设备及网络中各路由设备根据路径损耗值之和确定各自的优先级,In an embodiment of the present invention, the determining module 1302 is further configured to instruct the pseudo-designated routing device and each routing device in the network to determine respective priorities according to a sum of path loss values.
所述选举模块1303,还配置为指示所述伪指定路由设备根据网络中所有路由设备的优先级来选举指定路由设备和备份指定路由设备。The election module 1303 is further configured to instruct the pseudo-designated routing device to elect a designated routing device and a backup designated routing device according to priorities of all routing devices in the network.
在一优选实施例中,所述选举模块1303,还配置为将优先级最大的路由设备选举为指定路由设备,将优先级次之的路由设备选举为备份指定路由设备;如果优先级最大的路由设备有多个,则根据路由标识的大小来选举指定路由设备和备份指定路由设备。In a preferred embodiment, the election module 1303 is further configured to elect the routing device with the highest priority as the designated routing device, and elect the routing device with the lower priority as the backup designated routing device; If there are multiple devices, the specified routing device and the backup designated routing device are elected according to the size of the route identifier.
在一优选实施例中,所述选举模块1303,还配置为如果所述网络中添加了新路由设备,则指示当前的指定路由设备向所述新路由设备发送选举指定路由设备的握手报文,获取所述新路由设备的优先级进行指定路由设备选举。In a preferred embodiment, the election module 1303 is further configured to: if a new routing device is added to the network, instructing the current designated routing device to send a handshake message of the specified routing device to the new routing device. Obtain the priority of the new routing device to perform the routing device election.
在一优选实施例中,所述选举模块1303,还配置为当当前的指定路由 设备的优先级小于所述新路由设备的优先级的指定比例时,将所述新路由设备选举为新的指定路由设备。In a preferred embodiment, the election module 1303 is further configured to use the current designated route. When the priority of the device is smaller than the specified proportion of the priority of the new routing device, the new routing device is elected as a new designated routing device.
在一优选实施例中,所述选举模块1303,还配置为当检测到网络拓扑发生变化时,指示当前的指定路由设备向所述网络中各路由设备发送重新确定优先级请求的握手报文,重新根据收集到的新确定的优先级选举指定路由设备和备份指定路由设备。In a preferred embodiment, the election module 1303 is further configured to: when detecting that the network topology changes, instructing the current designated routing device to send a handshake message for re-determining the priority request to each routing device in the network, The specified routing device and the backup designated routing device are re-elected according to the newly determined priority.
在一优选实施例中,所述选举模块1303,还配置为若新确定的优先级最大的路由设备有多个,则比较路由设备的标识,选举路由设备的标识最大的路由设备为指定路由设备,选举路由设备的标识次之的路由设备为备份指定路由设备;如路由设备的标识最大的路由设备为多个,且其中一个路由设备为当前的指定路由设备,则仍选举当前的指定路由设备为指定路由设备,在路由设备的标识最大的其他路由设备中选举备份指定路由设备。In a preferred embodiment, the election module 1303 is further configured to: if there are multiple routing devices with the highest priority, the identifier of the routing device is compared, and the routing device with the largest identifier of the routing device is the designated routing device. The routing device that is elected to the routing device is the routing device for the backup. If the routing device has the largest number of routing devices, and one of the routing devices is the current routing device, the current routing device is still elected. Specifies the routing device to elect the backup routing device in the other routing device with the largest identifier of the routing device.
在实际应用中,所述基于OSPF协议的选择指定路由设备的装置中的各个单元所实现的功能,均可由位于基于OSPF协议的选择指定路由设备的装置中的中央处理器(CPU,Central Processing Unit)、或微处理器(MPU,Micro Processor Unit)、或数字信号处理器(DSP,Digital Signal Processor)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等实现。In an actual application, the OSPF protocol-based selection specifies that the functions implemented by each unit in the device of the routing device can be a central processing unit (CPU, Central Processing Unit) located in the device that selects the routing device based on the OSPF protocol. , or a microprocessor (MPU, Micro Processor Unit), or a digital signal processor (DSP, Digital Signal Processor), or a Field Programmable Gate Array (FPGA).
本发明实施例还提供一种基于OSPF协议的选择指定路由设备的装置,包括存储器和处理器,其中,An embodiment of the present invention further provides an apparatus for selecting a designated routing device based on an OSPF protocol, including a memory and a processor, where
所述存储器,存储有以下指令:将通过指定协议确定的指定路由设备作为伪指定路由设备;指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备; The memory stores the following instructions: the designated routing device determined by the specified protocol is used as a pseudo-designated routing device; and the pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node. The path loss values of the respective branches of the shortest path tree respectively determine the sum of the respective path loss values; and the information indicating that the pseudo designated routing device collects the sum of the path loss values of all the routing devices in the network, according to the path loss value And related information to elect a designated routing device and backup designated routing device;
所述处理器,配置为执行所述存储器的存储的指令。The processor is configured to execute an instruction to store the memory.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明不限制于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or a portion of the steps described above can be accomplished by a program that instructs the associated hardware, such as a read-only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware or in the form of a software function module. The invention is not limited to any specific form of combination of hardware and software.
以上仅为本发明的优选实施例,当然,本发明还可有其他多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。The above is only a preferred embodiment of the present invention, and of course, the present invention may be embodied in various other embodiments without departing from the spirit and scope of the invention. Corresponding changes and modifications are intended to be included within the scope of the appended claims.
工业实用性Industrial applicability
本发明实施例的技术方案,将通过指定协议确定的指定路由设备作为伪指定路由设备;指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备,如此,可以确保链路中总损耗是最小的。 The technical solution of the embodiment of the present invention, the designated routing device determined by the specified protocol is used as the pseudo-designated routing device; and the pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node, according to the The path loss values of the respective branches of the shortest path tree respectively determine the sum of the respective path loss values; the information indicating that the pseudo designated routing device collects the sum of the path loss values of all routing devices in the network, according to the sum of the path loss values The relevant information is elected to the designated routing device and the backup designated routing device, thus ensuring that the total loss in the link is minimal.

Claims (18)

  1. 一种基于开放式最短路径优先OSPF协议的选择指定路由设备的方法,包括:A method for selecting a routing device based on an open shortest path first OSPF protocol, including:
    将通过指定协议确定的指定路由设备作为伪指定路由设备;Specifying a specified routing device determined by the specified protocol as a pseudo-designated routing device;
    指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;Instructing the pseudo-designated routing device and each routing device in the network to determine the shortest path tree by using the root node as the root node, and determining the sum of the respective path loss values according to the path loss values of the respective branches of the shortest path tree;
    指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备。And the information indicating that the pseudo-designated routing device collects the sum of the path loss values of all the routing devices in the network, and elects the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
  2. 如权利要求1所述的方法,其中:所述指示网络中各路由设备分别以自己作为根节点确定最短路径树,还包括:The method of claim 1, wherein: the routing device in the network indicates that the shortest path tree is determined by itself as a root node, and further includes:
    指示所述网络中各路由设备在接收到所述伪指定路由设备发送的选举指定路由设备的握手报文后,开始确定最短路径树。The routing device in the network is instructed to determine the shortest path tree after receiving the handshake message of the election designated routing device sent by the pseudo designated routing device.
  3. 如权利要求1所述的方法,其中:The method of claim 1 wherein:
    所述指示所述伪指定路由设备及网络中各路由设备根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和之后,还包括:指示所述伪指定路由设备及网络中各路由设备根据路径损耗值之和确定各自的优先级,And after indicating that the pseudo-designated routing device and each routing device in the network respectively determine the sum of the path loss values according to the path loss values of the respective branches of the shortest path tree, the method further includes: indicating the pseudo designated routing device And each routing device in the network determines its own priority according to the sum of the path loss values.
    所述指示所述伪指定路由设备根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备,包括:指示所述伪指定路由设备根据网络中所有路由设备的优先级来选举指定路由设备和备份指定路由设备。And the instructing the pseudo-designated routing device to elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values, including: instructing the pseudo-designated routing device to elect a specified route according to the priority of all routing devices in the network Device and backup specify the routing device.
  4. 如权利要求3所述的方法,其中:所述指示所述伪指定路由设备根据网络中所有路由设备的优先级来选举指定路由设备和备份指定路由 设备,包括:The method of claim 3, wherein: said instructing said pseudo-designated routing device to elect a designated routing device and a backup designated route according to a priority of all routing devices in the network Equipment, including:
    将优先级最大的路由设备选举为指定路由设备,将优先级次之的路由设备选举为备份指定路由设备;如果优先级最大的路由设备有多个,则根据路由标识的大小来选举指定路由设备和备份指定路由设备。The routing device with the highest priority is elected as the designated routing device, and the routing device with the lower priority is elected as the backup routing device. If there are multiple routing devices with the highest priority, the routing device is elected according to the size of the routing identifier. And back up the specified routing device.
  5. 如权利要求4所述的方法,其中:The method of claim 4 wherein:
    如果所述网络中添加了新路由设备,则指示当前的指定路由设备向所述新路由设备发送选举指定路由设备的握手报文,获取所述新路由设备的优先级进行指定路由设备选举。If a new routing device is added to the network, the current designated routing device is configured to send the handshake packet of the specified routing device to the new routing device, and obtain the priority of the new routing device to perform the routing device election.
  6. 如权利要求5所述的方法,其中:所述获取所述新路由设备的优先级进行指定路由设备选举,包括:The method of claim 5, wherein the obtaining the priority of the new routing device to perform a routing device election comprises:
    当当前的指定路由设备的优先级小于所述新路由设备的优先级的指定比例时,将所述新路由设备选举为新的指定路由设备。When the priority of the current designated routing device is smaller than the specified proportion of the priority of the new routing device, the new routing device is elected as a new designated routing device.
  7. 如权利要求4所述的选择方法,其中:The selection method of claim 4 wherein:
    当检测到网络拓扑发生变化时,指示当前的指定路由设备向所述网络中各路由设备发送重新确定优先级请求的握手报文,重新根据收集到的新确定的优先级选举指定路由设备和备份指定路由设备。When it is detected that the network topology changes, the current designated routing device sends a handshake packet to the routing device of the network to re-determine the priority request, and then elects the routing device and the backup according to the newly determined priority. Specify a routing device.
  8. 如权利要求7所述的选择方法,其中:所述重新根据收集到的新确定的优先级选举指定路由设备和备份指定路由设备包括:The selection method according to claim 7, wherein: the re-election of the designated routing device and the backup designated routing device according to the newly determined priority of the collection comprises:
    若新确定的优先级最大的路由设备有多个,则比较路由设备的标识,选举路由设备的标识最大的路由设备为指定路由设备,选举路由设备的标识次之的路由设备为备份指定路由设备;If there are multiple routing devices with the highest priority, the routing device is the same as the routing device. The routing device with the largest number of the routing device is the designated routing device. ;
    如路由设备的标识最大的路由设备为多个,且其中一个路由设备为当前的指定路由设备,则仍选举当前的指定路由设备为指定路由设备,在路由设备的标识最大的其他路由设备中选举备份指定路由设备。If the routing device has the largest number of routing devices, and one of the routing devices is the current routing device, the current routing device is elected as the designated routing device. Back up the specified routing device.
  9. 一种基于开放式最短路径优先OSPF协议的选择指定路由设备的 装置,包括:A method for selecting a designated routing device based on an open shortest path first OSPF protocol Devices, including:
    初选模块,配置为将通过指定协议确定的指定路由设备作为伪指定路由设备;The primary selection module is configured to use the designated routing device determined by the specified protocol as a pseudo-designated routing device;
    确定模块,配置为指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;a determining module, configured to indicate that the pseudo-designated routing device and each routing device in the network respectively determine a shortest path tree by using the root node as a root node, and determine respective path loss values according to path loss values of the respective branches of the shortest path tree. Sum;
    选举模块,配置为指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备。The election module is configured to instruct the pseudo-designated routing device to collect information about a sum of path loss values of all routing devices in the network, and elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values.
  10. 如权利要求9所述的装置,其中:The apparatus of claim 9 wherein:
    所述确定模块,还配置为指示所述网络中各路由设备在接收到所述伪指定路由设备发送的选举指定路由设备的握手报文后,开始确定最短路径树。The determining module is further configured to: after each routing device in the network receives the handshake message of the election designated routing device sent by the pseudo-designated routing device, start determining the shortest path tree.
  11. 如权利要求9所述的装置,其中:The apparatus of claim 9 wherein:
    所述确定模块,还配置为指示所述伪指定路由设备及网络中各路由设备根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和之后,还包括:指示所述伪指定路由设备及网络中各路由设备根据路径损耗值之和确定各自的优先级,The determining module is further configured to: after the determining, by the pseudo-designated routing device, each routing device in the network, according to the path loss value of each branch of the shortest path tree, determining a sum of respective path loss values, the method further includes: indicating The pseudo-designated routing device and each routing device in the network determine respective priorities according to the sum of path loss values,
    所述选举模块,还配置为指示所述伪指定路由设备根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备,包括:指示所述伪指定路由设备根据网络中所有路由设备的优先级来选举指定路由设备和备份指定路由设备。The election module is further configured to instruct the pseudo designated router to elect the designated routing device and the backup designated routing device according to the information about the sum of the path loss values, including: indicating that the pseudo designated routing device is based on all routing devices in the network. Priority to elect the specified routing device and backup designated routing device.
  12. 如权利要求11所述的装置,其中:The apparatus of claim 11 wherein:
    所述选举模块,还配置为将优先级最大的路由设备选举为指定路由设备,将优先级次之的路由设备选举为备份指定路由设备;如果优先级 最大的路由设备有多个,则根据路由标识的大小来选举指定路由设备和备份指定路由设备。The election module is further configured to elect the routing device with the highest priority as the designated routing device, and elect the routing device with the lower priority as the backup designated routing device; if the priority is If there are multiple routing devices, the specified routing device and the backup routing device are elected according to the size of the route identifier.
  13. 如权利要求12所述的装置,其中:The apparatus of claim 12 wherein:
    所述选举模块,还配置为如果所述网络中添加了新路由设备,则指示当前的指定路由设备向所述新路由设备发送选举指定路由设备的握手报文,获取所述新路由设备的优先级进行指定路由设备选举。The election module is further configured to: if a new routing device is added to the network, instructing the current designated routing device to send a handshake packet of the specified routing device to the new routing device, and obtain the priority of the new routing device. The level is used to elect a routing device.
  14. 如权利要求13所述的装置,其中:The apparatus of claim 13 wherein:
    所述选举模块,还配置为当当前的指定路由设备的优先级小于所述新路由设备的优先级的指定比例时,将所述新路由设备选举为新的指定路由设备。The election module is further configured to elect the new routing device as a new designated routing device when the priority of the current designated routing device is less than a specified proportion of the priority of the new routing device.
  15. 如权利要求12所述的装置,其中:The apparatus of claim 12 wherein:
    所述选举模块,还配置为当检测到网络拓扑发生变化时,指示当前的指定路由设备向所述网络中各路由设备发送重新确定优先级请求的握手报文,重新根据收集到的新确定的优先级选举指定路由设备和备份指定路由设备。The election module is further configured to: when it is detected that the network topology changes, instructing the current designated routing device to send a handshake message for re-determining the priority request to each routing device in the network, and re-determining according to the newly determined collected Priority elections specify the routing device and backup designated routing device.
  16. 如权利要求15所述的装置,其中:The apparatus of claim 15 wherein:
    所述选举模块,还配置为若新确定的优先级最大的路由设备有多个,则比较路由设备的标识,选举路由设备的标识最大的路由设备为指定路由设备,选举路由设备的标识次之的路由设备为备份指定路由设备;如路由设备的标识最大的路由设备为多个,且其中一个路由设备为当前的指定路由设备,则仍选举当前的指定路由设备为指定路由设备,在路由设备的标识最大的其他路由设备中选举备份指定路由设备。The election module is further configured to: if there are multiple routing devices with the highest priority, the routing device is compared, and the routing device with the largest identifier of the routing device is the designated routing device, and the identifier of the routing device is elected. The routing device specifies the routing device for the backup. If the routing device has the largest number of routing devices, and one of the routing devices is the current designated routing device, the current routing device is still elected as the designated routing device. The identification of the largest other routing device in the election backup designated routing device.
  17. 一种基于开放式最短路径优先OSPF协议的选择指定路由设备的装置,包括存储器和处理器,An apparatus for selecting a designated routing device based on an open shortest path first OSPF protocol, including a memory and a processor,
    所述存储器,存储有以下指令:将通过指定协议确定的指定路由设 备作为伪指定路由设备;指示所述伪指定路由设备及网络中各路由设备分别以自己作为根节点确定最短路径树,根据所述最短路径树的各个枝干的路径损耗值分别确定各自的路径损耗值之和;指示所述伪指定路由设备收集网络中所有路由设备的路径损耗值之和的相关信息,根据路径损耗值之和的相关信息选举指定路由设备和备份指定路由设备;The memory stores the following instructions: a specified routing set to be determined by a specified protocol The device is configured as a pseudo-designated routing device; the pseudo-designated routing device and each routing device in the network respectively determine the shortest path tree by using the root node as the root node, and determine the respective paths according to the path loss values of the respective branches of the shortest path tree. The sum of the loss values; the information indicating that the pseudo-designated routing device collects the sum of the path loss values of all the routing devices in the network, and elects the designated routing device and the backup designated routing device according to the information about the sum of the path loss values;
    所述处理器,配置为执行所述存储器的存储的指令。The processor is configured to execute an instruction to store the memory.
  18. 一种存储介质,所述存储介质中存储有计算机可执行指令,该计算机可执行指令配置为执行权利要求1-8任一项所述的基于OSPF协议的选择指定路由设备的方法。 A storage medium storing computer executable instructions configured to perform the OSPF protocol-based selection of a routing device according to any one of claims 1-8.
PCT/CN2017/109724 2017-05-11 2017-11-07 Dr device selection method and apparatus based on ospf protocol, and storage medium WO2018205520A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710330958.0 2017-05-11
CN201710330958.0A CN108881007A (en) 2017-05-11 2017-05-11 A kind of method and device of the selection DR equipment based on ospf protocol

Publications (1)

Publication Number Publication Date
WO2018205520A1 true WO2018205520A1 (en) 2018-11-15

Family

ID=64104782

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/109724 WO2018205520A1 (en) 2017-05-11 2017-11-07 Dr device selection method and apparatus based on ospf protocol, and storage medium

Country Status (2)

Country Link
CN (1) CN108881007A (en)
WO (1) WO2018205520A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8018873B1 (en) * 2007-11-08 2011-09-13 Juniper Networks, Inc. Enhanced link state protocol for identifying broadcast networks
CN105227459A (en) * 2014-05-29 2016-01-06 国际商业机器公司 The method performed by ospf router and corresponding ospf router
CN106559343A (en) * 2015-09-28 2017-04-05 中兴通讯股份有限公司 A kind of electoral machinery and device of Designated Router

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8018873B1 (en) * 2007-11-08 2011-09-13 Juniper Networks, Inc. Enhanced link state protocol for identifying broadcast networks
CN105227459A (en) * 2014-05-29 2016-01-06 国际商业机器公司 The method performed by ospf router and corresponding ospf router
CN106559343A (en) * 2015-09-28 2017-04-05 中兴通讯股份有限公司 A kind of electoral machinery and device of Designated Router

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, XIAOHUA ET AL.: "Simulation and Analysis of OSPFv2 DR Election Based on GNS", NATIONAL CONFERENCE ON INFORMATION TECHNOLOGY AND COMPUTER SCIENCE (CITCS 2012, 31 December 2012 (2012-12-31) *

Also Published As

Publication number Publication date
CN108881007A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
US10541905B2 (en) Automatic optimal route reflector root address assignment to route reflector clients and fast failover in a network environment
US11848823B2 (en) System and method to recover from link or node failure in a network
EP2911348B1 (en) Control device discovery in networks having separate control and forwarding devices
EP1685681B1 (en) Method and apparatus for determining network routing information based on shared risk link group information
US8908676B2 (en) Automatically detecting best paths from shadow route reflectors
Vetriselvan et al. Survey on the RIP, OSPF, EIGRP routing protocols
EP2648375B1 (en) Method and device for establishing router neighbor
EP3399703B1 (en) Method for implementing load balancing, apparatus, and network system
KR101457317B1 (en) Prioritization of routing information updates
US20100085892A1 (en) Overlay network coordination redundancy
CN103532840A (en) Link switching method and link switching device
CN110380977B (en) Routing fusion method oriented to mixed environment of mobile ad hoc network and Internet
Asher Comprehensive analysis of dynamic routing protocols in computer networks
Zhang et al. Survivable path computation in PCE-based multi-domain networks
WO2018205520A1 (en) Dr device selection method and apparatus based on ospf protocol, and storage medium
CN106487682B (en) Diameter signaling network routing method and device
JP2005159846A (en) Method and apparatus for setting multicast transfer path
CN108243104B (en) Multi-layer LSP control method and device
CN112039770B (en) Routing method and device
Norvor et al. Dynamic Routing Implementation Decision between OSPFv3 and IS–IS in IPv6 Networks
Tian et al. One-hop overlay path recovery model with super-relay nodes
WO2016078342A1 (en) Trill network distribution tree computation method and trill network node
MEENAKSHI Study and Analysis of Techniques for Development of Quality of Service in Networks
JP2009284278A (en) Route aggregator and route aggregation method
Cakaj Implementing OSPF for ISP

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17909023

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17909023

Country of ref document: EP

Kind code of ref document: A1