Redundant data transmission method and system, switch and medium
By replicating the data packets in the switch and adding a virtual local network label identity symbol, the transmission of redundant data in different VLAN domains is realized, solving the problem of insufficient reliability and stability in the existing technology. Improve the reliability and stability of data transmission.
Patent Information
- Application Number
- CN202411490528.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, during the transmission of redundant packets, multiple redundancy can only be transmitted in the same VLAN domain, resulting in insufficient network reliability and stability.
By performing a frame copy on the original data message in the first switch and adding a different virtual LAN identifier to each copied data message, multi-channel redundant messages are transmitted in different virtual LANs.
It improves the reliability and stability of data packet transmission and avoids the problem of data transmission interruption when the virtual LAN fails or is congested.
Smart Images

Figure CN119363849A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a redundant data transmission method, system, switch and medium. Background Art
[0002] As the demand for network reliability and real-time performance in industrial automation, transportation systems, audio and video transmission, etc. continues to increase, the application of time-sensitive networks (TSN) is becoming more and more frequent. IEEE 802.1CB is part of the time-sensitive network standard, which aims to provide high reliability, low latency and deterministic data transmission. However, the current redundant message transmission process, through IEEE 802.1CB, adds a specific layer of the same VLAN tag to the original message, so that multi-path redundancy can only be transmitted in the same VLAN domain, which leads to insufficient reliability and stability of the transmission network. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a redundant data transmission method, system, switch and medium, which can effectively achieve the reliability and stability of redundant data transmission.
[0004] In a first aspect, an embodiment of the present application provides a redundant data transmission method, the method being applied to a first switch, comprising:
[0005] Receiving an original data message sent by the first terminal;
[0006] Processing the original data message according to the first configuration rule to obtain at least two new data messages; wherein each of the new data messages is a message with a virtual local area network identifier;
[0007] The at least two new data messages are transmitted to the second switch through the corresponding virtual local area networks according to the virtual local area network identifiers.
[0008] In some embodiments, the first configuration rule includes a first flow instance and a first fred instance; the first flow instance includes a first flow identifier and a first input port; the first fred instance includes a first fred identifier, a generation instance mode, a first ingress flow, a first output port, and a first virtual local area network identifier;
[0009] The processing of the original data message according to the first configuration rule to obtain at least two new data messages includes:
[0010] Performing frame replication processing on the original data message according to the generation instance mode to obtain at least two original data messages with the same R-tag;
[0011] Different first virtual local area network identifiers are respectively added to at least two original data packets with the same R-tag to obtain at least two new data packets.
[0012] In some embodiments, transmitting at least two of the new data packets to the second switch through corresponding virtual local area networks according to the virtual local area network identifiers respectively includes:
[0013] Determine the first output port of each of the new data packets according to the correspondence between the first output port in the first fred instance and the first virtual local area network identifier;
[0014] The new data message is transmitted to the second switch through the corresponding first output port.
[0015] In some embodiments, before adding different first virtual local area network identifiers to at least two original data packets with the same R-tag to obtain at least two new data packets, the method further includes:
[0016] According to the first frer instance, at least two data packets with the same R-tag are redirected to different output port queues according to the first output port configured by the first frer instance.
[0017] In a second aspect, an embodiment of the present application provides a redundant data transmission method, which is applied to a second switch and includes:
[0018] Receive at least two new data messages sent by the first switch; wherein the new data messages are messages obtained by transmitting through the above-mentioned redundant data transmission method;
[0019] At least two of the new data packets are processed according to the second configuration rule to obtain an output data packet, and the output data packet is transmitted to the second terminal; wherein the virtual local area network identifier of the output data packet is the virtual local area network identifier modified according to the second configuration rule.
[0020] In some embodiments, the second configuration rule includes a second flow instance and a second fred instance; the second flow instance includes a second flow identifier and a second input port; the second fred instance includes a second fred identifier, a recovery instance mode, a second ingress flow, a second output port, and a second virtual local area network identifier;
[0021] The processing of at least two of the new data packets according to the second configuration rule to obtain an output data packet, and transmitting the output data packet to the second terminal includes:
[0022] Performing frame elimination processing on the new data message according to the recovery instance mode, so as to eliminate multiple redundant frames in the multiple new data messages with R-tags, and only one new data message remains;
[0023] modifying the first virtual local area network identifier of the new data message to the second virtual local area network identifier according to the second fred instance to obtain the output data message;
[0024] The output data message is transmitted to the second terminal through the second output port.
[0025] In some embodiments, before modifying the first virtual local area network identifier of the new data message to the second virtual local area network identifier according to the second fred instance to obtain the output data message, the method further includes:
[0026] The new data message remaining after the frame is eliminated is redirected to the corresponding output port queue according to the second fred instance.
[0027] In a third aspect, an embodiment of the present application provides a redundant data transmission system, including: a first terminal, a first switch connected to the first terminal, a second terminal, and a second switch connected to the second terminal;
[0028] The first terminal is used to send a data message to the first switch;
[0029] The first switch is used in the above redundant data transmission method;
[0030] The second switch is used to execute the above redundant data transmission method;
[0031] The second terminal is used to receive the data message output by the second switch.
[0032] In a fourth aspect, an embodiment of the present application provides a switch, the switch comprising a processor and a memory, the memory storing a computer program, and the processor being configured to execute the computer program to implement the above-mentioned redundant data transmission method.
[0033] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the above-mentioned redundant data transmission method when executed on a processor.
[0034] The embodiment of the present application has the following beneficial effects: in the data message transmission process, the embodiment of the present application first transmits the original data message to be transmitted to the first switch through the configured input port through the first terminal, and performs frame replication in the first switch, and adds corresponding virtual local area network identifiers to the multiple data messages obtained after each frame replication according to the configuration rules, and then transmits the new data message generated in the first switch to the second switch through different virtual local area networks according to the virtual local area network identifier, and performs frame elimination processing in the second switch, and modifies the virtual local area network identifier of a data message remaining after elimination, and then transmits the output data message generated in the second switch to the second terminal through the corresponding virtual local area network. This embodiment realizes the transmission of multiple redundant messages in different virtual local area networks, ensures that the data message will not rely on one network path, and thus avoids the situation that when the virtual local area network fails or is congested, another virtual local area network can still transmit data normally, thereby ensuring the security, reliability and stability of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A schematic diagram showing a structure of a redundant data transmission system according to an embodiment of the present application is shown;
[0037] Figure 2 A first flow chart of a redundant data transmission method according to an embodiment of the present application is shown;
[0038] Figure 3 A second flow chart of the redundant data transmission method according to an embodiment of the present application is shown;
[0039] Figure 4 A third flow chart of the redundant data transmission method according to an embodiment of the present application is shown;
[0040] Figure 5 A fourth flow chart of the redundant data transmission method according to an embodiment of the present application is shown;
[0041] Figure 6 A fifth flow chart of the redundant data transmission method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0043] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0044] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0045] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0046] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0047] As the demand for network reliability and real-time performance in industrial automation, transportation systems, audio and video transmission and other fields continues to increase, in order to ensure that data can still be transmitted in the event of a network failure, the 802.1CB protocol is now mostly used, and its core technologies include frame replication and elimination.
[0048] Currently, the formats of redundant messages implemented by 802.1CB are commonly divided into the following two types:
[0049] 1. Redundant messages add a layer of R-TAG on the original message, where R-TAG is a unique identifier attached to each frame copy through the generation function, which is used to distinguish and identify different copies.
[0050] 2. Redundant messages add a layer of VLAN_TAG and a layer of R-TAG on the original message; Vlan_Tag is used to isolate redundant traffic in a dedicated VLAN, which can reduce the interference of other network traffic on redundant traffic and ensure the stable transmission of redundant traffic.
[0051] However, currently, the second type of redundant messages is mostly about adding the same dedicated Vlan ID to multiple redundant links.
[0052] It can be understood that in the prior art, the transmission of redundant messages is to copy the original data into two identical redundant data through the frame replication function. The two identical redundant data have the same r-tag and the same vlan_id (virtual local area network identifier), which means that the two redundant data must be transmitted in the same vlan domain, which in turn leads to insufficient reliability and stability of redundant data transmission.
[0053] Based on this, the present application proposes a redundant data transmission method, system, switch and medium to realize that redundant data of different output ports have different virtual LAN identifiers, and can then be transmitted through different virtual LANs to improve the reliability and stability of data message transmission.
[0054] The redundant data transmission system is described below in conjunction with some specific embodiments.
[0055] Figure 1 A schematic diagram of the structure of a redundant data transmission system according to an embodiment of the present application is shown. Exemplarily, the redundant data transmission system includes:
[0056] A first terminal 100, a first switch 200 connected to the first terminal 100, a second terminal 400, and a second switch 300 connected to the second terminal 400; wherein, the embodiment of the present application realizes data message transmission between the first terminal 100 and the second terminal 400 through the redundant transmission system. When describing the system of the embodiment of the present application below, the data message transmission mode is from the first terminal 100 to the second terminal 400; wherein, the first terminal 100 and the second terminal 400 can be, but are not limited to, various hardware devices for monitoring, controlling and managing production processes (such as programmable logic controllers, remote terminal units, distributed control systems, sensors and actuators, etc.), devices for data storage, processing and transmission (such as servers, storage devices, network devices, virtualization devices, monitoring devices, etc.), portable base stations, drones, wearable devices, radio devices, laptops, etc. The first switch 200 and the second switch 300 in the embodiment of the present application can use switches with TSN chips.
[0057] The following describes the ACL rules (implemented by configuring stream instances), stream instances (stream instances) and frer instances involved in the embodiments of the present application.
[0058] In this embodiment, ACL rule configuration can be implemented by configuring a stream instance (stream instance). The stream instance (stream instance) and the frer instance are both pre-set. The stream instance configuration includes but is not limited to the stream identifier, input port and virtual LAN identifier, etc. The frer instance configuration includes but is not limited to the frer identifier, instance mode, inlet flow, output port and virtual LAN identifier, etc.
[0059] The role of the flow instance in this embodiment is to achieve the effect of distinguishing different data packets in the tag topology network by matching the traffic characteristics of the terminal data.
[0060] The role of the frer instance in this embodiment is to perform corresponding processing flow on the data packets matched by the flow instance by binding to a specific flow instance. The processing flow varies according to different parameter configurations.
[0061] The parameters required for the configuration flow instance of the switch in this embodiment are described as follows:
[0062] The stream identifier is the ID of the specified stream instance, which is used to distinguish other stream instances.
[0063] Input port, to specify the data packets that match the incoming port. This parameter is a parameter that must be configured for the flow instance.
[0064] vlan ID is the virtual LAN identifier carried by the specified matching traffic data frame. If not configured, it means that the virtual LAN identifier will not be used for filtering.
[0065] The parameters required for configuring the frer instance of the switch in this embodiment are described as follows:
[0066] The frer identifier specifies the id of the frer instance and is used to distinguish other frer instances.
[0067] Instance mode, including instance generation mode and instance recovery mode.
[0068] The entry stream is the stream instance bound to enter the frer instance processing flow.
[0069] Output port is the output port of the specified data message.
[0070] The virtual LAN identifier is the virtual LAN identifier that a specified data message carries after it is transmitted from the switch. This virtual LAN identifier is added by the switch and is added to the outermost side of the data message.
[0071] Recovery terminate specifies whether to eliminate the r-tag (a unique identifier on a frame copy). If true, the outgoing data no longer has an r-tag. If false, the outgoing data still has an r-tag. This is configurable and takes effect only when the instance mode is set to recovery instance mode.
[0072] The first terminal 100 is used to send an original data message to the first switch 200 .
[0073] Exemplarily, when the first terminal 100 needs to communicate with the second terminal 400 , the first terminal 100 first sends an original data message to the first switch 200 .
[0074] The first switch 200 is configured to receive an original data message and process the original data message according to a first configuration rule to obtain at least two new data messages, and transmit the new data message to the second switch 300 according to the first configuration rule.
[0075] Each new data message is a data message with a virtual local area network identifier.
[0076] It can be understood that after the first switch 200 receives the original data message sent by the first terminal 100, it performs frame replication on the original data message according to the first configuration rule to obtain two data messages with the same R-tag, and then adds a virtual LAN identifier to each frame-replicated original data message according to the first configuration rule to generate two new data messages with the same R-tag but different virtual LAN identifiers, and then transmits the two new data messages to the second switch 300 through the corresponding virtual local area network (vlan).
[0077] In some embodiments, Figure 2 As shown, during the redundant data transmission process of the first switch 200, the process includes:
[0078] Step S100: receiving an original data message sent by the first terminal 100.
[0079] Step S200: Process the original data message according to the first configuration rule to obtain at least two new data messages.
[0080] Each new data message is a data message with a virtual local area network identifier.
[0081] Among them, the first configuration rule includes a first flow instance and a first frer instance; the first flow instance includes a first flow identifier and a first input port; the first frer instance includes a first frer identifier, a generation instance mode, a first inlet flow, a first output port and a first virtual LAN identifier.
[0082] Before step S200, the method further includes: determining whether the data message matches a preset matching field in the first flow instance.
[0083] The preset matching fields may include, but are not limited to, input port number, vid, sip, dip, sport, dport, etc. In this embodiment, only the input port is concerned, so only the first input port field needs to be matched. It can be understood that if the original data message received by the first switch 200 is input through the port number configured by the first input port, step S200 is executed. If the original data message received by the first switch 200 is not input through the port number configured by the first input port, it is directly forwarded to each output port queue normally.
[0084] In some embodiments, Figure 3 As shown, step S200 includes:
[0085] Step S210: perform frame replication processing on the data message according to the generation instance mode to obtain at least two data messages with the same R-tag.
[0086] In this embodiment, the first switch 200 performs frame replication on the received original data message according to the generation instance mode according to the first frer instance, so as to obtain two or more data messages with the same R-tag.
[0087] Step S220: Add different first virtual local area network identifiers to at least two data packets with the same R-tag, so as to obtain at least two new data packets.
[0088] In this embodiment, a different first virtual LAN identifier is added to each frame-copied data message according to the first frer instance through the vlan_Tag management module, wherein the added first virtual LAN identifier is pre-configured in the first frer instance.
[0089] Step S300: Transmit at least two new data packets to the second switch 300 through corresponding virtual local area networks according to virtual local area network identifiers.
[0090] In the above steps, each new data message carries a different virtual LAN identifier. In this step, the new data message can be transmitted to the second switch 300 through the corresponding virtual LAN according to the virtual LAN identifier. In this way, different redundant data can be transmitted through different virtual LANs, thereby improving the reliability and stability of data transmission, and enhancing the flexibility and fault tolerance of the network.
[0091] like Figure 4As shown, step S300 includes:
[0092] Step S310: determining the first output port of each new data message according to the correspondence between the first output port and the first virtual local area network identifier in the first frer instance.
[0093] Step S320: Transmit the new data message to the second switch 300 through the corresponding first output port.
[0094] The first fred instance is pre-configured with the first virtual LAN identifiers of multiple redundant data messages obtained through frame replication, and the first virtual LAN identifiers of each data message are different, and the correspondence between the first virtual LAN identifier and the first output port is configured, that is, the data message with the first virtual LAN identifier A is transmitted through the first output port a, the data message with the first virtual LAN identifier B is transmitted through the first output port b, the data message with the first virtual LAN identifier C is transmitted through the first output port c, and so on; in this way, the first output port of each new data message can be determined according to the first virtual LAN identifier in the new data message, and then the new data message can be transmitted to the second switch 300 through the determined corresponding first output port.
[0095] For example, Figure 1 In the redundant data transmission system shown, the first flow instance of the first switch 200 can be configured as follows:
[0096] stream 1;
[0097] ingress interface ge1 / / Bind the flow feature to ingress ge1;
[0098] That is, for the first stream instance, the first stream identifier is stream1 and the first input port is input port 1.
[0099] The first frer instance of the first switch 200 may be configured as follows:
[0100] frer 1;
[0101] mode generation;
[0102] egress interface ge2 frer-vlan 20 / / Only the frer-vlan of egress port 2 is 20;
[0103] egress interface ge3 frer-vlan 30 / / Only the frer-vlan of egress port 2 is 30;
[0104] ingress stream-id-list 1 / / bind stream instance id
[0105] That is, the first frer identifier is frer1, the instance mode is the generation instance mode, the first inlet flow is the bound first flow instance stream1, the virtual LAN identifier carried by the data packet output by output port 2 is vlan 20, and the virtual LAN identifier carried by the data packet output by output port 3 is vlan 20.
[0106] According to the above configuration rules, after the first switch 200 receives the original data message, it copies the original data message to generate two data messages with the same R-tag, and then adds virtual LAN identifiers to the two data messages with the same R-tag, that is, one new data message carries vlan 20 and the other new data message carries vlan 30. Then, the new data message with vlan 20 is transmitted through output port 2, and the new data message with vlan 30 is transmitted through output port 3.
[0107] In some embodiments, Figure 5 As shown, during the redundant data transmission process of the second switch 300, the process includes:
[0108] Step S400: receiving at least two new data packets sent by the first switch 200.
[0109] Step S500 : Process at least two new data packets according to the second configuration rule to obtain an output data packet, and transmit the output data packet to the second terminal 400 .
[0110] The virtual local area network identifier of the output data message is the virtual local area network identifier modified according to the second configuration rule.
[0111] The second configuration rule includes a second flow instance and a second fred instance; the second flow instance includes a second flow identifier and a second input port; the second fred instance includes a second fred identifier, a recovery instance mode, a second ingress flow, a second output port, and a second virtual LAN identifier.
[0112] Before step S500, it also includes: determining whether the data message matches the preset matching field in the second flow instance. The preset matching field may include but is not limited to the input port number, vid, sip, dip, sport, dport, etc. In this embodiment, only the input port is concerned, so only the second input port field needs to be matched. It can be understood that if the new data message received by the second switch 300 is input through the port number configured by the second input port, step S500 is executed.
[0113] like Figure 6 As shown, step S500 includes:
[0114] Step S510: performing frame elimination processing on at least two new data messages according to the recovery instance mode, so as to eliminate multiple redundant frames in multiple new data messages with R-tags, and only one new data message remains.
[0115] Since the new data packets received by the second switch 300 are two or more data packets with the same R-tag and different virtual LAN identifiers, in order to avoid the transmission of the same data packet to the second terminal 400, the present embodiment adopts a recovery instance mode to perform frame elimination operation on multiple data packets with the same R-tag, so that only one new data packet with the R-tag remains, and the remaining new data packet can be any one of the multiple data packets with the same R-tag.
[0116] Step S520: modify the first virtual local area network identifier of the new data message to the second virtual local area network identifier according to the second frer instance to obtain an output data message.
[0117] Step S530: Transmit the output data message to the second terminal 400 through the second output port.
[0118] In order to ensure the security and stability of the output data message transmission, the second virtual LAN identifier and the first virtual LAN identifier are configured as different virtual LAN identifiers, so that the virtual local area network (VLAN) used for the output data message and the new data message transmission is different. Therefore, in this step, the first virtual LAN identifier of the remaining new data message is modified to the second virtual LAN identifier according to the second virtual LAN identifier configured in the second frer instance, and transmitted to the second terminal 400 through the output port configured by the second output port.
[0119] For example, Figure 1 In the redundant data transmission system shown, the second flow instance of the second switch 300 can be configured as follows:
[0120] stream 2
[0121] ingress interface ge2 / / Bind the flow feature to ingress ge2
[0122] ingress interface ge3 / / bind the flow feature to the ingress ge3
[0123] That is, for the second stream instance, the first stream identifier is stream2, and the second input ports are input port 2 and input port 3.
[0124] The second fred instance of the second switch 300 may be configured as follows:
[0125] frer 2
[0126] mode recovery
[0127] recovery terminate / / eliminate R-TAG
[0128] egress interface ge1
[0129] frer-vlan 200 / / indicates that the frer-vlan of all outbound ports is 200
[0130] ingress stream-id-list 2 / / bind stream instance id
[0131] That is, the second frer identifier is frer2, the instance mode is the recovery instance mode, the second inlet flow is the bound second flow instance stream2, and the virtual LAN identifier carried by the data message output by the output port is vlan 200.
[0132] According to the above configuration rules, after the second switch 300 receives the new data packet, it will eliminate the frame of the new data packet. In addition, the second frer instance can also configure the Recovery terminate field and configure the Recoveryterminate word to eliminate the R-tag. After the frame is eliminated, the remaining new data packet will not carry the R-tag, and then the virtual LAN identifier of the remaining new data packet will be modified to vlan 200. In this way, the output data packet transmitted from the output port can be transmitted through the virtual LAN of vlan 200.
[0133] During the redundant data transmission process, the first switch 200 and the second switch 300 further include redirecting data packets that need to be transmitted through the output port, so that the data packets that need to be transmitted are mapped to the corresponding output port queues.
[0134] It can be understood that during the transmission process of the first switch 200, before step S220, at least two data packets with the same R-tag are redirected to different output port queues according to the first output port configured by the first frer instance. Figure 1In the example system, two data packets with the same R-tag are generated before step S220, and the first fred instance is configured with two first output ports, namely output port 2 and output port 3, then one of the two data packets with the same R-tag is redirected to the output queue of output port 2, and the other is redirected to the output queue of output port 3. During the transmission process of the second switch 300, before step S520, it also includes redirecting a new data packet remaining after the frame is eliminated to the corresponding output port queue. By redirecting the data packet to the corresponding output port queue, it can be ensured that the data packet can be transmitted along the expected path, and can be further processed as needed.
[0135] In some embodiments, when the first switch 200 and the second switch 300 transmit data packets through the output port, it also includes: determining whether the pvid of the output port is the same as the virtual local area network identifier (vlan id) of the transmitted data packet, if the same, stripping the virtual local area network identifier of the transmitted data packet, if different, directly transmitting.
[0136] It can be understood that when the first switch 200 executes step S320, it can also include determining whether the pvid of the first output port is the same as the virtual local area network identifier of the corresponding new data message to be transmitted. If they are the same, the virtual local area network identifier in the new data message is stripped, so that the data message received by the second switch 300 does not carry the virtual local area network identifier. In this way, after the second switch 300 performs frame elimination on at least two new data messages, it is not necessary to modify the virtual local area network identifier of the remaining new data message, and only the configured second virtual local area network identifier needs to be added to the remaining new data message to form an output data message. Similarly, when the second switch 300 executes step S530, it can also include determining whether the pvid of the second output port is the same as the virtual local area network identifier of the corresponding output data message to be transmitted. If they are the same, the virtual local area network identifier in the output data message is stripped.
[0137] Among them, the pvid (Port VLAN ID) of the output port is the default VLAN ID of the output port. In this embodiment, by judging whether the pvid of the output port is the same as the VLAN ID of the output port, if they are the same, the VLAN ID in the data message is stripped, so that redundant tags can be avoided. If the PVID of the output port is the same as the VLAN ID of the data message, then retaining the VLAN ID is redundant. Removing these VLAN IDs can simplify data packet processing and improve transmission efficiency. In addition, data consistency can be maintained to ensure the consistency of data messages during transmission, especially when transmitting between different network devices, to avoid confusion caused by redundant tags.
[0138] In some implementations, when creating an ACL matching rule, the hardware chip of the switch will assign a unique flow_id to each ACL matching rule (flow instance), and the two are mapped one-to-one and subsequently indexed.
[0139] Among them, flow_id is an identifier inside the switch chip, which is used to uniquely identify specific hardware resources (such as memory area, queue, processing engine, etc.). Each flow_id corresponds to a specially allocated hardware resource for processing specific datagrams. Since there is a one-to-one correspondence between flow_id and hardware resources, two different flow_ids will not point to the same hardware resources. This mutual exclusivity ensures that each datagram can be processed independently and will not be confused with other messages or compete for the same resources. When a new datagram arrives at the network device, the chip generates and assigns a flow_id according to predefined rules (such as quintuples or other features) and maps it to the corresponding hardware resources internally. This is a dynamic allocation process to ensure the rational use and isolation of resources.
[0140] When a data packet enters the switch, it is first matched by the classifier (ACL) (for example, according to the five-tuple, protocol type, QoS tag, etc.). This classification process determines which hardware resource (flow_id) the data packet should belong to. In addition, the switch maintains a flow table inside, which records the mapping relationship between each flow_id and its corresponding hardware resource. When the data packet is classified, the switch will search the flow table according to the classification result, obtain the corresponding flow_id, and access the relevant hardware resources accordingly. When accessing resources, the switch can accurately locate and access the hardware resources assigned to the data packet through the flow_id, such as a specific buffer, queue or processing engine. All data packet processing operations will be based on the corresponding hardware resources. The flow_id will not exist as an explicit tag in the data packet, but will be managed completely as a parameter inside the switch. All data packet processing decisions are based on the mapping relationship between the flow_id and the hardware resources inside the switch, and will not affect or change the data packet itself. Inside the switch, the data packet processing path is guided and controlled by the flow_id, which is a key control parameter in the data packet processing process inside the switch. It can be understood that the above operation of allocating flow_id to the data message is applicable to both the first switch 200 and the second switch 300.
[0141] In the embodiment of the present application, during the data message transmission process, the first terminal 100 first transmits the original data message to be transmitted to the first switch 200 through the configured input port, and performs frame replication in the first switch 200, and adds corresponding virtual local area network identifiers (vlan ids) to each of the multiple data messages obtained after the frame replication according to the configuration rules, and then transmits the new data message generated in the first switch 200 to the second switch 300 through different vlan domains (virtual local area networks) according to the virtual local area network identifier, and performs frame elimination processing in the second switch 300, and modifies the virtual local area network identifier of a data message remaining after elimination, and then transmits the output data message generated in the second switch 300 to the second terminal 400 through the corresponding virtual local area network. This embodiment realizes the transmission of multiple redundant messages in different virtual local area networks (vlan domains), ensures that the data message does not rely on one network path, and thus avoids the situation that when a virtual local area network fails or is congested, another virtual local area network can still transmit data normally, thereby ensuring the security and reliability of the data. In addition, the isolation between different virtual LANs ensures that a failure in one virtual LAN in the network will not affect another virtual LAN. This isolation effectively reduces the risk of fault propagation and ensures the continuity and stability of data flow.
[0142] The present application also provides a switch. Exemplarily, the switch includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program, thereby causing the switch to execute the above-mentioned redundant data transmission method.
[0143] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0144] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0145] The present application also provides a computer-readable storage medium for storing the computer program used in the above switch. For example, the computer-readable storage medium may include but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0146] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes 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 box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0147] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0148] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0149] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the 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.
Claims
1. A redundant data transmission method, characterized in that: The method is applied to a first switch, comprising: Receiving an original data message sent by the first terminal; Processing the original data message according to the first configuration rule to obtain at least two new data messages; wherein each of the new data messages is a message with a virtual local area network identifier; The at least two new data messages are transmitted to the second switch through the corresponding virtual local area networks according to the virtual local area network identifiers.
2. The redundant data transmission method according to claim 1, characterized in that: The first configuration rule includes a first flow instance and a first frer instance; the first flow instance includes a first flow identifier and a first input port; the first frer instance includes a first frer identifier, a generation instance mode, a first ingress flow, a first output port and a first virtual local area network identifier; The processing of the original data message according to the first configuration rule to obtain at least two new data messages includes: Performing frame replication processing on the original data message according to the generation instance mode to obtain at least two original data messages with the same R-tag; Different first virtual local area network identifiers are respectively added to at least two original data packets with the same R-tag to obtain at least two new data packets.
3. The redundant data transmission method according to claim 2, characterized in that: The step of transmitting at least two of the new data messages to the second switch through corresponding virtual local area networks according to the virtual local area network identifiers includes: Determine the first output port of each of the new data packets according to the correspondence between the first output port in the first fred instance and the first virtual local area network identifier; The new data message is transmitted to the second switch through the corresponding first output port.
4. The redundant data transmission method according to claim 2, characterized in that: Before respectively adding different first virtual local area network identifiers to at least two original data messages with the same R-tag to obtain at least two new data messages, the method further includes: According to the first frer instance, at least two data packets with the same R-tag are redirected to different output port queues according to the first output port configured by the first frer instance.
5. A redundant data transmission method, characterized in that: The method is applied to a second switch, comprising: Receive at least two new data messages sent by the first switch; wherein the new data messages are messages obtained by transmitting the redundant data transmission method according to any one of claims 1 to 4; At least two of the new data packets are processed according to the second configuration rule to obtain an output data packet, and the output data packet is transmitted to the second terminal; wherein the virtual local area network identifier of the output data packet is the virtual local area network identifier modified according to the second configuration rule.
6. The redundant data transmission method according to claim 5, characterized in that: The second configuration rule includes a second flow instance and a second fred instance; the second flow instance includes a second flow identifier and a second input port; the second fred instance includes a second fred identifier, a recovery instance mode, a second ingress flow, a second output port and a second virtual local area network identifier; The processing of at least two of the new data packets according to the second configuration rule to obtain an output data packet, and transmitting the output data packet to the second terminal includes: Performing frame elimination processing on the new data message according to the recovery instance mode, so as to eliminate multiple redundant frames in the multiple new data messages with R-tags, and only one new data message remains; modifying the first virtual local area network identifier of the new data message to the second virtual local area network identifier according to the second fred instance to obtain the output data message; The output data message is transmitted to the second terminal through the second output port.
7. The redundant data transmission method according to claim 6, characterized in that: Before the first virtual local area network identifier of the new data message is modified to a second virtual local area network identifier according to the second fred instance to obtain the output data message, the method further includes: The new data message remaining after the frame is eliminated is redirected to the corresponding output port queue according to the second fred instance.
8. A redundant data transmission system, characterized in that: include: A first terminal, a first switch connected to the first terminal, a second terminal, and a second switch connected to the second terminal; The first terminal is used to send a data message to the first switch; The first switch is used to execute the redundant data transmission method according to any one of claims 1 to 4; The second switch is used to execute the redundant data transmission method according to any one of claims 5 to 7; The second terminal is used to receive the data message output by the second switch.
9. A switch, characterized in that: The switch comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the redundant data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The device stores a computer program, which, when executed on a processor, implements the redundant data transmission method according to any one of claims 1 to 7.
Citation Information
Cited By
Multi-terminal redundant data transmission method and system, bridge switch and storage medium
CN120455408A