Multicast message forwarding method and related device thereof
By determining the primary and secondary ports in the multicast network device and switching to the secondary port when the primary port fails, the problem of excessive network bandwidth consumption caused by the dual transmission and selection method is solved, and rapid recovery and bandwidth saving is achieved.
Patent Information
- Application Number
- CN202311405708.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2025-04-29
AI Technical Summary
The network bandwidth consumption caused by the dual transmission and selection method of packet reception is excessive.
Create messages through a multicast tree dispatching source, allowing network devices to determine a primary port and a secondary port among multiple outgoing ports, and switch to the secondary port for forwarding only if the primary port fails.
Reduces system recovery time in the event of failure, reduces the possibility of service interruption, and saves network bandwidth consumption.
Smart Images

Figure CN119906671A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of data transmission, and in particular to a multicast message forwarding method and related devices. Background Art
[0002] Multicast technology is a network communication mechanism that sends data from a single source node to a group of user nodes. This "point-to-multipoint" data transmission has a wide range of applications in current Internet information services, such as online live broadcast, distance education, Internet TV, real-time audio and video conferencing, etc.
[0003] In multicast technology, one-to-many, or point-to-multipoint, data transmission can save network bandwidth and reduce network load. To complete multicast data transmission, it is necessary to first establish a multicast forwarding path between the multicast source and the multicast member nodes, and network nodes forward multicast messages based on the multicast forwarding path. Since the path between the multicast source and the multicast member nodes is similar to a tree, the industry also calls the multicast forwarding path a multicast tree.
[0004] In order to ensure the security, integrity and availability of multicast data transmission, there are usually primary and backup forwarding paths. The multicast data packets sent by the multicast source are transmitted on the primary and backup forwarding paths respectively. The network devices connected to the member nodes select the packets on the primary path for reception and discard the packets on the backup path. If the primary path fails, the backup path is switched to receive the packets. That is, the primary and backup paths use a dual-send and selective-receive method to transmit multicast packets. Although this method improves the reliability of data transmission, it further increases the consumption of network bandwidth. Summary of the invention
[0005] The embodiment of the present application provides a multicast message forwarding method and related devices thereof, which solve the problem of large network bandwidth consumption caused by adopting a dual-send selective reception method for message reception.
[0006] The first aspect of the present application provides a multicast message forwarding method, comprising:
[0007] The first network device receives a multicast tree creation message corresponding to a multicast group sent by a multicast source, where the multicast group includes multiple member nodes, the multicast tree creation message carries multiple member node addresses corresponding to the multiple member nodes, and the multicast tree creation message is used to instruct the first network device to determine a message forwarding port corresponding to the multicast group;
[0008] The first network device searches the routing table according to each member node address to determine the egress port connected to each corresponding member node;
[0009] If there are multiple egress ports, the first network device determines a primary port and a backup port from the multiple egress ports, and the primary port and the backup port are different egress ports;
[0010] After receiving a multicast message corresponding to a multicast group sent by a multicast source, the first network device forwards the multicast message from a primary port;
[0011] When the first network device detects a link failure corresponding to the primary port, the first network device forwards the multicast message from the backup port.
[0012] The multicast message forwarding method provided in the embodiment of the present application sends a multicast tree creation message from the multicast source, so that the network device that receives the multicast tree creation message can determine the output port for forwarding the multicast message. When there are multiple output ports, a primary port and a backup port are determined from the multiple output ports, that is, a backup message forwarding path is established while establishing the multicast tree. When a node or link on the primary path corresponding to the primary port fails, the first network device can directly switch the primary and backup paths locally, reducing the system recovery time when the failure occurs. The switching delay is low, other nodes are not aware of it, the switching efficiency is high, and the possibility of service interruption is reduced. In addition, when there is no abnormality in the link, the multicast message is forwarded only from the primary port to the corresponding member node, rather than forwarding the multicast message on both the primary and backup paths as in the prior art. Therefore, the multicast message forwarding method provided in the embodiment of the present application saves the consumption of network bandwidth.
[0013] In a possible implementation method, the first network device determines a primary port and a backup port from a plurality of egress ports, including:
[0014] If there is no pre-determined master port among the multiple egress ports, the first network device determines one of the multiple egress ports as the master port;
[0015] If there is no predetermined backup port among the multiple egress ports, the first network device determines one of the multiple egress ports as a backup port.
[0016] In this embodiment, if there are multiple egress ports, it is first determined whether there is a pre-determined primary port among the multiple egress ports. If so, no processing is required, and the multicast message is directly forwarded through the primary port in the future; if not, the first network device determines one of the multiple egress ports as the primary port. After the primary port is determined, it is determined whether there is a pre-determined backup port among the multiple egress ports. If so, no processing is required, and when a link failure corresponding to the primary port is detected, the multicast message is switched to the backup port to forward the multicast message; if not, the first network device determines one of the multiple egress ports as the backup port. Similarly, for the same member node, the primary port and the backup port are different ports.
[0017] In a possible implementation method, the first network device determines one of the multiple egress ports as a main port, including:
[0018] The first network device determines one of the multiple egress ports as a main port according to a load balancing algorithm.
[0019] In this embodiment, the load balancing algorithm can also distribute data traffic among multiple available paths to avoid excessive congestion of certain paths, thereby improving the performance and stability of the entire network.
[0020] In a possible implementation method, after the first network device receives a multicast message corresponding to the multicast group and sent by the multicast source, before forwarding the multicast message from the primary port, the method further includes:
[0021] The first network device records the primary port in the egress port list of the multicast forwarding table, and records the primary port and the backup port in the primary-backup relationship table of the multicast forwarding table, and the multicast forwarding table corresponds to the multicast group.
[0022] In this embodiment, by establishing a multicast forwarding table and a primary-backup relationship table, the network device can accurately forward multicast messages and automatically switch to a backup path in the event of a failure, thereby improving the reliability and availability of the network.
[0023] In a possible implementation method, if there are multiple egress ports, after the first network device determines a primary port and a backup port from the multiple egress ports, the method further includes:
[0024] The first network device edits the multicast tree creation message to obtain a first multicast tree creation sub-message, where the first multicast tree creation sub-message carries a member node address corresponding to a member node connected to the primary port;
[0025] The first network device forwards the first multicast tree creation sub-message to the second network device through the primary port. The second network device is connected to the first network device through the primary port. The first multicast tree creation sub-message is used to instruct the second network device to determine the message forwarding port corresponding to the multicast group.
[0026] In this embodiment, after determining its own message forwarding port, the first network device may continue to send a multicast tree creation sub-message to instruct other network devices connected to the first network device to determine a corresponding message forwarding port.
[0027] In a possible implementation method, after the first network device forwards the first multicast tree creation sub-message to the primary port, the method further includes:
[0028] The first network device edits the multicast tree creation message to obtain a second multicast tree creation sub-message, where the second multicast tree creation sub-message carries a member node address corresponding to the member node connected to the standby port;
[0029] The first network device forwards the second multicast tree creation sub-message to the third network device through the backup port. The third network device is connected to the first network device through the backup port. The second multicast tree creation message is used to instruct the third network device to determine the message forwarding main port corresponding to the multicast group.
[0030] In this embodiment, the message forwarding path where the backup port of the first network device is located is a backup path. Therefore, in this embodiment of the application, for the backup path, the second multicast tree creation sub-message sent by the first network device can only be used for the nodes on the backup path to determine the corresponding primary port.
[0031] In a possible implementation method, after the first network device forwards the second multicast tree creation sub-message to the third network device through the standby port, the method further includes:
[0032] After a preset time, the first network device sends a second multicast tree creation sub-message to the unconfirmed node through the standby port, and the unconfirmed node is a member node that does not return a confirmation message to the first network device through the standby port within the preset time.
[0033] In this embodiment, in order to ensure that all member nodes in the multicast group have successfully joined the multicast group and the primary and backup paths have been established, the network devices and multicast sources in the multicast communication system need to receive confirmation messages returned by the member nodes. If the confirmation message is not received after a preset time, the multicast tree creation message is sent again to the unconfirmed member nodes.
[0034] In a possible implementation method, the first network device receives a multicast tree creation message corresponding to a multicast group and sent by a multicast source, including:
[0035] The first network device receives the multicast tree creation message sent by the multicast source through the fourth network device, and the first network device is connected to the multicast source through the fourth network device.
[0036] In this embodiment, the fourth network device is a device in the path between the first network device and the multicast source, that is, the first network device is connected to the multicast source through the fourth network device.
[0037] In a possible implementation method, after the first network device searches the routing table according to each member node address and determines the egress port connected to each corresponding member node, the method further includes:
[0038] If the number of the egress port is one, the first network device determines the egress port as a primary port.
[0039] In this embodiment, if the number of output ports is one, it means that the first network device is directly connected to the corresponding member node, or in other words, the first network device is directly connected to other network devices connected to the member node. In order to forward the multicast message to the member node, it can only be forwarded through the unique output port. Therefore, the first network device determines the unique output port as the main port.
[0040] A second aspect of the present application provides a network device, which is applied to a multicast communication system, wherein the multicast communication system includes a multicast source, multiple network devices and a multicast group, wherein the multicast group includes multiple member nodes; the multicast source is connected to the multiple member nodes via the multiple network devices;
[0041] Network equipment includes:
[0042] An acquisition module is used to receive a multicast tree creation message corresponding to a multicast group sent by a multicast source, where the multicast group includes multiple member nodes, the multicast tree creation message carries multiple member node addresses corresponding to the multiple member nodes, and the multicast tree creation message is used to instruct the first network device to determine a message forwarding port corresponding to the multicast group;
[0043] A port determination module, used to search the routing table according to each member node address, and determine the egress port connected to each corresponding member node; if there are multiple egress ports, the first network device is further used to determine a primary port and a backup port from the multiple egress ports, and the primary port and the backup port are different egress ports;
[0044] A forwarding module, configured to forward the multicast message from a primary port after receiving a multicast message corresponding to a multicast group sent by a multicast source;
[0045] The switching module is used to forward the multicast message from the backup port when the first network device detects a link failure corresponding to the primary port.
[0046] In a possible implementation method, the method further includes:
[0047] The recording module is used to record the primary port in the egress port list of the multicast forwarding table, and to record the primary port and the backup port in the primary-backup relationship table of the multicast forwarding table. The multicast forwarding table corresponds to the multicast group.
[0048] In one possible implementation,
[0049] The port determination module is specifically used to determine a main port from multiple egress ports according to a load balancing algorithm.
[0050] In a possible implementation method, the method further includes:
[0051] An editing module, used for editing the multicast tree creation message to obtain a first multicast tree creation sub-message, wherein the first multicast tree creation sub-message carries a member node address corresponding to a member node connected to the main port;
[0052] The forwarding module is also used to forward the first multicast tree creation sub-message to the second network device through the main port. The second network device is connected to the first network device through the main port. The first multicast tree creation sub-message is used to instruct the second network device to determine the message forwarding port corresponding to the multicast group.
[0053] In one possible implementation,
[0054] The editing module is further used to edit the multicast tree creation message to obtain a second multicast tree creation sub-message, where the second multicast tree creation sub-message carries a member node address corresponding to the member node connected to the standby port;
[0055] The forwarding module is also used to forward the second multicast tree creation sub-message to the third network device through the backup port. The third network device is connected to the first network device through the backup port. The second multicast tree creation message is used to instruct the third network device to determine the message forwarding main port corresponding to the multicast group.
[0056] In a possible implementation method, the method further includes:
[0057] The confirmation module is used to send a second multicast tree creation sub-message to the unconfirmed node through the standby port after a preset time. The unconfirmed node is a member node that does not return a confirmation message to the first network device through the standby port within the preset time.
[0058] A third aspect of the present application provides a communication device, including: a memory and a processor;
[0059] The processor stores instructions, and when the instructions are executed on the processor, the method of the first aspect is implemented.
[0060] A fourth aspect of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores instructions, and when the instructions are executed on a processor, the method of the first aspect is implemented.
[0061] The fifth aspect of the present application provides a computer program product, characterized in that when the computer program product is executed on a computer, the computer executes the method of the first aspect.
[0062] The beneficial effects of the technical solutions provided in the second to fifth aspects above can refer to the beneficial effects of the technical solution of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1A schematic diagram of a method for establishing a primary and backup path in the prior art;
[0064] Figure 2 A schematic diagram of the structure of the multicast communication system provided in the embodiment of the present application;
[0065] Figure 3 A method flow chart of a multicast message forwarding method provided in an embodiment of the present application;
[0066] Figure 4 A method flow chart of a multicast message forwarding method provided in an embodiment of the present application;
[0067] Figure 5 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0068] Figure 6 A schematic diagram of the structure of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] The embodiment of the present application provides a multicast message forwarding method and related devices thereof, which are used to solve the problem of large network bandwidth consumption caused by adopting a dual-send selective reception method for message reception.
[0070] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0071] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged in appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attribute in the embodiments of the present application when describing. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment containing a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment. In addition, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or", describes the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B, can represent: A exists alone, A and B exist simultaneously, and B exists alone, wherein A, B can be singular or plural. The character " / " generally represents that the associated objects before and after are a kind of "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0072] To facilitate understanding of the technical solutions provided by the embodiments of the present application, a brief introduction to the technical background of the present application is first given here.
[0073] Multicast technology is a network communication mechanism that allows data to be sent from a single source node to a specific group of user nodes. This "point-to-multipoint" data transmission method is widely used in current Internet information services. For example, online live broadcast, distance education, Internet TV, and real-time audio and video conferencing all rely on multicast technology to achieve efficient and reliable data transmission.
[0074] The one-to-many feature of multicast technology enables it to save network bandwidth, reduce network load, and make data transmission more efficient. In order to achieve multicast data transmission, the network needs to establish a multicast forwarding path from the multicast source to each multicast member node. This path is composed of switches and routers in the network, which replicate and forward multicast data packets according to set rules and algorithms.
[0075] In actual network environments, the multicast forwarding path often presents a tree structure, which is also called a multicast forwarding tree. Each multicast source node is located at the root of the tree, and each member node that receives multicast data is distributed on each branch of the tree. Through this tree, data packets can be transmitted from the source node all the way to each receiving node, and can also be copied and distributed on each intermediate node, thereby realizing one-to-many data transmission.
[0076] The current solution for multicast communication between multicast sources and multicast members requires two technologies:
[0077] 1. Internet Group Management Protocol (IGMP):
[0078] IGMP is a protocol between multicast group members and their access network devices. The host notifies the network device to obtain multicast group member information by sending IGMP messages such as joining and leaving the multicast group to the multicast network device directly connected to it. In this way, the network device can understand the situation of multicast group members and prepare for the forwarding of multicast data packets. The main versions of the IGMP protocol include IGMPv1, IGMPv2 and IGMPv3. These versions are gradually enhanced in function to provide more multicast group member management functions.
[0079] 2. Protocol independent multicast (PIM):
[0080] PIM is a routing protocol between multicast forwarding devices, that is, how multicast packets are forwarded to multicast group members through network devices. The current main multicast routing protocols include PIM dense mode (protocol independent multicast-dense mode, PIM-DM) and PIM sparse mode (protocol independent multicast-sparse mode, PIM-SM). PIM-DM and PIM-SM protocols are used to establish a multicast forwarding tree, that is, a multicast forwarding table is established on the network devices between the multicast source and the multicast members. In this way, multicast packets can be forwarded through this multicast forwarding tree.
[0081] The multicast forwarding path established by the PIM protocol will be interrupted when a link failure occurs. Therefore, the multicast-only fast reroute (MoFRR) protocol establishes the primary and backup forwarding paths by sending PIM join messages to the primary and backup paths respectively. In this way, the upstream sends double multicast traffic, and the network device nodes deployed with MoFRR select the primary path traffic to receive and discard the backup path traffic.
[0082] For easier understanding, see Figure 1 , Figure 1 The following is a schematic diagram of a method for establishing a primary and backup path in the prior art, as shown in the figure:
[0083] In multicast group G, the node Receiver initiates an IGMP report message, joins multicast group G, and becomes a member node of multicast group G;
[0084] Network device E, which has deployed MoFRR, receives the IGMP report message initiated by the Receiver, selects the primary and backup paths, and sends two PIN join messages to the primary and backup paths. The process of network device E creating a PIN multicast routing table entry is as follows:
[0085] 1) Network device E creates a (*, G) entry locally and copies the PIM join message to network device B and network device D.
[0086] 2) After receiving the join message, network device B and network device D configure their local devices and forward the join message to the multicast source Source.
[0087] In this way, the main path from Receiver to Source is E->B->A, and the backup path is E->D->C->A.
[0088] When the multicast source Source sends a multicast data packet, the packet is copied twice at network device A and arrives at network device E through the primary path A->B->E and the backup path A->C->D->E. Network device E selects the packet on the primary path through MoFRR configuration and discards the packet on the backup path. If the primary path fails, it switches to the backup path to receive the packet.
[0089] In this method, each member node in the multicast group needs to initiate a protocol message to the multicast device. There are a large number of message interactions in the establishment of the multicast tree, and the primary and backup paths use a dual-send and selective-receive method, which causes a waste of network bandwidth resources.
[0090] Therefore, an efficient and reliable multicast distribution tree construction method is needed, which can ensure that multicast forwarding can continue when a node failure or link failure occurs on the multicast path, and the application layer business layer using multicast forwarding does not need to be aware of it.
[0091] In order to solve the above problems, the present application provides a multicast message forwarding method and related devices, which adopts an active multicast path tree construction method initiated by a multicast source, and simultaneously establishes a multicast backup path. When a node failure or a link failure occurs, multicast forwarding can quickly switch to a backup path tree, and the switching delay can reach the μs (microsecond) level, reducing the possibility of service interruption.
[0092] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of the multicast communication system provided in the embodiment of the present application, and the multicast communication system includes but is not limited to an IP multicast network and a remote direct memory access (RDMA) multicast network. Figure 2 The multicast communication system shown includes a multicast source node 0, multiple network devices (L0 to L7 nodes, S0 to S7 nodes, c0 to c3 nodes) and a multicast group, and the multicast group includes multiple member nodes (1 to 15 nodes). The multicast source is connected to the multiple member nodes through multiple network devices. Among them, the port numbers of the c0 to c3 nodes are 0, 1, 2, 3 from left to right; the port numbers of the S0 to S7 nodes and the L0 to L7 nodes are 0, 1, 2, 3 from bottom to top and from left to right.
[0093] Next, the multicast message forwarding method in the present application will be introduced from the perspective of the first network device. The first network device is Figure 2 Any network device in the multicast communication system shown is a network device such as a switch or router that has certain cache resources and can perform basic read, write, and compare operations on the data in the cache resources. The device has the ability to receive network messages, extract a field in the network message, update the message field after comparison and calculation, and forward the message. Figure 3 , Figure 3 The method flow chart of the multicast message forwarding method provided in the embodiment of the present application includes:
[0094] 301. The first network device receives a multicast tree creation message corresponding to a multicast group sent by a multicast source. The multicast group includes multiple member nodes. The multicast tree creation message carries multiple member node addresses corresponding to the multiple member nodes. The multicast tree creation message is used to instruct the first network device to determine a message forwarding port corresponding to the multicast group.
[0095] First, the multicast source initiates a multicast tree creation message, which carries multiple member node addresses corresponding to multiple member nodes. The address in this embodiment can be an IP (Internet Protocol) address. Figure 2 As shown, taking the first network device as L0 node as an example, the multicast source 0 node obtains the multicast group IP address and the member node addresses of the member nodes in the multicast group through the configuration file or the control plane. In order to simplify the description, in this embodiment, the multicast group includes member nodes 1 to 6, and the corresponding member node addresses are IP1 to IP6. Then the multicast source 0 node constructs a multicast tree creation message and sends an envelope message through the User Datagram Protocol (UDP), wherein the key fields are shown in Table 1.
[0096] Table 1 Key fields of multicast tree creation message
[0097]
[0098] After the first network device receives the multicast tree creation message, it can determine the message forwarding port corresponding to the multicast group according to the key fields in the multicast tree creation message. Taking the first network device as an L0 node as an example, the L0 node parses the envelope message, queries the multicast forwarding table, and finds<IP0,G> The entry does not exist, which means that in the multicast forwarding table of the first network device, there is no multicast group with node 0 with IP address IP0 as the multicast source and IP address G. Therefore, the first network device adds a new node with IP address G.<IP0,G> The entry for key into the multicast forwarding table.
[0099] 302. The first network device searches the routing table according to the address of each member node, and determines an egress port connected to each corresponding member node.
[0100] After the first network device receives the multicast tree creation message, by searching the routing table information, it can determine the egress port of each member node connected thereto. It is understandable that each network device (such as router, switch, etc.) in the multicast communication system has a corresponding routing table, and the network device can rely on the established routing table to determine how to forward the received multicast message. The routing table is usually composed of a series of routing entries, and each routing entry includes key information such as target network, next hop address, interface, etc. Through these routing entries, the network device can determine how to forward the received multicast message to the correct egress port according to the path information between the multicast source and the destination according to these path information.
[0101] 303. If there are multiple egress ports, the first network device determines a primary port and a backup port from the multiple egress ports, where the primary port and the backup port are different egress ports.
[0102] It is understandable that in a multicast network, there may be multiple paths from the first network device to a certain member node. This is because each node in the multicast network has multiple interfaces and can be connected to other nodes through different paths. Therefore, the message forwarded by the first network device to a certain member node can be sent through different egress ports. These egress ports may be different interfaces connected to the same member node, or they may be different paths connected to the same member node through different intermediate nodes.
[0103] If there are multiple outbound ports for a certain member node, it means that there are multiple paths from the first network device to the member node. Then when a path fails or is congested, the multicast network can select other available paths to forward data, thereby ensuring that the transmission of data is not affected. Therefore, in the embodiment of the present application, a primary port and a backup port are determined from the multiple outbound ports by the first network device, and the primary port is used to forward multicast messages. When the link corresponding to the primary port fails, the multicast message is switched to the backup port to forward the multicast message.
[0104] It should be noted that each member node has a corresponding primary port, multiple member nodes can share the same primary port, and a network device can have multiple primary ports.
[0105] 304. After receiving the multicast message corresponding to the multicast group sent by the multicast source, the first network device forwards the multicast message from the primary port.
[0106] 305 , when the first network device detects a link failure corresponding to the primary port, the first network device forwards the multicast message from the backup port.
[0107] It is understandable that for a member node, both the primary port and the backup port are outbound ports that can reach the member node. Therefore, after the first network device determines the primary port and the backup port, when the first network device obtains the multicast message sent by the multicast source, it forwards the multicast message from the primary port. When the first network device detects a link failure corresponding to the primary port, that is, the link corresponding to the primary port is different, the first network device switches the primary and backup ports locally, and updates the outbound port of the multicast message to the backup port. Since the backup port is also connected to the corresponding member node, the multicast message can still be sent to the member node, thereby reducing the possibility of service interruption.
[0108] The multicast message forwarding method provided in the embodiment of the present application sends a multicast tree creation message from the multicast source, so that the network device that receives the multicast tree creation message can determine the output port for forwarding the multicast message. When there are multiple output ports, a primary port and a backup port are determined from the multiple output ports, that is, a backup message forwarding path is established while establishing the multicast tree. When a node or link on the primary path corresponding to the primary port fails, the first network device can directly switch the primary and backup paths locally, reducing the system recovery time when the failure occurs. The switching delay is low, other nodes are not aware of it, the switching efficiency is high, and the possibility of service interruption is reduced. In addition, when there is no abnormality in the link, the multicast message is forwarded only from the primary port to the corresponding member node, rather than forwarding the multicast message on both the primary and backup paths as in the prior art. Therefore, the multicast message forwarding method provided in the embodiment of the present application saves the consumption of network bandwidth.
[0109] The following further describes and supplements the multicast message forwarding method provided in the embodiment of the present application. Figure 4 , Figure 4 The method flow chart of the multicast message forwarding method provided in the embodiment of the present application is for ease of understanding. Figure 4 The corresponding method embodiment can also be applied to Figure 2 The corresponding multicast communication system includes:
[0110] 401. The first network device receives a multicast tree creation message corresponding to a multicast group sent by a multicast source. The multicast group includes multiple member nodes. The multicast tree creation message carries multiple member node addresses corresponding to the multiple member nodes. The multicast tree creation message is used to instruct the first network device to determine a message forwarding port corresponding to the multicast group.
[0111] It is understandable that step 401 and Figure 3 Step 301 in the illustrated embodiment is similar and will not be described in detail here.
[0112] 402. The first network device searches the routing table according to the address of each member node to determine an egress port connected to each corresponding member node.
[0113] It is understandable that step 402 and Figure 3 Step 302 in the illustrated embodiment is similar and will not be described in detail here.
[0114] 403. If the number of the egress port is one, determine the egress port as the primary port.
[0115] It can be understood that if the number of output ports is one, it means that the first network device is directly connected to the corresponding member node, or in other words, the first network device is directly connected to other network devices connected to the member node. In order to forward the multicast message to the member node, it can only be forwarded through the unique output port. Therefore, the first network device determines the unique output port as the main port.
[0116] like Figure 2 As shown, when the first network device is an L0 node, after receiving a multicast tree creation message sent by multicast source node 0, the member node IP addresses in the multicast tree creation message are traversed to search the routing table.
[0117] For the IP address IP1 corresponding to the member node 1, the L0 node searches the unicast routing table and finds that the egress port port1 with IP1 as the destination is directly connected, and then determines port1 as the primary port.
[0118] 404: If there are multiple egress ports, and if there is no pre-determined master port among the multiple egress ports, the first network device determines one of the multiple egress ports as a master port.
[0119] It can be understood that if there are multiple output ports, it is first determined whether there is a predetermined primary port among the multiple output ports. If so, no processing is required and the multicast message is forwarded directly through the primary port subsequently; if not, the first network device determines one of the multiple output ports as the primary port.
[0120] like Figure 2 As shown, when the first network device is the L0 node, for the IP address IP2 corresponding to the member node 2, the L0 node searches the unicast routing table and finds that there are two equivalent paths with IP2 as the destination, namely node0-L0-S0-L1-node2 and node0-L0-S1-L1-node2. At this time, the L0 node selects port 2 of L0-S0 as the primary port.
[0121] Then the L0 node continues to traverse the member node addresses. For the IP address IP3 corresponding to member node 3, the L0 node searches the unicast routing table and finds that there are two equivalent paths with IP3 as the destination, namely node0-L0-S0-L1-node3 and node0-L0-S1-L1-node3. Since port 2 of L0-S0 is already the primary port, the L0 node does not need to do any other processing.
[0122] For IP addresses IP4 to IP6 corresponding to member nodes 4 to 6, the L0 node also finds that the pre-determined primary port port2 exists in the egress ports reaching IP4 to IP6, so the L0 node does not need to perform other processing.
[0123] 405 : If there is no predetermined backup port among the multiple egress ports, the first network device determines one of the multiple egress ports as a backup port.
[0124] It can be understood that after determining the main port, it is determined whether there is a predetermined backup port among the multiple output ports. If so, no processing is required. When a link failure corresponding to the main port is detected, the multicast message is switched to the backup port; if not, the first network device determines one of the multiple output ports as the backup port. Similarly, for the same member node, the main port and the backup port are different ports.
[0125] like Figure 2 As shown, when the first network device is an L0 node, port2 has been selected as the primary port for IP2, and the port corresponding to the other path is determined as the backup port. For IP3, port2 is already the primary port, and port3 is already the backup port, so the L0 node does not need to do any other processing. For IP4 to IP6, similarly, port2 and port3 have been recorded, so no other processing is required.
[0126] It is understandable that in a network device, the primary port is usually the preferred path for forwarding data packets. When a network device has multiple egress ports that can be used to forward data to the same destination, a primary port can be determined according to a certain algorithm, such as a load balancing algorithm. The purpose of a load balancing algorithm is to distribute data traffic among multiple available paths to improve network performance and reliability. The load balancing algorithm can select the primary port based on different factors, such as link quality, bandwidth, latency, load, etc. The specific algorithm can be configured according to the needs of the network device and application. Some common load balancing algorithms include polling, weighted polling, least connection selection, etc. The load balancing algorithm can also distribute data traffic among multiple available paths to avoid excessive congestion of certain paths, thereby improving the performance and stability of the entire network.
[0127] 406. The first network device records the primary port in the egress port list of the multicast forwarding table, and records the primary port and the backup port in the primary-backup relationship table of the multicast forwarding table. The multicast forwarding table corresponds to the multicast group.
[0128] It is understandable that after the first network device determines the primary port and the backup port, the primary port is recorded in the egress port list of the multicast forwarding table, and the primary port and the backup port are recorded in the primary-backup relationship table of the multicast forwarding table. These tables are key data structures for guiding data packet forwarding.
[0129] The multicast forwarding table corresponds to the multicast group, and each multicast group has a corresponding multicast forwarding table. In the multicast forwarding table, the egress port list contains all the egress ports forwarded from the network device to the multicast group. The information of these egress ports is used to guide the forwarding of data packets. The primary and backup relationship table records the correspondence between the primary port and the backup port. Under normal circumstances, data packets are forwarded through the primary port, and the backup port is used as a backup to take over the forwarding task when the primary port fails. When the primary port fails or is congested, the network device will detect this situation and switch the data packet to the backup port for forwarding to ensure reliable data transmission.
[0130] By establishing a multicast forwarding table and a primary-backup relationship table, network devices can accurately forward multicast messages and automatically switch to backup paths in the event of a failure, thereby improving network reliability and availability.
[0131] A possible format of a multicast forwarding table is:<srcIP,Group IP> ,out port list], that is, the information recorded in the multicast forwarding table is: multicast source IP address (srcIP) + multicast group IP address (Group IP) as key, out port list (out port list) as value kv (key, value) pair.
[0132] like Figure 2 As shown, taking the first network device as the L0 node as an example, according to the above steps 403, 404 and 405, it is determined that the primary ports are port1 and port2, and port2 and port3 have a primary-backup relationship, then the L0 node generates the table entries shown in Table 2 and Table 3.
[0133] Table 2: Outbound port list entries of the multicast forwarding table corresponding to the L0 node
[0134]
[0135] That is, when the L0 node receives a message with a multicast group IP of G sent by the multicast source node 0, it forwards it from port 1 and port 2.
[0136] Table 3: Entries of the master-slave relationship table of the multicast forwarding table corresponding to the L0 node
[0137]
[0138] That is, there is a master-slave relationship between port2 and port3. Under normal circumstances, multicast packets are forwarded through port2. When the corresponding link of port2 fails, port3 is switched to forward the multicast packets.
[0139] 407, the first network device edits the multicast tree creation message to obtain a first multicast tree creation sub-message, where the first multicast tree creation sub-message carries a member node address corresponding to the member node connected to the primary port;
[0140] 408. The first network device forwards the first multicast tree creation sub-message to the second network device through the primary port. The second network device is connected to the first network device through the primary port. The first multicast tree creation sub-message is used to instruct the second network device to determine the message forwarding port corresponding to the multicast group.
[0141] It is understandable that after determining its own message forwarding port, the first network device may continue to send a multicast tree creation sub-message to instruct other network devices connected to the first network device to determine a corresponding message forwarding port.
[0142] like Figure 2 As shown, taking the first network device as L0 node as an example, the node S0 connected to the primary port port2 is the second network device:
[0143] For the primary port port1, since the L0 node is directly connected to the member node 1, the L0 node reserves IP1 in the multicast tree creation message obtained from the multicast source and forwards it from port1 to the member node 1. The member node 1 parses the multicast tree creation message and finds that the IP it carries is consistent with its own IP. It then uses the user datagram protocol (UDP) to unicast an acknowledgement (ACK) message to the multicast source node 0. The acknowledgement message carries the multicast group IP, the IP1 of the member node 1, and an operation code (opCode). The opCode is used to indicate that the member node 1 has confirmed joining the multicast group.
[0144] For the main port port2, the member nodes connected to port2 include member nodes 2 to member nodes 6. Then, after the L0 node retains IP2 to IP6 in the multicast tree creation message obtained from the multicast source, it obtains the first multicast tree creation sub-message and forwards the message from port2, that is, it is sent from the L0 node to the S0 node. The first multicast tree creation sub-message is used to instruct the S0 node to determine the message forwarding port corresponding to the multicast group. It can be understood that after receiving the first multicast tree creation sub-message, the S0 node can determine the main port and backup port corresponding to itself according to the above steps.
[0145] 409, the first network device edits the multicast tree creation message to obtain a second multicast tree creation sub-message, where the second multicast tree creation sub-message carries a member node address corresponding to the member node connected to the standby port;
[0146] 410. The first network device forwards the second multicast tree creation sub-message to the third network device through the backup port. The third network device is connected to the first network device through the backup port. The second multicast tree creation message is used to instruct the third network device to determine the message forwarding main port corresponding to the multicast group.
[0147] It can be understood that the message forwarding path where the backup port of the first network device is located is a backup path. Therefore, in an embodiment of the present application, for the backup path, the second multicast tree creation sub-message sent by the first network device can only be used for the nodes on the backup path to determine the corresponding main port.
[0148] like Figure 2 As shown, taking the first network device as the L0 node as an example, the node S1 connected to the backup port port3 is the third network device:
[0149] For the backup port port3, the member nodes connected to port3 include member nodes 2 to 6. Then the L0 node retains IP2 to IP6 in the multicast tree creation message obtained from the multicast source, and updates the opCode to create backup (create backup), obtains the second multicast tree creation sub-message, and forwards the message from port3, that is, sends it from the L0 node to the S1 node. The second multicast tree creation sub-message is used to instruct the S1 node to determine the primary port for forwarding messages corresponding to the multicast group. It can be understood that after receiving the second multicast tree creation sub-message, the S1 node can determine the primary port for forwarding its multicast messages based on the load balancing algorithm.
[0150] Further, as a supplement, in a possible implementation method, the multicast communication system also includes a fourth network device, which is a device in the path between the first network device and the multicast source, that is, the first network device is connected to the multicast source through the fourth network device.
[0151] For easier understanding, see Figure 2 , assuming that in this embodiment, the first network device is an S0 node, then the fourth network device may be an L0 node. It is understandable that, assuming that the multicast group G includes member nodes 1 to 6, the multicast tree creation message sent by the multicast source to the L0 node carries the corresponding IP1 to IP6. After the L0 node determines the message forwarding port through the above steps, since the member nodes connected to the S0 node are nodes 2 to 6, only IP2 to IP6 are retained in the multicast tree creation message forwarded by the L0 node to S0.
[0152] 411. After a preset time, the first network device sends a second multicast tree creation sub-message to the unconfirmed node through the standby port. The unconfirmed node is a member node that does not return a confirmation message to the first network device through the standby port within the preset time.
[0153] It can be understood that in order to ensure that all member nodes in the multicast group successfully join the multicast group and the primary and backup paths are established, the network equipment and multicast source in the multicast communication system need to receive confirmation messages returned by the member nodes. If the confirmation message is not received after a preset time, the multicast tree creation message is sent again to the unconfirmed member nodes.
[0154] It can be understood that since the first network device has determined the backup port, it is equivalent to creating a backup path. Therefore, in order to ensure the successful creation of the backup path, the member node needs to return a confirmation message after receiving the second multicast tree creation sub-message. The first network device needs to collect the confirmation messages of the member nodes connected to the backup port, otherwise the second multicast tree creation sub-message will be resent after timeout.
[0155] 412, after receiving the multicast message corresponding to the multicast group sent by the multicast source, the first network device forwards the multicast message from the primary port;
[0156] 413. When the first network device detects a link failure corresponding to the primary port, the first network device forwards the multicast message from the backup port.
[0157] It is understandable that step 412 and step 413 are similar to Figure 3 Step 304 and step 305 in the illustrated embodiment are similar and will not be described in detail here.
[0158] In order to further understand this solution, Figure 2 The multicast communication system shown in the figure provides a detailed introduction to the multicast message forwarding method in this application.
[0159] In the multicast communication system, it includes multicast source 0, multiple network devices (L0 to L7 nodes, S0 to S7 nodes, c0 to c3 nodes) and multicast group. The multicast group includes multiple member nodes (1 to 15 nodes). To simplify the description, in this embodiment, the multicast group includes member nodes 1 to member nodes 6.
[0160] According to the multicast message forwarding method provided in the embodiment of the present application, the following multicast forwarding number is finally generated:
[0161] Main Path:
[0162] Rank0->L0->S0->C0->S2->L2 / L3->rank4,5,6;
[0163] Rank0->L0->rank1;
[0164] Rank0->L0->S0->L1->rank2,3.
[0165] Backup path:
[0166] Rank0->L0->S1->L1->rank2,3;
[0167] Rank0->L0->S0->C1->S2->L2 / L3->rank4,5,6;
[0168] Rank0->L0->S1->C2->S3->L2 / L3->rank4,5,6.
[0169] The steps for generating the primary and backup paths are described below respectively.
[0170] First, the multicast source node 0 creates a multicast tree creation message and sends an envelope message via UDP. The multicast tree creation message carries the multicast group IP address, the multicast source IP address, and the IP addresses of multiple member nodes in the multicast group, as shown in Table 1.
[0171] For the main paths Rank0->L0->S0->C0->S2->L2 / L3->rank4,5,6, Rank0->L0->rank1 and Rank0->L0->S0->L1->rank2,3:
[0172] L0 receives the multicast tree creation message, and L0 processes the multicast group creation message as follows:
[0173] 1) L0 parses the envelope message and queries the multicast forwarding table and finds<IP0,G> If the table entry does not exist, add it with<IP0,G> The entry for the key into the multicast forwarding table.
[0174] 2) L0 traverses the node IP list in the envelope.
[0175] IP1: Search the unicast routing table and find that the outbound port port1 with IP1 as the destination is directly connected, so record port1 to the outbound interface list.
[0176] IP2: Traverse to the IP2 node and search the unicast routing table. The outbound interface has two equal-cost paths, namely node0-L0-S0-L1-node2 and node0-L0-S1-L1-node2. At this time, L0 selects port 2 of L0-S0 as the primary outbound port and port 3 of L0-S1 as the backup outbound port according to the load balancing algorithm. It records port 2 in the multicast routing table.<IP0,G> In the output port list of key, record [port2, port3] in the primary and backup port relationship table.
[0177] IP3: Search for the outbound interface with the destination IP3, find port2 and port3, and port2 is already in the outbound interface list. Port2 and port3 are already in the active / standby relationship table. No processing is performed.
[0178] IP4~IP6: Same as IP3. If the primary and backup outbound ports reaching IP4~IP6 are already recorded, no processing will be performed.
[0179] 3) L0 edits the envelope message and forwards it:
[0180] Only IP1 is retained in the IP list, and the message is forwarded from port1 to node 1;
[0181] The IP list retains IP2 to IP6, and forwards the message from port2, that is, L0 to S0;
[0182] The IP list retains IP2 to IP6, Opcode is updated to create backup, and the message is forwarded from port3, that is, L0 to S1.
[0183] L0 generates a message with the opcode "create backup". It needs to collect the ACK messages from the IP2 to IP6 nodes. Otherwise, after a timeout, it will resend the message with the opcode "create backup" to the node that has not returned the ACK message.
[0184] The processing flow of node 1 is as follows:
[0185] The multicast tree creation message sent by L0 from port1 arrives at node 1. Node 1 parses the envelope and finds that the contained IP is consistent with its own IP. It then uses UDP to unicast a confirmation message to the rank0 node. The confirmation message contains the multicast IP, its own IP, and opCode.
[0186] The S0 processing flow is as follows:
[0187] The multicast tree creation message sent by L0 from port 2 arrives at S0. S0's processing logic is the same as L0. Here we only describe the process of IP list traversal. At this time, the IP list in the multicast tree creation message received by S0 contains IP2 to IP6. The message is parsed and the process of traversing the IP list is as follows:
[0188] IP2: S0 searches the routing table and finds that the outbound interface for IP2 is port1. It records port1 in the outbound interface list.
[0189] IP3: S0 searches the routing table and finds that the outbound interface for IP3 is port1. Port1 is already in the outbound interface list and is not processed.
[0190] IP4: According to the load balancing algorithm, port2 is selected as the outbound interface, port3 is selected as the backup outbound interface, port2 is added to the outbound port list, and the primary and backup relationship between port2 and port3 is recorded;
[0191] IP5~IP6: Same as IP4. If the primary and backup outbound ports reaching IP5~IP6 are already recorded, no processing will be performed.
[0192] S0 edits the envelope message and forwards it:
[0193] The IP list retains IP2 to IP3 and forwards the message from port1, that is, S0 to L1;
[0194] The IP list retains IP4 to IP6, and forwards messages from port2, that is, S0 to C0;
[0195] The IP list retains IP4 to IP6, Opcode is updated to create backup, and the message is forwarded from port3, that is, S0 to C1.
[0196] Since S0 generates a message with the opcode "create backup", it is necessary to collect the ack messages from the IP4 to IP6 nodes. Otherwise, after a timeout, the message with the opcode "create backup" will be resent to the node that has not returned the ack message.
[0197] The C0 processing flow is as follows:
[0198] The IP list in the multicast tree creation message received by C0 contains IP4 to IP6. The message is parsed and the process of traversing the IP list is as follows:
[0199] IP4: Select port1 as the outbound interface based on the load balancing algorithm and add port1 to the outbound port list;
[0200] IP5~IP6: Same as IP4. If the outgoing port port1 reaching IP5~IP6 is found to have been recorded, no processing will be performed.
[0201] C0 edits the envelope message and forwards it:
[0202] The IP list retains IP4 to IP6 and forwards the message from port1, that is, C0 to S2.
[0203] The S2 processing flow is as follows:
[0204] The IP list in the multicast tree creation message received by S2 contains IP4 to IP6. The process of parsing the message and traversing the IP list is as follows:
[0205] IP4: Select port0 as the outbound interface based on the load balancing algorithm and add port0 to the outbound port list;
[0206] IP5: Same as IP4. If the outbound port port 0 of IP5 is found to have been recorded, no processing will be done.
[0207] IP6: Select port1 as the outbound interface based on the load balancing algorithm and add port1 to the outbound port list.
[0208] S2 edits the envelope message and forwards it:
[0209] The IP list retains IP4 to IP5 and forwards messages from port0, i.e. S2-》L2;
[0210] The IP list retains IP6 and is sent from port2, i.e. S2-》L3;
[0211] The L2 processing flow is as follows:
[0212] L2 finds that IP4 and IP5 are directly connected, so it records port0 and port1 in the forwarding table and forwards the envelope message from port0 and port1.
[0213] The L3 processing flow is as follows:
[0214] When L3 finds that IP6 is directly connected, it records port0 in the forwarding table and forwards the envelope message from port0.
[0215] For the backup path Rank0->L0->S1->C2->S3->L2 / L3->rank4,5,6:
[0216] The S1 processing flow is as follows:
[0217] The multicast backup tree creation message (i.e., the second multicast tree creation sub-message) sent by L0 from port 3 reaches S1, i.e., the envelope message with opcode = create backup. S1 parses the message, and the processing logic is mostly the same as L0 and S0, except that it is a create backup message, so it only records the primary outbound port, unlike the create message, which also selects the backup outbound port. At this time, the IP list in the create multicast tree message received by S1 contains IP2 to IP6, and the message is parsed and the process of traversing the IP list is as follows:
[0218] IP2: S1 searches the routing table and finds that the outbound interface for IP2 is port1. It records port1 in the outbound interface list.
[0219] IP3: S1 searches the routing table and finds that the outbound interface for IP3 is port1. Port1 is already in the outbound interface list and is not processed.
[0220] IP4: Select port2 as the outbound interface based on the load balancing algorithm and add port2 to the outbound port list.
[0221] IP5~IP6: Same as IP4. If the outgoing port port 2 reaching IP5~IP6 is found to have been recorded, no processing will be performed.
[0222] S1 edits the envelope message and forwards it:
[0223] The IP list retains IP2 to IP3 and forwards messages from port1, i.e. S1-》L1;
[0224] The IP list retains IP4 to IP6 and forwards messages from port2, that is, S1-》C2.
[0225] The C2 process is as follows:
[0226] The IP list in the multicast backup tree creation message received by C2 contains IP4 to IP6. The message is parsed and the process of traversing the IP list is as follows:
[0227] IP4: Select port1 as the outbound interface based on the load balancing algorithm and add port1 to the outbound port list;
[0228] IP5~IP6: Same as IP4. If the outgoing port port1 reaching IP5~IP6 is found to have been recorded, no processing will be performed.
[0229] C2 edits the envelope message and forwards it:
[0230] The IP list retains IP4 to IP6 and forwards messages from port1, i.e. C2-》S3.
[0231] The S3 processing flow is as follows:
[0232] The IP list in the multicast backup tree creation message received by S3 contains IP4 to IP6. The message is parsed and the process of traversing the IP list is as follows:
[0233] IP4: Select port0 as the outbound interface based on the load balancing algorithm and add port0 to the outbound port list;
[0234] IP5: Same as IP4. If the outbound port port 0 of IP5 is found to have been recorded, no processing will be done.
[0235] IP6: Select port1 as the outbound interface based on the load balancing algorithm and add port1 to the outbound port list.
[0236] S3 edits the envelope message and forwards it:
[0237] The IP list retains IP4 to IP5 and forwards messages from port0, i.e. S3-》L2;
[0238] The IP list retains IP6 and is sent from port2, that is, S3-》L3.
[0239] The L2 processing flow is as follows:
[0240] If it is found that IP4 and IP5 are directly connected and port0 and port1 are already in the multicast forwarding table, the envelope message is forwarded from port0 and port1.
[0241] The L3 processing flow is as follows:
[0242] If IP6 direct connection is found and port0 is already in the forwarding table, the envelope message is forwarded from port0.
[0243] For the backup path Rank0->L0->S0->C1->S2->L2 / L3->rank4,5,6:
[0244] The C1 processing flow is as follows:
[0245] The IP list in the multicast backup tree creation message received by C1 contains IP4 to IP6. The message is parsed and the process of traversing the IP list is as follows:
[0246] IP4: Select port1 as the outbound interface based on the load balancing algorithm and add port1 to the outbound port list;
[0247] IP5~IP6: Same as IP4. If the outgoing port port1 reaching IP5~IP6 is found to have been recorded, no processing will be performed.
[0248] C1 edits the envelope message and forwards it:
[0249] The IP list retains IP4 to IP6 and forwards messages from port1, i.e. C1-》S2.
[0250] The S2 processing flow is as follows:
[0251] The IP list in the multicast backup tree creation message received by S2 contains IP4 to IP6. The process of parsing the message and traversing the IP list is as follows:
[0252] IP4: The load balancing algorithm selects port0 as the outbound interface. If port0 is already in the multicast forwarding table, no processing is performed.
[0253] IP5: Same as IP4. If the outbound port port 0 of IP5 is found to have been recorded, no processing will be done.
[0254] IP6: If port 1 is already in the multicast forwarding table, no processing is performed.
[0255] S2 edits the envelope message and forwards it:
[0256] The IP list retains IP4 to IP5 and forwards messages from port0, i.e. S2-》L2;
[0257] The IP list retains IP6 and is sent from port2, that is, S2-》L3.
[0258] If the link between L0 and S0 fails, L0 will detect the failure and start multicast switching. According to the primary and backup port table entries saved in L0, the outbound port information in the corresponding multicast group is updated and the primary port is switched to the backup port. That is, the updated multicast forwarding table is [<IP0,G> ,<port1,port3> ] In this way, after the subsequent multicast group G related messages arrive at L0, they are sent out from port1 and port3, that is, they arrive at node1 and S1. S1 receives the message of multicast group G and finds that the outbound interface of multicast group G is port1 and port2 according to the multicast forwarding table, that is, it arrives at L1 and C2.
[0259] If the link between S0 and C0 fails, S0 will detect the failure and start S0 multicast switching. According to the primary and backup port table entries saved in S0, the outbound port information in the corresponding multicast group is updated and the primary port is switched to the backup port. That is, the updated multicast forwarding table is [<IP0,G> ,<port1,port 3> ].
[0260] The multicast message forwarding method provided in the embodiment of the present application establishes a multicast backup forwarding tree while the multicast source initiates the creation of a multicast group. The backup forwarding path is established in advance. When a node or link fails, the switching delay is low, the service is not interrupted, and other nodes other than the failed node are unaware. The network device creates a multicast forwarding table through the multicast tree creation message information and the unicast routing table information, and selects the primary and backup paths through a certain algorithm. The multicast source node confirms the successful creation of the multicast path through the confirmation message of the member node, thereby avoiding the failure of the multicast path creation caused by packet loss, etc.; when the network device detects a failure in the main link, it directly initiates the activation process of the backup path, and performs local switching of the primary and backup paths, thereby reducing the system recovery time when the failure occurs.
[0261] The present application also provides a network device, which can be applied to Figure 2In the multicast communication system shown, the multicast communication system includes a multicast source node 0, multiple network devices (L0 to L7 nodes, S0 to S7 nodes, c0 to c3 nodes) and a multicast group, and the multicast group includes multiple member nodes (1 to 15 nodes). The multicast source is connected to the multiple member nodes through multiple network devices.
[0262] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device is specifically a first network device 500, including:
[0263] The acquisition module 501 is used to receive a multicast tree creation message corresponding to a multicast group sent by a multicast source, where the multicast group includes multiple member nodes, the multicast tree creation message carries multiple member node addresses corresponding to the multiple member nodes, and the multicast tree creation message is used to instruct the first network device to determine a message forwarding port corresponding to the multicast group;
[0264] The port determination module 502 is used to search the routing table according to the address of each member node to determine the egress port connected to each corresponding member node; if there are multiple egress ports, the first network device is also used to determine a primary port and a backup port among the multiple egress ports, and the primary port and the backup port are different egress ports; if there are one egress port, the first network device is also used to determine the egress port as the primary port.
[0265] The forwarding module 503 is used to forward the multicast message from the primary port after receiving the multicast message corresponding to the multicast group sent by the multicast source;
[0266] The switching module 504 is configured to forward the multicast message from the backup port when the first network device detects a link failure corresponding to the primary port.
[0267] The multicast message forwarding method provided in the embodiment of the present application sends a multicast tree creation message from the multicast source, so that the network device that receives the multicast tree creation message can determine the output port for forwarding the multicast message. When there are multiple output ports, a primary port and a backup port are determined from the multiple output ports, that is, a backup message forwarding path is established while establishing the multicast tree. When a node or link on the primary path corresponding to the primary port fails, the first network device can directly switch the primary and backup paths locally, reducing the system recovery time when the failure occurs. The switching delay is low, other nodes are not aware of it, the switching efficiency is high, and the possibility of service interruption is reduced. In addition, when there is no abnormality in the link, the multicast message is forwarded only from the primary port to the corresponding member node, rather than forwarding the multicast message on both the primary and backup paths as in the prior art. Therefore, the multicast message forwarding method provided in the embodiment of the present application saves the consumption of network bandwidth.
[0268] In a possible implementation method, the method further includes:
[0269] The recording module 505 is used to record the primary port in the egress port list of the multicast forwarding table, and record the primary port and the backup port in the primary-backup relationship table of the multicast forwarding table. The multicast forwarding table corresponds to the multicast group.
[0270] It is understandable that, after the first network device determines the primary port and the backup port, the primary port is recorded in the outgoing port list of the multicast forwarding table, and the primary port and the backup port are recorded in the primary and backup relationship table of the multicast forwarding table. These tables are key data structures for guiding data packet forwarding. By establishing the multicast forwarding table and the primary and backup relationship table, the network device can realize accurate forwarding of multicast messages, and can automatically switch to the backup path in the event of a failure, thereby improving the reliability and availability of the network.
[0271] In a possible implementation method, the port determination module 502 is specifically configured to determine a primary port from among multiple egress ports according to a load balancing algorithm.
[0272] In a possible implementation method, the method further includes:
[0273] An editing module 506 is used to edit the multicast tree creation message to obtain a first multicast tree creation sub-message, where the first multicast tree creation sub-message carries a member node address corresponding to a member node connected to the primary port;
[0274] The forwarding module 503 is also used to forward the first multicast tree creation sub-message to the second network device through the main port. The second network device is connected to the first network device through the main port. The first multicast tree creation sub-message is used to instruct the second network device to determine the message forwarding port corresponding to the multicast group.
[0275] It is understandable that after determining its own message forwarding port, the first network device may continue to send a multicast tree creation sub-message to instruct other network devices connected to the first network device to determine a corresponding message forwarding port.
[0276] In one possible implementation,
[0277] The editing module 506 is further configured to edit the multicast tree creation message to obtain a second multicast tree creation sub-message, wherein the second multicast tree creation sub-message carries a member node address corresponding to the member node connected to the standby port;
[0278] The forwarding module 503 is also used to forward the second multicast tree creation sub-message to the third network device through the backup port. The third network device is connected to the first network device through the backup port. The second multicast tree creation message is used to instruct the third network device to determine the message forwarding main port corresponding to the multicast group.
[0279] It can be understood that the message forwarding path where the backup port of the first network device is located is a backup path. Therefore, in an embodiment of the present application, for the backup path, the second multicast tree creation sub-message sent by the first network device can only be used for the nodes on the backup path to determine the corresponding main port.
[0280] In a possible implementation method, the method further includes:
[0281] The confirmation module 507 is used to send a second multicast tree creation sub-message to the unconfirmed node through the standby port after a preset time, and the unconfirmed node is a member node that does not return a confirmation message to the first network device through the standby port within the preset time.
[0282] It can be understood that in order to ensure that all member nodes in the multicast group successfully join the multicast group and the primary and backup paths are established, the network equipment and multicast source in the multicast communication system need to receive confirmation messages returned by the member nodes. If the confirmation message is not received after a preset time, the multicast tree creation message is sent again to the unconfirmed member nodes.
[0283] This application also provides a communication device, see Figure 6 , Figure 6 A schematic diagram of the structure of a communication device provided in an embodiment of the present application includes: a memory 601 and a processor 602;
[0284] The processor 601 stores instructions. When the instructions are executed on the processor 602, the above-mentioned Figure 3 or Figure 4 The method in the corresponding embodiment.
[0285] The present application also provides a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to execute the following Figure 3 or Figure 4 The method in the corresponding embodiment.
[0286] The present application also provides a computer program product or a computer program, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned Figure 3 or Figure 4 The method in the corresponding embodiment.
[0287] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0288] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0289] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0290] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0291] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A multicast message forwarding method, characterized in that: include: The first network device receives a multicast tree creation message corresponding to a multicast group sent by a multicast source, wherein the multicast group includes a plurality of member nodes, the multicast tree creation message carries a plurality of member node addresses corresponding to the plurality of member nodes, and the multicast tree creation message is used to instruct the first network device to determine a message forwarding port corresponding to the multicast group; The first network device searches the routing table according to the address of each member node to determine the egress port connected to each member node; If there are multiple egress ports, the first network device determines a primary port and a backup port from the multiple egress ports, and the primary port and the backup port are different egress ports; After receiving the multicast message corresponding to the multicast group sent by the multicast source, the first network device forwards the multicast message from the primary port; When the first network device detects a link failure corresponding to the primary port, the first network device forwards the multicast message from the backup port.
2. The method according to claim 1, characterized in that The first network device determines a primary port and a backup port from the plurality of egress ports, including: If the pre-determined primary port does not exist among the multiple egress ports, the first network device determines one of the multiple egress ports as the primary port; If the predetermined backup port does not exist among the multiple egress ports, the first network device determines one of the multiple egress ports as the backup port.
3. The method according to claim 2, characterized in that The first network device determines one of the multiple egress ports as the primary port, including: The first network device determines one of the multiple egress ports as the primary port according to a load balancing algorithm.
4. The method according to any one of claims 1 to 3, characterized in that: After the first network device receives the multicast message corresponding to the multicast group sent by the multicast source and before forwarding the multicast message from the primary port, the method further includes: The first network device records the primary port in an egress port list of a multicast forwarding table, and records the primary port and the backup port in a primary-backup relationship table of the multicast forwarding table, and the multicast forwarding table corresponds to the multicast group.
5. The method according to any one of claims 1 to 4, characterized in that: If the number of the egress ports is multiple, after the first network device determines a primary port and a backup port from the multiple egress ports, the method further includes: The first network device edits the multicast tree creation message to obtain a first multicast tree creation sub-message, where the first multicast tree creation sub-message carries a member node address corresponding to the member node connected to the primary port; The first network device forwards the first multicast tree creation sub-message to the second network device through the primary port, the second network device is connected to the first network device through the primary port, and the first multicast tree creation sub-message is used to instruct the second network device to determine a message forwarding port corresponding to the multicast group.
6. The method according to claim 5, characterized in that After the first network device forwards the first multicast tree creation sub-message to the primary port, the method further includes: The first network device edits the multicast tree creation message to obtain a second multicast tree creation sub-message, where the second multicast tree creation sub-message carries a member node address corresponding to the member node connected to the standby port; The first network device forwards the second multicast tree creation sub-message to the third network device through the backup port, the third network device is connected to the first network device through the backup port, and the second multicast tree creation message is used to instruct the third network device to determine the message forwarding main port corresponding to the multicast group.
7. The method according to claim 6, characterized in that After the first network device forwards the second multicast tree creation sub-message to the third network device through the standby port, the method further includes: After a preset time, the first network device sends the second multicast tree creation sub-message to the unconfirmed node through the backup port, and the unconfirmed node is the member node that does not return a confirmation message to the first network device through the backup port within the preset time.
8. The method according to any one of claims 1 to 6, characterized in that: The first network device receives a multicast tree creation message corresponding to the multicast group and sent by the multicast source, including: The first network device receives the multicast tree creation message sent by the multicast source through the fourth network device, and the first network device is connected to the multicast source through the fourth network device.
9. The method according to any one of claims 1 to 7, characterized in that: After the first network device searches the routing table according to each member node address and determines the egress port connected to each corresponding member node, the method further includes: If the number of the egress port is one, the first network device determines the egress port as a primary port.
10. A network device, characterized in that: Applied to a multicast communication system, the multicast communication system comprises a multicast source, a plurality of the network devices and a multicast group, the multicast group comprises a plurality of member nodes; The multicast source is connected to a plurality of the member nodes via a plurality of the network devices; The network equipment includes: an acquisition module, configured to receive a multicast tree creation message corresponding to a multicast group sent by a multicast source, wherein the multicast group includes a plurality of member nodes, the multicast tree creation message carries a plurality of member node addresses corresponding to the plurality of member nodes, and the multicast tree creation message is used to instruct the first network device to determine a message forwarding port corresponding to the multicast group; A port determination module, configured to search the routing table according to the address of each member node, and determine the egress port connected to each corresponding member node; if there are multiple egress ports, the first network device is further configured to determine a primary port and a backup port from the multiple egress ports, wherein the primary port and the backup port are different egress ports; a forwarding module, configured to forward the multicast message corresponding to the multicast group sent by the multicast source from the primary port; The switching module is used to forward the multicast message from the backup port when the first network device detects a link failure corresponding to the primary port.
11. The network device according to claim 10, characterized in that: Also includes: The recording module is used to record the primary port in the egress port list of the multicast forwarding table, and record the primary port and the backup port in the primary-backup relationship table of the multicast forwarding table, wherein the multicast forwarding table corresponds to the multicast group.
12. The network device according to claim 10 or 11, characterized in that: The port determination module is specifically configured to determine one of the multiple egress ports as the primary port according to a load balancing algorithm.
13. A communication device, characterized in that: include: Memory and processor; The processor stores instructions, and when the instructions are executed on the processor, the method according to any one of claims 1 to 9 is implemented.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a processor, the method according to any one of claims 1 to 9 is implemented.
15. A computer program product, characterized in that When the computer program product is executed on a computer, the computer performs the method according to any one of claims 1 to 9.