Methods, apparatus, gateway devices and storage media for multicast tunnel load balancing
By selecting high-priority and high-load relay devices from the gateway device to forward multicast data streams, the problem of low multicast data stream forwarding efficiency is solved, and resource utilization and efficiency are improved.
Patent Information
- Application Number
- CN202380009532.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-06-26
AI Technical Summary
Gateway devices obtain multicast data streams by forwarding relay devices that are heavily burdened with forwarding and whose forwarding resources have not yet been exhausted, resulting in low forwarding efficiency for multicast data streams.
The gateway device receives a multicast join request message sent by a multicast receiver, obtains the priority values and load values of multiple relay devices, selects a target relay device based on the priority values and load values, and sends a member update message to the target relay device to forward the multicast data stream.
By distributing multicast data streams through load balancing, the resources of multiple relay devices are fully utilized, thereby improving the forwarding efficiency of multicast data streams.
Smart Images

Figure CN119586106B_ABST
Abstract
Description
Technical Field
[0001] This 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 Technology
[0002] The Automatic Multicast Tunneling (AMT) protocol enables multicast receivers that do not support native multicast protocols to connect to multicast sources and receive multicast traffic from those sources.
[0003] The AMT protocol uses a client-server model. The gateway device can determine the nearest relay device via anycast, and then join the multicast group maintained by that relay device as a multicast member. At this point, the AMT tunnel between the gateway device and the relay device is successfully established. After receiving the multicast data stream from the multicast source, the relay device can then send the multicast data stream to the gateway device through the AMT tunnel. The gateway device then forwards the multicast data stream to the multicast receivers.
[0004] After the AMT tunnel is successfully established, if the relay device remains the closest to the gateway device in the topology and the route between the relay device and the gateway device is reachable, the gateway device will continuously obtain multicast data streams through the relay device. In this case, if the relay device has a heavy forwarding load but its forwarding resources are not yet fully exhausted, the forwarding efficiency of the multicast data stream will be low. Summary of the Invention
[0005] This application provides a method, apparatus, gateway device, and storage medium for multicast tunnel load balancing, which addresses the problem of low forwarding efficiency of multicast data streams when gateway devices acquire multicast data streams from relay devices with heavy forwarding loads and unexhausted forwarding resources. Specifically, the solution includes the following:
[0006] In a first aspect, embodiments of this application provide a method for multicast tunnel load balancing, applied to a gateway device, wherein the gateway device has established AMT tunnels with multiple relay devices, the method comprising:
[0007] Receive a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information about the multicast group;
[0008] Obtain the priority value and load value of each of the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device;
[0009] Based on the priority value and load value of each relay device, a target relay device is selected for the multicast group from the plurality of relay devices;
[0010] A first member update message is sent to the target relay device, the first member update message including information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0011] In one 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 the gateway device establishing an AMT tunnel with the plurality of relay devices includes:
[0012] After the gateway device comes online, it sends a relay discovery message to each relay device in the relay device group, and each relay discovery message includes a different anycast address.
[0013] Within a first preset time period, receive a first number of relay notification messages sent by relay devices, wherein the relay notification messages include the priority values of the relay devices;
[0014] AMT tunnels are established between each of the first number of relay devices, and the priority values of the first number of relay devices are recorded.
[0015] 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 did not send a relay notification message within the first preset time period. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0016] In one possible implementation, after recording the priority values of the first number of relay devices, the method further includes:
[0017] Every second preset time interval, a request message is sent to the first number of relay devices;
[0018] Receive member query messages sent by the first number of relay devices, wherein the member query message includes the priority value of the relay device;
[0019] Based on the priority value included in the member query message, update the priority values of the first number of recorded relay devices.
[0020] In one possible implementation, selecting a target relay device for the multicast group from the plurality of relay devices based on the priority value and load value of each relay device includes:
[0021] Obtain the weight value of each relay device;
[0022] From multiple weight values, filter out the weight values that exceed the preset threshold;
[0023] From the relay devices corresponding to the selected weight-sharing values, the relay device with the smallest load value is selected as the target relay device.
[0024] In one possible implementation, obtaining the weight value of each relay device includes:
[0025] Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or,
[0026] For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of the multiple relay devices.
[0027] In one possible implementation, after sending the first member update message to the target relay device, the method further includes:
[0028] If the target relay device fails, then the priority value of each relay device other than the target relay device is obtained.
[0029] Based on the priority value and load value of each relay device, a new target relay device is selected for the multicast group from among the relay devices other than the target relay device.
[0030] A second member update message is sent to the reselected target relay device, the second member update message including information about the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group for the multicast receiver.
[0031] In one possible implementation, the relay announcement message includes a priority field, which carries the priority value of the relay device.
[0032] In one possible implementation, the member query message includes a first flag field and a priority field. When the first flag field takes the first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0033] In one possible implementation, the member query message further includes a second flag bit field;
[0034] If the second flag field takes the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0035] If the value of the second flag field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and adjacent to the encapsulation information.
[0036] In one possible implementation, the priority field occupies 8 reserved bits, and when the priority field is 0, it indicates that the priority field does not carry a priority value.
[0037] In one possible implementation, the priority value is determined based on the health parameters of the relay device, which include any one or more of the following:
[0038] The number of accessible multicast sources;
[0039] Network quality between the source and the multicast source;
[0040] Failure rate of the transmission path between the multicast source and the multicast source;
[0041] Quality of the routing link between the source and the multicast source.
[0042] In one possible implementation, the load value is the number of multicast groups handled by the relay device.
[0043] Secondly, embodiments of this application provide a multicast tunnel load balancing apparatus applied to a gateway device, wherein the gateway device has established AMT tunnels with multiple relay devices, and the apparatus includes:
[0044] The receiving module is used to receive multicast join request messages sent by multicast receivers, wherein the multicast join request message includes information about the multicast group;
[0045] The acquisition module is used to acquire the priority value and load value of each of the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device;
[0046] The selection module is used to select a target relay device for the multicast group from the plurality of relay devices based on the priority value and load value of each relay device;
[0047] The sending module is configured to send a first member update message to the target relay device, the first member update message including information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0048] In one 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 the gateway device establishing an AMT tunnel with the plurality of relay devices includes:
[0049] After the gateway device comes online, it sends a relay discovery message to each relay device in the relay device group, and each relay discovery message includes a different anycast address.
[0050] Within a first preset time period, receive a first number of relay notification messages sent by relay devices, wherein the relay notification messages include the priority values of the relay devices;
[0051] AMT tunnels are established between each of the first number of relay devices, and the priority values of the first number of relay devices are recorded.
[0052] 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 did not send a relay notification message within the first preset time period. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0053] In one possible implementation, after recording the priority values of the first number of relay devices, the device further includes an update module:
[0054] The sending module is also used to send a request message to the first number of relay devices every second preset time interval;
[0055] The receiving module is further configured to receive member query messages sent by the first number of relay devices, wherein the member query message includes the priority value of the relay device;
[0056] The update module is used 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.
[0057] In one possible implementation, the selection module is specifically used for:
[0058] Obtain the weight value of each relay device;
[0059] From multiple weight values, filter out the weight values that exceed the preset threshold;
[0060] From the relay devices corresponding to the selected weight-sharing values, the relay device with the smallest load value is selected as the target relay device.
[0061] In one possible implementation, the selection module is specifically used for:
[0062] Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or,
[0063] For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of the multiple relay devices.
[0064] In one possible implementation, the acquisition module is further configured to acquire the priority value of each of the plurality of relay devices other than the target relay device if the target relay device fails.
[0065] The selection module is also used to reselect a target relay device for the multicast group from among the relay devices other than the target relay device, based on the priority value and load value of each relay device.
[0066] The sending module is further configured to send a second member update message to the reselected target relay device, the second member update message including 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.
[0067] In one possible implementation, the relay announcement message includes a priority field, which carries the priority value of the relay device.
[0068] In one possible implementation, the member query message includes a first flag field and a priority field. When the first flag field takes the first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0069] In one possible implementation, the member query message further includes a second flag bit field;
[0070] If the second flag field takes the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0071] If the value of the second flag field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and adjacent to the encapsulation information.
[0072] In one possible implementation, the priority field occupies 8 reserved bits, and when the priority field is 0, it indicates that the priority field does not carry a priority value.
[0073] In one possible implementation, the priority value is determined based on the health parameters of the relay device, which include any one or more of the following:
[0074] The number of accessible multicast sources;
[0075] Network quality between the source and the multicast source;
[0076] Failure rate of the transmission path between the multicast source and the multicast source;
[0077] Quality of the routing link between the source and the multicast source.
[0078] In one possible implementation, the load value is the number of multicast groups handled by the relay device.
[0079] Thirdly, embodiments of this application provide a gateway device that has established AMT tunnels with multiple relay devices, the gateway device comprising:
[0080] processor;
[0081] transceiver;
[0082] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the machine-executable instructions cause the processor to perform the following steps:
[0083] The transceiver receives multicast join request messages sent by multicast receivers, and the multicast join request messages include information about the multicast group.
[0084] Obtain the priority value and load value of each of the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device;
[0085] Based on the priority value and load value of each relay device, a target relay device is selected for the multicast group from the plurality of relay devices;
[0086] The transceiver sends a first member update message to the target relay device, the first member update message including information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
[0087] In one possible implementation, the gateway device is configured with an anycast address for each relay device included in the relay device group, and the machine-executable instructions further cause the processor to perform the following steps:
[0088] After the gateway device comes online, it sends a relay discovery message to each relay device in the relay device group through the transceiver. Each relay discovery message includes a different anycast address.
[0089] Within a first preset time period, the transceiver receives a first number of relay announcement messages sent by relay devices, the relay announcement messages including the priority values of the relay devices;
[0090] AMT tunnels are established between each of the first number of relay devices, and the priority values of the first number of relay devices are recorded.
[0091] 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 did not send a relay notification message within the first preset time period. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0092] In one possible implementation, the machine-executable instructions further cause the processor to perform the following steps:
[0093] Every second preset time interval, a request message is sent to the first number of relay devices through the transceiver;
[0094] The transceiver receives member query messages sent by the first number of relay devices, wherein the member query message includes the priority value of the relay device;
[0095] Based on the priority value included in the member query message, update the priority values of the first number of recorded relay devices.
[0096] In one possible implementation, the machine-executable instructions cause the processor to perform the following steps:
[0097] Obtain the weight value of each relay device;
[0098] From multiple weight values, filter out the weight values that exceed the preset threshold;
[0099] From the relay devices corresponding to the selected weight-sharing values, the relay device with the smallest load value is selected as the target relay device.
[0100] In one possible implementation, the machine-executable instructions cause the processor to perform the following steps:
[0101] Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or,
[0102] For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of the multiple relay devices.
[0103] In one possible implementation, the machine-executable instructions further cause the processor to perform the following steps:
[0104] If the target relay device fails, then the priority value of each relay device other than the target relay device is obtained.
[0105] Based on the priority value and load value of each relay device, a new target relay device is selected for the multicast group from among the relay devices other than the target relay device.
[0106] The transceiver sends a second member update message to the reselected target relay device, the second member update message including information about the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group for the multicast receiver.
[0107] In one possible implementation, the relay announcement message includes a priority field, which carries the priority value of the relay device.
[0108] In one possible implementation, the member query message includes a first flag field and a priority field. When the first flag field takes the first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0109] In one possible implementation, the member query message further includes a second flag bit field;
[0110] If the second flag field takes the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field;
[0111] If the value of the second flag field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and adjacent to the encapsulation information.
[0112] In one possible implementation, the priority field occupies 8 reserved bits, and when the priority field is 0, it indicates that the priority field does not carry a priority value.
[0113] In one possible implementation, the priority value is determined based on the health parameters of the relay device, which include any one or more of the following:
[0114] The number of accessible multicast sources;
[0115] Network quality between the source and the multicast source;
[0116] Failure rate of the transmission path between the multicast source and the multicast source;
[0117] Quality of the routing link between the source and the multicast source.
[0118] In one possible implementation, the load value is the number of multicast groups handled by the relay device.
[0119] Fourthly, embodiments of this application provide a machine-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in the first aspect.
[0120] Fifthly, embodiments of this application provide a computer program product that causes the processor to implement the method described in the first aspect.
[0121] Using the above technical solution, the gateway device can establish AMT tunnels with multiple relay devices. After receiving a multicast join request message from a multicast receiver, it can select a target relay device for the multicast group the multicast receiver requests to join, based on the priority and load values of each relay device. The target relay device then forwards the multicast data stream of that multicast group to the multicast receiver. Because the selection of the target relay device comprehensively considers both priority and load values, each relay device can share the forwarding of multicast data streams from 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. Attached Figure Description
[0122] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0123] Figure 1 A schematic diagram of an AMT network architecture provided in an embodiment of this application;
[0124] Figure 2 A flowchart illustrating a method for establishing an AMT tunnel between a gateway device and a relay device, provided in an embodiment of this application;
[0125] Figure 3 A flowchart of a multicast tunnel load balancing method provided in this application embodiment;
[0126] Figure 4 An exemplary schematic diagram of a member query message provided in an embodiment of this application;
[0127] Figure 5 An exemplary schematic diagram of a relay notification message provided in an embodiment of this application;
[0128] Figure 6 A flowchart illustrating another method for multicast tunnel load balancing provided in this application embodiment;
[0129] Figure 7 A schematic diagram of a multicast tunnel load balancing device provided in an embodiment of this application;
[0130] Figure 8 This is a schematic diagram of the structure of a gateway device provided in an embodiment of this application. Detailed Implementation
[0131] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this invention are within the scope of protection of this invention.
[0132] To facilitate understanding of the solutions provided in the embodiments of this application, the AMT network architecture involved in the embodiments of this application will first be introduced, such as... Figure 1 As shown, the AMT network architecture includes a multicast receiver, a gateway device, a relay device R1, a relay device R2, a multicast source S1, a multicast source S2, and a multicast source S3.
[0133] Figure 1 The number of devices shown is for illustrative purposes only; the actual number of devices in the implementation is not limited to this.
[0134] Multicast receivers can be sites, hosts, or applications that do not support multicast routing protocols but need to obtain multicast data.
[0135] The gateway device is located in a network that does not support multicast routing protocols, and multicast receivers can access the gateway device.
[0136] Each relay device can connect to at least one multicast source, for example Figure 1 The relay devices R1 and R2 are both connected to multicast sources S1, S2 and S3.
[0137] A gateway device can establish an AMT tunnel with a relay device via anycast, and then receive multicast data from the multicast source sent by the relay device through the AMT tunnel.
[0138] exist Figure 1Taking the establishment of an AMT tunnel between a gateway device and a relay device R1 as an example, after receiving multicast data from any multicast source, the relay device R1 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.
[0139] The following describes the process of establishing an AMT tunnel between the gateway device and the relay device.
[0140] like Figure 2 As shown, the process of establishing an AMT tunnel between the gateway device and the relay device includes the following steps:
[0141] S201. The gateway device sends a relay discovery message to the relay device.
[0142] In this configuration, relay devices supporting the AMT protocol will advertise routes with the same IP address prefix. After learning these routes, gateway devices can generate anycast addresses based on the IP address prefix. As an example, the anycast address includes the IP address prefix, with all other bits set to 0.
[0143] When a gateway device sends a relay discovery message based on an anycast address, it will forward the message to the nearest relay device in the topology that has already advertised the aforementioned IP address prefix, according to the anycast routing table.
[0144] Optionally, the relay discovery message includes a random number.
[0145] S202. After receiving the relay discovery message, the relay device sends a relay advertisement message to the gateway device.
[0146] After receiving a relay discovery message, the relay device can obtain a random number from the message. Furthermore, the relay announcement message sent by the relay device includes this random number and the relay device's unicast Internet Protocol (IP) address.
[0147] After receiving a relay advertisement message, the gateway device verifies whether the random number in the relay advertisement 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 advertisement message when communicating with the relay device using the AMT protocol.
[0148] Among them, S201-S202 is the relay device discovery phase. Through the above steps, the gateway device can identify the relay devices that can establish an AMT tunnel with itself.
[0149] S203. The gateway device sends a request message to the relay device. Accordingly, the relay device receives the request message.
[0150] The request message contains a request random number and a query identifier. The query identifier is used to indicate whether the relay device should return a message to the gateway device containing a regular query message of Internet Group Management Protocol version 3 (IGMPv3) or a regular query message of Multicast Listener Discover version 2 (MLDv2).
[0151] For example, the query flag can be 1 or 0. When the query flag is 1, it indicates that the relay device should send a message containing an IGMPv3 regular query message or an MLDv2 regular query message to the gateway device. When the query flag is 0, it indicates that the relay device does not need to send a message containing an IGMPv3 regular query message or an MLDv2 regular query message to the gateway device.
[0152] S204. The relay device sends a Membership Query message to the gateway device. Correspondingly, the gateway device receives the Membership Query message.
[0153] 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 digest of the extracted information to obtain the message authentication code.
[0154] Furthermore, the relay device can return a member query message to the gateway device, which includes: the aforementioned request random number, message authentication code, and IGMPv3 or MLDv2 regular query message.
[0155] S205. The gateway device sends a Membership Update message to the relay device.
[0156] After receiving a member query message, the gateway device can verify whether the request random number in the member query message is the same as the request random number included in its own request message.
[0157] If they are the same, the gateway device can start a periodic query keep-alive timer. Whenever the periodic query keep-alive timer expires, the gateway device is triggered to send a new request message to the relay device.
[0158] Meanwhile, the gateway device saves the request random number and message authentication code, and obtains the IGMPv3 regular query message or MLDv2 regular query message from the member query message. The IGMP protocol module in the gateway device processes the IGMPv3 regular query message, or the MLD protocol module processes the MLDv2 regular query message.
[0159] When a gateway device receives a multicast join request from a multicast receiver, the gateway device can send a member update message to the relay device.
[0160] The member update message includes: a request random number, a message verification code, and an IGMPv3 report message or an MLDv2 report message.
[0161] It is understandable 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 each member update message sent by the gateway device is the request random number in the last member query message received by the gateway device, and the message verification code carried is the message authentication code in the last member query message received by the gateway device.
[0162] S206. The relay device sends a multicast data packet to the gateway device.
[0163] Upon receiving a member update message, the relay device calculates a verification code based on the source IP address, source UDP port, request random number, and private key. If the calculated verification code matches the verification code in the member update message, the relay device receives and processes the message, thus successfully establishing an AMT tunnel between the gateway and the relay device. If the calculated verification code differs from the message in the update message, the relay device ignores the update message.
[0164] 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.
[0165] After receiving a multicast data packet, the gateway device extracts the multicast data from the multicast data packet and sends the multicast data to the multicast receiver.
[0166] After the AMT tunnel between the gateway device and the relay device is established, if the relay device has a heavy forwarding load and its forwarding resources are not completely exhausted, the gateway device will still obtain multicast data streams through the relay device, which will result in low forwarding efficiency of the multicast data streams.
[0167] To address the aforementioned issues, this application provides a method for multicast tunnel load balancing. This method is applied to a gateway device, which has already established AMT tunnels with multiple relay devices, such as... Figure 3 As shown, the method includes:
[0168] S301. Receive a multicast join request message sent by a multicast receiver.
[0169] The multicast join request message includes information about the multicast group.
[0170] Multicast group information can be represented as (S, G) or (*, G), where S is the address of the multicast source, G is the address of the multicast group, and "*" indicates that the multicast source is not limited.
[0171] S302. Obtain the priority value and load value of each of the multiple relay devices.
[0172] The priority value represents the multicast service quality of the relay device. The higher the multicast service quality of the relay device, the higher the priority value; the lower the multicast service quality of the relay device, the lower the priority value.
[0173] The load value is used to represent the load status of relay devices. As an example, the load value can be the number of multicast groups handled by the relay device. The more multicast groups the relay device handles, the larger the load value will be.
[0174] S303. Based on the priority value and load value of each relay device, select a target relay device for the multicast group from multiple relay devices.
[0175] Gateway devices can select a target relay device for a multicast group based on the principle of load sharing, taking into account the priority value and load value of the relay device.
[0176] S304. Send the first member update message to the target relay device.
[0177] The first member update message includes information about the multicast group, enabling the target relay device to forward the multicast data stream of the multicast group to the multicast receiver.
[0178] After receiving the first member update message, the target relay device can 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 receivers through the gateway device.
[0179] Using the above technical solution, the gateway device can establish AMT tunnels with multiple relay devices. After receiving a multicast join request message from a multicast receiver, it can select a target relay device for the multicast group the multicast receiver requests to join, based on the priority and load values of each relay device. The target relay device then forwards the multicast data stream of that multicast group to the multicast receiver. Because the selection of the target relay device comprehensively considers both priority and load values, each relay device can share the forwarding of multicast data streams from 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.
[0180] In this embodiment of the application, the gateway device is configured with the anycast address of each relay device included in the relay device group, and performs execution Figure 3 Before the process, the gateway device needs to establish an AMT tunnel with the relay devices in the relay device group.
[0181] The process of establishing an AMT tunnel between a gateway device and multiple relay devices includes the following steps:
[0182] Step 1: After the gateway device comes online, send a relay discovery message to each relay device in the relay device group. Each relay discovery message includes a different anycast address.
[0183] In this embodiment, a specified number of relay addresses can be pre-configured for each relay device in the relay device group. Each relay address has a different IP address prefix, and the forwarding paths between the gateway device and the specified number of relay addresses are different. Here, the specified number refers to the number of relay devices included in the relay device group.
[0184] Furthermore, each relay device will advertise a specified number of routes with different IP address prefixes, and the gateway device can learn the routes advertised by the relay devices.
[0185] In one implementation, the gateway device can create a pseudo-interface for each relay device, and configure a relay discovery address prefix and a relay discovery address with that Relay Discovery Address Prefix for each pseudo-interface.
[0186] For example, assuming the specified quantity is 2, two pseudo interfaces can be created. The RelayDiscovery 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 another IP address prefix advertised by the relay device.
[0187] In another implementation, the gateway device can create a pseudo interface on which a specified number of Relay Discovery Address Prefixes and a specified number of Relay Discovery Addresses are configured simultaneously.
[0188] It is understandable that the aforementioned relay discovery address is an anycast address. Taking a relay device group containing two relay devices as an example, assuming the gateway device is configured with two relay discovery addresses, anycast address 1 and anycast address 2, then a relay discovery message sent will have its destination address as anycast address 1. This relay discovery message can be routed to the relay device closest to the gateway device according to anycast address 1. Similarly, if another relay discovery message sent by the gateway device has its destination address as anycast address 2, this relay discovery message will also be routed to the relay device closest to the gateway device according to anycast address 2. Because the topology 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.
[0189] Step 2: Within a first preset time period, receive a first number of relay announcement messages sent by relay devices. The relay announcement messages include the priority values of the relay devices.
[0190] Optionally, after sending the aforementioned relay discovery message, the gateway device may start an advertisement timer, the timeout duration of which is the aforementioned first preset duration. Thus, the timeout mechanism can determine whether the first preset duration has been reached.
[0191] The first quantity is the number of relay devices corresponding to the relay announcement messages received by the gateway device within a first preset time period after the gateway device sends a relay discovery message to each relay device included in the relay device group.
[0192] The first quantity is less than or equal to the number of relay devices included in the relay device group.
[0193] Step 3: Establish AMT tunnels between each of the first number of relay devices and record the priority values of the first number of relay devices.
[0194] After receiving the relay announcement messages sent by the first number of relay devices, the gateway device can record the priority value of each of the first number of relay devices.
[0195] Step 4: Record the priority value 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 did not send a relay announcement message within the first preset time period. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0196] If the gateway device does not receive a relay announcement message from any relay device in the relay device group within the first preset time period, it can resend a relay discovery message to that relay device in accordance with the AMT protocol. Furthermore, the priority value of that relay device will be temporarily recorded as 0, meaning that the relay device will not participate in load balancing for the time being.
[0197] If, within the first time interval after retransmitting the relay discovery message, the gateway device receives a relay announcement message from the relay device, it can obtain the priority value carried in the relay announcement message and record the priority value of the relay device. Furthermore, it establishes an AMT tunnel with the relay device, enabling the relay device to participate in subsequent load balancing.
[0198] 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, the priority values and load values of each relay device can be used to distribute different multicast streams to multiple relay devices in a load-sharing manner, thereby making full use of the network resources of the relay devices and improving multicast forwarding efficiency.
[0199] In some embodiments of this application, the priority value of the relay device may change because the multicast service quality of the relay device may change. In order to obtain the changed priority value of the relay device in a timely manner, after the network device establishes AMT tunnels with a first number of relay devices and records the priority values of the first number of relay devices, the gateway device may also execute step AC.
[0200] Step A: Every second preset time interval, send a request message to a first number of relay devices.
[0201] During the process of establishing an AMT tunnel with each relay device, the gateway device will send a request message to the relay device. After receiving the member query message replied by the primary 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. The timeout duration of the periodic query keep-alive timer is the second preset duration.
[0202] Furthermore, whenever the query keep-alive timer expires, the gateway device sends a new request message to the primary relay device.
[0203] 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.
[0204] Step B: Receive the first number of member query messages sent by relay devices. The member query message includes the priority value of the relay device.
[0205] Each time a relay device receives a request message, it can obtain its latest priority value and encapsulate that priority value in a member query message.
[0206] Understandably, after each request message is sent to a relay device, the gateway device can receive a member query message in response from the relay device, thereby enabling the gateway device to periodically obtain the priority value of each relay device.
[0207] Step C: Update the priority values of the first number of recorded relay devices based on the priority values included in the member query message.
[0208] For each of the first number of relay devices, after receiving a member query message from that relay device each time, the priority value of that relay device can be updated to the priority value carried in the member query message.
[0209] It should be noted that, in the above embodiments, for relay devices that do not reply to the relay notification message within the first preset time period, if an AMT tunnel can be successfully established with the relay device later, the recorded priority value of the relay device can also be updated in the manner of steps A-C.
[0210] By using the embodiments of this application, the gateway device can periodically obtain the priority value of the relay device through the keep-alive mechanism between the gateway device and the relay device. This allows for load balancing based on the accurate multicast service quality of each relay device, thereby improving the multicast service quality.
[0211] In this embodiment, the priority value can be determined based on the health parameters of the relay device, including but not limited to the following parameters:
[0212] The number of accessible multicast sources;
[0213] Network quality between the source and the multicast source;
[0214] Failure rate of the transmission path between the multicast source and the multicast source;
[0215] Quality of the routing link between the source and the multicast source.
[0216] Among these, network quality can be categorized as transmission latency, jitter, and packet loss rate between relay devices and multicast sources.
[0217] Relay devices can detect the failure rate of the transmission path between themselves and the multicast source through a detection mechanism, such as a point-to-multiple-point bidirectional forwarding detection (P2MP BFD) mechanism.
[0218] Each health parameter of the relay device corresponds to a preset weight value and threshold. The priority value of the relay device is the sum of the weight values of each health parameter. Each time a health parameter is acquired, if a health parameter is less than its corresponding threshold, the priority value is decreased by the corresponding weight value. This continues until the health parameter is again greater than or equal to its corresponding threshold, at which point the priority value is increased by the corresponding weight value.
[0219] Relay devices can periodically refresh their own priority values.
[0220] In one implementation, the relay device can calculate its own priority value based on its own health parameters.
[0221] In another implementation, the network controller can centrally monitor the health parameters of each relay device, calculate priority values for each relay device, and then issue priority values to each relay device.
[0222] In some embodiments of this application, the above-described S303, 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, can be specifically implemented as follows:
[0223] Obtain the load-sharing weight value for each relay device, filter out the load-sharing weight values that exceed a preset threshold from multiple load-sharing weight values, and select the relay device with the smallest load value from the relay devices corresponding to the filtered load-sharing weight values as the target relay device.
[0224] The gateway device can obtain the load-sharing weight value of each relay device through one of the following two methods:
[0225] Method 1: Determine the weight value corresponding to the priority value of each relay device based on the preset mapping relationship between priority values and weight values.
[0226] The higher the priority value, the greater the weighting value. The above-mentioned preset mapping relationship can be preset based on experience.
[0227] Method 2: For each relay device, determine the weighting value of that relay device as the ratio between the priority value of that relay device and the sum of the priority values of multiple relay devices.
[0228] If there are N relay devices participating in load balancing, and the priority values of the N relay devices are priority-1 to priority-N respectively, then the load balancing weight of relay device n is:
[0229] priority-n / (priority-1+priority-2+……+Priority-N)*100.
[0230] The value of n ranges from 1 to N.
[0231] The above formula allows for the calculation of the load-sharing weight value for each relay device. Weight values exceeding a preset threshold can then be filtered out. This preset threshold can be set based on experience.
[0232] If the weighting values of relay devices 1, 3, and 5 out of N relay devices are greater than a preset threshold, then the load values of relay devices 1, 3, and 5 can be compared.
[0233] If the load value of relay device 1 is the smallest, then relay device 1 can be used as the target relay device.
[0234] 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. After selecting a target relay device for a multicast group, the load value of the target relay device can be incremented by 1.
[0235] Optionally, the method for selecting the target relay device in this embodiment is not limited to this. Other load-sharing methods can also be used, based on the priority value and load value of each relay device, to select a target relay device for the multicast group from multiple relay devices. This embodiment does not specifically limit this.
[0236] For example, the load sharing value of each relay device can be determined sequentially in descending order of the load sharing weight value 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 selected as the target relay device.
[0237] Specifically, you can first select the largest sharing weight value. If the load value of the relay device corresponding to the largest sharing weight value is less than the preset load value threshold, then the relay device is selected as the target relay device. If the load value of the relay device is greater than or equal to the preset load value threshold, then 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 value threshold, then the relay device is selected as the target relay device. Otherwise, continue to select the next sharing weight value, and so on, until the target relay device is selected.
[0238] By adopting the above technical solution, the gateway device can select the target relay device for the multicast group by comprehensively considering 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 that are overloaded or have poor multicast service quality, make full use of the relay device resources, and improve multicast forwarding efficiency.
[0239] In some embodiments of this application, after the gateway device selects a target relay device for a multicast group, the multicast data stream of the multicast group will continue to be forwarded by the target relay device 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.
[0240] However, if the gateway device detects that the target relay device is unreachable through the keep-alive mechanism, i.e., the target relay device is faulty, after sending the first member update message to the target relay device in S304 above, the method further includes:
[0241] If the target relay device fails, obtain the priority value of each relay device other than the target relay device among the multiple relay devices;
[0242] Based on the priority value and load value of each relay device, a new target relay device is selected for the multicast group from among the relay devices other than the target relay device.
[0243] A second member update message is sent to the reselected target relay device. The second member update message includes information about the multicast group so that the reselected target relay device can forward the multicast data stream of the multicast group to the multicast receiver.
[0244] The method for reselecting the target relay device is the same as the method for selecting the target relay device described in the above embodiments. For each multicast group that is responsible for by the faulty target relay device, the target relay device must be reselected in the relay device group.
[0245] In this way, after a target relay device fails, a new target relay device can be selected for the multicast group that the failed target relay device is responsible for, which can improve the reliability of the AMT tunnel and avoid multicast service interruption.
[0246] Based on the above embodiments, this application adds priority values to both member query messages and relay announcement messages. The message formats of member query messages and relay announcement messages are described below.
[0247] In one embodiment of this application, the member query message includes a first flag bit field and a priority field. When the first flag bit field takes the first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0248] In addition, the member query message also includes a second flag field.
[0249] If the second flag field takes the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field.
[0250] If the value of the second flag field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and adjacent to the encapsulation information.
[0251] For example, the first value can be 1, and the second value can be 0.
[0252] As an example, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of a member query message when the second flag field is set to the first value.
[0253] The member 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.
[0254] In this context, the Version field has a value of 0, and the Type field has a value of 4. If the gateway device and the relay device communicate using the IPv4 protocol, the regular query message is a Membership Query based on the IGMPv3 protocol; if the gateway device and the relay device communicate using the IPv6 protocol, the regular query message is a Listener Query based on the MLDv2 protocol. The gateway device's IP address can be either an IPv4 address or an IPv6 address.
[0255] The first flag field is the P flag field, and the second flag field is the G flag field. When both the P and G flag fields are 1, it indicates that the priority field is located at... Figure 4 After the Gateway IP Address field.
[0256] When the P flag field is 1 and the G flag field is 0, it indicates that the member query message does not include the Gateway Port Number and Gateway IP Address fields, and the priority field is located at... Figure 4 After the Encapsulated General Query Message.
[0257] In another embodiment of this application, the relay notification message includes a priority field, which carries the priority value of the relay device.
[0258] As an example, such as Figure 5 As shown, Figure 5 This is a schematic diagram of a relay announcement message provided in an embodiment of this application. The relay announcement message includes the following fields: Version, Type, Priority, Reserved, Discovery Nonce, and Relay Address. The Version field has a value of 0, the Type field has a value of 2, and the Relay Address field includes either an IPv4 address or an IPv6 address. The Priority field follows and is adjacent to the Type field.
[0259] In the aforementioned 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-255. When the priority field is 0, it indicates that the priority field does not carry the priority value of the relay device.
[0260] like Figure 6As shown, taking a relay equipment group including relay equipment 1 and relay equipment 2 as an example, Figure 6 The flowchart of the multicast tunnel load balancing method provided in the embodiments of this application may include the following steps: S601-S611.
[0261] S601, the gateway device sends relay discovery messages to relay device 1 and relay device 2 respectively. Correspondingly, relay device 1 and relay device 2 receive the relay discovery messages sent by the gateway device.
[0262] 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.
[0263] The relay notification message includes the priority value of relay device 1, Priority-1.
[0264] After S602, execute S604.
[0265] 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.
[0266] After S603, execute S606.
[0267] The relay notification message includes the priority value of relay device 2, Priority-2.
[0268] S604. The gateway device sends a request message to the relay device 1.
[0269] Once the gateway device receives the relay notification message sent by the relay device 1, it can execute S604.
[0270] S605 After receiving the request message, relay device 1 sends a member query message (MembershipQuery) to the gateway device.
[0271] The member query message includes the latest priority value of relay device 1, Priority-1.
[0272] After receiving a member query message from relay device 1, the gateway device can start a periodic query keep-alive timer 1 with relay device 1. Whenever the periodic query keep-alive timer 1 expires, the gateway device is triggered to resend a request message to relay device 1.
[0273] S606, The gateway device sends a request message to the relay device 2.
[0274] Once the gateway device receives the relay notification message sent by the relay device 2, it can execute S606.
[0275] S607 After receiving the request message, relay device 2 sends a member query message (MembershipQuery) to the gateway device.
[0276] The member query message includes the latest priority value of relay device 2, Priority-2.
[0277] After receiving the member query message sent by the relay device 2, the gateway device can start the periodic query keep-alive timer 2 with the relay device 2. Whenever the periodic query keep-alive timer 2 times out, the gateway device is triggered to resend the request message to the relay device 2.
[0278] 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, then S608 continues to be executed.
[0279] S608. The gateway device sends a Membership Update message to relay device 1. Correspondingly, relay device 1 receives the Membership Update message.
[0280] The member update message includes information about the multicast group (S1, G1).
[0281] S609. Relay device 1 sends a multicast data stream of (S1, G1) to the gateway device. Correspondingly, the gateway device receives the multicast data stream of (S1, G1) sent by relay device 1.
[0282] Furthermore, the gateway device can forward the multicast data stream of (S1,G1) to multicast receiver 1.
[0283] 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) according to 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, then S610 continues to be executed.
[0284] S610, the gateway device sends a Membership Update message to the relay device 2. Correspondingly, the relay device 2 receives the Membership Update message.
[0285] The member update message includes information about the multicast group (S1, G2).
[0286] S611, Relay device 2 sends a multicast data stream of (S1, G2) to the gateway device. Correspondingly, the gateway device receives the multicast data stream of (S1, G2) sent by relay device 2.
[0287] Furthermore, the gateway device can forward the multicast data stream of (S1, G2) to multicast receiver 2.
[0288] Using this method, the gateway device can establish AMT tunnels with multiple relay devices simultaneously. When a multicast join request message is received, the gateway device can select a relay device for the multicast group in a load-sharing manner based on the priority value and load value of multiple relay devices. The selected relay device then forwards the multicast data stream of the multicast group requested by the multicast join request, which can improve multicast forwarding efficiency.
[0289] Based on the same concept, embodiments of this application provide a multicast tunnel load balancing device. This device is applied to a gateway device that has established AMT tunnels with multiple relay devices, such as... Figure 7 As shown, the device includes:
[0290] The receiving module 701 is used to receive a multicast join request message sent by a multicast receiver. The multicast join request message includes information about the multicast group.
[0291] The acquisition module 702 is used to acquire the priority value and load value of each of the multiple relay devices. The priority value is used to represent the multicast service quality of the relay device.
[0292] Selection module 703 is used to select a target relay device for a multicast group from multiple relay devices based on the priority value and load value of each relay device;
[0293] The sending module 704 is used to send a first member update message to the target relay device. The first member update message includes information about the multicast group, so that the target relay device can forward the multicast data stream of the multicast group to the multicast receiver.
[0294] Optionally, the gateway device is configured with the anycast address of each relay device in the relay device group. The process of establishing an AMT tunnel between the gateway device and multiple relay devices includes:
[0295] After the gateway device comes online, it sends a relay discovery message to each relay device in the relay device group. Each relay discovery message includes a different anycast address.
[0296] Within a first preset time period, receive a first number of relay announcement messages sent by relay devices, the relay announcement messages including the priority values of the relay devices;
[0297] Establish AMT tunnels between each of the first number of relay devices and record the priority values of the first number of relay devices;
[0298] The priority value of the second number of relay devices is recorded as 0. The second number of relay devices are the relay devices in the relay device group that did not send a relay announcement message within the first preset time period. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0299] Optionally, after recording the priority values of the first number of relay devices, the device further includes an update module:
[0300] The sending module 704 is also used to send a request message to a first number of relay devices every second preset time interval;
[0301] The receiving module 701 is also used to receive a first number of member query messages sent by relay devices, wherein the member query message includes the priority value of the relay device;
[0302] The update module is used to update the priority values of the first number of recorded relay devices based on the priority values included in the member query message.
[0303] Optionally, select module 703, specifically for:
[0304] Obtain the weight value of each relay device;
[0305] From multiple weight values, filter out the weight values that exceed the preset threshold;
[0306] From the relay devices corresponding to the selected weight-sharing values, select the relay device with the smallest load value as the target relay device.
[0307] Optionally, select module 703, specifically for:
[0308] Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or,
[0309] For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of multiple relay devices.
[0310] Optionally, the acquisition module 702 is also used to acquire the priority value of each relay device other than the target relay device among multiple relay devices if the target relay device fails.
[0311] The selection module 703 is also used to reselect a target relay device for the multicast group from among the relay devices other than the target relay device, based on the priority value and load value of each relay device.
[0312] The sending module 704 is also configured to send a second member update message to the reselected target relay device, the second member update message including information about the multicast group, so that the reselected target relay device forwards the multicast data stream of the multicast group for the multicast receiver.
[0313] Optionally, the relay announcement message includes a priority field, which carries the priority value of the relay device.
[0314] Optionally, the member query message includes a first flag field and a priority field. When the first flag field takes the first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0315] Optionally, the member query message may also include a second flag field;
[0316] If the second flag field takes the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field.
[0317] If the value of the second flag field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and adjacent to the encapsulation information.
[0318] Optionally, the priority field occupies 8 reserved bits. When the priority field is 0, it means that the priority field does not carry a priority value.
[0319] Optionally, the priority value is determined based on the health parameters of the relay device, which include any one or more of the following:
[0320] The number of accessible multicast sources;
[0321] Network quality between the source and the multicast source;
[0322] Failure rate of the transmission path between the multicast source and the multicast source;
[0323] Quality of the routing link between the source and the multicast source.
[0324] Optionally, the load value is the number of multicast groups that the relay device is responsible for.
[0325] Based on the same concept, embodiments of this application provide a gateway device, such as... Figure 8 As shown, the gateway device has established AMT tunnels with multiple relay devices. The gateway device includes:
[0326] Processor 801;
[0327] Transceiver 804;
[0328] Machine-readable storage medium 802 stores machine-executable instructions that can be executed by a processor; the machine-executable instructions cause processor 801 to perform the following steps:
[0329] The transceiver 804 receives multicast join request messages sent by multicast receivers. The multicast join request message includes information about the multicast group.
[0330] Obtain the priority value and load value of each of the multiple relay devices. The priority value is used to represent the multicast service quality of the relay device.
[0331] Based on the priority value and load value of each relay device, a target relay device is selected for the multicast group from multiple relay devices;
[0332] The transceiver 804 sends a first member update message to the target relay device. The first member update message includes information about the multicast group, so that the target relay device can forward the multicast data stream of the multicast group to the multicast receiver.
[0333] 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 also cause the processor 801 to perform the following steps:
[0334] After the gateway device comes online, it sends a relay discovery message to each relay device in the relay device group through transceiver 804. Each relay discovery message includes a different anycast address.
[0335] Within a first preset time period, the transceiver 804 receives a first number of relay announcement messages sent by relay devices, the relay announcement messages including the priority values of the relay devices;
[0336] Establish AMT tunnels between each of the first number of relay devices and record the priority values of the first number of relay devices;
[0337] The priority value of the second number of relay devices is recorded as 0. The second number of relay devices are the relay devices in the relay device group that did not send a relay announcement message within the first preset time period. The sum of the first number and the second number is the number of relay devices included in the relay device group.
[0338] Optionally, the machine-executable instructions also cause the processor 801 to perform the following steps:
[0339] Every second preset time interval, a request message is sent to a first number of relay devices via transceiver 804;
[0340] The transceiver 804 receives a first number of member query messages sent by relay devices, the member query messages including the priority values of the relay devices;
[0341] Based on the priority values included in the member query message, update the priority values of the first number of recorded relay devices.
[0342] Optionally, machine-executable instructions cause processor 801 to perform the following steps:
[0343] Obtain the weight value of each relay device;
[0344] From multiple weight values, filter out the weight values that exceed the preset threshold;
[0345] From the relay devices corresponding to the selected weight-sharing values, select the relay device with the smallest load value as the target relay device.
[0346] Optionally, machine-executable instructions cause processor 801 to perform the following steps, including:
[0347] Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or,
[0348] For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of multiple relay devices.
[0349] Optionally, the machine-executable instructions also cause the processor 801 to perform the following steps:
[0350] If the target relay device fails, obtain the priority value of each relay device other than the target relay device among the multiple relay devices;
[0351] Based on the priority value and load value of each relay device, a new target relay device is selected for the multicast group from among the relay devices other than the target relay device.
[0352] The transceiver 804 sends a second member update message to the reselected target relay device. The second member update message includes information about the multicast group, so that the reselected target relay device can forward the multicast data stream of the multicast group to the multicast receiver.
[0353] Optionally, the relay announcement message includes a priority field, which carries the priority value of the relay device.
[0354] Optionally, the member query message includes a first flag field and a priority field. When the first flag field takes the first value, it is used to indicate that the priority field carries the priority value of the relay device.
[0355] Optionally, the member query message may also include a second flag field;
[0356] If the second flag field takes the first value, it means that the priority field is located after the gateway address field and adjacent to the gateway address field.
[0357] If the value of the second flag field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and adjacent to the encapsulation information.
[0358] Optionally, the priority field occupies 8 reserved bits. When the priority field is 0, it means that the priority field does not carry a priority value.
[0359] Optionally, the priority value is determined based on the health parameters of the relay device, which include any one or more of the following:
[0360] The number of accessible multicast sources;
[0361] Network quality between the source and the multicast source;
[0362] Failure rate of the transmission path between the multicast source and the multicast source;
[0363] Quality of the routing link between the source and the multicast source.
[0364] Optionally, the load value is the number of multicast groups that the relay device is responsible for.
[0365] exist Figure 8 The system may also include a communication bus 803. The processor 801, machine-readable storage medium 802, and transceiver 804 communicate with each other via the communication bus 803. The communication bus 803 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0366] The transceiver 804 can be a wireless communication module. Under the control of the processor 801, the transceiver 804 interacts with other devices for data exchange.
[0367] 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 also be at least one storage device located remotely from the aforementioned processor.
[0368] 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, or discrete hardware components.
[0369] Based on the same inventive concept, and according to the multicast tunnel load balancing method provided in the above embodiments of this application, this application also provides a machine-readable storage medium storing machine-executable instructions that can be executed by a processor. The processor is prompted by the machine-executable instructions to implement the steps of the above-described multicast tunnel load balancing method.
[0370] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of the multicast tunnel load balancing method described in the above embodiments.
[0371] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0372] The above are merely 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 within the scope of protection of the present invention.
Claims
1. A method for load balancing in multicast tunnels, characterized in that, Applied to a gateway device that has established AMT tunnels with multiple relay devices, the method includes: Receive a multicast join request message sent by a multicast receiver, wherein the multicast join request message includes information about the multicast group; Obtain the priority value and load value of each of the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device; Based on the priority value and load value of each relay device, a target relay device is selected for the multicast group from the plurality of relay devices; A first member update message is sent to the target relay device, the first member update message including information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to 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 in the relay device group, and the process of establishing an AMT tunnel between the gateway device and the plurality of relay devices includes: After the gateway device comes online, it sends a relay discovery message to each relay device in the relay device group, and each relay discovery message includes a different anycast address. Within a first preset time period, receive a first number of relay notification messages sent by relay devices, wherein the relay notification messages include the priority values of the relay devices; AMT tunnels are established between each of the first number of relay devices, and the priority values of the first number of relay devices are recorded. 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 did not send a relay notification message within the first preset time period. 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: Every second preset time interval, a request message is sent to the first number of relay devices; Receive member query messages sent by the first number of relay devices, wherein the member query message includes the priority value of the relay device; Based on the priority value included in the member query message, update the priority values of the first number of recorded relay devices.
4. The method according to claim 1, characterized in that, The step of selecting a target relay device for the multicast group from the plurality of relay devices based on the priority value and load value of each relay device includes: Obtain the weight value of each relay device; From multiple weight values, filter out the weight values that exceed the preset threshold; From the relay devices corresponding to the selected weight-sharing 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 step of obtaining the weight value of each relay device includes: Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or, For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of the multiple 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, then the priority value of each relay device other than the target relay device is obtained. Based on the priority value and load value of each relay device, a new target relay device is selected for the multicast group from among the relay devices other than the target relay device. A second member update message is sent to the reselected target relay device, the second member update message including information about 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, which carries the priority value of the relay device.
8. The method according to claim 3, characterized in that, The member query message includes a first flag field and a priority field. When the first flag field takes the 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 field; If the second flag field takes 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 field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and 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 is 0, it means 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 parameters of the relay device, which include any one or more of the following: The number of accessible multicast sources; Network quality between the source and the multicast source; Failure rate of the transmission path between the multicast source and the multicast source; Quality of the routing link between the source and the multicast source.
12. The method according to claim 1, characterized in that, The load value is the number of multicast groups handled by the relay device.
13. A multicast tunnel load balancing device, characterized in that, Applied to a gateway device that has established AMT tunnels with multiple relay devices, the device includes: The receiving module is used to receive multicast join request messages sent by multicast receivers, wherein the multicast join request message includes information about the multicast group; The acquisition module is used to acquire the priority value and load value of each of the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device; The selection module is used to select a target relay device for the multicast group from the plurality of relay devices based on the priority value and load value of each relay device; The sending module is configured to send a first member update message to the target relay device, the first member update message including information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
14. The apparatus according to claim 13, characterized in that, The gateway device is configured with the anycast address of each relay device in the relay device group, and the process of establishing an AMT tunnel between the gateway device and the plurality of relay devices includes: After the gateway device comes online, it sends a relay discovery message to each relay device in the relay device group, and each relay discovery message includes a different anycast address. Within a first preset time period, receive a first number of relay notification messages sent by relay devices, wherein the relay notification messages include the priority values of the relay devices; AMT tunnels are established between each of the first number of relay devices, and the priority values of the first number of relay devices are recorded. 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 did not send a relay notification message within the first preset time period. The sum of the first number and the second number is the number of relay devices included in the relay device group.
15. The apparatus according to claim 14, characterized in that, After recording the priority values of the first number of relay devices, the device further includes an update module: The sending module is also used to send a request message to the first number of relay devices every second preset time interval; The receiving module is further configured to receive member query messages sent by the first number of relay devices, wherein the member query message includes the priority value of the relay device; The update module is used 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.
16. The apparatus according to claim 13, characterized in that, The selection module is specifically used for: Obtain the weight value of each relay device; From multiple weight values, filter out the weight values that exceed the preset threshold; From the relay devices corresponding to the selected weight-sharing values, the relay device with the smallest load value is selected as the target relay device.
17. The apparatus according to claim 16, characterized in that, The selection module is specifically used for: Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or, For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of the multiple relay devices.
18. The apparatus according to claim 13, characterized in that, The acquisition module is further configured to acquire the priority value of each relay device other than the target relay device among the plurality of relay devices if the target relay device fails. The selection module is also used to reselect a target relay device for the multicast group from among the relay devices other than the target relay device, based on the priority value and load value of each relay device. The sending module is further configured to send a second member update message to the reselected target relay device, the second member update message including 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.
19. The apparatus according to claim 14, characterized in that, The relay notification message includes a priority field, which carries the priority value of the relay device.
20. The apparatus according to claim 15, characterized in that, The member query message includes a first flag field and a priority field. When the first flag field takes the first value, it is used to indicate that the priority field carries the priority value of the relay device.
21. The apparatus according to claim 20, characterized in that, The member query message also includes a second flag field; If the second flag field takes 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 field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and adjacent to the encapsulation information.
22. The apparatus according to claim 19 or 20, characterized in that, The priority field occupies 8 reserved bits. When the priority field is 0, it means that the priority field does not carry a priority value.
23. The apparatus according to claim 13, characterized in that, The priority value is determined based on the health parameters of the relay device, which include any one or more of the following: The number of accessible multicast sources; Network quality between the source and the multicast source; Failure rate of the transmission path between the multicast source and the multicast source; Quality of the routing link between the source and the multicast source.
24. The apparatus according to claim 13, characterized in that, The load value is the number of multicast groups handled by the relay device.
25. A gateway device, characterized in that, The gateway device has established AMT tunnels 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 cause the processor to perform the following steps: The transceiver receives multicast join request messages sent by multicast receivers, and the multicast join request messages include information about the multicast group. Obtain the priority value and load value of each of the plurality of relay devices, wherein the priority value is used to represent the multicast service quality of the relay device; Based on the priority value and load value of each relay device, a target relay device is selected for the multicast group from the plurality of relay devices; The transceiver sends a first member update message to the target relay device, the first member update message including information about the multicast group, so that the target relay device forwards the multicast data stream of the multicast group to the multicast receiver.
26. The gateway device according to claim 25, characterized in that, The gateway device is configured with anycast addresses for 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 comes online, it sends a relay discovery message to each relay device in the relay device group through the transceiver. Each relay discovery message includes a different anycast address. Within a first preset time period, the transceiver receives a first number of relay announcement messages sent by relay devices, the relay announcement messages including the priority values of the relay devices; AMT tunnels are established between each of the first number of relay devices, and the priority values of the first number of relay devices are recorded. 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 did not send a relay notification message within the first preset time period. 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 also cause the processor to perform the following steps: Every second preset time interval, a request message is sent to the first number of relay devices through the transceiver; The transceiver receives the first number of member query messages sent by the relay devices, wherein the member query message includes the priority value of the relay device; Based on the priority value included in the member query message, update the priority values of the first number of recorded relay devices.
28. The gateway device according to claim 25, characterized in that, The machine-executable instructions cause the processor to perform the following steps: Obtain the weight value of each relay device; From multiple weight values, filter out the weight values that exceed the preset threshold; From the relay devices corresponding to the selected weight-sharing 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: Based on a preset mapping relationship between priority values and sharing weight values, the sharing weight value corresponding to the priority value of each relay device is determined; or, For each relay device, the weighting value of that relay device is determined as the ratio between the priority value of that relay device and the sum of the priority values of the multiple relay devices.
30. The gateway device according to claim 25, characterized in that, The machine-executable instructions also cause the processor to perform the following steps: If the target relay device fails, then the priority value of each relay device other than the target relay device is obtained. Based on the priority value and load value of each relay device, a new target relay device is selected for the multicast group from among the relay devices other than the target relay device. The transceiver sends a second member update message to the reselected target relay device, the second member update message including information about 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, which carries the priority value of the relay device.
32. The gateway device according to claim 27, characterized in that, The member query message includes a first flag field and a priority field. When the first flag field takes the 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 field; If the second flag field takes 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 field is the second value, it means that the priority field is located after the encapsulation information of the regular query message and 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 is 0, it means 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 parameters of the relay device, which include any one or more of the following: The number of accessible multicast sources; Network quality between the source and the multicast source; Failure rate of the transmission path between the multicast source and the multicast source; Quality of the routing link between the source and the multicast source.
36. The gateway device according to claim 25, characterized in that, The load value is the number of multicast groups handled by the relay device.
37. A machine-readable storage medium, characterized in that, The device stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implement the method of any one of claims 1-12.
38. A computer program product, characterized in that, The computer program product causes the processor to implement the method of any one of claims 1-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