Multicast message forwarding method and device, equipment and storage medium

By defining preset multicast message filtering rules in the switch, filtering and updating the multicast message forwarding table, the switch solves the problem of resource waste and inefficiency when processing large number of multicast requests or duplicate messages, and achieves efficient multicast message forwarding and performance improvement.

CN119922153APending Publication Date: 2025-05-02SHENZHEN FENGRUNDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510016044.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

The switches experience waste of resources and inefficiency when processing large number of multicast requests or duplicate messages, resulting in performance degradation.

Method used

By defining filtering rules with preset multicast message address or type, the initial multicast messages of the Internet group management protocol and multicast monitoring discovery protocol are received, and invalid, duplicate and expired messages are filtered according to these rules to obtain the target multicast message, and then update the forwarding table for efficient forwarding.

Benefits of technology

It effectively reduces the processing of invalid messages, reduces CPU load and resource consumption, improves the efficiency and forwarding performance of multicast message processing, and is especially suitable for high-density multicast traffic scenarios in large network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922153A_ABST
    Figure CN119922153A_ABST
Patent Text Reader

Abstract

The invention discloses a multicast message forwarding method, device and equipment and a storage medium, relates to the technical field of switch message forwarding, and discloses a multicast message forwarding method which comprises the following steps: defining a preset filtering rule according to a preset multicast message address or a preset multicast message type; receiving an initial multicast message of an Internet group management protocol and a multicast monitoring discovery protocol; filtering the initial multicast message according to the preset filtering rule to obtain a target multicast message; and modifying an initial multicast forwarding table according to the target multicast message to obtain a target multicast forwarding table, and forwarding the multicast message according to the target multicast forwarding table. The multicast message is filtered and the multicast forwarding table is optimized through the preset filtering rule, so that invalid message processing is reduced, resource consumption is reduced, and multicast message forwarding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of switch message forwarding, and in particular to a multicast message forwarding method, device, equipment and storage medium. Background Art

[0002] Currently, switches usually rely on traditional multicast management mechanisms when processing Internet Group Management Protocol (IGMP) and Multicast Listener Discovery (MLD) protocol messages, that is, dynamically adjusting routes based on user-initiated requests to join or leave multicast groups to achieve multicast traffic forwarding.

[0003] However, when a large number of multicast requests or duplicate messages are received, the IGMP and MLD protocol messages require the switch to check each message to determine the type and validity of the message. If there are a large number of duplicate or invalid requests in the message, the switch still needs to consume computing resources for repeated calculations and storage, resulting in increased CPU load and memory usage. Therefore, when a large number of multicast requests or duplicate messages appear in the network, the switch is prone to performance degradation due to processing delays or unnecessary resource usage. In particular, the frequent processing of duplicate messages or invalid requests will cause a significant increase in the load on the switch, which not only reduces resource utilization efficiency, but also has a negative impact on the overall performance of the switch.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present application is to provide a multicast message forwarding method, apparatus, device and storage medium, aiming to solve the technical problems of resource waste and low efficiency when a switch processes a large number of multicast requests or repeated messages.

[0006] To achieve the above object, the present application proposes a multicast message forwarding method, the method comprising:

[0007] Defining preset filtering rules according to preset multicast message addresses or preset multicast message types;

[0008] Receive initial multicast messages of Internet Group Management Protocol and Multicast Listener Discovery Protocol;

[0009] Filtering the initial multicast message according to the preset filtering rule to obtain a target multicast message;

[0010] The initial multicast forwarding table is modified according to the target multicast message to obtain a target multicast forwarding table, and the multicast message is forwarded according to the target multicast forwarding table.

[0011] In one embodiment, the step of filtering the initial multicast message according to the preset filtering rule to obtain the target multicast message includes:

[0012] Identifying invalid multicast messages based on the initial multicast message, the Internet Group Management Protocol, and the Multicast Listening Discovery Protocol;

[0013] Identifying repeated multicast messages according to the initial multicast message and a preset receiving period;

[0014] Identifying an expired multicast message according to the initial multicast message and a preset message validity period;

[0015] The invalid multicast message, the repeated multicast message and the expired multicast message are discarded according to the preset filtering rule, and the target multicast message is obtained by filtering.

[0016] In one embodiment, the step of identifying an invalid multicast message according to the initial multicast message, the Internet Group Management Protocol, and the Multicast Listener Discovery Protocol includes:

[0017] According to the Internet Group Management Protocol and the Multicast Listening Discovery Protocol, a preset message format, a preset message address range, and a preset address type are obtained;

[0018] Identify a format error message in the initial multicast message according to the preset message format to obtain a format error multicast message;

[0019] Identify the out-of-range address in the initial multicast message according to the preset message address range, and obtain an invalid address multicast message;

[0020] Identify the non-sending type address in the initial multicast message according to the preset address type, and obtain an invalid sending type multicast message;

[0021] Invalid multicast messages are identified according to the format error multicast message, the invalid address multicast message, and the invalid sending type multicast message.

[0022] In one embodiment, the step of identifying a format error message in the initial multicast message according to the preset message format to obtain a format error multicast message includes:

[0023] According to the preset message format, obtain the message type format, message length format and message field range format;

[0024] Identify a type error message in the initial multicast message according to the message type format, and obtain a type error multicast message;

[0025] Identify a length error message in the initial multicast message according to the message length format, and obtain a length error multicast message;

[0026] Identify a field out-of-range message in the initial multicast message according to the message field range format, and obtain a field out-of-range multicast message;

[0027] A format error multicast message is identified according to the type error multicast message, the length error multicast message, and the field out-of-range multicast message.

[0028] In one embodiment, the step of identifying repeated multicast messages according to the initial multicast message and the preset receiving period includes:

[0029] According to the initial multicast message, obtain the multicast message address, multicast message type and message timestamp;

[0030] According to the multicast message address and the multicast message type, matching historical multicast message records within a preset receiving period;

[0031] According to the message timestamp and the historical multicast message record, the multicast message repeated within a preset receiving period is identified to obtain the repeated multicast message.

[0032] In one embodiment, the step of identifying the expired multicast message according to the initial multicast message and the preset message validity period includes:

[0033] According to the initial multicast message, obtain the current time and the message reception time of the initial multicast message;

[0034] Obtaining a time difference according to the message receiving time and the current time, and determining whether the time difference exceeds a preset message validity period;

[0035] When it is determined that the time difference exceeds the preset message validity period, the initial multicast message is determined as an expired multicast message.

[0036] In one embodiment, the step of defining a preset filtering rule according to a preset multicast message address or a preset multicast message type includes:

[0037] According to the preset multicast message address, obtain the target multicast address range and the reserved multicast address;

[0038] Defining a multicast address filtering rule according to the target multicast address range and the reserved multicast address;

[0039] According to the preset multicast message type, obtain the multicast message type classification and type priority;

[0040] Defining a multicast message type filtering rule according to the multicast message type classification and the type priority;

[0041] A preset filtering rule is defined according to the multicast address filtering rule and the multicast message type filtering rule.

[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a multicast message forwarding device, the multicast message forwarding device comprising: a rule definition module, used to define a preset filtering rule according to a preset multicast message address or a preset multicast message type;

[0043] A message receiving module, used for receiving initial multicast messages of Internet Group Management Protocol and Multicast Listening Discovery Protocol;

[0044] A message filtering module, used to filter the initial multicast message according to the preset filtering rule to obtain a target multicast message;

[0045] The message forwarding module is used to modify the initial multicast forwarding table according to the target multicast message, obtain the target multicast forwarding table, and forward the multicast message according to the target multicast forwarding table.

[0046] In addition, to achieve the above-mentioned purpose, the present application also proposes a multicast message forwarding device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the multicast message forwarding method described above.

[0047] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the multicast message forwarding method described above are implemented.

[0048] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the multicast message forwarding method described above are implemented.

[0049] One or more technical solutions proposed in this application have at least the following technical effects:

[0050] By adopting a preset multicast message address or multicast message type to define filtering rules, combined with receiving the initial multicast message of the Internet Group Management Protocol and the Multicast Listening Discovery Protocol, the initial multicast message is filtered according to the preset filtering rules, and the target multicast message is screened out, so that after modifying the initial multicast forwarding table and generating the target multicast forwarding table, the multicast message is efficiently forwarded according to the updated forwarding table. Compared with the prior art that directly processes all received multicast messages, this solution introduces filtering rules to filter invalid messages, duplicate messages, and expired messages, avoiding the waste of resources and performance degradation of the switch when processing a large number of invalid or redundant multicast requests, thereby significantly reducing the CPU load and resource consumption, and improving the efficiency of multicast message processing and forwarding performance. It is particularly suitable for high-density multicast traffic scenarios in large network environments, and has significant technical advantages and practical application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0053] Figure 1 A flowchart of the first embodiment of the multicast message forwarding method of the present application is provided;

[0054] Figure 2 A flowchart of the second embodiment of the multicast message forwarding method of the present application is provided;

[0055] Figure 3 A schematic diagram of a simplified process of a multicast message forwarding method provided in Embodiment 2 of the present application;

[0056] Figure 4 This is a schematic diagram of the module structure of the multicast message forwarding device according to an embodiment of the present application;

[0057] Figure 5 A schematic diagram of the device structure of the hardware operating environment involved in the multicast message forwarding method in the embodiment of the present application.

[0058] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0059] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0060] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0061] The main solution of the embodiment of the present application is: define a preset filtering rule according to a preset multicast message address or a preset multicast message type; receive an initial multicast message of the Internet Group Management Protocol and the Multicast Listening Discovery Protocol; filter the initial multicast message according to the preset filtering rule to obtain a target multicast message; modify the initial multicast forwarding table according to the target multicast message to obtain a target multicast forwarding table, and forward the multicast message according to the target multicast forwarding table.

[0062] In this embodiment, for ease of description, the following description is made by taking the identification of a multicast message forwarding device as the execution subject.

[0063] Since the switches of the prior art waste resources and are inefficient when processing a large number of multicast requests or duplicate messages, the present application provides a solution, which adopts a preset multicast message address or multicast message type to define filtering rules, combines the initial multicast messages received from the Internet Group Management Protocol and the Multicast Listening Discovery Protocol, filters the initial multicast messages according to the preset filtering rules, and screens out the target multicast messages, so that after modifying the initial multicast forwarding table and generating the target multicast forwarding table, the multicast messages are efficiently forwarded according to the updated forwarding table. Compared with the prior art that directly processes all received multicast messages, this solution introduces filtering rules to screen invalid messages, duplicate messages, and expired messages, thereby avoiding the problem of resource waste and performance degradation of the switch when processing a large number of invalid or redundant multicast requests, thereby significantly reducing the CPU load and resource consumption, and improving the efficiency and forwarding performance of multicast message processing. It is particularly suitable for high-density multicast traffic scenarios in large network environments, and has significant technical advantages and practical application value.

[0064] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a multicast message forwarding device and a switch, etc. The following takes a switch as an example to illustrate this embodiment and the following embodiments.

[0065] Based on this, the embodiment of the present application provides a multicast message forwarding method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the multicast message forwarding method of the present application.

[0066] In this embodiment, the multicast message forwarding method includes steps S10 to S40:

[0067] Step S10, defining a preset filtering rule according to a preset multicast message address or a preset multicast message type;

[0068] It should be noted that the preset multicast message address refers to a specific multicast address range used in the communication process. These addresses are used to identify the receiving targets of multicast data. The range of multicast addresses needs to comply with the specifications of the multicast protocol. For example, the legal multicast address range in IPv4 is from 224.0.0.0 to 239.255.255.255, while the legal multicast address range in IPv6 is addresses starting with FF00 (i.e. FF00:: / 8). These addresses are usually used to identify groups of devices that receive certain specific data, thereby achieving efficient one-to-many communication. By limiting the preset multicast message address, messages that do not meet the requirements can be effectively filtered out.

[0069] In addition, the preset multicast message type refers to a specific category defined in accordance with the multicast protocol to describe the function of the multicast message. The Internet Group Management Protocol and the Multicast Listener Discovery Protocol define a variety of multicast message types, including query messages, report messages for joining a multicast group, and report messages for leaving a multicast group. Query messages are used to detect the status of multicast group members in the network, and report messages are used by devices to notify themselves of the status of joining or leaving a multicast group. By presetting the message type, the scope of multicast messages to be processed can be limited to avoid processing irrelevant messages.

[0070] In addition, the preset filtering rules are a set of rules for filtering multicast messages, which are usually defined according to the preset multicast message address and multicast message type. These rules are used to filter out multicast messages that do not meet the conditions, such as messages that are out of the address range, messages that do not belong to the specified type, or messages that do not meet specific conditions. Through these rules, the device can reduce the resource consumption of processing invalid messages and improve the efficiency and reliability of message processing.

[0071] It is understandable that by analyzing the multicast address range and message type used in the communication, a set of filtering rules are defined in advance. According to the specification range of the multicast message address, the legal multicast addresses that meet the conditions are screened out, and the addresses outside the range are eliminated. For example, the legal multicast address range in the IPv4 environment is 224.0.0.0 to 239.255.255.255, and the filtering rules will match this range. In addition, the processing object is limited according to the type of multicast message, such as only processing the request message to join the multicast group and ignoring the message to leave the multicast group. Through these rules, the efficiency can be improved in the subsequent message processing and the interference of invalid messages can be reduced. For example, in an enterprise network, the filtering rules defined for the multicast group 239.1.1.1 only process the joining request, filter out other types of messages, and ensure efficient management of network traffic.

[0072] Step S20, receiving initial multicast messages of Internet Group Management Protocol and Multicast Listener Discovery Protocol;

[0073] It should be noted that the Internet Group Management Protocol is a multicast management protocol used in IPv4 networks, abbreviated as IGMP, which is used to manage multicast group membership between hosts and routers. The protocol allows devices in the network (such as hosts) to dynamically join or leave a multicast group by sending messages to join or leave the multicast group. IGMP has multiple versions, each providing different functions. For example, IGMPv1 provides basic functions of joining and leaving multicast groups, IGMPv2 supports devices to explicitly send messages to leave multicast groups, and IGMPv3 further supports source-specific multicast (i.e., multicast for specific data sources). Through IGMP, switches can maintain which devices have subscribed to a multicast group, thereby efficiently sending multicast data streams to subscribing devices.

[0074] In addition, the Multicast Listener Discovery Protocol is a multicast management protocol in IPv6 networks, referred to as MLD. It is used to manage multicast group memberships between hosts and routers and is a functional extension of IGMP in IPv6. MLD is designed based on the characteristics of IPv6 networks. Its core functions are similar to IGMP, including allowing hosts to join or leave a multicast group, or receiving router queries to respond to the status of the currently subscribed multicast group. MLD also supports multiple versions. For example, MLDv1 provides basic multicast management functions, while MLDv2 supports source-specific multicast, thereby enabling more precise multicast traffic control for specific data sources. MLD transmits messages through the extended header of IPv6 and is an important part of multicast communication in IPv6 networks.

[0075] In addition, it should be noted that the initial multicast message refers to the original multicast communication data sent by the device from the network through the Internet Group Management Protocol and the Multicast Listener Discovery Protocol, including join requests, leave requests or other types of management information. The role of the initial multicast message is to maintain the normal operation of multicast communication, such as helping devices join or remove from a multicast group. These messages are the basic data of multicast communication and need to be processed before forwarding or updating the configuration of network devices.

[0076] It is understood that the multicast messages of the Internet Group Management Protocol or the Multicast Listener Discovery Protocol received from the network may contain management information such as join requests, leave requests or query messages. These messages reflect the multicast subscription status of the devices in the network and are used to update or maintain the status of the multicast communication.

[0077] Step S30, filtering the initial multicast message according to the preset filtering rule to obtain a target multicast message;

[0078] It should be noted that the target multicast message refers to the valid multicast message retained after filtering. These messages meet the preset filtering rules and are usually legitimate join requests or leave notifications. The processing of target multicast messages is the basis for subsequent forwarding table updates and multicast data forwarding, which can significantly reduce the impact of invalid messages on network performance.

[0079] It is understandable that the received initial multicast message is compared with the preset filtering rules, and invalid messages are filtered out by address range matching, message type screening, etc. Messages that exceed the address range, messages that do not conform to the type, and messages that do not meet specific conditions are directly discarded.

[0080] In a feasible implementation, step S30 may include steps S31 to S34:

[0081] Step S31, identifying invalid multicast messages according to the initial multicast message, Internet Group Management Protocol and Multicast Listening Discovery Protocol;

[0082] It should be noted that invalid multicast messages are messages that do not comply with the Internet Group Management Protocol or the Multicast Listener Discovery Protocol. These messages may be marked as invalid due to format errors, illegal address ranges, or incorrect message types. For example, a message with an address of 192.168.1.1 in an IPv4 environment will be considered an invalid multicast message because the address does not belong to the multicast address range. Invalid multicast messages occupy resources and cannot participate in multicast communications correctly, so they need to be discarded during filtering.

[0083] It is understandable that by checking the format, address range, and message type of the initial multicast message, messages that do not comply with the Internet Group Management Protocol and the Multicast Listener Discovery Protocol can be identified. Invalid messages may include messages with incorrect formats, such as messages whose message length does not comply with protocol requirements; messages with illegal address ranges, such as addresses in the IPv4 environment that are not within the range of 224.0.0.0 to 239.255.255.255; and messages with incorrect message types, such as messages that are not defined by the protocol. These invalid messages are usually caused by network failures or incorrect configuration of the sending device and need to be screened out and marked as invalid in this step. For example, if an IGMP message is received that is less than the minimum message length specified by the protocol, it will be marked as invalid.

[0084] In a feasible implementation, step S31 may include steps S311 to S315:

[0085] Step S311, obtaining a preset message format, a preset message address range, and a preset address type according to the Internet Group Management Protocol and the Multicast Listener Discovery Protocol;

[0086] It should be noted that the preset message format refers to the standard structure of multicast messages specified in the Internet Group Management Protocol and the Multicast Listener Discovery Protocol. Each multicast message must contain specific fields in the format defined by the protocol. For example, IGMP messages usually contain fields such as message type, maximum response time, and multicast address. The length of the message is also strictly regulated. The preset message format is used to ensure that the message can be correctly parsed and understood when it is transmitted in the network.

[0087] In addition, the preset message address range is the legal multicast address range specified in the protocol. For IPv4 networks, the legal multicast address range is 224.0.0.0 to 239.255.255.255, some of which are reserved for specific functions, such as 224.0.0.x is used for multicast addresses of local links; for IPv6 networks, the legal multicast address range is FF00:: / 8, that is, addresses starting with FF. The preset message address range is used to filter out addresses that do not belong to the legal multicast range, such as ordinary unicast addresses or broadcast addresses.

[0088] In addition, the preset address type refers to the type of address that is classified in the protocol according to the purpose of the multicast address. For example, some multicast addresses are used for management functions, such as query addresses, while other addresses are used for data transmission. Common address types in IPv4 include multicast management addresses and multicast data transmission addresses; similar classifications in IPv6 include link-local addresses and site-local addresses. Preset address types can help identify whether certain special-purpose addresses are suitable for data transmission.

[0089] It is understandable that the standard format of the message, the legal address range, and the classified address types are extracted based on the specification content of the Internet Group Management Protocol and the Multicast Listener Discovery Protocol. For example, in the IGMP protocol, the preset message format defines that the minimum length of the message is 8 bytes, and the message must contain a checksum field; the preset message address range is 224.0.0.0 to 239.255.255.255, and the preset address types include management addresses and data transmission addresses. In the MLD protocol, the preset message format includes IPv6 extended header information, the address range starts with FF00, and the address types include link-local addresses and site-local addresses. By clarifying these rules, a basic filtering basis can be provided for subsequent steps.

[0090] Step S312, identifying a format error message in the initial multicast message according to the preset message format, and obtaining a format error multicast message;

[0091] It should be noted that a format-incorrect multicast message refers to a multicast message that does not conform to the preset message format. Such messages may be marked as format-incorrect due to insufficient message length, missing fields, or incorrect field content. For example, an IGMP message with a length of less than 8 bytes or an incorrect checksum field will be considered a format-incorrect multicast message.

[0092] It is understandable that the initial multicast message is checked to see if it complies with the requirements of the preset message format, such as whether it contains necessary fields, whether the message length complies with the regulations, whether the checksum is correct, etc. If the length of the message is less than the minimum value specified by the protocol, or if key fields such as the multicast address field or the checksum field are missing, it will be marked as a malformed multicast message. For example, a received IGMPv2 message is 6 bytes long, which is less than the 8 bytes specified by the protocol, and is therefore marked as a malformed multicast message.

[0093] In a feasible implementation, step S312 may include steps S3121 to S3125:

[0094] Step S3121, according to the preset message format, obtaining a message type format, a message length format, and a message field range format;

[0095] It should be noted that the message type format refers to the message type defined in the multicast protocol and its corresponding standardized format. Each type of multicast message has a clear function and a fixed type identifier. For example, in the IGMP protocol, the type identifier of the query message is 0x11, and the type of the report message for joining a multicast group is 0x16. In the MLD protocol, similar type identifiers are defined to distinguish multicast messages with different functions. The message type format is used to ensure that the message can be correctly parsed and processed according to the expected function.

[0096] In addition, the message length format refers to the length specification that the multicast message needs to meet when it is transmitted according to the protocol requirements. Different types of multicast messages have different minimum or fixed length requirements. For example, in the IGMP protocol, the minimum length of the message is 8 bytes, while in the MLD protocol, the length of the message needs to include the IPv6 header and extension header information, which is usually at least 24 bytes. The message length format is used to detect whether the message is complete to avoid parsing errors due to insufficient length.

[0097] In addition, the message field range format refers to the value range or legal value of each field in the multicast message. For example, in an IGMP message, the multicast address field should be in the range of 224.0.0.0 to 239.255.255.255; the value of the checksum field needs to be dynamically calculated based on the message content and cannot be a fixed value of 0. The message field range format is used to check whether each field in the message complies with the protocol specification to avoid abnormal message parsing or function due to illegal field values.

[0098] It is understandable that the format specifications of various messages are extracted from the preset message format, including the message type identifier and its corresponding function, the legal message length range, and the value range of each field. For example, in the IGMP protocol, the query message type identifier is 0x11, the length is 8 bytes, and the multicast address field needs to be in the range of 224.0.0.0 to 239.255.255.255. By obtaining these format specifications, a clear basis is provided for subsequent error detection.

[0099] Step S3122, identifying a type error message in the initial multicast message according to the message type format, and obtaining a type error multicast message;

[0100] It should be noted that a type error multicast message refers to a message whose type identifier does not conform to the protocol. For example, in the IGMP protocol, if the type identifier of a message is an undefined value, such as 0x20, the message will be marked as a type error multicast message. Type error multicast messages are usually caused by incorrect configuration of the sending device or malicious attacks.

[0101] It is understood that the type field in the initial multicast message is checked to determine whether it complies with the message type format. For example, in the IGMP protocol, if the received message type is 0x20, that is, the type value is undefined, it is marked as a type error message. Type errors usually reflect a device's protocol implementation problem or a malicious message attack.

[0102] Step S3123, identifying a length error message in the initial multicast message according to the message length format, and obtaining a length error multicast message;

[0103] It should be noted that a length error multicast message refers to a message whose length does not comply with the protocol. For example, in the IGMP protocol, if the length of a message is less than 8 bytes or greater than the maximum length allowed by the protocol, it will be marked as a length error multicast message. A length error multicast message may be caused by truncation during network transmission or device error transmission.

[0104] It is understandable that the length of the initial multicast message is checked to determine whether it complies with the message length format. For example, in the IGMP protocol, the minimum length of a message is 8 bytes. If the received message length is 6 bytes, it is marked as a length error message. The length error may be caused by truncation during transmission or incorrect implementation of the sending device.

[0105] Step S3124, identifying a field out-of-range message in the initial multicast message according to the message field range format, and obtaining a field out-of-range multicast message;

[0106] It should be noted that a field out-of-range multicast message refers to a message where the value of some fields in the message exceeds the value range specified by the protocol. For example, in an IGMP message, if the value of the multicast address field is 192.168.1.1 (unicast address), or the value of the checksum field does not match the message content, the message will be marked as a field out-of-range multicast message. Field out-of-range multicast messages usually reflect configuration problems or protocol implementation errors on the sending device.

[0107] It is understood that the values ​​of each field in the initial multicast message are checked to see if they are within the specified range of the message field range format. For example, in the IGMP protocol, the multicast address field should be in the range of 224.0.0.0 to 239.255.255.255, and if the address is 192.168.1.1, it will be marked as a field out of range message. Similarly, if the checksum field does not match the message content, it will also be marked as a field out of range message.

[0108] Step S3125: Identify a format error multicast message according to the type error multicast message, the length error multicast message, and the field out-of-range multicast message.

[0109] Comprehensively analyze the type error message, length error message, and field out-of-range message identified in the above steps, and mark them as format-error multicast messages. For example, a message length of 6 bytes, i.e., length error, or a multicast address field of 192.168.1.1, i.e., field out-of-range, will be marked as a format-error multicast message. The format-error multicast message will be discarded and will no longer participate in subsequent processing.

[0110] Step S313, identifying an out-of-range address in the initial multicast message according to the preset message address range, and obtaining an invalid address multicast message;

[0111] It should be noted that an invalid address multicast message refers to a message whose multicast address exceeds the preset message address range. For example, in an IPv4 network, if the multicast address is 192.168.1.1, that is, a unicast address, or in an IPv6 network, a multicast message whose address does not start with FF will be considered an invalid address multicast message.

[0112] It is understandable that the multicast address in the initial multicast message is checked to see if it is within a preset address range, such as the address range of IPv4 is between 224.0.0.0 and 239.255.255.255. If the multicast address exceeds the range, such as 192.168.1.1, it will be marked as an invalid address multicast message. Similarly, in IPv6, the address range is required to start with FF, and if the address is 2001::1, it will be marked as an invalid address multicast message.

[0113] Step S314, identifying a non-sending type address in the initial multicast message according to the preset address type, and obtaining an invalid sending type multicast message;

[0114] It should be noted that an invalid sending type multicast message means that the multicast address contained in the message does not meet the requirements of the preset address type. For example, some multicast addresses are reserved for management functions and cannot be used for data transmission. If the message contains such an address for sending data, it will be marked as an invalid sending type multicast message.

[0115] It is understood that the multicast address in the initial multicast message is checked to see if it meets the requirements of the preset address type. For example, in IPv4, the address 224.0.0.1 is a reserved address that is only used for management functions and cannot be used as a target address for data transmission. If the multicast address of the message is 224.0.0.1 and an attempt is made to send data, it will be marked as an invalid sending type multicast message. Similarly, in IPv6, link-local addresses cannot be used for global data transmission.

[0116] Step S315: Identify invalid multicast messages according to the format error multicast message, the invalid address multicast message, and the invalid sending type multicast message.

[0117] It is understandable that format error multicast messages, invalid address multicast messages and invalid sending type multicast messages are comprehensively analyzed and marked as invalid multicast messages. Invalid multicast messages will be uniformly processed and removed from subsequent processes, such as discarding these messages to avoid wasting device resources. For example, a message that meets the format error or invalid address range will be marked as an invalid multicast message.

[0118] Step S32, identifying repeated multicast messages according to the initial multicast message and a preset receiving period;

[0119] It should be noted that duplicate multicast messages refer to multicast messages with the same content that are received multiple times within a short period of time. Usually, these messages are caused by repeated transmissions by devices in the network or other factors. Duplicate messages may cause unnecessary processing overhead and reduce the efficiency of the device. For example, if a device sends multiple join requests to the same multicast group within one minute, and the content of these requests is exactly the same, they will be identified as duplicate messages.

[0120] It is understandable that by comparing the received initial multicast message with the historical message records within the preset receiving period, it is determined whether there are duplicate messages with exactly the same content. The preset receiving period can be a fixed time window used to limit the identification range of duplicate messages. For example, if the receiving period is 10 seconds, and the same join request is received within this time window, it will be marked as a duplicate message. This process requires checking key fields of the message, such as the multicast address, message type, and timestamp, to ensure that only messages with exactly the same content are identified as duplicates. For example, a device sends three consecutive join requests to the address 239.1.1.1 within 5 seconds, and the last two requests will be considered duplicate messages.

[0121] In a feasible implementation, step S32 may include steps S321 to S323:

[0122] Step S321, acquiring a multicast message address, a multicast message type, and a message timestamp according to the initial multicast message;

[0123] It should be noted that the multicast message address is the network address used to identify the target multicast group in multicast communication. In IPv4, the legal multicast address range is 224.0.0.0 to 239.255.255.255, for example, 239.1.1.1 can represent the multicast group address of a video stream; in IPv6, the legal multicast address range is FF00:: / 8, for example, FF01::1 represents the link-local multicast group address. The multicast message address is used to ensure that the message can be accurately sent to the corresponding multicast group.

[0124] In addition, the multicast message type refers to the message category defined in the multicast protocol, which is used to distinguish the function of the message. For example, in the IGMP protocol, common message types include query messages, which are message types used to detect the member status of the current multicast group, and report messages, which are message types used by devices to apply to join or leave the multicast group. Different message types correspond to different functional logics, and the device determines how to process the message by identifying the message type.

[0125] In addition, the message timestamp refers to the time information when the multicast message is generated or sent, usually expressed as a specific time value, such as a time point with second or millisecond accuracy. The timestamp is used to record the time when the message is generated, helping to determine the timeliness of the message and whether it belongs to the preset receiving cycle. Through the message timestamp, messages that are repeatedly sent within a short period of time can be accurately identified.

[0126] It is understandable that important information for uniquely identifying the message is extracted from the received initial multicast message, including the multicast message address, multicast message type, and message timestamp. The multicast message address is used to identify which multicast group the message belongs to. For example, the address 239.1.1.1 represents a specific multicast group. The multicast message type is used to determine the function of the message, such as whether it is a join request or a leave request. The message timestamp is used to record the sending time of the message. For example, the timestamp of a message is 2025-01-03 15:00:00, which is used for subsequent time matching. This information constitutes an important basis for judging the uniqueness of the message and whether it is repeated.

[0127] Step S322, matching historical multicast message records within a preset receiving period according to the multicast message address and the multicast message type;

[0128] It should be noted that the preset receiving period refers to the time window set by the system for detecting duplicate messages. For example, if it is set to 10 seconds, the messages received within 10 seconds will be recorded as messages within the current receiving period to match whether there are duplicate messages. The preset receiving period is dynamically adjusted according to specific network requirements to ensure that duplicate messages can be effectively filtered.

[0129] In addition, historical multicast message records refer to the information of received multicast messages saved by the device within the preset receiving period, including the address, type, timestamp, etc. of the message. These records are used to compare whether the currently received message is repeated with the previously received message. By matching historical multicast message records, duplicate messages can be identified and repeated processing can be avoided.

[0130] It is understandable that the extracted multicast message address and multicast message type are matched with the historical multicast message records saved by the device to determine whether the currently received message has the same address and type as the message in the historical record. For example, if there is a message with an address of 239.1.1.1 and a type of join request in the historical record, and the message time is within the current receiving cycle, it is considered a match. The matching result is used to further determine whether the message is a duplicate message.

[0131] Step S323: identifying multicast messages repeated within a preset receiving period according to the message timestamp and the historical multicast message record, and obtaining repeated multicast messages.

[0132] It is understandable that by comparing the timestamp of the initial multicast message with the timestamp in the historical multicast message record, it is determined whether the two messages appear repeatedly within the preset receiving period. If the addresses and types of the two messages match, and the difference between their timestamps is less than or equal to the receiving period, the current message is marked as a repeated multicast message. For example, in a network with a receiving period of 10 seconds, if a join request message has a timestamp of 15:00:05 and another message of the same type and address has a timestamp of 15:00:08, then the two messages are marked as repeated multicast messages.

[0133] Step S33, identifying an expired multicast message according to the initial multicast message and a preset message validity period;

[0134] It should be noted that an expired multicast message refers to a multicast message that has exceeded the preset validity period. Due to the timeliness requirement in multicast communication, if some messages exceed the predefined validity period during transmission, they are no longer worth processing and will be marked as expired messages. For example, if a request to join a multicast group is not processed for more than 30 seconds, it may be considered an expired message.

[0135] It is understandable that by comparing the reception time of the initial multicast message with the current time, it is determined whether the message has exceeded the preset validity period. The preset message validity period can be dynamically set according to network requirements, such as 30 seconds or 60 seconds. If the difference between the reception time of the message and the current time is greater than the preset message validity period, it is marked as an expired message. For example, in a multicast environment, a join request is received after exceeding the validity period of 60 seconds due to network delay during the transmission process, and it will be marked as an expired message.

[0136] In a feasible implementation manner, step S33 may include steps S331 to S333:

[0137] Step S331, acquiring the current time and the message receiving time of the initial multicast message according to the initial multicast message;

[0138] It should be noted that the current time refers to the system time recorded by the device when processing a multicast message, which is used to compare with the time when the message is received. The current time is usually expressed in a standardized time format, such as UTC time, with an accuracy of seconds or milliseconds. It is a dynamically obtained time point that can reflect the real time when the message is processed. For example, if the current time is 15:30:00 on January 3, 2025, it means that the device is processing the message at that specific moment.

[0139] In addition, the message reception time refers to the time point when the initial multicast message is received by the device, which is usually recorded with second or millisecond accuracy and is used to determine the timeliness of the message. For example, the reception time of a multicast message is 15:29:50 on January 3, 2025, which means that the device received the message at this moment. The comparison between the message reception time and the current time is an important basis for determining whether the message is expired.

[0140] Step S332, obtaining a time difference according to the message receiving time and the current time, and determining whether the time difference exceeds a preset message validity period;

[0141] It should be noted that the time difference refers to the time interval between the current time and the time when the message is received, which is used to measure the delay from the receipt of the message to its processing. The time difference is obtained by simple subtraction. For example, if the current time is 15:30:00 on January 3, 2025, and the message is received at 15:29:50 on January 3, 2025, the time difference is 10 seconds. The time difference is a key indicator used to determine whether the message exceeds the preset validity period.

[0142] It is understandable that the time difference from the message receiving time to the current processing is calculated by subtracting the current time from the message receiving time. For example, if the current time is 15:30:00 on January 3, 2025, and the message receiving time is 15:29:40 on January 3, 2025, the time difference is 20 seconds. The time difference is compared with the preset message validity period. If the time difference is less than or equal to the validity period, the message is considered to be still valid; if the time difference exceeds the validity period, the message is considered to have expired. For example, if the validity period is set to 15 seconds and the time difference is 20 seconds, the message is judged to be an expired message.

[0143] Step S333: When it is determined that the time difference exceeds the preset message validity period, the initial group message is determined as an overdue multicast message.

[0144] It is understandable that when the time difference exceeds the preset message validity period, the multicast message is marked as an expired multicast message. An expired multicast message usually has lost its original processing value. For example, if a request message to join a multicast group expires, it may mean that the device has sent a new request message and the original request is meaningless. Expired messages will be filtered out and will no longer participate in subsequent processing or forwarding table updates. For example, a message received at 15:29:00 is judged to be an expired message at the current time 15:30:31, with a validity period of 30 seconds, and will be marked as an expired multicast message.

[0145] Step S34: discard the invalid multicast message, the repeated multicast message and the expired multicast message according to the preset filtering rule, and filter to obtain the target multicast message.

[0146] It is understandable that the identified invalid multicast messages, duplicate multicast messages and expired multicast messages are matched with the preset filtering rules, and these messages are discarded, and only the target multicast messages that meet the filtering rules are retained, which ensures that only valid messages that have been strictly screened can enter the subsequent forwarding table update link.

[0147] Step S40: modifying the initial multicast forwarding table according to the target multicast message to obtain a target multicast forwarding table, and forwarding the multicast message according to the target multicast forwarding table.

[0148] It should be noted that the multicast forwarding table is a data structure that stores the multicast forwarding path rules inside the device and is used to guide the transmission of multicast data in the network. The forwarding table contains information such as the multicast group address, the receiving interface list, and the output interface list, which determines which devices the multicast traffic should be delivered to. By dynamically updating the multicast forwarding table, it can adapt to changes in devices joining or leaving the network, ensuring the real-time and accuracy of multicast communication.

[0149] It is understandable that the forwarding table is updated according to the information contained in the target multicast message, such as adding a new receiving interface or removing an interface that is no longer needed. After the updated information is written to the forwarding table, the forwarding path of the data stream is guided according to the target multicast forwarding table. For example, when a device applies to join the multicast group with the address 239.1.1.1, the forwarding table will update the receiving interface list to include the device interface to ensure that the multicast data can be correctly forwarded to the device.

[0150] This embodiment provides a multicast message forwarding method, which solves the technical problem of invalid messages, duplicate messages and expired messages occupying resources and affecting processing efficiency in multicast communication by defining filtering rules based on preset multicast message addresses and multicast message types, and combining technical means for receiving and screening initial multicast messages, thereby achieving the beneficial effects of reducing invalid message interference, improving multicast message processing efficiency and optimizing multicast data forwarding paths.

[0151] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , step S40 of the multicast message forwarding method further includes steps S41 to S45:

[0152] Step S41, obtaining a target multicast address range and a reserved multicast address according to a preset multicast message address;

[0153] It should be noted that the target multicast address range refers to a subset of the preset multicast message addresses, which is used for traffic management of actual multicast communications. These addresses are usually related to specific business scenarios. For example, the multicast address of a video conference within an enterprise may be defined as 239.1.1.0 / 24, and other messages that do not belong to this range will be regarded as irrelevant messages.

[0154] In addition, reserved multicast addresses are special purpose addresses defined in the protocol. These addresses are usually not used for ordinary data transmission, but for multicast management and specific network functions. For example, the address 224.0.0.1 in IPv4 is the all-host group, and the address FF02::1 in IPv6 is the all-node group. These addresses are mainly used for network management rather than data transmission. Reserved multicast addresses need to be removed from the target multicast addresses to ensure the accuracy of the filtering rules.

[0155] It is understandable that the target multicast address range actually used for multicast communication is extracted from the preset multicast message address, and the reserved multicast address is separated. The target multicast address range is usually related to a specific business scenario. For example, 239.1.1.0 / 24 may be the multicast address range of a video conferencing system, while reserved addresses such as 224.0.0.1 need to be excluded. By clarifying the target range and reserved addresses, a basis is provided for the subsequent definition of address filtering rules.

[0156] Step S42, defining a multicast address filtering rule according to the target multicast address range and the reserved multicast address;

[0157] It should be noted that the multicast address filtering rules are a set of rules defined based on the target multicast address range and reserved multicast addresses, which are used to filter whether the addresses of multicast messages are legal. For example, the rules may stipulate that only addresses within the range of 239.1.1.0 / 24 are allowed, and reserved addresses such as 224.0.0.1 are not included. These rules can help eliminate multicast messages with irrelevant or illegal addresses and improve communication efficiency.

[0158] It is understandable that based on the target multicast address range and the reserved multicast addresses, filtering rules for filtering legal multicast addresses are defined. For example, the rule may stipulate that only addresses in the range of 239.1.1.0 / 24 are allowed to pass the filter, while excluding reserved addresses such as 224.0.0.1. The definition of multicast address filtering rules can help the device quickly determine whether the address is legal when processing messages, thereby improving processing efficiency.

[0159] Step S43, obtaining a multicast message type classification and a type priority according to a preset multicast message type;

[0160] It should be noted that multicast message type classification is a way to classify multicast messages according to their functions or usage scenarios. For example, messages can be classified into management messages, such as query messages, and data messages, such as join or leave report messages. Classification allows different types of messages to be processed more efficiently.

[0161] It can be understood that different types of classifications and corresponding priorities are extracted from the preset multicast message types. For example, a query message can be classified as a high priority because it affects the multicast group member status; while a leave report message can be classified as a low priority because the processing delay has little impact on the communication. By clarifying the classification and priority, a reference is provided for the subsequent definition of message type filtering rules.

[0162] Step S44, defining a multicast message type filtering rule according to the multicast message type classification and the type priority;

[0163] It should be noted that type priority refers to the processing order and importance of different types of multicast messages. For example, a query message may be set to a high priority because it directly affects the member status of the multicast group; while a report message leaving the multicast group may be set to a low priority because its processing timeliness requirement is lower. By setting type priority, you can ensure that critical messages are processed first.

[0164] It is understood that based on the classification and priority of multicast message types, filtering rules for filtering and sorting messages are defined. For example, the rules may specify that query messages are processed first and irrelevant message types are discarded, or only high-priority messages are processed when resources are tight. The definition of multicast message type filtering rules can help devices concentrate resources to process important messages and improve communication efficiency.

[0165] Step S45: defining a preset filtering rule according to the multicast address filtering rule and the multicast message type filtering rule.

[0166] It is understandable that a comprehensive preset filtering rule is generated by combining the multicast address filtering rule and the multicast message type filtering rule. For example, the rule may stipulate that only query messages with addresses within the range of 239.1.1.0 / 24 are allowed to pass the filtering, while leaving report messages are discarded. The preset filtering rule provides a comprehensive and accurate screening standard for subsequent message filtering.

[0167] This embodiment provides a multicast message forwarding method, which realizes dual screening of the legitimacy and importance of multicast messages by combining the technical means of multicast address filtering rules and multicast message type filtering rules, solves the technical problems of resource waste and low processing efficiency caused by illegal addresses and low-priority messages in multicast communications, and achieves the beneficial effects of accurately filtering invalid messages and improving the efficiency and reliability of multicast communications.

[0168] For example, to help understand the implementation process of the multicast message forwarding method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 3 , Figure 3 A brief flow chart of a multicast message forwarding method is provided, specifically:

[0169] The message receiving module is used to receive the initial multicast messages from the network, which include the message contents in the Internet Group Management Protocol and the Multicast Listener Discovery Protocol. The received messages will be passed to the message filtering module, in which three main functions are performed in sequence: identifying invalid messages, identifying duplicate messages, and filtering expired messages. Identifying invalid messages is to remove messages that do not conform to the protocol specifications by checking the message format, address range, and message type; identifying duplicate messages is to filter out repeated messages in a short period of time by comparing the content and timestamp of the received messages with the historical records; filtering expired messages is to remove messages that exceed the preset validity period by calculating the difference between the message receiving time and the current time. The filtered target multicast message will be passed to the multicast routing module, which maps the multicast address and the target device interface in the target message to the routing table by updating the routing table, and forwards the multicast message according to the updated routing table. The forwarding operation is completed through the network interface layer, and the multicast message that meets the requirements is sent to the target device, and finally the transmission and distribution of the multicast message is completed.

[0170] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the multicast message forwarding method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0171] This application also provides a multicast message forwarding device, please refer to Figure 4 , the multicast message forwarding device comprises:

[0172] A rule definition module 10, used to define a preset filtering rule according to a preset multicast message address or a preset multicast message type;

[0173] The message receiving module 20 is used to receive the initial multicast message of the Internet Group Management Protocol and the Multicast Listener Discovery Protocol;

[0174] A message filtering module 30, configured to filter the initial multicast message according to the preset filtering rule to obtain a target multicast message;

[0175] The message forwarding module 40 is used to modify the initial multicast forwarding table according to the target multicast message, obtain the target multicast forwarding table, and forward the multicast message according to the target multicast forwarding table.

[0176] The multicast message forwarding device provided by the present application adopts the multicast message forwarding method in the above embodiment, which can solve the technical problem of resource waste and low efficiency when the switch processes a large number of multicast requests or repeated messages. Compared with the prior art, the beneficial effects of the multicast message forwarding device provided by the present application are the same as the beneficial effects of the multicast message forwarding method provided by the above embodiment, and other technical features in the multicast message forwarding device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0177] In one embodiment, the message filtering module 30 is also used to identify invalid multicast messages based on the initial multicast message, the Internet Group Management Protocol and the multicast monitoring discovery protocol; identify repeated multicast messages based on the initial multicast message and the preset receiving period; identify expired multicast messages based on the initial multicast message and the preset message validity period; discard the invalid multicast message, the repeated multicast message and the expired multicast message according to the preset filtering rules, and filter to obtain the target multicast message.

[0178] In one embodiment, the message filtering module 30 is further used to obtain a preset message format, a preset message address range, and a preset address type according to the Internet Group Management Protocol and the multicast listening discovery protocol; identify a format error message in the initial multicast message according to the preset message format to obtain a format error multicast message; identify an out-of-range address in the initial multicast message according to the preset message address range to obtain an invalid address multicast message; identify a non-sending type address in the initial multicast message according to the preset address type to obtain an invalid sending type multicast message; and identify an invalid multicast message according to the format error multicast message, the invalid address multicast message, and the invalid sending type multicast message.

[0179] In one embodiment, the message filtering module 30 is further used to obtain a message type format, a message length format, and a message field range format according to the preset message format; identify a type error message in the initial multicast message according to the message type format to obtain a type error multicast message; identify a length error message in the initial multicast message according to the message length format to obtain a length error multicast message; identify a field out-of-range message in the initial multicast message according to the message field range format to obtain a field out-of-range multicast message; identify a format error multicast message according to the type error multicast message, the length error multicast message, and the field out-of-range multicast message.

[0180] In one embodiment, the message filtering module 30 is further used to obtain a multicast message address, a multicast message type, and a message timestamp based on the initial multicast message; match historical multicast message records within a preset receiving period based on the multicast message address and the multicast message type; and identify multicast messages repeated within a preset receiving period based on the message timestamp and the historical multicast message records to obtain repeated multicast messages.

[0181] In one embodiment, the message filtering module 30 is also used to obtain the current time and the message reception time of the initial multicast message based on the initial multicast message; obtain the time difference based on the message reception time and the current time, and determine whether the time difference exceeds the preset message validity period; when it is determined that the time difference exceeds the preset message validity period, the initial multicast message is determined as an overdue multicast message.

[0182] In one embodiment, the message forwarding module 40 is further used to obtain a target multicast address range and a reserved multicast address according to a preset multicast message address; define a multicast address filtering rule according to the target multicast address range and the reserved multicast address; obtain a multicast message type classification and a type priority according to a preset multicast message type; define a multicast message type filtering rule according to the multicast message type classification and the type priority; and define a preset filtering rule according to the multicast address filtering rule and the multicast message type filtering rule.

[0183] The present application provides a multicast message forwarding device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the multicast message forwarding method in the above-mentioned embodiment 1.

[0184] Reference below Figure 5 , which shows a schematic diagram of the structure of a multicast message forwarding device suitable for implementing the embodiment of the present application. The multicast message forwarding device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The multicast message forwarding device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0185] like Figure 5 As shown, the multicast message forwarding device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the multicast message forwarding device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the multicast message forwarding device to communicate wirelessly or wired with other devices to exchange data. Although the multicast message forwarding device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0186] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0187] The multicast message forwarding device provided by the present application adopts the multicast message forwarding method in the above embodiment, which can solve the technical problem of resource waste and low efficiency when the switch processes a large number of multicast requests or repeated messages. Compared with the prior art, the beneficial effects of the multicast message forwarding device provided by the present application are the same as the beneficial effects of the multicast message forwarding method provided by the above embodiment, and other technical features in the multicast message forwarding device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0188] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0189] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0190] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the multicast message forwarding method in the above-mentioned embodiment.

[0191] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0192] The computer-readable storage medium may be included in the multicast message forwarding device; or may exist independently without being assembled into the multicast message forwarding device.

[0193] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the multicast message forwarding device, the multicast message forwarding device: defines a preset filtering rule according to a preset multicast message address or a preset multicast message type; receives an initial multicast message of the Internet Group Management Protocol and the Multicast Listening Discovery Protocol; filters the initial multicast message according to the preset filtering rule to obtain a target multicast message; modifies the initial multicast forwarding table according to the target multicast message to obtain a target multicast forwarding table, and forwards the multicast message according to the target multicast forwarding table.

[0194] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0195] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0196] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0197] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned multicast message forwarding method, and can solve the technical problems of resource waste and low efficiency when the switch processes a large number of multicast requests or repeated messages. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the multicast message forwarding method provided by the above-mentioned embodiment, and will not be repeated here.

[0198] The present application also provides a computer program product, including a computer program, which implements the steps of the multicast message forwarding method as described above when executed by a processor.

[0199] The computer program product provided by the present application can solve the technical problem of resource waste and low efficiency when a switch processes a large number of multicast requests or repeated messages. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the multicast message forwarding method provided by the above embodiment, which will not be repeated here.

[0200] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A multicast message forwarding method, characterized in that: The method comprises: Defining preset filtering rules according to preset multicast message addresses or preset multicast message types; Receive initial multicast messages of Internet Group Management Protocol and Multicast Listener Discovery Protocol; Filtering the initial multicast message according to the preset filtering rule to obtain a target multicast message; The initial multicast forwarding table is modified according to the target multicast message to obtain a target multicast forwarding table, and the multicast message is forwarded according to the target multicast forwarding table.

2. The method according to claim 1, characterized in that The step of filtering the initial multicast message according to the preset filtering rule to obtain the target multicast message includes: Identifying invalid multicast messages based on the initial multicast message, the Internet Group Management Protocol, and the Multicast Listening Discovery Protocol; Identifying repeated multicast messages according to the initial multicast message and a preset receiving period; Identifying an expired multicast message according to the initial multicast message and a preset message validity period; The invalid multicast message, the repeated multicast message and the expired multicast message are discarded according to the preset filtering rule, and the target multicast message is obtained by filtering.

3. The method according to claim 2, characterized in that The step of identifying an invalid multicast message according to the initial multicast message, the Internet Group Management Protocol and the Multicast Listening Discovery Protocol comprises: According to the Internet Group Management Protocol and the Multicast Listening Discovery Protocol, a preset message format, a preset message address range, and a preset address type are obtained; Identify a format error message in the initial multicast message according to the preset message format to obtain a format error multicast message; Identify the out-of-range address in the initial multicast message according to the preset message address range, and obtain an invalid address multicast message; Identify the non-sending type address in the initial multicast message according to the preset address type, and obtain an invalid sending type multicast message; Invalid multicast messages are identified according to the format error multicast message, the invalid address multicast message, and the invalid sending type multicast message.

4. The method according to claim 3, characterized in that The step of identifying a format error message in the initial multicast message according to the preset message format to obtain a format error multicast message comprises: According to the preset message format, obtain the message type format, message length format and message field range format; Identify a type error message in the initial multicast message according to the message type format, and obtain a type error multicast message; Identify a length error message in the initial multicast message according to the message length format, and obtain a length error multicast message; Identify a field out-of-range message in the initial multicast message according to the message field range format, and obtain a field out-of-range multicast message; A format error multicast message is identified according to the type error multicast message, the length error multicast message, and the field out-of-range multicast message.

5. The method according to claim 2, characterized in that The step of identifying repeated multicast messages according to the initial multicast message and the preset receiving period includes: According to the initial multicast message, obtain the multicast message address, multicast message type and message timestamp; According to the multicast message address and the multicast message type, matching historical multicast message records within a preset receiving period; According to the message timestamp and the historical multicast message record, the multicast message repeated within a preset receiving period is identified to obtain the repeated multicast message.

6. The method according to claim 2, characterized in that The step of identifying the expired multicast message according to the initial multicast message and the preset message validity period comprises: According to the initial multicast message, obtain the current time and the message reception time of the initial multicast message; Obtaining a time difference according to the message receiving time and the current time, and determining whether the time difference exceeds a preset message validity period; When it is determined that the time difference exceeds the preset message validity period, the initial multicast message is determined as an expired multicast message.

7. The method according to any one of claims 1 to 6, characterized in that The step of defining a preset filtering rule according to a preset multicast message address or a preset multicast message type comprises: According to the preset multicast message address, obtain the target multicast address range and the reserved multicast address; Defining a multicast address filtering rule according to the target multicast address range and the reserved multicast address; According to the preset multicast message type, obtain the multicast message type classification and type priority; Defining a multicast message type filtering rule according to the multicast message type classification and the type priority; A preset filtering rule is defined according to the multicast address filtering rule and the multicast message type filtering rule.

8. A multicast message forwarding device, characterized in that: The device comprises: A rule definition module, used to define preset filtering rules according to a preset multicast message address or a preset multicast message type; A message receiving module, used for receiving initial multicast messages of Internet Group Management Protocol and Multicast Listening Discovery Protocol; A message filtering module, used to filter the initial multicast message according to the preset filtering rule to obtain a target multicast message; The message forwarding module is used to modify the initial multicast forwarding table according to the target multicast message, obtain the target multicast forwarding table, and forward the multicast message according to the target multicast forwarding table.

9. A multicast message forwarding device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the multicast message forwarding method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the multicast message forwarding method according to any one of claims 1 to 7 are implemented.