Search

CN-121984647-A - Redundant message processing method and device without repeatedly occupying serial numbers

CN121984647ACN 121984647 ACN121984647 ACN 121984647ACN-121984647-A

Abstract

The invention discloses a method and a device for processing a redundant message without repeatedly occupying a serial number, wherein the method comprises the steps of S1, analyzing a message received by equipment, S2, judging whether the message carries a redundant frame, if so, proceeding to step S4, otherwise proceeding to step S3, determining to generate the serial number by using a truncation method, adding the redundant frame into the received message, wherein the value of a serial number field in the redundant frame is a value of the serial number, then proceeding to step S5, S4, judging whether the message needs to be copied to a redundant path, if so, proceeding to step S5, otherwise, directly forwarding the message according to the original path, and S5, copying the message to the redundant path. In the method, the message carrying the redundant frame originally does not repeatedly add the redundant frame and does not occupy the serial number, the message carrying the redundant frame is optionally copied to all redundant paths when the frame is copied, and when the serial number of the redundant frame is determined to be added, the serial number can be turned over by adopting a cut-off method without logic judgment.

Inventors

  • ZHANG MENGDI
  • WANG ZHENZHEN

Assignees

  • 昆高新芯微电子(江苏)有限公司

Dates

Publication Date
20260505
Application Date
20260109

Claims (8)

  1. 1. A redundant message processing method without repeatedly occupying serial numbers is characterized by comprising the following steps: S1, analyzing a message received by equipment; s2, judging whether the message carries redundant frames, if so, proceeding to a step S4, otherwise proceeding to a step S3; S3, determining a generated sequence number by using a truncation method, and adding a redundant frame in the received message, wherein the value of a sequence number field in the redundant frame is a value of the generated sequence number, and then proceeding to step S5; S4, judging whether the message needs to be copied to a redundant path or not based on user configuration, if so, proceeding to a step S5, otherwise, directly forwarding the message according to the original path; and S5, copying the message to a redundant path.
  2. 2. The method according to claim 1, wherein in step S2, it is determined whether the message carries a redundant frame by: Judging whether an R-TAG frame exists behind a source MAC address of a message which does not carry VLAN frames; and judging whether an R-TAG frame exists after the first VLAN frame of the message for the message carrying the VLAN frame.
  3. 3. The method according to claim 1, wherein in step S3, determining the generated sequence number using a truncation method specifically comprises: S31, initializing a generated serial number to be any value in a preset range, wherein the preset range is 0-65535; S32, when receiving the message, judging whether the generated serial number needs to be reset or not based on user configuration, if so, resetting the generated serial number to 0 and then outputting, otherwise, directly outputting the current generated serial number; And S32, incrementing the current generation sequence number by 1, and then intercepting the lower 16 bits of the current generation sequence number as an updated generation sequence number for the next received message.
  4. 4. A method according to claim 3, wherein, in step S31, Default setting of initial value of generated sequence number to 0 in case of user not configuring initial value, and If the device does not receive the message more than twice the aging time, the serial number is generated and initialized again.
  5. 5. The method according to claim 1, characterized in that in step S3, redundant frames are added to the received message by: For the message which does not carry VLAN frame, adding the R-TAG frame after the source MAC address of the original message; for a message carrying one VLAN frame, adding an R-TAG frame after the VLAN frame of the original message; For a message carrying two VLAN frames, the R-TAG frame is added after the first VLAN frame of the original message.
  6. 6. The method according to claim 1, characterized in that in step S4, when copying the message to the redundant path, for the message that already carries the redundant frame, the copied redundant path includes the redundant path of the message original and the new redundant path.
  7. 7. The method according to claim 1, wherein in step S4, the number of messages copied does not exceed the maximum physical port total number of the redundant switching device minus one when the message copying is performed.
  8. 8. The redundant message processing device without repeatedly occupying the serial numbers is characterized by comprising the following modules: the message analysis module is used for analyzing the message received by the equipment; The redundant message judging module is used for judging whether the message carries redundant frames or not; The redundant frame adding module is used for determining to generate a serial number by using a truncation method when the redundant message judging module judges that the message does not carry the redundant frame, and adding the redundant frame into the received message, wherein the value of the serial number field in the redundant frame is a value of the serial number; The redundant message processing module is used for further judging whether the message needs to be copied to a redundant path or not based on user configuration when the redundant message judging module judges that the message carries the redundant frame; And the message copying and forwarding module is used for copying the message added with the redundant frame by the redundant frame adding module to the redundant path, copying the message judged to be copied to the redundant path by the redundant message processing module to the redundant path, and forwarding the message judged not to be copied to the redundant path by the redundant message processing module directly according to the original path.

Description

Redundant message processing method and device without repeatedly occupying serial numbers Technical Field The invention relates to the technical field of time sensitive network TSN, in particular to a redundant message processing method and device without repeatedly occupying sequence numbers. Background IEEE 802.1CB is one of the important protocols for time-sensitive networks (TSN, time Sensitive networks) in the IEEE standard, and has a main role in improving the reliability of network communication through a redundant transmission mechanism, and is mostly used in the scenes of industrial automation, vehicle-mounted ethernet, etc. with high requirements on real-time and fault tolerance. The frame copying technology copies the key data frames for a plurality of times, and sends the key data frames to the destination through the redundant network, so that the situation that the data is lost due to the fault of a forwarding path is avoided, and the reliability of data transmission can be ensured without retransmission. The frame elimination technology is applied to the receiving end and used for detecting and discarding repeated frames, so that the uniqueness of the data is ensured. In an actual application scene, due to the limitation of the number of devices or the functions of the devices, the redundant network topology may have a scene that a plurality of redundant paths are overlapped and used, and FRER (Frame Replication and Elimination for Redundancy) technology has a certain limitation. Because traffic from different devices is replicated at different nodes, the situation that the message carrying the redundant frame and the message not carrying the redundant frame exist simultaneously exists in the redundant network, and the processing strategy of the FRER frame replication technology does not distinguish the two, but uniformly carries out the operation of adding the redundant frame, so that the reliability of redundant transmission cannot be ensured. Disclosure of Invention Aiming at the technical problems, the invention provides a redundant message processing method without repeatedly occupying sequence numbers, which solves the problem that the messages without carrying redundant frames and the messages with redundant frames exist simultaneously in a complex redundant network, so that the messages originally carrying the redundant frames can not repeatedly occupy the sequence numbers, the messages newly added with the redundant frames carry the redundant frames with continuous sequence numbers, the phenomenon of message error loss caused by overlarge sequence number intervals among the continuous messages is avoided, the reliability of redundant paths is improved, the messages carrying the redundant frames are controlled not to be duplicated to all the redundant paths when being processed, the number of the redundant paths is effectively restrained, and the occupation of network bandwidth is reduced. Meanwhile, a truncation method is adopted to determine the serial number of the redundant frame, the generated serial number is turned over without judgment, the operation flow is simplified, and the equipment processing speed is increased. In order to achieve the purpose, the technical scheme of the invention provides a redundant message processing method without repeatedly occupying a serial number, which comprises the following steps of S1, S2, judging whether a message carries a redundant frame or not, if so, proceeding to S4, otherwise proceeding to S3, determining to generate the serial number by using a truncation method, adding the redundant frame into the received message, wherein the value of a serial number field in the redundant frame is a value of the generated serial number, then proceeding to S5, S4, judging whether the message needs to be copied to a redundant path based on user configuration, if so, proceeding to S5, otherwise, directly forwarding the message according to the original path, and S5, copying the message to the redundant path. Further, in step S2, whether the message carries a redundant frame is determined by determining whether an R-TAG frame exists after the source MAC address of the message for the message which does not carry a VLAN frame, and whether an R-TAG frame exists after the first VLAN frame of the message for the message which carries a VLAN frame. Further, in the step S3, the method for determining the generated sequence number by using the truncation method specifically comprises the steps of S31 of initializing the generated sequence number to an arbitrary value within a preset range, wherein the preset range is 0-65535, S32 of judging whether the generated sequence number needs to be reset or not based on user configuration when a message is received, if so, resetting the generated sequence number to 0 and then outputting, otherwise, directly outputting the current generated sequence number, S32 of increasing the current generated sequence number by 1