Main-backup switching method, device, gateway device, and storage medium

The main-backup switching method in a gateway device ensures timely and high-quality multicast service delivery by switching between primary and backup relay devices based on their priority values, addressing the issue of service quality degradation.

JP2026509324APending Publication Date: 2026-03-18NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2026-03-18

AI Technical Summary

Technical Problem

Existing multicast receivers may fail to obtain multicast data in a timely manner due to failures or deteriorations in the transfer path of the relay device, affecting the quality of multicast services.

Method used

A main-backup switching method is implemented in a gateway device to switch between primary and backup relay devices based on their priority values, which indicate the quality of multicast service, ensuring timely data delivery by maintaining a high-quality relay connection.

Benefits of technology

The method prevents decreases in multicast service quality by switching to a backup relay when the primary relay's quality deteriorates, thereby maintaining consistent and high-quality multicast service delivery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026509324000001_ABST
    Figure 2026509324000001_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a main-backup switching method, apparatus, gateway device, and storage medium, relating to the field of network communication technology and applicable to gateway devices. The method includes obtaining the priority values ​​of a main relay device and a backup relay device, and switching between the main relay device and the backup relay device if the relationship between the priority values ​​of the main relay device and the backup relay device satisfies a preset switching condition. According to embodiments of the present invention, the quality of multicast services can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and particularly relates to a main-backup switching method, apparatus, gateway device, and storage medium.

Background Art

[0002] By using the Automatic Multicast Tunneling (AMT) protocol, even multicast receivers that do not support the native multicast protocol can connect to a multicast source and receive multicast traffic from the multicast source.

[0003] The AMT protocol adopts a relay arrangement method. The gateway identifies the relay device with the shortest distance in an anycast manner, and further, the gateway joins the multicast group maintained by this relay device as a multicast member, thereby successfully establishing an AMT tunnel between the gateway and this relay device. After receiving multicast data from the multicast source, the relay device can send the multicast data to the gateway via the AMT tunnel, and the gateway sends the multicast data to the multicast receiver.

[0004] After successfully establishing the AMT tunnel, if this relay device is always the closest to the gateway in terms of topology and the routing between this relay device and the gateway is maintained, the gateway can always obtain multicast data via this relay device. In this case, if a failure occurs in the transfer path between this relay device and the multicast source or the transmission quality deteriorates, the gateway cannot timely obtain the multicast data transmitted from this relay device, and further, the multicast receiver cannot timely obtain the multicast data, which affects the quality of the multicast service. [Overview of the Initiative] [Problems that the invention aims to solve]

[0005] Embodiments of the present invention provide a main-backup switching method, apparatus, gateway device, and storage medium to prevent multicast receivers from being unable to obtain multicast data in a timely manner, thereby avoiding impacts on the quality of service. The specific technical means are as follows: [Means for solving the problem]

[0006] In a first aspect, an embodiment of the present invention provides a main-backup switching method, the method being applied to a gateway device. The method is This involves obtaining the priority value of the main relay device and the priority value of the backup relay device, wherein the priority value indicates the quality of the multicast service of the relay device. This includes switching between the main relay device and the backup relay device if the relationship between the priority value of the main relay device and the priority value of the backup relay device satisfies a predetermined switching condition.

[0007] In one possible implementation, the method further includes: After the gateway device comes online, it sends a relay discovery packet to each of the multiple relay devices, and each relay discovery packet contains a different anycast address. If a relay advertisement packet transmitted from one relay device is received within the first preset time, the relay device that transmitted the relay advertisement packet is designated as the main relay device, or if multiple relay advertisement packets transmitted from multiple relay devices are received within the first preset time, the main relay device is selected from the multiple relay devices, provided that the relay advertisement packet transmitted from the main relay device carries the maximum priority value. This includes establishing an AMT tunnel with the aforementioned main relay equipment.

[0008] In one possible implementation, obtaining the priority value of the main relay device and the priority value of the backup relay device is: Send a request packet to the main relay device at every second preset time interval, Receiving a membership query packet transmitted from the main relay device, wherein the membership query packet contains the priority value of the main relay device. Sending relay discovery packets to the backup relay device at the first preset time intervals, Receiving relay advertisement packets transmitted from the backup relay device, wherein the relay advertisement packets include the priority value of the backup relay device.

[0009] In one possible implementation, if the relative priority values ​​of the main relay device and the backup relay device satisfy a predetermined switching condition, then switching between the main relay device and the backup relay device is performed. If the priority value of the backup relay device is higher than the priority value of the main relay device, the main relay device and the backup relay device will be switched over, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started, and if the priority value of the last acquired backup relay device is greater than the priority value of the main relay device before the main-backup switching timer times out, the main relay device and the backup relay device are switched, or The system includes: if the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started; and if, before the main-backup switching timer times out, the priority values ​​of all acquired backup relay devices are greater than the priority value of the main relay device, a switch is performed between the main relay device and the backup relay device.

[0010] In one possible implementation, switching between the main relay device and the backup relay device is performed as follows: Sending a request packet to the aforementioned backup relay device, When a membership query packet is received from the backup relay device, a membership update packet is sent to the backup relay device and the periodic query keep-alive timer between the main relay device and the backup relay device is stopped, wherein the timeout time of the periodic query keep-alive timer is the second preset time. If membership query packets sent from the main relay device are not received within the third preset time, the AMT tunnel information between the main relay device and the main relay device is deleted.

[0011] In one possible implementation, after deleting the AMT tunnel information between the main relay device, the method further: This includes sending a relay discovery packet to the main relay device at each of the first preset time intervals, After receiving the membership query packet transmitted from the backup relay device, the method further: This includes sending a request packet to the backup relay device at each of the second preset time intervals.

[0012] In one possible implementation, the membership query packet includes a first flag bit field and a priority field, wherein the first flag bit field has a first value, indicating that the priority field holds the priority value of the main relay device.

[0013] In one possible implementation, the membership query packet further includes a second flag bit field, If the second flag bit field has a first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. If the second flag bit field has a value of 2, it indicates that the priority field is located after the encapsulation information of a normal query message and adjacent to the encapsulation information.

[0014] In one possible implementation, the relay advertisement packet includes a priority field, the priority field holding the priority value of the backup relay device.

[0015] In one possible implementation, the priority field occupies 8 reserved bits, and a value of 0 in the priority field indicates that the priority field does not carry a priority value.

[0016] In one possible implementation, the priority value is determined based on the health parameters of the relay equipment, which include one or more of the following: the number of accessible multicast sources, the network quality to and from the multicast sources, the failure rate of the transmission path to and from the multicast sources, and the routing link quality to and from the multicast sources.

[0017] In a second aspect, an embodiment of the present invention provides a main-backup switching device that is applied to gateway equipment. The device is An acquisition module that acquires the priority value of the main relay device and the priority value of the backup relay device, wherein the priority value indicates the quality of the multicast service of the relay device, The system includes a switching module that switches between the main relay device and the backup relay device when the relationship between the priority value of the main relay device and the priority value of the backup relay device satisfies a preset switching condition.

[0018] In one possible implementation, the device further includes: a transmission module configured to transmit relay discovery packets to a plurality of relay devices respectively after the gateway device goes online, wherein each of the relay discovery packets includes a different multicast address; a selection module configured to, when receiving a relay advertisement packet transmitted from one relay device within a first preset time, set the relay device that transmitted the relay advertisement packet as the main relay device, or, when receiving a plurality of relay advertisement packets transmitted from a plurality of relay devices within the first preset time, select a main relay device from the plurality of relay devices, wherein the relay advertisement packet transmitted from the main relay device carries the maximum value of the priority value; and an establishment module configured to establish an AMT tunnel with the main relay device.

[0019] In one possible implementation, specifically, the acquisition module is configured to: transmit a request packet to the main relay device every second preset time; receive a membership query packet transmitted from the main relay device, wherein the membership query packet includes the priority value of the main relay device; transmit a relay discovery packet to the backup relay device every first preset time; receive a relay advertisement packet transmitted from the backup relay device, wherein the relay advertisement packet includes the priority value of the backup relay device.

[0020] In one possible implementation, specifically, the switching module is configured to: switch between the main relay device and the backup relay device when the priority value of the backup relay device is greater than the priority value of the main relay device, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started, and if the priority value of the last acquired backup relay device is greater than the priority value of the main relay device before the main-backup switching timer times out, the main relay device and the backup relay device are switched, or This system is used to activate a main-backup switching timer if the priority value of the backup relay device is greater than the priority value of the main relay device, and to switch between the main relay device and the backup relay device if, before the main-backup switching timer times out, the priority values ​​of all the acquired backup relay devices are greater than the priority value of the main relay device.

[0021] In one possible implementation, the switching module specifically, Sending a request packet to the aforementioned backup relay device, When a membership query packet is received from the backup relay device, a member update packet is sent to the backup relay device and the periodic query keep-alive timer between it and the main relay device is stopped, wherein the timeout time of the periodic query keep-alive timer is the second preset time. If a membership query packet sent from the main relay device is not received within the third preset time, the AMT tunnel information between the main relay device and the main relay device is deleted.

[0022] In one possible implementation, the switching module is further used to transmit relay discovery packets to the main relay device at the first preset time intervals. The switching module is further used to send request packets to the backup relay device at the second preset time intervals.

[0023] In one possible implementation, the membership query packet includes a first flag bit field and a priority field, wherein the first flag bit field has a first value, indicating that the priority field holds the priority value of the main relay device.

[0024] In one possible implementation, the membership query packet further includes a second flag bit field, If the second flag bit field has a first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. If the second flag bit field has a value of 2, it indicates that the priority field is located after the encapsulation information of a normal query message and adjacent to the encapsulation information.

[0025] In one possible implementation, the relay advertisement packet includes a priority field, the priority field holding the priority value of the backup relay device.

[0026] In one possible implementation, the priority field occupies 8 reserved bits, and a value of 0 in the priority field indicates that the priority field does not carry a priority value.

[0027] In one possible implementation, the priority value is determined based on the health parameters of the relay equipment, which include one or more of the following: the number of accessible multicast sources, the network quality to and from the multicast sources, the failure rate of the transmission path to and from the multicast sources, and the routing link quality to and from the multicast sources.

[0028] In a third aspect, an embodiment of the present invention provides a gateway device, the gateway device is, Processor and Transmitter and receiver, The system comprises a machine-readable storage medium in which machine-executable instructions that can be executed by the processor are stored, The machine-executable instruction is given to the processor, This involves obtaining the priority value of the main relay device and the priority value of the backup relay device, wherein the priority value indicates the quality of the multicast service of the relay device. If the relationship between the priority value of the main relay device and the priority value of the backup relay device satisfies a preset switching condition, the system will perform a switch between the main relay device and the backup relay device.

[0029] In one possible implementation, the machine-executable instruction further provides the processor with: After the gateway device comes online, the transceiver sends relay discovery packets to each of the multiple relay devices, and each relay discovery packet contains a different anycast address. If the transceiver receives a relay advertisement packet transmitted from one relay device within a first preset time, the relay device that transmitted the relay advertisement packet is designated as the main relay device, or if the transceiver receives multiple relay advertisement packets transmitted from multiple relay devices within the first preset time, the main relay device is selected from the multiple relay devices, provided that the relay advertisement packet transmitted from the main relay device carries the maximum priority value. The system establishes an AMT tunnel with the aforementioned main relay device and performs the following actions.

[0030] In one possible implementation, the machine-executable instruction further provides the processor with: The transceiver transmits a request packet to the main relay device at every second preset time interval, The transceiver receives a membership query packet transmitted from the main relay device, wherein the membership query packet contains the priority value of the main relay device. The transceiver transmits a relay discovery packet to the backup relay device at each of the first preset time intervals, The transceiver receives relay advertisement packets transmitted from the backup relay device, and the relay advertisement packets include the priority value of the backup relay device.

[0031] In one possible implementation, the machine-executable instruction further provides the processor with: If the priority value of the backup relay device is higher than the priority value of the main relay device, the main relay device and the backup relay device will be switched over, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started, and if the priority value of the last acquired backup relay device is greater than the priority value of the main relay device before the main-backup switching timer times out, the main relay device and the backup relay device are switched, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started. If, before the main-backup switching timer times out, the priority values ​​of all acquired backup relay devices are greater than the priority value of the main relay device, the system will perform a switch between the main relay device and the backup relay device.

[0032] In one possible implementation, the machine-executable instruction further provides the processor with: The transceiver transmits the request packet to the backup relay device, When the transceiver receives a membership query packet transmitted from the backup relay device, the transceiver sends a membership update packet to the backup relay device and stops the periodic query keep-alive timer between it and the main relay device, wherein the timeout time of the periodic query keep-alive timer is the second preset time. If the transceiver does not receive a membership query packet transmitted from the main relay device within the third preset time, the AMT tunnel information between the transceiver and the main relay device is deleted.

[0033] In one possible implementation, the machine-executable instruction further provides the processor with: The transceiver is instructed to transmit a relay discovery packet to the main relay device at each of the first preset time intervals. The aforementioned machine-executable instructions are further provided to the processor, The transceiver is instructed to send a request packet to the backup relay device at each of the second preset time intervals.

[0034] In one possible implementation, the membership query packet includes a first flag bit field and a priority field, wherein the first flag bit field has a first value, indicating that the priority field holds the priority value of the main relay device.

[0035] In one possible implementation, the membership query packet further includes a second flag bit field, If the second flag bit field has a first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. If the second flag bit field has a value of 2, it indicates that the priority field is located after the encapsulation information of a normal query message and adjacent to the encapsulation information.

[0036] In one possible implementation, the relay advertisement packet includes a priority field, the priority field holding the priority value of the backup relay device.

[0037] In one possible implementation, the priority field occupies 8 reserved bits, and a value of 0 in the priority field indicates that the priority field does not carry a priority value.

[0038] In one possible implementation, the priority value is determined based on the health parameters of the relay equipment, and the health parameters are Number of accessible multicast sources, Network quality between multicast source and network source, Failure rate of the transmission path between multicast sources, This includes one or more of the routing link quality characteristics between the multicast source and the destination.

[0039] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium in which machine-executable instructions are stored, and when called and executed by a processor, the machine-executable instructions cause the processor to perform a step of the method according to any one of the first aspects.

[0040] In a fifth aspect, an embodiment of the present invention provides a computer program product which causes the processor to implement the steps of the method according to any one of the first aspects. [Effects of the Invention]

[0041] According to the above technical means, in an embodiment of the present invention, a relay device communicating with a gateway device comprises a main relay device and a backup relay device, and when the relative priority values ​​of the main relay device and the backup relay device satisfy a preset switching condition, a switch between the main relay device and the backup relay device can be performed. Since the priority value indicates the quality of the multicast service of the relay device, that is, the gateway device can perform a main-to-backup switch for the relay device based on the quality of the multicast service of the relay device. This makes it possible to avoid the quality of multicast service from the gateway device to multicast receivers being affected by a decrease in the quality of multicast service of one relay device, and to improve the quality of multicast service of the gateway device. [Brief explanation of the drawing]

[0042] The drawings described herein are for further understanding of the present invention and constitute part of the present invention. Exemplary embodiments and their descriptions are for illustrative purposes only and do not constitute an inappropriate limitation to the present invention.

[0043] [Figure 1] Figure 1 is a schematic diagram of an AMT network architecture provided in an embodiment of the present invention. [Figure 2] Figure 2 is a flowchart illustrating a method for establishing an AMT tunnel between a gateway device and a relay device provided in an embodiment of the present invention. [Figure 3] Figure 3 is a flowchart of the main-backup switching method provided in an embodiment of the present invention. [Figure 4] Figure 4 is an illustrative schematic diagram of a membership query packet provided in an embodiment of the present invention. [Figure 5] Figure 5 is an exemplary schematic diagram of a relay advertisement packet provided in an embodiment of the present invention. [Figure 6]Figure 6 is a flowchart of another main-backup switching method provided in an embodiment of the present invention. [Figure 7] Figure 7 is a flowchart of another main-backup switching method provided in an embodiment of the present invention. [Figure 8] Figure 8 is a schematic diagram of the structure of a main-backup switching device provided in an embodiment of the present invention. [Figure 9] Figure 9 is a schematic diagram of the structure of a gateway device provided in an embodiment of the present invention. [Modes for carrying out the invention]

[0044] The present invention will be described in more detail below with reference to the drawings, with reference to examples, in order to further clarify its objectives, technical proposals, and advantages. Clearly, the examples described are only some, and not all, examples of the present invention. All other examples that can be obtained by those skilled in the art based on the examples of the present invention are all within the scope of protection of the present invention.

[0045] To facilitate understanding of the technical concepts provided in the embodiments of the present invention, first, the AMT network architecture according to the embodiments of the present invention will be described. As shown in Figure 1, the AMT network architecture comprises 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.

[0046] The number of devices shown in Figure 1 is merely illustrative and, in reality, is not limited to this number.

[0047] Here, a multicast receiver may be a site, host, or application program that does not support multicast routing protocols but needs to receive multicast data.

[0048] The gateway device is located in a network that does not support multicast routing protocols, and multicast receivers can access the gateway device.

[0049] Each relay device can connect to at least one multicast source. For example, both relay devices R1 and R2 in Figure 1 are connected to multicast sources S1, S2, and S3.

[0050] The gateway device can establish an AMT tunnel with a relay device using the anycast method, and furthermore, can receive multicast data from a multicast source transmitted from the relay device via the AMT tunnel.

[0051] In Figure 1, as an example, a gateway device establishes an AMT tunnel with relay device R1. After receiving multicast data from any multicast source, relay device R1 can forward the multicast data to the gateway device via the AMT tunnel. Furthermore, the gateway device can forward the multicast data to multicast receivers.

[0052] The following describes the process by which the gateway device establishes an AMT tunnel with the relay device.

[0053] As shown in Figure 2, the process by which the gateway device establishes an AMT tunnel with the relay device includes the following steps.

[0054] S201, the gateway device sends a Relay Discovery packet to the relay device.

[0055] Here, relay devices supporting the AMT protocol advertise routing with the same IP address prefix, and after the gateway device learns these routes, it can generate anycast addresses based on that IP address prefix. For example, an anycast address includes that IP address prefix, and all the remaining bits are set to 0.

[0056] When a gateway device sends a relay discovery packet based on an anycast address, the gateway device forwards the relay discovery packet to the relay device that is closest in the topology and has already advertised the IP address prefix, based on its anycast routing table.

[0057] Preferably, the relay discovery packet includes a nonce.

[0058] S202, after receiving a relay discovery packet, the relay device sends a relay advertisement packet to the gateway device.

[0059] After receiving a relay discovery packet, the relay device can obtain a nonce from the packet. Furthermore, the relay advertisement packet transmitted from the relay device contains this nonce and the relay device's unicast Internet Protocol (IP) address.

[0060] After receiving a relay advertisement packet, the gateway device verifies whether the nonce in the relay advertisement packet matches the nonce it itself sent. If they match, the gateway device can then use the unicast IP address in the relay advertisement packet when communicating with the relay device using the AMT protocol.

[0061] Here, steps S201 to S202 above represent the relay device discovery stage, and through these steps, the gateway device can identify relay devices with which it can establish an AMT tunnel.

[0062] S203, the gateway device sends a request packet to the relay device. In response, the relay device receives the request packet.

[0063] Here, the request packet contains a request nonce and a query identifier, which indicates whether the relay device needs to send back a packet containing either an Internet Group Management Protocol (IGMPv3) normal query message or a Multicast Listener Discover (MLDv2) normal query message to the gateway device.

[0064] For example, the query identifier can be 1 or 0. If the query identifier is 1, it instructs the relay device to send a packet containing an IGMPv3 normal query message or an MLDv2 normal query message to the gateway device. If the query identifier is 0, it instructs the relay device to not send a packet containing an IGMPv3 normal query message or an MLDv2 normal query message to the gateway device.

[0065] S204, the relay device sends a Membership Query packet to the gateway device. In response, the gateway device receives the Membership Query packet.

[0066] After receiving a request packet, the relay device can extract information such as the source IP address, source User Datagram Protocol (UDP) port, request nonce, and secret key from the request information, and then calculate a hash digest from the extracted information to obtain a message authentication code.

[0067] Furthermore, the relay device can send a membership query packet back to the gateway device, which includes the request nonce, message authentication code, and either an IGMPv3 or MLDv2 normal query message.

[0068] S205, the gateway device sends a Membership Update packet to the relay device.

[0069] After receiving a membership query packet, the gateway device can verify whether the request nonce in the membership query packet matches the request nonce contained in the request packet it itself sent.

[0070] If a match is found, the gateway device can activate a periodic query keep-alive timer (Query Timer), and each time the periodic query keep-alive timer times out, the gateway device triggers the relay device to send new request information.

[0071] Simultaneously, the gateway device stores the request nonce and message authentication code, retrieves the IGMPv3 normal query message or MLDv2 normal query message within the membership query packet, and the IGMP protocol module in the gateway device processes the IGMPv3 normal query message, or the MLD protocol module processes the MLDv2 normal query message.

[0072] After a gateway device receives a multicast join request from a multicast receiver, the gateway device can send a membership update packet to a relay device.

[0073] Here, the membership renewal packet includes a request nonce, a message authentication code, and either an IGMPv3 report message or an MLDv2 report message.

[0074] Furthermore, when a gateway device periodically sends request information to a relay device using a periodic query keep-alive timer, the nonce carried in the membership update packet sent each time by the gateway device is understood to be the request nonce in the last membership query packet received by the gateway device, and the message authentication code carried is understood to be the message authentication code in the last membership query packet received by the gateway device.

[0075] S206, the relay device sends multicast data packets to the gateway device.

[0076] After receiving a membership update packet, the relay device calculates a message authentication code based on information within the packet, such as the source IP address, source UDP port, request nonce, and secret key. If the calculated message authentication code matches the message authentication code in the membership update packet, the relay device receives and processes the packet, successfully establishing an AMT tunnel between the gateway device and the relay device. If the calculated message authentication code differs from the message authentication code in the membership update packet, the relay device ignores the membership update packet.

[0077] After an AMT tunnel is established between the gateway device and the relay device, if the relay device receives multicast data from a multicast source and the gateway device determines that it belongs to the multicast group corresponding to that multicast source, i.e., if the gateway device is interested in the multicast data of that multicast source, the relay device can encapsulate the multicast data in a multicast data packet and then transmit the multicast data packet to the gateway device via the AMT tunnel.

[0078] After receiving a multicast data packet, the gateway device extracts the multicast data from the multicast data packet and sends that multicast data to the multicast recipient.

[0079] Referring to Figure 1, assuming that the gateway device and relay device R1 are closest and that an AMT tunnel has been successfully established between them, if a failure occurs in the forwarding path between relay device R1 and the multicast source, or if the transmission quality deteriorates, it will affect the quality of service.

[0080] To solve the above problems, an embodiment of the present invention provides a main-backup switching method, which is applied to gateway equipment. As shown in Figure 3, the method includes the following steps.

[0081] S301 retrieves the priority values ​​of the main relay device and the backup relay device.

[0082] Here, the priority value indicates the quality of the multicast service provided by the relay device. The higher the quality of the multicast service provided by the relay device, the higher its priority value. The lower the quality of the multicast service provided by the relay device, the lower its priority value.

[0083] An AMT tunnel has already been established between the main relay device and the gateway device, but no AMT tunnel has been established between the backup relay device and the gateway device. There is one main relay device, and there may be one or more backup relay devices, which can be configured according to the actual situation. In the embodiment of the present invention, the case where there is one backup relay device will be described as an example.

[0084] S302: If the relationship between the priority value of the main relay device and the priority value of the backup relay device satisfies the pre-set switching conditions, the main relay device and the backup relay device are switched over.

[0085] In this context, switching between the main relay device and the backup relay device means switching the current main relay device to the backup relay device, and then switching the current backup relay device back to the main relay device.

[0086] Furthermore, in the main-backup switching process, the gateway device can disconnect the AMT tunnel with the main relay device, and after the AMT tunnel with the main relay device is disconnected, the main relay device is switched to the backup relay device. Accordingly, the gateway device needs to establish an AMT tunnel with the backup relay device, and after the AMT tunnel with the backup relay device is established, the backup relay device is switched to the main relay device, thereby achieving the main-backup switching.

[0087] According to an embodiment of the present invention, a relay device communicating with a gateway device comprises a main relay device and a backup relay device. When the relative priority values ​​of the main relay device and the backup relay device satisfy a preset switching condition, the main relay device and the backup relay device can be switched. Since the priority value indicates the quality of the relay device's multicast service, the gateway device can perform a main-to-backup switch for the relay device based on the quality of the relay device's multicast service. This prevents a decrease in the quality of the multicast service from one relay device to multicast receivers from affecting the quality of the multicast service from the gateway device, thereby improving the quality of the multicast service from the gateway device.

[0088] In an embodiment of the present invention, in order for the gateway device to perform a main-backup switchover according to the flow shown in Figure 2, the gateway device must first identify the main relay device and the backup relay device. After the gateway device comes online, it can identify the main relay device and the backup relay device as follows.

[0089] After the gateway device comes online, it sends relay discovery packets to multiple relay devices, and each relay discovery packet contains a different anycast address.

[0090] Preferably, if there is one backup relay device, each relay device can be pre-configured with two relay addresses, where the two relay addresses have different IP address prefixes, and the forwarding paths between the gateway device and the two relay addresses are different. Furthermore, each relay device advertises routing for two different IP address prefixes, and the gateway device can learn the routing advertised by the relay devices.

[0091] In response to this, the gateway device can create one pseudo-interface for both the main relay device and the backup relay device, and arrange these two pseudo-interfaces in a mutual backup relationship. For each pseudo-interface, a Relay Discovery Address Prefix and a Relay Discovery Address associated with that Relay Discovery Address Prefix are assigned.

[0092] For example, the Relay Discovery Address Prefix placed on pseudo-interface 1 is one of the IP address prefixes advertised by the relay device, and the Relay Discovery Address Prefix placed on pseudo-interface 2 is another of the IP address prefixes advertised by the relay device.

[0093] Alternatively, the gateway device can create a pseudo-interface and simultaneously place two Relay Discovery Address Prefixes and two Relay Discovery Addresses on that pseudo-interface.

[0094] Assuming that the above relay discovery address is an anycast address, and that the two relay discovery addresses placed on the gateway device are anycast address 1 and anycast address 2, it is understood that the destination address of one transmitted relay discovery packet is anycast address 1, and that this relay discovery packet can be routed to the relay device closest to the gateway device according to anycast address 1. Similarly, the destination address of another relay discovery packet sent from the gateway device is anycast address 2, and that relay discovery packet is routed to the relay device closest to the gateway device according to anycast address 2. Since the pology path between the gateway device and anycast address 1 is different from the pology path between the gateway device and anycast address 2, the two relay discovery packets sent from the gateway device are sent to two different relay devices.

[0095] After the gateway device sends the two relay discovery packets mentioned above, if it receives a relay advertisement packet sent from one relay device within the first preset time, it designates the relay device that sent the relay advertisement packet as the main relay device.

[0096] Alternatively, if relay advertisement packets sent from multiple relay devices are received within the first preset time, a main relay device is selected from the multiple relay devices, and the relay advertisement packets sent from the selected main relay device carry the maximum priority value.

[0097] In other words, if relay advertisement packets sent from multiple relay devices are received within the first preset time, and one of those relay advertisement packets has the highest priority value, the relay device corresponding to the relay advertisement packet with the highest priority value will be designated as the main relay device, and the other relay devices will be designated as backup relay devices.

[0098] Preferably, after the gateway device sends the two relay discovery packets described above, it activates an Advertisement Timer, and the timeout period of the Advertisement Timer is the first preset time. In this way, the timer's timeout mechanism can be used to determine whether the first preset time has been reached.

[0099] If the gateway device does not receive a relay advertisement packet sent from any relay device within the first preset time, it may retransmit a relay discovery packet in accordance with the provisions of the AMT protocol.

[0100] After the main relay device is identified, the gateway device can establish an AMT tunnel with the main relay device. The method by which the gateway device establishes the AMT tunnel with the main relay device conforms to the provisions of the AMT protocol, but a redundant explanation will be omitted here.

[0101] According to an embodiment of the present invention, the gateway device transmits multiple relay discovery packets, and each relay discovery packet contains a different anycast address. Furthermore, if one relay advertisement packet is received within a first preset time, the relay device that transmitted the relay advertisement packet can be designated as the main relay device, and in this way, the gateway device can establish an AMT tunnel with at least one relay device. Alternatively, if multiple relay advertisement packets are received within a first preset time, the relay device corresponding to the relay advertisement packet with the highest priority value can be designated as the main relay device, thereby enabling the gateway device to provide multicast services to multicast recipients with higher quality.

[0102] In one embodiment of the present invention, the gateway device can continue to acquire the priority values ​​of the main relay device and the backup relay device after establishing an AMT tunnel with the main relay device. The gateway device can acquire the priority value of the main relay device by the following steps A to B, and acquire the priority value of the backup relay device by the following steps C to D.

[0103] Step A: Send the request packet to the main relay device at the second preset time interval.

[0104] Here, the gateway device sends a request packet to the main relay device during the process of establishing an AMT tunnel with the main relay device. After the gateway device receives the membership query packet returned from the main relay device and verifies that the request nonce carried in the membership query packet is correct, it can activate the periodic query keep-alive timer (Query Timer), the timeout period of the periodic query keep-alive timer is the second preset time.

[0105] Furthermore, each time the query keep-alive timer times out, the gateway device sends a new request packet to the main relay device.

[0106] The request packet is a Request packet in the AMT protocol, and the membership query packet is a Membership Query packet in the AMT protocol.

[0107] Step B: The system receives a membership query packet sent from the main relay device, and the membership query packet contains the priority value of the main relay device.

[0108] Each time the main relay device receives a request packet, it can obtain its latest priority value and encapsulate that priority value in the membership query packet.

[0109] Furthermore, it is understood that each time the gateway device sends a request packet to the main relay device, it can receive a membership query packet returned by the main relay device, thereby allowing the gateway device to periodically obtain the priority value of the main relay device.

[0110] According to the AMT protocol, after receiving a membership query packet, the gateway device then sends a membership update packet to the main relay device.

[0111] Step C: Send a relay discovery packet to the backup relay device at the first preset time interval.

[0112] Each time the gateway device sends a relay discovery packet, it activates the above-mentioned Advertisement Timer. Each time the Advertisement Timer times out, it can send a relay discovery packet to the backup relay device, and this relay discovery packet is the Relay Discovery packet in the AMT protocol.

[0113] For example, if a gateway device comes online and then sends relay discovery packets to multiple relay devices, the advertisement waiting timer can be activated.

[0114] For example, after the gateway device comes online, the destination addresses of the two relay discovery packets it sends are Anycast Address 1 and Anycast Address 2, respectively. The relay discovery packet with destination address Anycast Address 1 is sent to relay device 1, and if the gateway device identifies relay device 1 as the main relay device, then the gateway device can subsequently send a relay discovery packet with destination address Anycast Address 2 each time the advertisement waiting timer times out.

[0115] Step D: The relay advertisement packet sent from the backup relay device is received, and the relay advertisement packet contains the priority value of the backup relay device.

[0116] After receiving a relay discovery packet, the backup relay device can obtain its own latest priority value and encapsulate that priority value in a relay advertisement packet, which is the Relay Advertisement packet in the AMT protocol.

[0117] Furthermore, it is understood that each time the gateway device sends a relay discovery packet to the backup relay device, it can receive a relay advertisement packet returned by the backup relay device, thereby allowing the gateway device to periodically obtain the priority value of the backup relay device.

[0118] According to an embodiment of the present invention, the gateway device can periodically acquire the priority values ​​of the main relay device and the backup relay device. As a result, the gateway device can perform a timely main-to-backup switch based on the priority values ​​of the main relay device and the backup relay device, thereby improving the quality of multicast services.

[0119] In an embodiment of the present invention, the priority value is determined based on the health parameters of the relay device, and the health parameters are, Number of accessible multicast sources, Network quality between multicast source and network source, Failure rate of the transmission path to and from the multicast source, and This includes, but is not limited to, the quality of the routing link to and from the multicast source.

[0120] Here, network quality may include transmission delay, jitter, and packet loss rate between the relay device and the multicast source.

[0121] The relay device can use a detection mechanism to detect the failure rate of the transmission path to and from the multicast source. For example, the detection mechanism may be a point-to-multipoint bidirectional forwarding detection (P2MP BFD) mechanism.

[0122] Each health parameter of a relay device corresponds to a preset weight value and threshold, and the relay device's priority value is the sum of the weight values ​​of each health parameter. Each time a health parameter is acquired, if a health parameter is smaller than the threshold corresponding to that health parameter, the priority value is decreased by the weight value corresponding to that health parameter. After the health parameter becomes equal to or greater than the threshold corresponding to that health parameter again, the priority parameter is increased by the weight value corresponding to that health parameter.

[0123] Relay devices can periodically refresh their own priority values.

[0124] In one embodiment, a relay device can calculate its own priority value based on its own health parameters.

[0125] In another embodiment, the network controller can centrally monitor the health parameters of each relay device, calculate a priority value for each relay device, and issue a priority value to each relay device.

[0126] In one embodiment of the present invention, in step S302, if the relative order of the priority value of the main relay device and the priority value of the backup relay device satisfies a preset switching condition, switching between the main relay device and the backup relay device includes, specifically, the following three types of implementation.

[0127] In configuration 1, if the priority value of the backup relay device is higher than the priority value of the main relay device, a switchover will occur between the main relay device and the backup relay device.

[0128] In other words, the pre-configured switching condition may be that the priority value of the backup relay device is greater than the priority value of the main relay device.

[0129] A higher priority value for a backup relay device indicates that the backup relay device provides higher quality multicast services. Therefore, a switchover between the main and backup relay devices is possible, which allows the multicast tunnel to be switched to the AMT tunnel between the main and backup relay devices, enabling the gateway device to provide better multicast services to multicast recipients.

[0130] In configuration two, if the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started. Before the main-backup switching timer times out, if the priority value of the backup relay device acquired last is greater than the priority value of the main relay device, a switch is performed between the main relay device and the backup relay device.

[0131] In other words, the pre-configured switching condition may be that, after detecting that the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started, and before the main-backup switching timer times out, the priority value of the last acquired backup relay device is greater than the priority value of the main relay device.

[0132] Furthermore, if the priority value of the backup relay device last acquired by the gateway device is less than or equal to the priority value of the main relay device before the main-backup switching timer times out, the gateway device does not need to switch between the main and backup relay devices and maintains the AMT tunnel with the main relay device. This avoids frequent switching between the main and backup relay devices due to network instability or other reasons.

[0133] In configuration 3, if the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started. If, before the main-backup switching timer times out, the priority values ​​of all acquired backup relay devices are greater than the priority value of the main relay device, the main relay device and the backup relay device are switched over.

[0134] In other words, the pre-configured switching conditions may include starting the main-backup switching timer when the priority value of the backup relay device is greater than the priority value of the main relay device, and ensuring that the acquired priority values ​​of all backup relay devices are greater than the priority value of the main relay device before the main-backup switching timer times out.

[0135] Conversely, if, before the main-backup switching timer times out, the priority value of any backup relay device obtained at one point is less than or equal to the priority value of the main relay device, then there is no need to switch between the main and backup relay devices, and the AMT tunnel between them is maintained.

[0136] In this way, if the priority value of the backup relay device remains consistently higher than the priority value of the main relay device within a certain period, a switchover between the main and backup relay devices will occur; otherwise, no switchover will take place. This avoids frequent switching between the main and backup relay devices due to network instability or other reasons.

[0137] In one embodiment of the present invention, the gateway device determines that the priority values ​​of the main relay device and the backup relay device satisfy the preset switching conditions, and then switches between the main relay device and the backup relay device, which specifically includes the following:

[0138] The gateway device sends a request packet to the backup relay device, and upon receiving a membership query packet from the backup relay device, it sends a membership update packet to the backup relay device. After sending the membership update packet to the backup relay device, the establishment of the AMT tunnel between the gateway device and the backup relay device is complete.

[0139] Furthermore, if the gateway device receives a membership query packet sent from the backup relay device, it must also stop the periodic query keep-alive timer (Query timer) between it and the main relay device. If the gateway device does not receive a membership query packet sent from the main relay device within the third preset time, it deletes the AMT tunnel information between it and the main relay device. Here, the timeout period for the periodic query keep-alive timer is the second preset time. The AMT tunnel information may include the AMT tunnel identifier and other information to describe the AMT tunnel; specifically, refer to the relevant provisions of the AMT protocol. The third preset time can also be implemented by a timer, and the third preset time can be set according to the provisions of the IGMP protocol or the MLD protocol.

[0140] At this point, the gateway device stops the periodic query keep-alive timer between itself and the main relay device, and then stops sending membership query packets to the main relay device every second preset time interval. In response, the main relay device also stops sending membership query packets back.

[0141] If the gateway device sends a request packet to the backup relay device and then receives a membership query packet from the backup relay device, it indicates that the gateway device can communicate with the backup relay device, meaning it can establish an AMT tunnel with the backup relay device. Therefore, the gateway device can delete the AMT tunnel information between it and the main relay device as described above. Note that the gateway device deleting the AMT tunnel information between it and the main relay device is equivalent to severing the AMT tunnel with the main relay device, and it is understood that the main relay device will not send multicast data to the gateway device through that AMT tunnel.

[0142] After the gateway device deletes the AMT tunnel information between itself and the main relay device, the gateway device can then perform the following steps:

[0143] A relay discovery packet is sent to the main relay device at the first preset time interval.

[0144] After the gateway device deletes the AMT tunnel information between itself and the main relay device, the main relay device is changed to a backup role. Therefore, the gateway device needs to activate an advertisement waiting timer for the main relay device, that is, it starts sending relay discovery packets to the main relay device at the first preset time interval, and in response, the main relay device also replies with a relay advertisement packet carrying a priority value.

[0145] Furthermore, after the gateway device receives a membership query packet sent from the backup relay device, the gateway device can send a relay advertisement packet to the backup relay device at the second preset time interval.

[0146] Since the gateway device has already established an AMT tunnel with the backup relay device, and the backup relay device has now been changed to the main role, the gateway device can stop the Advertisement Timer it maintains for the backup relay device, that is, it can stop sending relay discovery packets to the backup relay device at the first preset time intervals.

[0147] The gateway device can then activate a periodic query keep-alive timer (Query timer) for the backup relay device, meaning it starts sending request packets to the backup relay device every two preset time intervals, and in response, the backup relay device also replies with a membership query packet that carries a priority value.

[0148] Thus, the switching between the main relay device and the backup relay device is completed, and the main / backup switching between the main relay device and the backup relay device is completed. However, after that, the priority values ​​of the main relay device and the backup relay device can be periodically acquired according to the method described in the above embodiment, and if the pre-set switching conditions are met, the switching between the main relay device and the backup relay device can be performed again.

[0149] As described above for the embodiments, in the embodiments of the present invention, priority values ​​were added to both membership query packets and relay advertisement packets. The packet formats of membership query packets and relay advertisement packets are described below.

[0150] In one embodiment of the present invention, a membership query packet includes a first flag bit field and a priority field, wherein a first flag bit field indicates that the priority field holds the priority value of the main relay device.

[0151] Furthermore, the membership query packet also includes a second flag bit field.

[0152] If the second flag bit field is valued as 1, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. A second flag bit field with a value of 2 indicates that the priority field is located after the encapsulation information in a typical query message, and adjacent to it.

[0153] For example, the first value may be 1, and the second value may be 0.

[0154] As an example, Figure 4 shows a schematic diagram of the configuration of a membership query packet when the second flag bit field is the first value.

[0155] A membership query packet includes the following fields: Version, Type, Reserved, P flag bit, L flag bit, G flag bit, Response Media Access Control (Response MAC) address, Request Nonce, Encapsulated General Query Message, Gateway Port Number, Gateway IP Address, and Priority.

[0156] Here, the value of the Type field is 4. When communicating between the gateway device and the relay device based on the IPv4 protocol, the query message is usually a Membership Query based on the IGMPv3 protocol. When communicating between the gateway device and the relay device based on the IPv6 protocol, the query message is usually a Listener Query based on the MLDv2 protocol. The IP address of the gateway device is either an IPv4 address or an IPv6 address.

[0157] Here, the first flag bit field is the P flag bit field, and the second flag bit field is the G flag bit field. The fact that both the P flag bit field and the G flag bit field are 1 indicates that the priority field follows the Gateway IP Address field in Figure 4.

[0158] If the P flag bit field is 1 and the G flag bit field is 0, it indicates that the membership query packet does not contain the Gateway Port Number field and Gateway IP Address field, and the priority field is after the Encapsulated General Query Message in Figure 4.

[0159] In another embodiment of the present invention, the relay advertisement packet includes a priority field, the priority field holding the priority value of the backup relay device.

[0160] As an example, Figure 5 shows a schematic diagram of a relay advertisement packet provided in an embodiment of the present invention. The relay advertisement packet includes the fields Version, Type, Priority, Reserved, Discovery Nonce, and Relay Address. Here, the Version field takes the value 1, the Type field takes the value 2, and the Relay Address field includes an IPv4 address or an IPv6 address. The Priority field is located after the Type field and adjacent to the Type field.

[0161] In the above membership query packets and relay query packets, the priority field is an 8-bit unsigned integer with a valid range of 1 to 255. A priority field of 0 indicates that the priority field does not hold the priority value of the main relay device.

[0162] As shown in Figure 6, Figure 6 is a schematic flowchart of a main-backup switching method provided in an embodiment of the present invention, which may include the following steps S601 to S608.

[0163] S601, the gateway device, sends relay discovery packets to the first and second relay devices.

[0164] S602, the first relay device, after receiving the relay discovery packet, sends a relay advertisement packet to the gateway device.

[0165] Here, the relay advertisement packet contains the first priority value of the first relay device.

[0166] S603, the second relay device, after receiving the relay discovery packet, sends a relay advertisement packet to the gateway device.

[0167] Here, the relay advertisement packet contains the second priority value of the second relay device.

[0168] After receiving relay advertisement packets transmitted from the first and second relay devices, the gateway device determines the relative order of the first and second priority values. If the first priority value is greater than the second priority value, the gateway device identifies the first relay device as the main relay device and the second relay device as the backup relay device.

[0169] S604, the gateway device sends a request packet to the first relay device.

[0170] For example, if the priority value of the first relay device is greater than the priority value of the second relay device, the gateway device will designate the first relay device as the main relay device and the second relay device as the backup relay device, and in accordance with the AMT protocol, the gateway device will send the request packet to the first relay device.

[0171] S605, after receiving the request packet, the first relay device sends a Membership Query packet to the gateway device.

[0172] Here, the membership query packet contains the latest first priority value from the first relay device.

[0173] After receiving a membership query packet, the gateway device can activate a periodic query keep-alive timer (Query Timer). Whenever the periodic query keep-alive timer times out, the gateway device triggers a retransmission of the request packet to the first relay device.

[0174] S606, the gateway device sends a Membership Update packet to the first relay device.

[0175] After the first relay device received and processed the membership update packet, the AMT tunnel was established between the gateway device and the first relay device.

[0176] It is understood that the priority values ​​of the relay devices change, and after identifying the first relay device as the main relay device and the second relay device as the backup relay device, the Advertisement Timer can be activated. Specifically, the Advertisement Timer can be activated after the gateway device receives a membership query packet sent from the first relay device, and each time the Advertisement Timer times out, the following steps are triggered.

[0177] S607, the gateway device sends a Relay Discovery packet to the second relay device.

[0178] S608, the second relay device, sends a relay advertisement packet to the gateway device.

[0179] Similarly, the relay advertisement packet carries the latest second priority value from the second relay device. This allows the gateway device to obtain the second priority value from the second relay device in a timely manner.

[0180] Although the details of the implementation of the above steps have been explained here, we will omit the redundant explanation here.

[0181] As shown in Figure 7, Figure 7 is a schematic flowchart of another main-backup switching method provided in an embodiment of the present invention, which may include the following steps S701 to S707.

[0182] S701, when the periodic query keep-alive timer times out, the gateway device sends a request packet to the first relay device.

[0183] Here, the first relay device is the main relay device.

[0184] S702, the first relay device, sends a Membership Query packet to the gateway device.

[0185] The gateway device receives a membership query packet and obtains the priority value of the first relay device. If the priority value of the first relay device is lower than the priority value of the second relay device, it performs a main / backup switch.

[0186] S703, the gateway device, sends a request packet to the second relay device.

[0187] S704, the second relay device, sends a Membership Query packet to the gateway device.

[0188] Here, the membership query packet carries the priority value of the second relay device.

[0189] When the gateway device receives a membership query packet, it indicates that the second relay device is available as the main relay device. The gateway device then stops the periodic query keep-alive timer (Query Timer) of the first relay device, starts the periodic query keep-alive timer between the gateway and the second relay device, and sends a new request packet to the second relay device each time the periodic query keep-alive timer of the second relay device times out.

[0190] S705, the gateway device, sends a Membership Update packet to the second relay device.

[0191] After the second relay device received and processed the membership update packet, the AMT tunnel was established between the gateway device and the second relay device.

[0192] At this time, the second relay device is switched to the main relay device, and the first relay device is switched to the backup relay device.

[0193] Furthermore, in S704 described above, after receiving a membership query packet, the gateway device can stop the periodic query keep-alive timer of the first relay device. In this case, the gateway device will not continue sending request packets to the first relay device, and the first relay device will also stop sending membership query packets back to the gateway device.

[0194] If the gateway device does not receive a membership query packet within the third preset time, it can activate the advertisement timer of the first relay device, and each time the advertisement timer of the first relay device times out, it can perform the following steps.

[0195] S706, the gateway device sends a Relay Discovery packet to the first relay device.

[0196] S707, the first relay device, sends a relay advertisement packet to the gateway device.

[0197] Similarly, the relay advertisement packet carries the priority value of the second relay device. This allows the gateway device to obtain the priority value of the second relay device in a timely manner.

[0198] Although the details of the implementation of the above steps have been explained here, we will not repeat them here.

[0199] Based on the same inventive concept, embodiments of the present invention further provide a main-backup switching device, which is applied to gateway equipment. As shown in Figure 8, the main-backup switching device is An acquisition module 801 that acquires the priority value of the main relay device and the priority value of the backup relay device, wherein the priority value indicates the quality of the multicast service of the relay device, The system includes a switching module 802 that switches between the main relay device and the backup relay device when the relative priority values ​​of the main relay device and the backup relay device satisfy a pre-set switching condition.

[0200] Preferably, the main-backup switching device further includes: A transmitting module that, after a gateway device comes online, sends relay discovery packets to multiple relay devices, wherein each relay discovery packet contains a different anycast address. A selection module that, when it receives a relay advertisement packet transmitted from one relay device within a first preset time, designates the relay device that transmitted the relay advertisement packet as the main relay device, or, when it receives multiple relay advertisement packets transmitted from multiple relay devices within a first preset time, selects a main relay device from among multiple relay devices, wherein the relay advertisement packet transmitted from the main relay device carries the maximum priority value, It includes an establishment module for establishing an AMT tunnel with the main relay equipment.

[0201] Preferably, the acquisition module 801 specifically, Send the request packet to the main relay device at every second preset time interval, This involves receiving a membership query packet sent from the main relay device, where the membership query packet contains the priority value of the main relay device. Send a relay discovery packet to the backup relay device at the first preset time interval, This is used for receiving relay advertisement packets transmitted from a backup relay device, where the relay advertisement packets contain the priority value of the backup relay device.

[0202] Preferably, the switching module 802 specifically, If the priority value of the backup relay device is higher than the priority value of the main relay device, a switchover will occur between the main relay device and the backup relay device, or If the priority value of the backup relay device is higher than the priority value of the main relay device, the main-backup switchover timer is started. Before the main-backup switchover timer times out, if the last acquired priority value of the backup relay device is higher than the priority value of the main relay device, a switchover between the main relay device and the backup relay device is performed, or This is used to activate a main-backup switching timer when the priority value of a backup relay device is higher than the priority value of the main relay device, and to switch between the main relay device and the backup relay device if the acquired priority values ​​of all backup relay devices are higher than the priority value of the main relay device before the main-backup switching timer times out.

[0203] Preferably, the switching module 802 specifically, Sending the request packet to the backup relay device, When a membership query packet is received from a backup relay device, a membership update packet is sent to the backup relay device, and the periodic query keep-alive timer between it and the main relay device is stopped, wherein the timeout period of the periodic query keep-alive timer is the second preset time. If a membership query packet sent from the main relay device is not received within the third preset time, the AMT tunnel information between the main relay device and the other device is deleted.

[0204] Preferably, the switching module 802 is further used to send relay discovery packets to the main relay device at first preset time intervals, and the switching module 802 is further used to send request packets to the backup relay device at second preset time intervals.

[0205] Preferably, the membership query packet includes a first flag bit field and a priority field, where a first flag bit field indicates that the priority field holds the priority value of the main relay device.

[0206] Preferably, the membership query packet further includes a second flag bit field. If the second flag bit field is valued as 1, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. A second flag bit field with a value of 2 indicates that the priority field is located after the encapsulation information in a typical query message, and adjacent to it.

[0207] Preferably, the relay advertisement packet includes a priority field, where the priority field holds the priority value of the backup relay device.

[0208] Preferably, the priority field occupies 8 reserved bits, and a priority field of 0 indicates that the priority field does not carry a priority value.

[0209] Preferably, the priority value is determined based on the health parameters of the relay equipment, which include one or more of the following: the number of accessible multicast sources, the network quality to and from the multicast sources, the failure rate of the transmission path to and from the multicast sources, and the routing link quality to and from the multicast sources.

[0210] The embodiment of the present invention further provides a gateway device, as shown in Figure 9, the gateway device is Processor 901 and, Transmitter / receiver 904 and, The system comprises a machine-readable storage medium 902 in which machine-executable instructions that can be executed by the processor 901 are stored, and the machine-executable instructions are given to the processor 901. The transceiver 904 obtains the priority values ​​of the main relay device and the backup relay device, and the priority values ​​indicate the quality of the multicast service of the relay device. If the priority values ​​of the main relay device and the backup relay device satisfy the pre-set switching conditions, the system will switch between the main relay device and the backup relay device.

[0211] Preferably, the machine-executable instructions are further provided to the processor 901. After the gateway device comes online, the transceiver 904 sends relay discovery packets to multiple relay devices, and each relay discovery packet contains a different anycast address. If the transceiver 904 receives a relay advertisement packet transmitted from one relay device within the first preset time, the relay device that transmitted the relay advertisement packet is designated as the main relay device, or if the transceiver 904 receives multiple relay advertisement packets transmitted from multiple relay devices within the first preset time, a main relay device is selected from the multiple relay devices, provided that the relay advertisement packet transmitted from the main relay device carries the maximum priority value. This establishes an AMT tunnel with the main relay device and performs the following actions.

[0212] Preferably, the machine-executable instructions are further provided to the processor 901. The transceiver 904 transmits a request packet to the main relay device at every second preset time interval, The transceiver 904 receives a membership query packet transmitted from the main relay device, and the membership query packet contains the priority value of the main relay device. The transceiver 904 transmits a relay discovery packet to the backup relay device at each of the first preset time intervals, The transceiver 904 receives relay advertisement packets transmitted from the backup relay device, and confirms that the relay advertisement packets contain the priority value of the backup relay device, and then executes the following action.

[0213] Preferably, the machine-executable instructions are further provided to the processor 901. If the priority value of the backup relay device is higher than the priority value of the main relay device, a switchover will occur between the main relay device and the backup relay device, or If the priority value of the backup relay device is higher than the priority value of the main relay device, the main-backup switchover timer is started. Before the main-backup switchover timer times out, if the last acquired priority value of the backup relay device is higher than the priority value of the main relay device, a switchover between the main relay device and the backup relay device is performed, or If the priority value of a backup relay device is higher than the priority value of the main relay device, the main-backup switching timer is started. If, before the main-backup switching timer times out, the acquired priority values ​​of all backup relay devices are higher than the priority value of the main relay device, the system will switch between the main relay device and the backup relay devices.

[0214] Preferably, the machine-executable instructions are further provided to the processor 901. The transceiver 904 transmits the request packet to the backup relay device, When the transceiver 904 receives a membership query packet transmitted from the backup relay device, the transceiver 904 sends a membership update packet to the backup relay device and stops the periodic query keep-alive timer between it and the main relay device, wherein the timeout period of the periodic query keep-alive timer is the second preset time. If the transceiver 904 does not receive a membership query packet sent from the main relay device within the third preset time, the AMT tunnel information between it and the main relay device will be deleted.

[0215] Preferably, the machine-executable instructions are further provided to the processor 901. At each of the first preset time intervals, the transceiver 904 is instructed to send a relay discovery packet to the main relay device. The machine-executable instructions are further transmitted to the processor 901. The transceiver 904 is instructed to send a request packet to the backup relay device at every second preset time interval.

[0216] Preferably, the membership query packet includes a first flag bit field and a priority field, where a first flag bit field indicates that the priority field holds the priority value of the main relay device.

[0217] Preferably, the membership query packet further includes a second flag bit field. If the second flag bit field is valued as 1, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. A second flag bit field with a value of 2 indicates that the priority field is located after the encapsulation information in a typical query message, and adjacent to it.

[0218] Preferably, the relay advertisement packet includes a priority field, where the priority field holds the priority value of the backup relay device.

[0219] Preferably, the priority field occupies 8 reserved bits, and a priority field of 0 indicates that the priority field does not carry a priority value.

[0220] Preferably, the priority value is determined based on the health parameters of the relay equipment, which include one or more of the following: the number of accessible multicast sources, the network quality to and from the multicast sources, the failure rate of the transmission path to and from the multicast sources, and the routing link quality to and from the multicast sources.

[0221] As shown in Figure 9, the gateway device may further include a communication bus 903. The processor 901, the machine-readable storage medium 902, and the transceiver 904 communicate with each other via the communication bus 903. The communication bus 903 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 903 can be divided into an address bus, a data bus, a control bus, etc.

[0222] The transceiver 904 may be a wireless communication module, and the transceiver 904 exchanges data with other devices under the control of the processor 901.

[0223] The machine-readable storage medium 902 may include random access memory (RAM) or non-volatile memory (NVM), and may be, for example, at least one magnetic disk memory. Alternatively, the machine-readable storage medium 902 may be at least one storage device located away from the processor.

[0224] The processor 901 may be a general-purpose processor including a Central Processing Unit (CPU), a Network Processor (NP), a Digital Signal Processing Unit (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.

[0225] Based on the same inventive concept, according to the main-backup switching method provided in the above embodiments of the present invention, the embodiments of the present invention further provide a machine-readable storage medium in which machine-executable instructions that can be executed by a processor are stored. The machine-executable instructions cause the processor to perform any of the steps of the above main-backup switching method.

[0226] Another embodiment provided in the present invention further provides a computer program product which, when executed on a computer, causes the computer to perform the steps of any of the main-backup switching methods of the above embodiments.

[0227] In this text, relational terms such as those in Sections 1 and 2 are used merely to distinguish one entity or action from another, and do not necessarily request or suggest that such an actual relationship or order exists between these entities or actions. Furthermore, the terms “encompassing,” “including,” or other variations thereof are intended to cover non-exclusive inclusion, meaning that a process, method, article, or device containing a set of elements may further include not only those elements but also other elements not explicitly enumerated, or elements inherent to such a process, method, article, or device. Unless otherwise specified, an element limited by “including one…” does not preclude a process, method, article, or device containing such element from having other identical elements.

[0228] The above description is merely a preferred embodiment of the present invention and does not limit the invention. Any amendments, equivalent substitutions, modifications, etc., made within the spirit and principles of the present invention shall all be within the scope of protection of the present invention.

Claims

1. A main-backup switching method applicable to gateway devices, This involves obtaining the priority value of the main relay device and the priority value of the backup relay device, wherein the priority value indicates the quality of the multicast service of the relay device. This includes switching between the main relay device and the backup relay device when the relative priority values ​​of the main relay device and the backup relay device satisfy a predetermined switching condition. A main-to-backup switching method characterized by the following:

2. The aforementioned main-backup switching method further includes: After the gateway device comes online, it sends a relay discovery packet to each of the multiple relay devices, and each relay discovery packet contains a different anycast address. If a relay advertisement packet transmitted from one relay device is received within the first preset time, the relay device that transmitted the relay advertisement packet is designated as the main relay device, or if multiple relay advertisement packets transmitted from multiple relay devices are received within the first preset time, the main relay device is selected from the multiple relay devices, provided that the relay advertisement packet transmitted from the main relay device carries the maximum priority value. This includes establishing an AMT tunnel with the aforementioned main relay equipment, The main-backup switching method according to claim 1, characterized in that

3. Obtaining the priority value of the main relay device and the priority value of the backup relay device is: Send a request packet to the main relay device at every second preset time interval, Receiving a membership query packet transmitted from the main relay device, wherein the membership query packet contains the priority value of the main relay device. Send a relay discovery packet to the backup relay device at each of the first preset time intervals, Receiving relay advertisement packets transmitted from the backup relay device, wherein the relay advertisement packets include the priority value of the backup relay device, The main-backup switching method according to claim 1, characterized in that

4. If the relationship between the priority value of the main relay device and the priority value of the backup relay device satisfies the pre-set switching conditions, then switching between the main relay device and the backup relay device will be performed. If the priority value of the backup relay device is higher than the priority value of the main relay device, the main relay device and the backup relay device will be switched over, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started, and if the priority value of the last acquired backup relay device is greater than the priority value of the main relay device before the main-backup switching timer times out, the main relay device and the backup relay device are switched, or The following steps include: if the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is activated; and if, before the main-backup switching timer times out, the priority values ​​of all acquired backup relay devices are greater than the priority value of the main relay device, a switch is performed between the main relay device and the backup relay devices. The main-backup switching method according to claim 3, characterized in that

5. Switching between the main relay device and the backup relay device is performed as follows: Sending a request packet to the aforementioned backup relay device, When a membership query packet is received from the backup relay device, a membership update packet is sent to the backup relay device and the periodic query keep-alive timer between the main relay device and the backup relay device is stopped, wherein the timeout time of the periodic query keep-alive timer is the second preset time. If a membership query packet transmitted from the main relay device is not received within the third preset time, the AMT tunnel information between the main relay device and the system is deleted. The main-backup switching method according to claim 3, characterized in that

6. After deleting the AMT tunnel information between the main relay device and the aforementioned main relay device, the main-backup switching method further: This includes sending a relay discovery packet to the main relay device at each of the first preset time intervals, After receiving the membership query packet transmitted from the backup relay device, the main-backup switching method further: This includes sending a request packet to the backup relay device at each of the second preset time intervals, The main-backup switching method according to claim 5, characterized in that

7. The membership query packet includes a first flag bit field and a priority field, wherein if the first flag bit field has a first value, it indicates that the priority field holds the priority value of the main relay device. The main-backup switching method according to claim 3, characterized in that

8. The membership query packet further includes a second flag bit field, If the second flag bit field is the first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. If the second flag bit field has a value of 2, it indicates that the priority field is located after the encapsulation information of a normal query message and adjacent to the encapsulation information. The main-backup switching method according to claim 7, characterized in that

9. The relay advertisement packet includes a priority field, and the priority field holds the priority value of the backup relay device. The main-backup switching method according to claim 3, characterized in that

10. The priority field occupies 8 reserved bits, and a value of 0 in the priority field indicates that the priority field does not carry a priority value. A main-to-backup switching method according to claim 7 or 9, characterized in that

11. The priority value is determined based on the health parameters of the relay equipment, and the health parameters are, Number of accessible multicast sources, Network quality between multicast source and network source, Failure rate of the transmission path to and from the multicast source, and Including one or more of the routing link quality to and from the multicast source, The main-backup switching method according to claim 1, characterized in that

12. A main-backup switching device applicable to gateway equipment, An acquisition module that acquires the priority value of the main relay device and the priority value of the backup relay device, wherein the priority value indicates the quality of the multicast service of the relay device, The system includes a switching module that switches between the main relay device and the backup relay device when the relationship between the priority value of the main relay device and the priority value of the backup relay device satisfies a preset switching condition. A main-backup switching device characterized by the following features.

13. The aforementioned main-backup switching device further, A transmitting module that, after the gateway device comes online, sends relay discovery packets to multiple relay devices, wherein each relay discovery packet contains a different anycast address. A selection module that, when it receives a relay advertisement packet transmitted from one relay device within a first preset time, designates the relay device that transmitted the relay advertisement packet as the main relay device, or, when it receives multiple relay advertisement packets transmitted from multiple relay devices within the first preset time, selects the main relay device from the multiple relay devices, wherein the relay advertisement packet transmitted from the main relay device carries the maximum priority value, The system includes an establishment module for establishing an AMT tunnel with the main relay device. The main-backup switching device according to claim 12, characterized in that...

14. The acquisition module described above is Send a request packet to the main relay device at every second preset time interval, Receiving a membership query packet transmitted from the main relay device, wherein the membership query packet contains the priority value of the main relay device. Send a relay discovery packet to the backup relay device at each of the first preset time intervals, Receiving relay advertisement packets transmitted from the backup relay device, wherein the relay advertisement packets include the priority value of the backup relay device, and is used for: The main-backup switching device according to claim 12, characterized in that...

15. The aforementioned switching module is If the priority value of the backup relay device is higher than the priority value of the main relay device, the main relay device and the backup relay device will be switched over, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started, and if the priority value of the last acquired backup relay device is greater than the priority value of the main relay device before the main-backup switching timer times out, the main relay device and the backup relay device are switched, or This system is used to activate a main-backup switching timer when the priority value of the backup relay device is greater than the priority value of the main relay device, and to switch between the main relay device and the backup relay device if, before the main-backup switching timer times out, the acquired priority values ​​of all backup relay devices are greater than the priority value of the main relay device. The main-backup switching device according to claim 14, characterized in that

16. The aforementioned switching module is Sending a request packet to the aforementioned backup relay device, When a membership query packet is received from the backup relay device, a membership update packet is sent to the backup relay device and the periodic query keep-alive timer between the main relay device and the backup relay device is stopped, wherein the timeout time of the periodic query keep-alive timer is the second preset time. If a membership query packet transmitted from the main relay device is not received within the third preset time, the AMT tunnel information between the main relay device and the system is deleted. The main-backup switching device according to claim 14, characterized in that

17. The switching module is further used to transmit relay discovery packets to the main relay device at the first preset time intervals. The switching module is further used to send request packets to the backup relay device at the second preset time intervals. The main-backup switching device according to claim 16, characterized in that...

18. The membership query packet includes a first flag bit field and a priority field, wherein if the first flag bit field has a first value, it indicates that the priority field holds the priority value of the main relay device. The main-backup switching device according to claim 14, characterized in that

19. The membership query packet further includes a second flag bit field, If the second flag bit field is the first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. If the second flag bit field has a value of 2, it indicates that the priority field is located after the encapsulation information of a normal query message and adjacent to the encapsulation information. The main-backup switching device according to claim 18, characterized in that...

20. The relay advertisement packet includes a priority field, and the priority field holds the priority value of the backup relay device. The main-backup switching device according to claim 14, characterized in that

21. The priority field occupies 8 reserved bits, and a value of 0 in the priority field indicates that the priority field does not carry a priority value. A main-backup switching device according to claim 18 or 20, characterized in that it is a main-backup switching device according to claim 18 or 20.

22. The priority value is determined based on the health parameters of the relay equipment, and the health parameters are, Number of accessible multicast sources, Network quality between multicast source and network source, Failure rate of the transmission path to and from the multicast source, and Including one or more of the routing link quality to and from the multicast source, The main-backup switching device according to claim 12, characterized in that...

23. Processor and Transmitter and receiver, The system comprises a machine-readable storage medium in which machine-executable instructions that can be executed by the processor are stored, The machine-executable instruction is given to the processor, This involves obtaining the priority value of the main relay device and the priority value of the backup relay device, wherein the priority value indicates the quality of the multicast service of the relay device. If the relationship between the priority value of the main relay device and the priority value of the backup relay device satisfies a preset switching condition, the system will perform a switch between the main relay device and the backup relay device. A gateway device characterized by the following features.

24. The aforementioned machine-executable instructions are further provided to the processor, After the gateway device comes online, the transceiver sends relay discovery packets to each of the multiple relay devices, and each relay discovery packet contains a different anycast address. If the transceiver receives a relay advertisement packet transmitted from one relay device within a first preset time, the relay device that transmitted the relay advertisement packet is designated as the main relay device, or if the transceiver receives multiple relay advertisement packets transmitted from multiple relay devices within the first preset time, the main relay device is selected from the multiple relay devices, provided that the relay advertisement packet transmitted from the main relay device carries the maximum priority value. To establish an AMT tunnel with the aforementioned main relay device and to perform the following: The gateway device according to claim 23, characterized in that...

25. The aforementioned machine-executable instructions are further provided to the processor, The transceiver transmits a request packet to the main relay device at every second preset time interval, The transceiver receives a membership query packet transmitted from the main relay device, wherein the membership query packet contains the priority value of the main relay device. The transceiver transmits a relay discovery packet to the backup relay device at each of the first preset time intervals, The transceiver receives relay advertisement packets transmitted from the backup relay device, and the relay advertisement packets include the priority value of the backup relay device. The gateway device according to claim 23, characterized in that...

26. The aforementioned machine-executable instructions are further provided to the processor, If the priority value of the backup relay device is higher than the priority value of the main relay device, the main relay device and the backup relay device will be switched over, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started, and if the priority value of the last acquired backup relay device is greater than the priority value of the main relay device before the main-backup switching timer times out, the main relay device and the backup relay device are switched, or If the priority value of the backup relay device is greater than the priority value of the main relay device, the main-backup switching timer is started. If, before the main-backup switching timer times out, the priority values ​​of all acquired backup relay devices are greater than the priority value of the main relay device, the main relay device and the backup relay devices are switched over. The gateway device according to claim 25, characterized in that...

27. The aforementioned machine-executable instructions are further provided to the processor, The transceiver transmits the request packet to the backup relay device, When the transceiver receives a membership query packet transmitted from the backup relay device, the transceiver sends a membership update packet to the backup relay device and stops the periodic query keep-alive timer between it and the main relay device, wherein the timeout time of the periodic query keep-alive timer is the second preset time. If the transceiver does not receive a membership query packet transmitted from the main relay device within the third preset time, the AMT tunnel information between the transceiver and the main relay device is deleted. The gateway device according to claim 25, characterized in that...

28. The aforementioned machine-executable instructions are further provided to the processor, The transceiver is instructed to transmit a relay discovery packet to the main relay device at each of the first preset time intervals. The aforementioned machine-executable instructions are further provided to the processor, The transceiver is instructed to send a request packet to the backup relay device at each of the second preset time intervals. The gateway device according to claim 27, characterized in that...

29. The membership query packet includes a first flag bit field and a priority field, wherein if the first flag bit field has a first value, it indicates that the priority field holds the priority value of the main relay device. The gateway device according to claim 25, characterized in that...

30. The membership query packet further includes a second flag bit field, If the second flag bit field is the first value, it indicates that the priority field is located after the gateway address field and adjacent to the gateway address field. If the second flag bit field has a value of 2, it indicates that the priority field is located after the encapsulation information of a normal query message and adjacent to the encapsulation information. The gateway device according to claim 29, characterized in that...

31. The relay advertisement packet includes a priority field, and the priority field holds the priority value of the backup relay device. The gateway device according to claim 25, characterized in that...

32. The priority field occupies 8 reserved bits, and a value of 0 in the priority field indicates that the priority field does not carry a priority value. A gateway device according to claim 29 or 31, characterized in that it is a gateway device according to claim 29 or 31.

33. The priority value is determined based on the health parameters of the relay equipment, and the health parameters are, Number of accessible multicast sources, Network quality between multicast source and network source, Failure rate of the transmission path to and from the multicast source, and Including one or more of the routing link quality to and from the multicast source, The gateway device according to claim 23, characterized in that...

34. A machine-executable instruction is stored and, when called and executed by the processor, causes the processor to perform the steps of the main-backup switching method described in any one of claims 1 to 11. A machine-readable storage medium characterized by the following features.

35. The processor is made to implement the steps of the main-backup switching method described in any one of claims 1 to 11. A computer program product characterized by the following features.