Method and apparatus for multicast tunnel load balancing, gateway device, and storage medium
By selecting load-balanced relay devices in the AMT protocol for multicast data stream forwarding, the problem of low multicast data stream efficiency when the relay device forwards is heavy, and the full utilization of resources and the improvement of multicast service quality is achieved. .
Patent Information
- Application Number
- PCT/CN2023/102392
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-01-02
AI Technical Summary
In the automatic multicast tunnel (AMT) protocol, when the forwarding burden of the relay device is heavy but the forwarding resources are not completely exhausted, the forwarding efficiency of the multicast data stream is low.
By receiving the multicast join request message sent by the multicast receiver, the priority values and load values of multiple relay devices are obtained, and a target relay device is selected based on these values to achieve load balancing multicast data stream forwarding . The specific steps include sending relay discovery messages, receiving relay notification messages, establishing an AMT tunnel, updating priority values, filtering the sharing weight value, and selecting the relay device with the lowest load as the target relay device.
Effectively utilize the resources of multiple relay devices to improve the forwarding efficiency of multicast data streams, avoid choosing relay devices with excessive load or poor service quality, and ensure multicast service quality.
Smart Images

Figure CN2023102392_02012025_PF_FP_ABST
Abstract
Description
Multicast tunnel load balancing method, device, gateway device and storage medium Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a method, apparatus, gateway device, and storage medium for multicast tunnel load balancing. Background Art
[0002] The Automatic Multicast Tunneling (AMT) protocol enables multicast receivers that do not support native multicast protocols to connect to a multicast source and receive multicast traffic from the multicast source.
[0003] The AMT protocol uses a client-server model. A gateway device can use anycast to determine the nearest relay device. The gateway device then joins the multicast group maintained by the relay device as a multicast member, successfully establishing an AMT tunnel between the gateway and the relay device. After receiving the multicast data stream from the multicast source, the relay device can send the multicast data stream to the gateway device through the AMT tunnel. The gateway device then sends the multicast data stream to the multicast receivers.
[0004] After an AMT tunnel is successfully established, if the relay device is topologically closest to the gateway device and the route between the relay device and the gateway device is reachable, the gateway device will continue to receive multicast data streams through the relay device. In this case, if the relay device's forwarding load is heavy but its forwarding resources are not yet fully exhausted, the multicast data stream forwarding efficiency will be low.
[0005] Summary of the Invention
[0006] The present application provides a method, apparatus, gateway device, and storage medium for multicast tunnel load balancing, which are used to address the problem of low forwarding efficiency of multicast data streams when a gateway device obtains multicast data streams through a relay device with a heavy forwarding burden and not yet exhausted forwarding resources. Specifically, the method includes the following solutions:
[0007] In a first aspect, an embodiment of the present application provides a method for multicast tunnel load balancing, which is applied to a gateway device, wherein the gateway device has established AMT tunnels with multiple relay devices. The method includes:
[0008] receiving a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information about the multicast group;
[0009] Obtaining a priority value and a load value of each relay device in the plurality of relay devices, wherein the priority value is used to represent a multicast service quality of the relay device;
[0010] selecting a target relay device for the multicast group from the plurality of relay devices based on a priority value and a load value of each relay device;
[0011] A first member update message is sent to the target relay device, where the first member update message includes information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0012] In a possible implementation, the gateway device is configured with the anycast address of each relay device included in the relay device group, and the process of establishing the AMT tunnel between the gateway device and the multiple relay devices includes:
[0013] After the gateway device comes online, a relay discovery message is sent to each relay device included in the relay device group, each relay discovery message includes a different anycast address;
[0014] Within a first preset time period, receiving relay announcement messages sent by a first number of relay devices, wherein the relay announcement messages include priority values of the relay devices;
[0015] Establishing AMT tunnels with the first number of relay devices respectively, and recording priority values of the first number of relay devices;
[0016] The priority values of the second number of relay devices are recorded as 0, and the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0017] In a possible implementation, after recording the priority values of the first number of relay devices, the method further includes:
[0018] Sending a request message to the first number of relay devices every second preset time period;
[0019] receiving member query messages sent by the first number of relay devices, wherein the member query messages include priority values of the relay devices;
[0020] Based on the priority value included in the member query message, the recorded priority values of the first number of relay devices are updated.
[0021] In a possible implementation, selecting a target relay device for the multicast group from the multiple relay devices based on the priority value and the load value of each relay device includes:
[0022] Get the shared weight value of each relay device;
[0023] Filtering out a sharing weight value exceeding a preset threshold from multiple sharing weight values;
[0024] From the filtered relay devices corresponding to the shared weight values, the relay device with the smallest load value is selected as the target relay device.
[0025] In a possible implementation, obtaining the sharing weight value of each relay device includes:
[0026] Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or
[0027] For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of the multiple relay devices.
[0028] In a possible implementation, after sending the first member update message to the target relay device, the method further includes:
[0029] If the target relay device fails, obtaining a priority value of each relay device in the plurality of relay devices except the target relay device;
[0030] reselecting a target relay device for the multicast group from the plurality of relay devices excluding the target relay device based on the obtained priority value and load value of each relay device;
[0031] A second member update message is sent to the reselected target relay device, where the second member update message includes information about the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0032] In a possible implementation, the relay announcement message includes a priority field, and the priority field is used to carry a priority value of the relay device.
[0033] In a possible implementation, the member query message includes a first flag bit field and a priority field. When the first flag bit field takes a first value, it indicates that the priority field carries a priority value of the relay device.
[0034] In a possible implementation, the member query message further includes a second flag bit field;
[0035] If the value of the second flag bit field is the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0036] If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
[0037] In a possible implementation, the priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
[0038] In one possible implementation, the priority value is determined based on a health parameter of the relay device, where the health parameter includes any one or more of the following:
[0039] The number of accessible multicast sources;
[0040] Network quality between the multicast source and the source;
[0041] Failure rate of the transmission path to the multicast source;
[0042] The quality of the routing link to the multicast source.
[0043] In a possible implementation, the load value is the number of multicast groups that the relay device is responsible for.
[0044] In a second aspect, an embodiment of the present application provides a multicast tunnel load balancing device, which is applied to a gateway device. The gateway device has established AMT tunnels with multiple relay devices. The device includes:
[0045] A receiving module, configured to receive a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information about the multicast group;
[0046] an acquisition module, configured to acquire a priority value and a load value of each relay device in the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device;
[0047] A selection module, configured to select a target relay device for the multicast group from the plurality of relay devices based on a priority value and a load value of each relay device;
[0048] The sending module is configured to send a first member update message to the target relay device, where the first member update message includes information of the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0049] In a possible implementation, the gateway device is configured with the anycast address of each relay device included in the relay device group, and the process of establishing the AMT tunnel between the gateway device and the multiple relay devices includes:
[0050] After the gateway device comes online, a relay discovery message is sent to each relay device included in the relay device group, each relay discovery message includes a different anycast address;
[0051] Within a first preset time period, receiving relay announcement messages sent by a first number of relay devices, wherein the relay announcement messages include priority values of the relay devices;
[0052] Establishing AMT tunnels with the first number of relay devices respectively, and recording priority values of the first number of relay devices;
[0053] The priority values of the second number of relay devices are recorded as 0, and the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0054] In a possible implementation, after recording the priority values of the first number of relay devices, the apparatus further includes an updating module:
[0055] The sending module is further configured to send a request message to the first number of relay devices every second preset time period;
[0056] The receiving module is further configured to receive member query messages sent by the first number of relay devices, wherein the member query messages include priority values of the relay devices;
[0057] The updating module is configured to update the priority values of the first number of relay devices that have been recorded based on the priority value included in the member query message.
[0058] In a possible implementation, the selection module is specifically configured to:
[0059] Get the shared weight value of each relay device;
[0060] Filtering out a sharing weight value exceeding a preset threshold from multiple sharing weight values;
[0061] From the filtered relay devices corresponding to the shared weight values, the relay device with the smallest load value is selected as the target relay device.
[0062] In a possible implementation, the selection module is specifically configured to:
[0063] Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or
[0064] For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of the multiple relay devices.
[0065] In a possible implementation, the acquisition module is further configured to acquire a priority value of each relay device other than the target relay device among the multiple relay devices if the target relay device fails;
[0066] The selection module is further configured to reselect a target relay device for the multicast group from the multiple relay devices excluding the target relay device based on the acquired priority value and load value of each relay device;
[0067] The sending module is further configured to send a second member update message to the reselected target relay device, where the second member update message includes information of the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0068] In a possible implementation, the relay announcement message includes a priority field, and the priority field is used to carry a priority value of the relay device.
[0069] In a possible implementation, the member query message includes a first flag bit field and a priority field. When the first flag bit field takes a first value, it indicates that the priority field carries a priority value of the relay device.
[0070] In a possible implementation, the member query message further includes a second flag bit field;
[0071] If the value of the second flag bit field is the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0072] If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
[0073] In a possible implementation, the priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
[0074] In one possible implementation, the priority value is determined based on a health parameter of the relay device, where the health parameter includes any one or more of the following:
[0075] The number of accessible multicast sources;
[0076] Network quality between the multicast source and the source;
[0077] Failure rate of the transmission path to the multicast source;
[0078] The quality of the routing link to the multicast source.
[0079] In a possible implementation, the load value is the number of multicast groups that the relay device is responsible for.
[0080] In a third aspect, an embodiment of the present application provides a gateway device, wherein the gateway device has established AMT tunnels with multiple relay devices, and the gateway device includes:
[0081] processor;
[0082] transceiver;
[0083] A machine-readable storage medium storing machine-executable instructions capable of being executed by the processor; the machine-executable instructions prompting the processor to perform the following steps:
[0084] Receiving, by the transceiver, a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information about the multicast group;
[0085] Obtaining a priority value and a load value of each relay device in the plurality of relay devices, wherein the priority value is used to represent a multicast service quality of the relay device;
[0086] selecting a target relay device for the multicast group from the plurality of relay devices based on a priority value and a load value of each relay device;
[0087] A first member update message is sent to the target relay device through the transceiver, where the first member update message includes information of the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0088] In a possible implementation, the gateway device is configured with the anycast address of each relay device included in the relay device group, and the machine-executable instructions further cause the processor to execute the following steps:
[0089] After the gateway device is online, a relay discovery message is sent to each relay device included in the relay device group through the transceiver, each relay discovery message including a different anycast address;
[0090] Within a first preset time period, receiving, through the transceiver, relay announcement messages sent by a first number of relay devices, the relay announcement messages including priority values of the relay devices;
[0091] Establishing AMT tunnels with the first number of relay devices respectively, and recording priority values of the first number of relay devices;
[0092] The priority values of the second number of relay devices are recorded as 0, and the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0093] In one possible implementation, the machine executable instructions further cause the processor to execute the following steps:
[0094] Sending a request message to the first number of relay devices through the transceiver every second preset time period;
[0095] receiving, by the transceiver, member query messages sent by the first number of relay devices, the member query messages including priority values of the relay devices;
[0096] Based on the priority value included in the member query message, the recorded priority values of the first number of relay devices are updated.
[0097] In one possible implementation, the machine executable instructions cause the processor to perform the following steps:
[0098] Get the shared weight value of each relay device;
[0099] Filtering out a sharing weight value exceeding a preset threshold from multiple sharing weight values;
[0100] From the filtered relay devices corresponding to the shared weight values, the relay device with the smallest load value is selected as the target relay device.
[0101] In one possible implementation, the machine executable instructions cause the processor to perform the following steps, including:
[0102] Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or
[0103] For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of the multiple relay devices.
[0104] In one possible implementation, the machine executable instructions further cause the processor to execute the following steps:
[0105] If the target relay device fails, obtaining a priority value of each relay device in the plurality of relay devices except the target relay device;
[0106] reselecting a target relay device for the multicast group from the plurality of relay devices excluding the target relay device based on the obtained priority value and load value of each relay device;
[0107] A second member update message is sent to the reselected target relay device through the transceiver, where the second member update message includes information of the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0108] In a possible implementation, the relay announcement message includes a priority field, and the priority field is used to carry a priority value of the relay device.
[0109] In a possible implementation, the member query message includes a first flag bit field and a priority field. When the first flag bit field takes a first value, it indicates that the priority field carries a priority value of the relay device.
[0110] In a possible implementation, the member query message further includes a second flag bit field;
[0111] If the value of the second flag bit field is the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0112] If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
[0113] In a possible implementation, the priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
[0114] In one possible implementation, the priority value is determined based on a health parameter of the relay device, where the health parameter includes any one or more of the following:
[0115] The number of accessible multicast sources;
[0116] Network quality between the multicast source and the source;
[0117] Failure rate of the transmission path to the multicast source;
[0118] The quality of the routing link to the multicast source.
[0119] In a possible implementation, the load value is the number of multicast groups that the relay device is responsible for.
[0120] In a fourth aspect, an embodiment of the present application provides a machine-readable storage medium storing machine-executable instructions. When called and executed by a processor, the machine-executable instructions prompt the processor to implement the method described in the first aspect.
[0121] In a fifth aspect, an embodiment of the present application provides a computer program product, which prompts the processor to implement the method described in the first aspect.
[0122] Using the above technical solution, a gateway device can establish AMT tunnels with multiple relay devices. Upon receiving a multicast join request message from a multicast receiver, the gateway device can select a target relay device for the multicast group the receiver requested to join based on the priority and load values of each relay device. This target relay device then forwards the multicast data stream of the multicast group to the multicast receiver. Because the priority and load values are taken into consideration when selecting the target relay device, each relay device can share and forward the multicast data streams of multiple multicast groups in a load-sharing manner, fully utilizing the device resources of multiple relay devices and improving the forwarding efficiency of multicast data streams. BRIEF DESCRIPTION OF THE DRAWINGS
[0123] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0124] FIG1 is a schematic diagram of an AMT network architecture provided in an embodiment of the present application;
[0125] FIG2 is a flowchart of a method for establishing an AMT tunnel between a gateway device and a relay device provided in an embodiment of the present application;
[0126] FIG3 is a flow chart of a method for multicast tunnel load balancing provided in an embodiment of the present application;
[0127] FIG4 is an exemplary schematic diagram of a member query message provided in an embodiment of the present application;
[0128] FIG5 is an exemplary schematic diagram of a relay notification message provided in an embodiment of the present application;
[0129] FIG6 is a flow chart of another method for multicast tunnel load balancing provided in an embodiment of the present application;
[0130] FIG7 is a schematic structural diagram of a device for multicast tunnel load balancing provided in an embodiment of the present application;
[0131] FIG8 is a schematic structural diagram of a gateway device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0132] To make the objectives, technical solutions, and advantages of the present invention more clearly understood, the present invention is further described below with reference to the accompanying drawings and examples. It should be understood that the described examples are only some examples of the present invention, not all examples. All other examples derived by persons of ordinary skill in the art based on the examples of the present invention fall within the scope of protection of the present invention.
[0133] To facilitate understanding of the solution provided in the embodiments of the present application, the AMT network architecture involved in the embodiments of the present application is first introduced. As shown in Figure 1, the AMT network architecture includes a multicast receiver (Receiver), a gateway device (Gateway), a relay device (Relay) R1, a relay device (Relay) R2, a multicast source (Source) S1, a multicast source (Source) S2, and a multicast source (Source) S3.
[0134] The number of devices in FIG1 is only an example, and the number of devices in actual implementation is not limited thereto.
[0135] The multicast receiver may be a site, host, or application program that does not support the multicast routing protocol and needs to obtain multicast data.
[0136] The gateway device is located in a network that does not support multicast routing protocols, and multicast receivers can access the gateway device.
[0137] Each relay device can be connected to at least one multicast source. For example, the relay devices R1 and R2 in FIG1 are both connected to the multicast source S1 , the multicast source S2 , and the multicast source S3 .
[0138] The gateway device can establish an AMT tunnel with a relay device in anycast mode, and then receive multicast data from the multicast source sent by the relay device through the AMT tunnel.
[0139] In Figure 1, taking the establishment of an AMT tunnel between the gateway device and the relay device R1 as an example, after the relay device R1 receives multicast data from any multicast source, it can forward the multicast data to the gateway device through the AMT tunnel, and then the gateway device can forward the multicast data to the multicast receiver.
[0140] The following describes the process of establishing an AMT tunnel between a gateway device and a relay device.
[0141] As shown in Figure 2, the process of establishing an AMT tunnel between a gateway device and a relay device includes the following steps:
[0142] S201. The gateway device sends a relay discovery message (Relay Discovery) to the relay device.
[0143] AMT-enabled relay devices advertise routes with the same IP address prefix. Gateway devices, upon learning these routes, can generate anycast addresses based on the IP address prefix. For example, the anycast address includes the IP address prefix, with all remaining bits set to 0.
[0144] When a gateway device sends a relay discovery message based on an anycast address, it forwards the relay discovery message to the relay device that is topologically closest and has announced the above IP address prefix based on the anycast routing table.
[0145] Optionally, the relay discovery message includes a random number.
[0146] S202: After receiving the relay discovery message, the relay device sends a relay advertisement message (Relay Advertisement) to the gateway device.
[0147] After receiving the relay discovery message, the relay device can obtain the random number from the relay discovery message. In addition, the relay notification message sent by the relay device includes the random number and the unicast Internet Protocol (IP) address of the relay device.
[0148] After receiving the relay notification message, the gateway device verifies whether the random number in the relay notification message is the same as the random number it sent. If they are the same, the gateway device can use the unicast IP address in the relay notification message when communicating with the relay device using the AMT protocol.
[0149] Among them, the above S201-S202 is the relay device discovery stage. Through the above steps, the gateway device can determine the relay device that can establish an AMT tunnel with itself.
[0150] S203: The gateway device sends a request message to the relay device. Correspondingly, the relay device receives the request message.
[0151] The request message contains a request random number and a query identifier, which is used to indicate whether the relay device should return a message containing a third-generation Internet Group Management Protocol version 3 (IGMPv3) general query message or a second-generation Multicast Listener Discovery Protocol version 2 (MLDv2) general query message to the gateway device.
[0152] For example, the value of the query identifier can be 1 or 0. When the query identifier value is 1, it is used to indicate that the relay device should send a message containing an IGMPv3 general query message or an MLDv2 general query message to the gateway device; when the query identifier value is 0, it is used to indicate that the relay device does not need to send a message containing an IGMPv3 general query message or an MLDv2 general query message to the gateway device.
[0153] S204: The relay device sends a membership query message (Membership Query) to the gateway device. Correspondingly, the gateway device receives the membership query message.
[0154] After receiving the request message, the relay device can extract information such as the source IP address, source User Datagram Protocol (UDP) port, request random number and private key from the request information, and then calculate the hash summary of the extracted information to obtain the message authentication code.
[0155] Furthermore, the relay device may return a member query message to the gateway device, where the member query message includes: the request random number, the message authentication code, and an IGMPv3 regular query message or an MLDv2 regular query message.
[0156] S205: The gateway device sends a membership update message (Membership Update) to the relay device.
[0157] After receiving the membership query message, the gateway device can verify whether the request random number in the membership query message is the same as the request random number included in the request message sent by itself.
[0158] If they are the same, the gateway device may start a periodic query keep-alive timer (Query Timer), and whenever the periodic query keep-alive timer times out, the gateway device is triggered to send a new request message to the relay device.
[0159] At the same time, the gateway device saves the request random number and message authentication code, and obtains the IGMPv3 general query message or MLDv2 general query message in the member query message. The IGMP protocol module in the gateway device processes the IGMPv3 general query message, or the MLD protocol module processes the MLDv2 general query message.
[0160] After the gateway device receives the multicast join request sent by the multicast receiver, the gateway device may send a member update message to the relay device.
[0161] The member update message includes: a request random number, a message verification code, and an IGMPv3 report message or an MLDv2 report message.
[0162] It can be understood that when the gateway device periodically sends request information to the relay device based on the periodic query keep-alive timer, the random number carried in the member update message sent by the gateway device each time is the request random number in the member query message received by the gateway device for the last time, and the message verification code carried is the message authentication code in the member query message received by the gateway device for the last time.
[0163] S206: The relay device sends a multicast data message (Multicast Data) to the gateway device.
[0164] After receiving a Membership Update message, the relay device calculates a message authentication code based on the source IP address, source UDP port, request random number, and private key. If the calculated message authentication code matches the message authentication code in the Membership Update message, the relay device accepts and processes the Membership Update message, successfully establishing an AMT tunnel between the gateway device and the relay device. If the calculated message authentication code differs from the message authentication code in the Membership Update message, the relay device ignores the Membership Update message.
[0165] After an AMT tunnel is established between the gateway device and the relay device, if the relay device receives multicast data from the multicast source and determines that the gateway device belongs to the multicast group corresponding to the multicast source, that is, the gateway device is interested in the multicast data of the multicast source, the relay device can encapsulate the multicast data into a multicast data packet, and then send the multicast data packet to the gateway device based on the AMT tunnel.
[0166] After receiving the multicast data message, the gateway device extracts the multicast data in the multicast data message and sends the multicast data to the multicast receiver.
[0167] After the AMT tunnel is established between the gateway device and the relay device, when the forwarding burden of the relay device is heavy and the forwarding resources of the relay device are not completely exhausted, the gateway device still obtains the multicast data stream through the relay device, which will result in low forwarding efficiency of the multicast data stream.
[0168] To address the above issues, an embodiment of the present application provides a method for multicast tunnel load balancing. The method is applied to a gateway device, and the gateway device has established AMT tunnels with multiple relay devices. As shown in FIG3 , the method includes:
[0169] S301: Receive a multicast join request message sent by a multicast receiver.
[0170] The multicast join request message includes the information of the multicast group.
[0171] The multicast group information can be expressed as (S, G) or (*, G), where S is the address of the multicast source, G is the address of the multicast group, and "*" represents no restriction on the multicast source.
[0172] S302: Obtain a priority value and a load value of each relay device among multiple relay devices.
[0173] The priority value indicates the multicast service quality of the relay device. The higher the multicast service quality of the relay device, the higher the priority value of the relay device; the lower the multicast service quality of the relay device, the lower the priority value of the relay device.
[0174] The load value is used to indicate the load on the relay device. For example, the load value can be the number of multicast groups the relay device is responsible for. The more multicast groups the relay device is responsible for, the greater the load value.
[0175] S303: Select a target relay device for the multicast group from multiple relay devices based on the priority value and load value of each relay device.
[0176] The gateway device can select a target relay device for the multicast group based on the principle of load sharing and the priority and load values of the relay devices.
[0177] S304: Send a first member update message to the target relay device.
[0178] The first member update message includes information of the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0179] After receiving the first member update message, the target relay device may request the upstream multicast source to copy the multicast data stream of the multicast group, and forward the multicast data stream of the multicast group to the multicast receiver through the gateway device.
[0180] Using the above technical solution, a gateway device can establish AMT tunnels with multiple relay devices. Upon receiving a multicast join request message from a multicast receiver, the gateway device can select a target relay device for the multicast group the receiver requested to join based on the priority and load values of each relay device. This target relay device then forwards the multicast data stream of the multicast group to the multicast receiver. Because the priority and load values are taken into consideration when selecting the target relay device, each relay device can share and forward the multicast data streams of multiple multicast groups in a load-sharing manner, fully utilizing the device resources of multiple relay devices and improving the forwarding efficiency of multicast data streams.
[0181] In an embodiment of the present application, the gateway device is configured with the anycast address of each relay device included in the relay device group. Before executing the process of Figure 3, the gateway device needs to establish an AMT tunnel with the relay devices in the relay device group.
[0182] The process of establishing an AMT tunnel between a gateway device and multiple relay devices includes the following steps:
[0183] Step 1: After the gateway device goes online, a relay discovery message is sent to each relay device included in the relay device group, and each relay discovery message includes a different anycast address.
[0184] In an embodiment of the present application, a specified number of relay addresses can be pre-configured for each relay device in the relay device group, each relay address having a different IP address prefix, and the forwarding paths between the gateway device and the specified number of relay addresses are different. The specified number is the number of relay devices included in the relay device group.
[0185] Furthermore, each relay device will advertise routes with a specified number of different IP address prefixes, and the gateway device can learn the routes advertised by the relay device.
[0186] In one implementation, the gateway device may create a pseudo interface for each relay device, and configure a relay discovery address prefix (Relay Discovery Address Prefix) and a relay discovery address (Relay Discovery Address) having the Relay Discovery Address Prefix for each pseudo interface.
[0187] For example, if the specified quantity is 2, two pseudo-interfaces can be created. The Relay Discovery Address Prefix configured for pseudo-interface 1 is one of the IP address prefixes advertised by the relay device, and the Relay Discovery Address Prefix configured for pseudo-interface 2 is the other IP address prefix advertised by the relay device.
[0188] In another implementation, the gateway device may create a pseudo interface and configure a specified number of Relay Discovery Address Prefixes and a specified number of Relay Discovery Addresses on the pseudo interface.
[0189] It can be understood that the above-mentioned relay discovery address is an anycast address. Taking the relay device group including two relay devices as an example, assuming that the two relay discovery addresses configured by the gateway device are anycast address 1 and anycast address 2, the destination address of a relay discovery message sent is anycast address 1, and the relay discovery message can be routed to the relay device closest to the gateway device according to anycast address 1. Similarly, the destination address of another relay discovery message sent by the gateway device is anycast address 2, and the relay discovery message is routed to the relay device closest to the gateway device according to anycast address 2. Because the topological paths between the gateway device and anycast address 1 and anycast address 2 are different, the two relay discovery messages sent by the gateway device will be sent to two different relay devices.
[0190] Step 2: Receive relay notification messages sent by a first number of relay devices within a first preset time period, where the relay notification messages include priority values of the relay devices.
[0191] Optionally, after sending the relay discovery message, the gateway device may start an advertisement waiting timer, with the timeout duration of the advertisement waiting timer being the first preset duration. In this way, it may be determined whether the first preset duration has been reached through a timer timeout mechanism.
[0192] The first number is the number of relay devices corresponding to the relay announcement messages received within a first preset time period after the gateway device sends the relay discovery message to each relay device included in the relay device group.
[0193] The first number is less than or equal to the number of relay devices included in the relay device group.
[0194] Step 3: Establish AMT tunnels with the first number of relay devices respectively, and record the priority values of the first number of relay devices.
[0195] After receiving the relay announcement messages sent by the first number of relay devices, the gateway device may respectively record the priority value of each relay device in the first number of relay devices.
[0196] Step 4: Record the priority values of the second number of relay devices as 0. The second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0197] If the gateway device does not receive a relay notification message from any relay device in the relay device group within the first preset time period, it may resend a relay discovery message to the relay device in accordance with the AMT protocol. Furthermore, the priority value of the relay device is temporarily recorded as 0, indicating that the relay device is temporarily not participating in load sharing.
[0198] If the gateway device subsequently receives a relay notification message from the relay device within the first period after resending the relay discovery message, it can obtain the priority value carried in the relay notification message and record the priority value of the relay device. It can also establish an AMT tunnel with the relay device, allowing the relay device to participate in subsequent load sharing.
[0199] Using this method, the gateway device can simultaneously establish AMT tunnels with multiple relay devices in the relay device group, and can record the priority values of multiple relay devices. In this way, different multicast streams can be shared to multiple relay devices in a load-sharing manner based on the priority value and load value of each relay device, thereby making full use of the network resources of the relay devices and improving the multicast forwarding efficiency.
[0200] In some embodiments of the present application, the priority value may change because the multicast service quality of the relay device may change. To promptly obtain the changed priority value of the relay device, after the network device establishes AMT tunnels with the first number of relay devices and records the priority values of the first number of relay devices, the gateway device may further perform steps AC.
[0201] Step A: Send a request message to a first number of relay devices every second preset time period.
[0202] Among them, when the gateway device establishes an AMT tunnel with each relay device, it will send a request message to the relay device. After receiving the member query message replied by the main relay device and verifying that the request random number carried in the member query message is correct, the gateway device can start the periodic query keep-alive timer (Query Timer). The timeout period of the periodic query keep-alive timer is the second preset period.
[0203] Furthermore, whenever the query keep-alive timer times out, the gateway device sends a new request message to the active relay device.
[0204] The request message is a Request message in the AMT protocol, and the member query message is a Membership Query message in the AMT protocol.
[0205] Step B: Receive member query messages sent by a first number of relay devices, where the member query messages include priority values of the relay devices.
[0206] Each time the relay device receives a request message, it can obtain its latest priority value and encapsulate the priority value in a member query message.
[0207] It is understandable that each time the gateway device sends a request message to the relay device, it can receive a member query message replied by the relay device, so that the gateway device can periodically obtain the priority value of each relay device.
[0208] Step C: Based on the priority value included in the member query message, update the priority values of the first number of relay devices that have been recorded.
[0209] For each relay device in the first number of relay devices, each time after receiving a member query message from the relay device, the priority value of the relay device may be updated to the priority value carried in the member query message.
[0210] It should be noted that in the above embodiment, for the relay device that fails to reply to the relay notification message within the first preset time period, if an AMT tunnel can be successfully established with the relay device subsequently, the recorded priority value of the relay device can also be updated in accordance with steps A to C.
[0211] By adopting the embodiment of the present application, the gateway device can utilize the keep-alive mechanism between the gateway device and the relay device to periodically obtain the priority value of the relay device, that is, it can perform load sharing based on the accurate multicast service quality of each relay device, thereby improving the multicast service quality.
[0212] In this embodiment of the present application, the priority value may be determined based on the health parameters of the relay device, which include but are not limited to the following parameters:
[0213] The number of accessible multicast sources;
[0214] Network quality between the multicast source and the source;
[0215] Failure rate of the transmission path to the multicast source;
[0216] The quality of the routing link to the multicast source.
[0217] The network quality can include transmission delay, jitter, packet loss rate, etc. between the relay device and the multicast source.
[0218] The relay device may detect the failure rate of the transmission path between the relay device and the multicast source through a detection mechanism. For example, the detection mechanism may be a point 2 multiple point Bidirectional Forwarding Detection (P2MP BFD) mechanism.
[0219] Each health parameter of a relay device corresponds to a preset weight and threshold. The relay device's priority is the sum of the weights of each health parameter. Each time a health parameter is obtained, if a health parameter is less than its threshold, the priority is reduced by the weight associated with that health parameter. Once the health parameter is again greater than or equal to its threshold, the priority is increased by the weight associated with that health parameter.
[0220] The relay device can refresh its priority value periodically.
[0221] In one implementation, the relay device may calculate its own priority value based on its own health parameter.
[0222] In another implementation, the network controller may centrally monitor the health parameters of each relay device, calculate a priority value for each relay device, and then issue the priority value to each relay device.
[0223] In some embodiments of the present application, the above S303, selecting a target relay device for the multicast group from multiple relay devices based on the priority value and load value of each relay device, can be specifically implemented as follows:
[0224] Obtain the sharing weight value of each relay device, filter out the sharing weight values that exceed the preset threshold from multiple sharing weight values, and select the relay device with the smallest load value as the target relay device from the relay devices corresponding to the filtered sharing weight values.
[0225] The gateway device can obtain the shared weight value of each relay device in one of the following two ways:
[0226] Method 1: Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value.
[0227] Among them, the larger the priority value, the larger the sharing weight value, and the above preset mapping relationship can be pre-set based on experience.
[0228] Method 2: For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of multiple relay devices.
[0229] If there are N relay devices participating in load balancing, and their priorities range from priority-1 to priority-N, the load balancing weight of relay device n is:
[0230] priority-n / (priority-1+priority-2+……+Priority-N)*100.
[0231] The value of n ranges from 1 to N.
[0232] The above formula can be used to calculate the shared weight value of each relay device. Then, the shared weight values exceeding the preset threshold can be selected. The preset threshold can be set based on experience.
[0233] Assuming that the shared weight values of relay device 1, relay device 3, and relay device 5 among the N relay devices are greater than a preset threshold, the load values of relay device 1, relay device 3, and relay device 5 can be compared.
[0234] Assuming that the load value of relay device 1 is the smallest, relay device 1 can be selected as the target relay device.
[0235] The load value is the number of multicast groups that the relay device is responsible for. The gateway device can maintain the number of multicast groups that each relay device is responsible for. Each time a target relay device is selected for a multicast group, the load value of the target relay device can be increased by 1.
[0236] Optionally, the method for selecting a target relay device in the embodiment of the present application is not limited to this, and may also be based on other load sharing methods, such as selecting a target relay device for a multicast group from multiple relay devices based on the priority value and load value of each relay device. This embodiment of the present application does not specifically limit this.
[0237] For example, the load sharing value of the relay device corresponding to each sharing weight value can be judged in order from large to small to determine whether it is less than the preset load threshold, and the first relay device whose load sharing value is less than the preset load threshold can be used as the target relay device.
[0238] Specifically, the largest sharing weight value can be selected first. If the load value of the relay device corresponding to the largest sharing weight value is less than the preset load value threshold, the relay device is used as the target relay device; if the load value of the relay device is greater than or equal to the preset load value threshold, the second largest sharing weight value is selected. If the load value of the relay device corresponding to the second largest sharing weight value is less than the preset load threshold, the relay device is used as the target relay device. Otherwise, continue to select the next sharing weight value, and so on, until the target relay device is selected.
[0239] By adopting the above technical solution, the gateway device can comprehensively select the target relay device for the multicast group based on the sharing weight value and load value of the relay device. The selected target relay device can provide better multicast service quality, avoid selecting relay devices with excessive load or poor multicast service quality, make full use of the resources of the relay device, and improve multicast forwarding efficiency.
[0240] In some embodiments of the present application, after a gateway device selects a target relay device for a multicast group, the target relay device will continue to forward the multicast data stream for the multicast group unless the gateway device receives a request from the multicast receiver to leave the multicast group. Even if the priority value or load value of the target relay device changes, there is no need to reselect a target relay device for the multicast group.
[0241] However, if the gateway device senses through the keep-alive mechanism that the target relay device is unreachable, that is, the target relay device is faulty, after the above S304, sending the first member update message to the target relay device, the method further includes:
[0242] If the target relay device fails, obtaining the priority value of each relay device except the target relay device among the multiple relay devices;
[0243] reselecting a target relay device for the multicast group from among the multiple relay devices excluding the target relay device based on the obtained priority value and load value of each relay device;
[0244] A second member update message is sent to the reselected target relay device, where the second member update message includes information about the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0245] The method for reselecting a target relay device is the same as the method for selecting a target relay device described in the above embodiment. For each multicast group managed by the failed target relay device, a target relay device needs to be reselected from the relay device group.
[0246] In this way, after a target relay device fails, a new target relay device can be selected in time for the multicast group that the failed target relay device is responsible for, thereby improving the reliability of the AMT tunnel and avoiding multicast service interruption.
[0247] Based on the introduction of the above embodiments, the embodiments of the present application add priority values to both the member query message and the relay announcement message. The message formats of the member query message and the relay announcement message are introduced below.
[0248] In one embodiment of the present application, the member query message includes a first flag bit field and a priority field. When the first flag bit field takes a first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0249] In addition, the member query message also includes a second flag bit field.
[0250] If the value of the second flag bit field is the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field.
[0251] If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
[0252] For example, the first value may be 1 and the second value may be 0.
[0253] As an example, as shown in FIG4 , FIG4 is a schematic diagram of the structure of the member query message when the value of the second flag bit field is the first value.
[0254] The Membership Query Message includes the following fields: Version, Type, Reserved, P Flag, L Flag, G Flag, Response Media Access Control (Response MAC) Address, Request Nonce, Encapsulated General Query Message, Gateway Port Number, Gateway IP Address, and Priority.
[0255] The value of the Version field is 0, and the value of the Type field is 4. If the gateway device and the relay device communicate based on the IPv4 protocol, the regular query message is a Membership Query message based on the IGMPv3 protocol; if the gateway device and the relay device communicate based on the IPv6 protocol, the regular query message is a Listener Query message based on the MLDv2 protocol. The IP address of the gateway device can be an IPv4 address or an IPv6 address.
[0256] The first flag bit field is a P flag bit field, and the second flag bit field is a G flag bit field. When both the P flag bit field and the G flag bit field are 1, it indicates that the priority field is located after the Gateway IP Address field in FIG4 .
[0257] When the P flag field is 1 and the G flag field is 0, the Member Query message does not include the Gateway Port Number field and the Gateway IP Address field, and the Priority field is located after the Encapsulated General Query Message in Figure 4.
[0258] In another embodiment of the present application, the relay announcement message includes a priority field, and the priority field is used to carry the priority value of the relay device.
[0259] As an example, as shown in Figure 5, Figure 5 is a schematic diagram of a relay notification message provided in an embodiment of the present application. The relay notification message includes the following fields: version (Version), type (Type), priority (Priority), reserved bit (Reserved), discovery random number (Discovery Nonce) and relay address (Relay Address). Among them, the value of the version (Version) field is 0, the value of the type (Type) field is 2, and the relay address (Relay Address) field includes an IPv4 address or an IPv6 address. The priority field is located after the type field and is adjacent to the type field.
[0260] In the above-mentioned member query message and relay query message, the priority field occupies 8 reserved bits and can be an unsigned integer with a valid range of 1 to 255. When the priority field value is 0, it indicates that the priority field does not carry the priority value of the relay device.
[0261] As shown in FIG6 , taking the relay device group including relay device 1 and relay device 2 as an example, FIG6 is a flow chart of the multicast tunnel load balancing method provided in an embodiment of the present application, which may include the following steps: S601 - S611 .
[0262] S601: The gateway device sends a relay discovery message (Relay Discovery) to relay device 1 and relay device 2. Correspondingly, relay device 1 and relay device 2 receive the relay discovery message sent by the gateway device.
[0263] S602: After receiving the relay discovery message, relay device 1 sends a relay advertisement message to the gateway device. Correspondingly, the gateway device can receive the relay advertisement message.
[0264] The relay notification message includes the priority value Priority-1 of relay device 1.
[0265] After S602 , S604 is executed.
[0266] S603: After receiving the relay discovery message, relay device 2 sends a relay advertisement message to the gateway device. Correspondingly, the gateway device can receive the relay advertisement message.
[0267] After S603 , S606 is executed.
[0268] The relay notification message includes the priority value Priority-2 of relay device 2.
[0269] S604 : The gateway device sends a request message (Request) to the relay device 1 .
[0270] After the gateway device receives the relay notification message sent by the relay device 1, S604 may be executed.
[0271] S605 , after receiving the request message, the relay device 1 sends a membership query message (Membership Query) to the gateway device.
[0272] The member query message includes the latest priority value Priority-1 of relay device 1.
[0273] After receiving the member query message sent by relay device 1, the gateway device can start a periodic query keepalive timer (Query Timer) 1 between itself and relay device 1. Whenever the periodic query keepalive timer 1 times out, the gateway device is triggered to resend a request message to relay device 1.
[0274] S606 : The gateway device sends a request message (Request) to the relay device 2 .
[0275] After the gateway device receives the relay notification message sent by the relay device 2, it can execute S606.
[0276] S607: After receiving the request message, the relay device 2 sends a membership query message (Membership Query) to the gateway device.
[0277] The member query message includes the latest priority value Priority-2 of relay device 2.
[0278] After receiving the member query message sent by relay device 2, the gateway device can start a periodic query keepalive timer (Query Timer) 2 between itself and relay device 2. Whenever the periodic query keepalive timer 2 times out, the gateway device is triggered to resend a request message to relay device 2.
[0279] Subsequently, if the gateway device receives a multicast join request message sent by multicast receiver 1, which requests to join the multicast group (S1, G1), the gateway device selects a target relay device for the multicast group (S1, G1) based on the priority values and load values of relay device 1 and relay device 2. Assuming that the selected target relay device is relay device 1, continue to execute S608.
[0280] S608: The gateway device sends a membership update message (Membership Update) to the relay device 1. Correspondingly, the relay device 1 receives the membership update message.
[0281] The member update message includes information of the multicast group (S1, G1).
[0282] S609: Relay device 1 sends the multicast data stream (S1, G1) to the gateway device. Correspondingly, the gateway device receives the multicast data stream (S1, G1) sent by relay device 1.
[0283] Furthermore, the gateway device may forward the multicast data stream (S1, G1) to multicast receiver 1.
[0284] After S607, if the gateway device receives a multicast join request message sent by multicast receiver 2, which requests to join the multicast group (S1, G2), the gateway device selects a target relay device for the multicast group (S1, G2) based on the priority values and load values of relay device 1 and relay device 2. Assuming that the selected target relay device is relay device 2, continue to execute S610.
[0285] S610: The gateway device sends a membership update message (Membership Update) to the relay device 2. Correspondingly, the relay device 2 receives the membership update message.
[0286] The member update message includes information of the multicast group (S1, G2).
[0287] S611: Relay device 2 sends the multicast data stream (S1, G2) to the gateway device. Correspondingly, the gateway device receives the multicast data stream (S1, G2) sent by relay device 2.
[0288] Furthermore, the gateway device may forward the multicast data stream (S1, G2) to multicast receiver 2.
[0289] Using this method, the gateway device can establish AMT tunnels with multiple relay devices at the same time. After receiving a multicast join request message, the gateway device can select a relay device for the multicast group based on the priority values and load values of multiple relay devices in a load sharing manner. The selected relay device forwards the multicast data stream of the multicast group requested to join by the multicast join request, which can improve the multicast forwarding efficiency.
[0290] Based on the same concept, an embodiment of the present application provides a device for multicast tunnel load balancing, which is applied to a gateway device. The gateway has established AMT tunnels with multiple relay devices. As shown in FIG7 , the device includes:
[0291] The receiving module 701 is configured to receive a multicast join request message sent by a multicast receiver, where the multicast join request message includes information about the multicast group.
[0292] An acquisition module 702 is configured to acquire a priority value and a load value of each relay device among a plurality of relay devices, wherein the priority value is used to indicate the multicast service quality of the relay device;
[0293] A selection module 703 is configured to select a target relay device for the multicast group from a plurality of relay devices based on the priority value and load value of each relay device;
[0294] The sending module 704 is configured to send a first member update message to a target relay device, where the first member update message includes information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receivers.
[0295] Optionally, the gateway device is configured with the anycast address of each relay device included in the relay device group. The process of establishing the AMT tunnel between the gateway device and the multiple relay devices includes:
[0296] After the gateway device goes online, it sends a relay discovery message to each relay device included in the relay device group, each relay discovery message includes a different anycast address;
[0297] Within a first preset time period, receiving relay announcement messages sent by a first number of relay devices, the relay announcement messages including priority values of the relay devices;
[0298] Establishing AMT tunnels with a first number of relay devices respectively, and recording priority values of the first number of relay devices;
[0299] The priority values of the second number of relay devices are recorded as 0, the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length, and the sum of the first number and the second number is the number of relay devices included in the relay device group.
[0300] Optionally, after recording the priority values of the first number of relay devices, the apparatus further includes an updating module:
[0301] The sending module 704 is further configured to send a request message to a first number of relay devices every second preset time period;
[0302] The receiving module 701 is further configured to receive member query messages sent by a first number of relay devices, where the member query messages include priority values of the relay devices;
[0303] An updating module is configured to update the priority values of the first number of relay devices that have been recorded based on the priority values included in the member query message.
[0304] Optionally, the selection module 703 is specifically configured to:
[0305] Get the shared weight value of each relay device;
[0306] Filtering out a sharing weight value exceeding a preset threshold from multiple sharing weight values;
[0307] From the relay devices corresponding to the filtered sharing weight values, the relay device with the smallest load value is selected as the target relay device.
[0308] Optionally, the selection module 703 is specifically configured to:
[0309] Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or
[0310] For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of multiple relay devices.
[0311] Optionally, the acquisition module 702 is further configured to acquire a priority value of each relay device other than the target relay device among the multiple relay devices if the target relay device fails;
[0312] The selection module 703 is further configured to reselect a target relay device for the multicast group from the relay devices other than the target relay device in the plurality of relay devices based on the obtained priority value and load value of each relay device;
[0313] The sending module 704 is further configured to send a second member update message to the reselected target relay device, where the second member update message includes information about the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group to the multicast receivers.
[0314] Optionally, the relay notification message includes a priority field, and the priority field is used to carry the priority value of the relay device.
[0315] Optionally, the member query message includes a first flag bit field and a priority field. When the first flag bit field takes a first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0316] Optionally, the member query message further includes a second flag bit field;
[0317] If the second flag bit field takes the first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0318] If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
[0319] Optionally, the priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
[0320] Optionally, the priority value is determined based on a health parameter of the relay device, which may include one or more of the following:
[0321] The number of accessible multicast sources;
[0322] Network quality between the multicast source and the source;
[0323] Failure rate of the transmission path to the multicast source;
[0324] The quality of the routing link to the multicast source.
[0325] Optionally, the load value is the number of multicast groups that the relay device is responsible for.
[0326] Based on the same concept, an embodiment of the present application provides a gateway device, as shown in FIG8 , in which the gateway device has established AMT tunnels with multiple relay devices. The gateway device includes:
[0327] Processor 801;
[0328] transceiver 804;
[0329] A machine-readable storage medium 802 stores machine-executable instructions that can be executed by a processor; the machine-executable instructions prompt the processor 801 to perform the following steps:
[0330] Receiving a multicast join request message sent by a multicast receiver through the transceiver 804, where the multicast join request message includes information about the multicast group;
[0331] Obtaining a priority value and a load value of each relay device among the plurality of relay devices, where the priority value is used to indicate the multicast service quality of the relay device;
[0332] Selecting a target relay device for the multicast group from multiple relay devices based on the priority value and load value of each relay device;
[0333] The first member update message is sent to the target relay device via the transceiver 804 . The first member update message includes the information of the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0334] Optionally, the gateway device is configured with the anycast address of each relay device included in the relay device group, and the machine-executable instructions further cause the processor 801 to perform the following steps:
[0335] After the gateway device goes online, a relay discovery message is sent to each relay device included in the relay device group through the transceiver 804, and each relay discovery message includes a different anycast address;
[0336] Within a first preset time period, receiving, through the transceiver 804, relay announcement messages sent by a first number of relay devices, the relay announcement messages including priority values of the relay devices;
[0337] Establishing AMT tunnels with a first number of relay devices respectively, and recording priority values of the first number of relay devices;
[0338] The priority values of the second number of relay devices are recorded as 0, the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length, and the sum of the first number and the second number is the number of relay devices included in the relay device group.
[0339] Optionally, the machine executable instructions further cause the processor 801 to perform the following steps:
[0340] Every second preset time period, sending a request message to a first number of relay devices through the transceiver 804;
[0341] Receiving, through the transceiver 804, member query messages sent by a first number of relay devices, where the member query messages include priority values of the relay devices;
[0342] Based on the priority value included in the member query message, the priority values of the first number of relay devices that have been recorded are updated.
[0343] Optionally, the machine executable instructions cause the processor 801 to perform the following steps:
[0344] Get the shared weight value of each relay device;
[0345] Filtering out a sharing weight value exceeding a preset threshold from multiple sharing weight values;
[0346] From the relay devices corresponding to the filtered sharing weight values, the relay device with the smallest load value is selected as the target relay device.
[0347] Optionally, the machine executable instructions cause the processor 801 to perform the following steps, including:
[0348] Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or
[0349] For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of multiple relay devices.
[0350] Optionally, the machine executable instructions further cause the processor 801 to perform the following steps:
[0351] If the target relay device fails, obtaining the priority value of each relay device except the target relay device among the multiple relay devices;
[0352] reselecting a target relay device for the multicast group from among the multiple relay devices excluding the target relay device based on the obtained priority value and load value of each relay device;
[0353] The transceiver 804 sends a second member update message to the reselected target relay device, where the second member update message includes the multicast group information, so that the reselected target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0354] Optionally, the relay notification message includes a priority field, and the priority field is used to carry the priority value of the relay device.
[0355] Optionally, the member query message includes a first flag bit field and a priority field. When the first flag bit field takes a first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0356] Optionally, the member query message further includes a second flag bit field;
[0357] If the second flag bit field takes the first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0358] If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
[0359] Optionally, the priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
[0360] Optionally, the priority value is determined based on a health parameter of the relay device, which may include one or more of the following:
[0361] The number of accessible multicast sources;
[0362] Network quality between the multicast source and the source;
[0363] Failure rate of the transmission path to the multicast source;
[0364] The quality of the routing link to the multicast source.
[0365] Optionally, the load value is the number of multicast groups that the relay device is responsible for.
[0366] In Figure 8 , a communication bus 803 may also be included. The processor 801, the machine-readable storage medium 802, and the transceiver 804 communicate with each other via the communication bus 803. The communication bus 803 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, and the like.
[0367] The transceiver 804 may be a wireless communication module. Under the control of the processor 801 , the transceiver 804 exchanges data with other devices.
[0368] The machine-readable storage medium 802 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Alternatively, the machine-readable storage medium may be at least one storage device located remote from the processor.
[0369] The processor 801 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0370] Based on the same inventive concept, in accordance with the multicast tunnel load balancing method provided in the above embodiment of the present application, the present embodiment further provides a machine-readable storage medium storing machine-executable instructions executable by a processor. The machine-executable instructions cause the processor to implement the steps of the above multicast tunnel load balancing method.
[0371] In another embodiment provided by the present application, a computer program product including instructions is further provided, which, when executed on a computer, enables the computer to execute the steps of the multicast tunnel load balancing method in the above embodiment.
[0372] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0373] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for multicast tunnel load balancing, characterized in that: Applied to a gateway device, the gateway device has established an AMT tunnel with multiple relay devices, the method comprising: receiving a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information of the multicast group; Acquire a priority value and a load value of each relay device among the multiple relay devices, wherein the priority value is used to indicate the multicast service quality of the relay device; Selecting a target relay device for the multicast group from the plurality of relay devices based on the priority value and the load value of each relay device; A first member update message is sent to the target relay device, where the first member update message includes information of the multicast group, so that the target relay device forwards the multicast data stream of the multicast group for the multicast receiver.
2. The method according to claim 1, characterized in that The gateway device is configured with the anycast address of each relay device included in the relay device group, and the process of establishing the AMT tunnel between the gateway device and the multiple relay devices includes: After the gateway device is online, a relay discovery message is sent to each relay device included in the relay device group, each relay discovery message includes a different anycast address; Within a first preset time period, receiving relay announcement messages sent by a first number of relay devices, wherein the relay announcement messages include priority values of the relay devices; Establishing AMT tunnels with the first number of relay devices respectively, and recording priority values of the first number of relay devices; The priority values of the second number of relay devices are recorded as 0, the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length, and the sum of the first number and the second number is the number of relay devices included in the relay device group.
3. The method according to claim 2, characterized in that After recording the priority values of the first number of relay devices, the method further includes: Sending a request message to the first number of relay devices every second preset time period; receiving member query messages sent by the first number of relay devices, wherein the member query messages include priority values of the relay devices; Based on the priority value included in the member query message, the recorded priority values of the first number of relay devices are updated.
4. The method according to claim 1, characterized in that: The selecting a target relay device for the multicast group from the plurality of relay devices based on the priority value and the load value of each relay device comprises: Get the sharing weight value of each relay device; From the multiple sharing weight values, select the sharing weight value exceeding the preset threshold; From the selected relay devices corresponding to the shared weight values, the relay device with the smallest load value is selected as the target relay device.
5. The method according to claim 4, characterized in that The obtaining of the sharing weight value of each relay device includes: Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or, For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of the plurality of relay devices.
6. The method according to claim 1, characterized in that After sending the first member update message to the target relay device, the method further includes: If the target relay device fails, obtaining a priority value of each relay device among the multiple relay devices except the target relay device; reselecting a target relay device for the multicast group from the relay devices other than the target relay device among the plurality of relay devices based on the obtained priority value and load value of each relay device; A second member update message is sent to the reselected target relay device, where the second member update message includes information of the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group for the multicast receiver.
7. The method according to claim 2, characterized in that The relay notification message includes a priority field, and the priority field is used to carry a priority value of the relay device.
8. The method according to claim 3, characterized in that The member query message includes a first tag bit field and a priority field. When the first tag bit field takes a first value, it is used to indicate that the priority field carries the priority value of the relay device.
9. The method according to claim 8, characterized in that The member query message also includes a second flag bit field; If the value of the second flag bit field is the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field; If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
10. The method according to claim 7 or 8, characterized in that: The priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
11. The method according to claim 1, characterized in that: The priority value is determined based on the health parameter of the relay device, and the health parameter includes any one or more of the following: The number of accessible multicast sources; Network quality with the multicast source; The failure rate of the transmission path to the multicast source; The quality of the routing link to the multicast source.
12. The method according to claim 1, characterized in that The load value is the number of multicast groups that the relay device is responsible for.
13. A device for multicast tunnel load balancing, characterized in that: Applied to a gateway device, the gateway device has established an AMT tunnel with multiple relay devices, and the device includes: A receiving module, configured to receive a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information about the multicast group; An acquisition module, used to acquire a priority value and a load value of each relay device in the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device; A selection module, configured to select a target relay device for the multicast group from the plurality of relay devices based on a priority value and a load value of each relay device; The sending module is used to send a first member update message to the target relay device, wherein the first member update message includes information of the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
14. The device according to claim 13, characterized in that The gateway device is configured with the anycast address of each relay device included in the relay device group, and the process of establishing the AMT tunnel between the gateway device and the multiple relay devices includes: After the gateway device is online, a relay discovery message is sent to each relay device included in the relay device group. The subsequent discovery message includes different anycast addresses; Within a first preset time period, receiving relay announcement messages sent by a first number of relay devices, wherein the relay announcement messages include priority values of the relay devices; Establishing AMT tunnels with the first number of relay devices respectively, and recording priority values of the first number of relay devices; The priority values of the second number of relay devices are recorded as 0, the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length, and the sum of the first number and the second number is the number of relay devices included in the relay device group.
15. The device according to claim 14, characterized in that After recording the priority values of the first number of relay devices, the apparatus further includes an updating module: The sending module is further configured to send a request message to the first number of relay devices every second preset time period; The receiving module is further used to receive member query messages sent by the first number of relay devices, where the member query messages include priority values of the relay devices; The updating module is used to update the priority values of the first number of relay devices that have been recorded based on the priority value included in the member query message.
16. The device according to claim 13, characterized in that The selection module is specifically used for: Get the sharing weight value of each relay device; From the multiple sharing weight values, select the sharing weight value exceeding the preset threshold; From the selected relay devices corresponding to the shared weight values, the relay device with the smallest load value is selected as the target relay device.
17. The device according to claim 16, characterized in that The selection module is specifically used for: Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or, For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of the plurality of relay devices.
18. The device according to claim 13, characterized in that The acquisition module is further configured to acquire a priority value of each relay device among the plurality of relay devices except the target relay device if the target relay device fails; The selection module is further configured to reselect a target relay device for the multicast group from the relay devices other than the target relay device among the multiple relay devices based on the obtained priority value and load value of each relay device; The sending module is further used to send a second member update message to the reselected target relay device, wherein the second member update message includes information of the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
19. The device according to claim 14, characterized in that The relay notification message includes a priority field, and the priority field is used to carry a priority value of the relay device.
20. The device according to claim 15, characterized in that The member query message includes a first tag bit field and a priority field. When the first tag bit field takes a first value, it is used to indicate that the priority field carries the priority value of the relay device.
21. The device according to claim 20, characterized in that The member query message also includes a second flag bit field; If the second flag bit field takes the first value, it means that the priority field is located after the gateway address field and is The location adjacent to the address field; If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
22. The device according to claim 19 or 20, characterized in that The priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
23. The device according to claim 13, characterized in that The priority value is determined based on the health parameter of the relay device, and the health parameter includes any one or more of the following: The number of accessible multicast sources; Network quality with the multicast source; The failure rate of the transmission path to the multicast source; The quality of the routing link to the multicast source.
24. The device according to claim 13, characterized in that The load value is the number of multicast groups that the relay device is responsible for.
25. A gateway device, characterized in that: The gateway device has established an AMT tunnel with multiple relay devices, and the gateway device includes: processor; Transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions prompt the processor to perform the following steps: Receiving, by the transceiver, a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information of the multicast group; Acquire a priority value and a load value of each relay device among the multiple relay devices, wherein the priority value is used to indicate the multicast service quality of the relay device; Selecting a target relay device for the multicast group from the plurality of relay devices based on the priority value and the load value of each relay device; A first member update message is sent to the target relay device through the transceiver, wherein the first member update message includes information of the multicast group, so that the target relay device forwards the multicast data stream of the multicast group for the multicast receiver.
26. The gateway device according to claim 25, characterized in that: The gateway device is configured with an anycast address of each relay device included in the relay device group, and the machine executable instructions further cause the processor to perform the following steps: After the gateway device is online, a relay discovery message is sent to each relay device included in the relay device group through the transceiver, each relay discovery message includes a different anycast address; Within a first preset time period, receiving, by the transceiver, relay announcement messages sent by a first number of relay devices, the relay announcement messages including priority values of the relay devices; Establishing AMT tunnels with the first number of relay devices respectively, and recording priority values of the first number of relay devices; The priority values of the second number of relay devices are recorded as 0, the second number of relay devices are the relay devices in the relay device group that have not sent relay notification messages within the first preset time length, and the sum of the first number and the second number is the number of relay devices included in the relay device group.
27. The gateway device according to claim 26, characterized in that: The machine executable instructions further cause the processor to perform the following steps: Every second preset time period, sending a request message to the first number of relay devices through the transceiver; Receiving, by the transceiver, member query messages sent by the first number of relay devices, wherein the member query messages include priority values of the relay devices; Based on the priority value included in the member query message, the recorded priority values of the first number of relay devices are updated.
28. The gateway device according to claim 25, characterized in that: The machine executable instructions cause the processor to perform the following steps: Get the sharing weight value of each relay device; From the multiple sharing weight values, select the sharing weight value exceeding the preset threshold; From the selected relay devices corresponding to the shared weight values, the relay device with the smallest load value is selected as the target relay device.
29. The gateway device according to claim 28, characterized in that: The machine executable instructions cause the processor to perform the following steps, including: Determine the sharing weight value corresponding to the priority value of each relay device according to a preset mapping relationship between the priority value and the sharing weight value; or, For each relay device, the sharing weight value of the relay device is determined as: the ratio between the priority value of the relay device and the sum of the priority values of the plurality of relay devices.
30. The gateway device according to claim 25, characterized in that: The machine executable instructions further cause the processor to perform the following steps: If the target relay device fails, obtaining a priority value of each relay device among the multiple relay devices except the target relay device; reselecting a target relay device for the multicast group from the relay devices other than the target relay device among the plurality of relay devices based on the obtained priority value and load value of each relay device; A second member update message is sent to the reselected target relay device through the transceiver, wherein the second member update message includes information of the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group for the multicast receiver.
31. The gateway device according to claim 26, characterized in that: The relay notification message includes a priority field, and the priority field is used to carry a priority value of the relay device.
32. The gateway device according to claim 27, characterized in that: The member query message includes a first tag bit field and a priority field. When the first tag bit field takes a first value, it is used to indicate that the priority field carries the priority value of the relay device.
33. The gateway device according to claim 32, characterized in that: The member query message also includes a second flag bit field; If the value of the second flag bit field is the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field; If the value of the second flag bit field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and is adjacent to the encapsulation information.
34. The gateway device according to claim 31 or 32, characterized in that: The priority field occupies 8 reserved bits. When the priority field takes a value of 0, it indicates that the priority field does not carry a priority value.
35. The gateway device according to claim 25, characterized in that: The priority value is determined based on the health parameter of the relay device, and the health parameter includes any one or more of the following: The number of accessible multicast sources; Network quality with the multicast source; The failure rate of the transmission path to the multicast source; The quality of the routing link to the multicast source.
36. The gateway device according to claim 25, characterized in that: The load value is the number of multicast groups that the relay device is responsible for.
37. A machine-readable storage medium, characterized in that: Machine executable instructions are stored, and when called and executed by a processor, the machine executable instructions prompt the processor to implement any method described in claims 1-12.
38. A computer program product, characterized in that The computer program product causes the processor to implement the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Multicast traffic processing method, device and routing equipment
CN109218207A
Load sharing method, device and terminal device in ad hoc network, and storage medium
CN109246024A
Message forwarding method and device, node equipment and storage medium
CN113472667A
Communication method of network equipment, network equipment and storage medium
CN113824754A
Method, device and system for processing multicast data
WO2017201750A1