Method, apparatus and device for controlling multicast frame message forwarding
A method and apparatus for controlling multicast frame message forwarding, a communication device, and a computer-readable medium are provided. The method includes: acquiring a multicast frame message; and inhibiting forwarding the multicast frame message, in response to a number of previously forwarded duplicate messages of the multicast frame message within a predetermined time period reaching a predetermined threshold.
1 . A method for controlling multicast frame message forwarding, comprising:
acquiring a multicast frame message; and
inhibiting forwarding the multicast frame message, in response to a number of previously forwarded duplicate messages of the multicast frame message within a predetermined time period having a predetermined time length reaching a predetermined threshold, wherein duplicate messages of the multicast frame message are determined based on key information including a hash value or checksum value of the multicast frame message;
wherein the method further comprising:
determining, from a table, a target information combination based on a message type and a key information of the multicast frame message, wherein each information combination of the table includes a respective message type, respective key information, and a respective reference forwarding time instant and a respective latest message quantity for messages with the respective message type and the respective key information; and
taking a latest message quantity in the target information combination as the number of previously forwarded duplicate messages of the multicast frame message within the predetermined time period for being compared with the predetermined threshold, in response to a time difference between the reference forwarding time instant and a first time instant being less than or equal to the predetermined time length, wherein the first time instant is a time instant at which the multicast frame message is acquired;
or
wherein the method further comprising:
determining, from a table, a target information combination based on a message type and a key information of the multicast frame message, wherein each information combination of the table includes a respective message type, respective key information, and a respective latest forwarding time instant and a respective latest message quantity for messages with the respective message type and the respective key information; and
taking a latest message quantity in the target information combination as the number of previously forwarded duplicate messages of the multicast frame message within the predetermined time period for being compared with the predetermined threshold, in response to a time difference between the latest forwarding time instant and a first time instant being less than or equal to the predetermined time length, wherein the first time instant is a time instant at which the multicast frame message is acquired.
2 . The method of claim 1 , further comprising:
forwarding the multicast frame message, updating the reference forwarding time instant to a forwarding time instant of the multicast frame message, and updating the latest message quantity to 1, in response to the time difference between the reference forwarding time instant and the first time instant being greater than the predetermined time length.
3 . The method of claim 1 , further comprising:
forwarding the multicast frame message, updating the latest forwarding time to a forwarding time instant of the multicast frame message, and updating the latest message quantity in the target information combination to 1, in response to the time difference between the latest forwarding time instant and the first time instant being greater than the predetermined time length.
4 . The method of claim 1 , wherein the key information of the multicast frame message comprises the checksum value;
wherein the target information combination is determined based on a comparison between the checksum value of the multicast frame message and the checksum value of each information combination in the table and a comparison between the message type of the multicast frame message and the message type of each information combination in the table.
5 . The method according to claim 1 , wherein the multicast frame message comprises an indication of a destination address, and
wherein the method is performed by a communication device, and further comprises:
inhibiting forwarding the multicast frame message, in response to the destination address being a multicast address and no devices being associated with an available interface of the communication device or no other devices being associated with the available interface of the communication device other than a device that transmits the multicast frame message.
6 . The method of claim 1 , further comprising:
forwarding the multicast frame message regardless of whether the number of the previously forwarded duplicate messages of the multicast frame message within the predetermined time period reaches the predetermined threshold, under a condition that a channel quality of a communication channel on which the multicast frame message is transmitted complies with a predetermined requirement.
7 . The method of claim 1 , further comprising:
determining a second number of previously forwarded duplicate messages of the multicast frame message recorded in a storage; and
inhibiting forwarding the multicast frame message, in response to the second number reaching a second predetermined threshold.
8 . The method of claim 1 , further comprising:
forwarding the multicast frame message, in response to an absence of previously forwarded duplicate messages of the multicast frame message or the number of the previously forwarded duplicate messages within the predetermined time period not reaching the predetermined threshold.
9 . A communication device comprising:
one or more processors; and
one or more memories storing computer-readable instructions thereon, wherein the computer-readable instructions, when executed by the one or more processors, are configured to cause the communication device to:
acquire a multicast frame message; and
inhibit forwarding the multicast frame message, in response to a number of previously forwarded duplicate messages of the multicast frame message within a predetermined time period reaching a predetermined threshold, wherein duplicate messages of the multicast frame message are determined based on key information including a hash value or checksum value of the multicast frame message;
wherein the computer-readable instructions are further configured to cause the communication device to:
determine, from a table, a target information combination based on a message type and a key information of the multicast frame message, wherein each information combination of the table includes a respective message type, respective key information, and a respective reference forwarding time instant and a respective latest message quantity for messages with the respective message type and the respective key information; and
take a latest message quantity in the target information combination as the number of previously forwarded duplicate messages of the multicast frame message within the predetermined time period, in response to a time difference between the reference forwarding time instant and a first time instant being less than or equal to the predetermined time length, wherein the first time instant is a time instant at which the multicast frame message is acquired;
or
wherein the computer-readable instructions are further configured to cause the communication device to:
determine, from a table, a target information combination based on a message type and a key information of the multicast frame message, wherein each information combination of the table includes a respective message type, respective key information, and a respective latest respective forwarding time instant and a respective latest message quantity for messages with the respective message type and the respective key information; and
take a latest message quantity in the target information combination as the number of previously forwarded duplicate messages of the multicast frame message within the predetermined time period, in response to a time difference between the latest forwarding time instant and a first time instant being less than or equal to the predetermined time length, wherein the first time instant is a time instant at which the multicast frame message is acquired.
10 . The communication device of claim 9 , wherein the computer-readable instructions further cause the communication device to:
forward the multicast frame message, updating the reference forwarding time instant to a forwarding time instant of the multicast frame message, and updating the latest message quantity to 1, in response to the time difference between the reference forwarding time instant and the first time instant being greater than the predetermined time length.
11 . The method of claim 9 , wherein the computer-readable instructions further cause the communication device to:
forward the multicast frame message, update the latest forwarding time to a forwarding time instant of the multicast frame message, and update the latest message quantity in the target information combination to 1, in response to the time difference between the latest forwarding time instant and the first time instant being greater than the predetermined time length.
12 . The communication device of claim 9 , wherein the key information of the multicast frame message comprises the checksum value;
wherein the target information combination is determined based on a comparison between the checksum value of the multicast frame message and the checksum value of each information combination in the table and a comparison between the message type of the multicast frame message and the message type of each information combination in the table.
13 . The communication device according to claim 9 , wherein the multicast frame message comprises an indication of a destination address,
wherein the computer readable instructions further cause the communication device to:
inhibit forwarding the multicast frame message, in response to the destination address being a multicast address, and no devices being associated with an available interface of the communication device or no other devices being associated with the available interface of the communication device other than a device that transmits the multicast frame message.
14 . A communication apparatus for controlling multicast frame message forwarding, comprising a processor, wherein the processor, in response to computer-executable instructions, performs the steps of the method as claimed in claim 1 .
15 . A non-transitory computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the steps of the method as claimed in claim 1 .