Method for determining multicast designated router and multicast equipment
Technical Field
The invention relates to the field of data communication, in particular to a method for determining a multicast designated router in a two-layer network and multicast equipment.
Background
With the development of three-layer network switch technology, the network flat design gradually becomes mainstream, the two-layer network is widely deployed and used, and with the popularization of video application, the multicast is usually connected to the two-layer network in a large range when facing a terminal, and the two-layer network is used together with a loop prevention technology. The state of the ring technology is prevented from changing with the change of the network, but a Designated Router (DR) of the multicast service cannot be changed dynamically.
The concept of a domain is to divide network segments having different configurations in a network, and to implement a uniform configuration inside the network segments, and to perform independent Spanning Tree construction within the domain, while a single Spanning Tree is used between domains to connect all domains (the Spanning Tree is called a Common Spanning Tree (CST), ensuring full connectivity and loop-free, Multiple Spanning Tree instances can be constructed inside the domain, and different V L ANs can be mapped onto different Spanning Tree instances.
The multicast Protocol used in the prior art is generally Protocol Independent Multicast (PIM). The PIM router elects a DR to take charge of the forwarding work of the multicast data by DR election. Multiple devices in the shared network can be used as multicast data forwarders, and a multicast service receiver receives multiple repeated multicast services, so that DR election is required to be performed, DR can be elected for the shared network (such as Ethernet) by means of the Hello message, and DR can be used as the only forwarder of multicast data in the shared network.
The process of DR election is as follows:
1) sending HE LL O messages among the devices on the shared network, wherein the HE LL O messages carry priority parameter information of DR competitively selected by the devices, and the device with the highest priority becomes DR;
2) if a plurality of devices have the same highest priority or at least one device in the shared network does not support the priority parameter carrying the election DR in the HE LL O message, the DR is election according to the IP address of each device, and the device with the largest IP address becomes the DR;
3) and when the DR fails, the rest devices still do not receive the HE LL O message from the DR after the preset response time is exceeded, and a new DR election process is triggered.
In data communication in a two-layer network, a loop prevention technique calculates a loop-free forwarding path in the two-layer network, and when multiple instances exist, each instance calculates a loop-free forwarding path. And the multicast service message is sent to the two-layer network through the DR. The multicast service has a high requirement on the delay, and a forwarding path without a loop formed by the loop prevention technology is not necessarily an optimal path for multicast forwarding, but the multicast service is forwarded along the forwarding path without a loop formed by the loop prevention technology, which may increase the delay. Therefore, forwarding the multicast service packet in the two-layer network by the optimal forwarding path is an urgent technical problem to be solved in the field of network communication.
In the prior art, the problem that a forwarding path formed by a loop prevention technology in a two-layer network is not an optimal forwarding path for multicast is mainly solved by a network planning method. When designing the network, the multicast forwarding path and the route prevention loop technology forwarding path are considered at the same time, so that the multicast forwarding path and the route prevention loop technology forwarding path are unified. However, this solution has the following disadvantages: firstly, the cost is high, the professional requirement is high, and the network planning is generally performed by engaging professionals; secondly, the network needs to be re-planned when expanding the capacity; finally, when the route prevention loop technology has multiple forwarding paths (multiple instances), the network analysis is very complicated, which increases the difficulty of network planning.
With the gradual expansion of the range of a two-layer network, the popularization of multiple instances (multiple forwarding paths) of the loop technology is prevented, the video multicast deployment is carried out, the multicast service message is forwarded to the two-layer network through DR, when a plurality of multicast network devices exist, one network device is elected as the DR, and when the DR forwards the multicast service message to the two-layer network, the specific forwarding path of the two-layer network is not concerned, and the multicast service message is only simply forwarded along the forwarding path formed by the loop technology. The multicast forwarding path may not be the optimal multicast forwarding path, which results in a large delay of the multicast service. As shown in fig. 1, a network device a is a multicast DR, a network device B is a root node of a loop prevention technology, and when the network device a forwards a multicast service packet to a multicast receiver network device C, the network device a-device D-device E-device B-device F-device C forwards the multicast service packet along a forwarding path formed by the loop prevention technology, where the forwarding path of the multicast is not an optimal forwarding path, the multicast service delay is increased.
Disclosure of Invention
The invention provides a method for determining a multicast designated router and multicast equipment, which are used for solving the problem that the multicast service delay is increased because a forwarding path of multicast is not an optimal path in the prior art.
A first aspect of the present invention provides a method for determining a multicast-specific router, which is applied to a first multicast device that enables a loop prevention technique, and the method includes:
the first multicast device determines that the device is a root node for preventing loop technology, records that the device is the root node, sets the device as a designated router DR of the multicast service, and sets the device as the highest priority.
Further, the method further comprises: and the first multicast equipment sends a Hello message to a network, and the second multicast equipment which does not start the loop prevention technology records the non-DR of the multicast service of the equipment after receiving the Hello message.
A second object of the present invention is to provide a method for determining a multicast-designated router, applied in a first multicast device that enables multiple instances of loop technology prevention, the method comprising: the first multicast equipment determines that the equipment is a non-root node for preventing loop technology, records that the equipment is the non-root node, sets the equipment as a non-designated router DR of the multicast service, and sets the equipment as the lowest priority.
A third aspect of the present invention is to provide a method for determining a multicast-designated router, applied in a first multicast device that enables multiple instances of loop prevention technology, the method comprising:
the first multicast device determines that the device is a root node of at least one loop prevention technical example, records that the device is the root node of the at least one loop prevention technical example, sets the device as a designated router DR of multicast service in the at least one loop prevention technical example, and sets the DR as a device with the highest priority in the at least one loop prevention technical example.
A fourth aspect of the present invention is to provide a method for determining a multicast-designated router, which is applied in a first multicast device that enables multiple instances of loop prevention technology, and the method includes: the first multicast device determines that the device is a non-root node of at least one loop prevention technical example, records that the device is the non-root node of the at least one loop prevention technical example, sets the device as a non-designated router DR of multicast service in the at least one loop prevention technical example, and sets the non-DR as a device with the lowest priority in the at least one loop prevention technical example.
A fifth object of the present invention is to provide a multicast device, including:
the judging module is used for recording that the multicast equipment is a root node when the multicast equipment is determined to be the root node of the loop prevention technology;
and the setting module is used for setting the multicast equipment as a designated router DR of the multicast service according to the condition that the multicast equipment recorded by the judging module is the root node, and setting the multicast equipment as the highest priority.
Further, the multicast device further includes: and the sending module is used for sending a Hello message to a network when the setting module sets the multicast equipment as the DR of the multicast service.
A sixth object of the present invention is to provide a multicast device, including:
the judging module is used for recording that the multicast equipment is a non-root node when the multicast equipment is determined to be the non-root node for preventing the loop technology;
and the setting module is used for setting the multicast equipment as a non-designated router DR of the multicast service according to the condition that the multicast equipment recorded by the judging module is a non-root node, and setting the multicast equipment as the lowest priority.
A seventh object of the present invention is to provide a multicast device, including:
a receiving module, configured to receive, in a network, a Hello packet sent by a first multicast device; when the first multicast equipment determines that the equipment is the root node for preventing the loop technology, recording that the equipment is the root node, setting the equipment as a designated router DR of the multicast service, and setting the equipment as the highest priority;
and the setting module is used for recording the non-DR of the multicast service of the self equipment after receiving the Hello message sent by the first multicast equipment when the self equipment does not start the loop prevention technology.
An eighth aspect of the present invention is to provide a multicast device, including:
the judging module is used for recording that the multicast equipment is the root node of at least one loop prevention technical example when the multicast equipment is determined to be the root node of at least one loop prevention technical example;
a setting module, configured to set the multicast device as a designated router DR of the multicast service in the at least one loop prevention technology instance according to the fact that the multicast device recorded by the determining module is the root node of the at least one loop prevention technology instance, and set the DR as a device with a highest priority in the at least one loop prevention technology instance.
A ninth object of the present invention is to provide a multicast apparatus, comprising:
a determining module, configured to record that the multicast device is a non-root node of the at least one loop prevention technology instance when determining that the multicast device is the non-root node of the at least one loop prevention technology instance;
a setting module, configured to set the multicast device as a non-designated router DR of the multicast service in the at least one loop prevention technology instance according to the fact that the multicast device recorded by the determining module is a non-root node of the at least one loop prevention technology instance, and set the non-DR as a device with a lowest priority in the at least one loop prevention technology instance.
The invention has the beneficial effects that: by setting the root node for preventing the loop technology as the DR of the multicast service, the time delay generated by DR election is reduced. Meanwhile, the forwarding path from the root node to other nodes is the optimal forwarding path, so that the forwarding path of the multicast service in the two-layer network is ensured to be the optimal forwarding path, and the time delay of the multicast service forwarding is reduced.
When multiple instances of the loop technology are prevented, the root nodes in each instance are distributed on different network equipment, and the DRs are also distributed on different network equipment, so that the multicast service is forwarded from different DRs, the load distribution of the multicast service is realized, the pressure of the network equipment is reduced, and the stability is improved.
Setting the DR of the multicast service and setting the priority of the DR as the highest, using a triggering mode to notify hello messages to a network, and using other network equipment which does not start a loop prevention technology to elect the DR in the network through a normal DR election strategy, thereby realizing the compatibility with the original DR election.
Drawings
Fig. 1 is a schematic diagram of a network topology of a multicast system in the prior art;
fig. 2 is a flowchart of a multicast-specified router determination method according to an embodiment of the present invention;
fig. 3 is a flowchart of a multicast-specified router determination method according to an embodiment of the present invention;
fig. 4 is a flowchart of a multicast-specified router determination method according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for preventing multicast-specific router determination during multiple instances of a loop according to an embodiment of the present invention;
fig. 6 is a flowchart of a method for preventing multicast-specific router determination during multiple instances of a loop according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a multicast device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a multicast device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a multicast device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a multicast device according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a multicast device according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a multicast device according to an embodiment of the present invention;
fig. 13 is a schematic diagram of a network topology of a multi-instance multicast system according to an embodiment of the present invention.
Detailed Description
In order to make the technical scheme of the invention more clear, the invention is further described in detail with reference to the attached drawings:
in order to solve the problem that the multicast service delay is increased because the multicast forwarding path is not the optimal forwarding path in the prior art, the invention sets the DR for forwarding the multicast service to the two-layer network and the root node for preventing the loop technology as the same device, thereby ensuring that the forwarding path of the multicast service in the two-layer network is the optimal forwarding path. The loop prevention technology can be an MSTP protocol or other ethernet protection switching protocols.
According to the calculation principle of the loop prevention technology, the root node of the loop prevention technology is determined firstly, and the path with the minimum cost from other non-root nodes to the root node is a forwarding path. I.e., the path from the root node to other non-root nodes is the optimal forwarding path. When multiple instances of the loop technology are prevented, each instance respectively calculates the optimal forwarding path.
Example 1
An embodiment of the present invention provides a method for determining a multicast-designated router, where as shown in fig. 2, the method is applied to a first multicast device that enables a loop prevention technique, and the method includes:
step 201, when the first multicast device determines that the device is a root node for preventing the loop technology, recording that the device is the root node.
In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
Step 202, setting the device as the designated router DR of the multicast service, and setting the device as the highest priority.
Another possible implementation manner of the embodiment of the present invention, on the basis of the multicast router assignment determination method shown in fig. 2, further includes step 303 shown in fig. 3,
step 303, the first multicast device sends a Hello packet to a network, and a second multicast device which does not use the loop prevention technology records that the device is a non-DR of the multicast service after receiving the Hello packet.
As shown in fig. 4, an embodiment of the present invention further provides a method for determining a multicast-designated router, where the method is applied in a first multicast device that enables a loop prevention technique, and the method includes:
step 401, when the first multicast device determines that the device is a non-root node for preventing the loop technology, it records that the device is a non-root node.
In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
Step 402, setting the device as a non-designated router DR of the multicast service, and setting the device as the lowest priority.
By the method of the embodiment of the invention, when the DR forwards the multicast service to the two-layer network, the multicast forwarding path is always forwarded from the root node of the loop prevention technology, and the path from the root node to other non-root nodes is always the optimal forwarding path, thereby ensuring that the multicast forwarding path is also the optimal forwarding path.
Such as: in the two-layer network, if a three-layer switch is a root node of a ring prevention technology (the ring prevention technology can be a multiple spanning tree protocol MSTP, and can also be an ethernet protection switching protocol), the three-layer switch is set as a DR of multicast service, and is set as the highest priority; and if the three-layer switch is a non-root node for preventing the loop technology, setting the three-layer switch as the non-DR of the multicast service and setting the three-layer switch as the lowest priority. In the embodiment of the invention, both DR and non-DR are system-forced settings, multicast DR election is not needed, and the settings are not related to the priority, but because multicast network devices which do not start loop prevention technology exist in the network, the multicast network devices can only know the DR in the network through normal multicast DR election rules, so when the system sets the DR, the priority must be set at the same time.
Example 2
An embodiment of the present invention provides a method for determining a multicast-designated router, where as shown in fig. 5, the method is applied to a first multicast device that enables multiple instances of a loop prevention technology, and the method includes:
step 501, when the first multicast device determines that the device is the root node of at least one loop prevention technology instance, recording that the device is the root node of the at least one loop prevention technology instance. In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
Step 502, setting the device as a designated router DR of the multicast service in the at least one loop prevention technology instance, and setting the DR as a device with the highest priority in the at least one loop prevention technology instance.
In the multiple instances of the loop prevention technology, one network device may be the root node in multiple instances at the same time, so that when the multiple instances of the loop prevention technology are performed, the network device is recorded as the root node and set as DR in different instances, and is set as the highest priority. Since the DR in different instances is triggered separately, all multicast network devices in each instance are guaranteed to know the DR in the network.
By the method of the embodiment of the invention, when the DR forwards the multicast service to the two-layer network, the multicast forwarding path is always forwarded from the root node of the loop prevention technology, and the paths from the root node to other non-root nodes are always the optimal forwarding path, so that the multicast forwarding path is also the optimal forwarding path, meanwhile, when multiple instances of the loop prevention technology are provided, because the root nodes in different instances are different, DR setting is different in different instances, and because the DR is distributed to different multicast network devices, the load distribution of the multicast service is realized, the pressure of the network devices is reduced, and the stability of the network is enhanced.
Further, another method for determining a multicast-designated router is provided in an embodiment of the present invention, as shown in fig. 6, where the application is in a first multicast device that enables multiple instances of a loop prevention technology, and the method includes:
step 601, when the first multicast device determines that the device is a non-root node of at least one loop prevention technology instance, recording that the device is a non-root node of the at least one loop prevention technology instance. In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
Step 602, setting the device as a non-designated router DR of the multicast service in the at least one loop prevention technology instance, and setting the non-DR as a device with the lowest priority in the at least one loop prevention technology instance.
In the multiple instances of the loop prevention technology, one network device may be simultaneously a non-root node in the multiple instances, so that when the multiple instances of the loop prevention technology are performed, the network device is respectively recorded as the non-root node and set as the non-DR in different instances, and simultaneously set as the lowest priority.
Example 3
As shown in fig. 7, an embodiment of the present invention provides a multicast device 70, where the multicast device 70 includes:
a determining module 701, configured to record that the multicast device is a root node when the multicast device is determined to be a root node of a loop prevention technology. In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
A setting module 702, configured to set the multicast device as an assigned router DR of a multicast service according to that the multicast device recorded by the determining module is a root node, and set the multicast device as a highest priority.
Another possible implementation manner of the embodiment of the present invention is, on the basis as shown in fig. 7, further including a sending module 803 as shown in fig. 8, where the sending module 803 is configured to send a Hello packet to a network when the setting module sets the multicast device as a DR of a multicast service.
As shown in fig. 9, an embodiment of the present invention further provides a multicast device 90, where the multicast device 90 includes:
a determining module 901, configured to record that the multicast device is a non-root node when the multicast device is determined to be a non-root node for preventing a loop technology. In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
A setting module 902, configured to set the multicast device as a non-DR of the multicast service according to that the multicast device recorded by the determining module is a non-root node, and set the multicast device as a lowest priority.
In the embodiment of the invention, both DR and non-DR are system-forced settings, multicast DR election is not needed, and the settings are not related to the priority, but because multicast network devices which do not start loop prevention technology exist in the network, the multicast network devices can only know the DR in the network through normal multicast DR election rules, so when the system sets the DR, the priority must be set at the same time.
Example 4
As shown in fig. 10, an embodiment of the present invention provides a multicast device, where the multicast device 100 does not enable a loop prevention technique, and the multicast device 100 includes:
a receiving module 101, configured to receive, in a network, a Hello packet sent by a designated router DR of a multicast service;
a setting module 102, configured to receive a Hello packet sent by a DR of a multicast service and record a non-DR of the multicast service to the self device when the multicast device does not enable a loop prevention technique.
Example 5
As shown in fig. 11, an embodiment of the present invention provides a multicast device 110, where the multicast device 110 includes:
the determining module 111 is configured to record that the multicast device is a root node of at least one loop prevention technology instance when the multicast device is determined to be the root node of the at least one loop prevention technology instance. In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
A setting module 112, configured to set, according to the condition that the multicast device recorded by the determining module is the root node of the at least one loop prevention technology instance, the multicast device as a designated router DR of the multicast service in the at least one loop prevention technology instance, and set the DR as a device with a highest priority in the at least one loop prevention technology instance.
As shown in fig. 12, an embodiment of the present invention further provides another multicast device 120, where the multicast device 120 includes:
the determining module 121 is configured to record that the multicast device is a non-root node of the at least one loop prevention technology instance when the multicast device is determined to be the non-root node of the at least one loop prevention technology instance. In the embodiment of the invention, the loop prevention technology can be a Multiple Spanning Tree Protocol (MSTP) or an Ethernet protection switching protocol.
A setting module 122, configured to set, according to the condition that the multicast device recorded by the determining module is a non-root node of the at least one loop prevention technology instance, the multicast device as a non-designated router DR of a multicast service in the at least one loop prevention technology instance, and set the non-DR as a device with a lowest priority in the at least one loop prevention technology instance.
In the multiple instances of the loop prevention technology according to the embodiment of the present invention, one network device may be a root node or a non-root node in multiple instances at the same time, so that when multiple instances of the loop prevention technology are performed, the network device is recorded as the root node and set as DR in different instances, and is set as the highest priority. Or in different instances, the network device is respectively recorded as a non-root node and set as a non-DR, and is set as the lowest priority. Since the DR in different instances is triggered separately, all multicast network devices in each instance are guaranteed to know the DR in the network.
Example 6
An embodiment of the present invention provides a multicast system, where the system at least includes a first multicast device and a second multicast device, where the first multicast device is the multicast device included in embodiment 3, and the second multicast device is the multicast device included in embodiment 4.
Example 7
In the embodiment of the present invention, when the method for determining a multicast-designated router according to the present invention is applied to the networking environment shown in fig. 1, since the network device B is set as the DR of the multicast service, the DR forwards the multicast service to the multicast receiver device C along the forwarding path device B-device F-device C formed by the loop prevention technology. And the multicast forwarding path is just the optimal forwarding path.
Example 8
The embodiment of the present invention is to illustrate a specific implementation process of applying the method according to the embodiment of the present invention when multiple instances exist, the method according to the embodiment of the present invention is not limited by the number of network devices in a networking environment, and the embodiment of the present invention is described in a case where 2 instances exist, as shown in fig. 13, a network device a is a root node of instance 1, so that the network device a is set as a DR of a multicast service of instance 1; the network device B is the root node of the instance 2, and thus the network device B is set as DR of the multicast service of the instance 2; thus, network device a is multicast non-DR in example 2 and network device B is multicast non-DR in example 1. After the method according to the embodiment of the present invention is applied, because multicast forwarding is performed along a path formed by a loop prevention technology, the multicast forwarding path in the example 1 is device a-device D-device C, the multicast forwarding path in the example 2 is device B-device F-device D, and both the multicast forwarding path in the example 1 and the multicast forwarding path in the example 2 are optimal forwarding paths from DR of multicast service to multicast receiver devices. Meanwhile, in 2 instances in this embodiment, 2 network devices are respectively set as DR, so that load distribution of multicast services is realized, the pressure of the network devices is reduced, and the stability of the network is enhanced.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.