What Is HSR?
As a protocol for highly reliable industrial network transmission, High-availability Seamless Redundancy (HSR) not only reduces the network delay and packet loss rate, but also improves reliability in industrial IoT scenarios. This article describes why we need HSR and how it works.
Why Do We Need HSR?
In modern industrial settings, such as ports, automobile manufacturing, and mining sites (for example, coal and iron mines), control devices are centrally deployed in factory-level data centers, whereas production devices are deployed in harsh environments. The long distance between control devices and production devices makes data transmission unstable.
Dual-homing links in Ethernet ring protection switching (ERPS) networking can solve the problem of unstable data transmission. However, when the primary link fails and services are switched to the backup link, packet loss lasts for dozens of milliseconds. In this case, service systems such as production automation may respond slowly and provide poor user experience, and network reliability cannot be ensured without packet loss.
With the development of modern industrial technologies, service scenarios such as robot-controlled production, automatic transportation of production logistics, and remote management of medical devices have increasingly strict requirements on service reliability. HSR was developed to meet such requirements and reduce the network delay and packet loss rate in industrial scenarios. As a protocol for highly reliable industrial network transmission, HSR can forward packets through dual links concurrently, eliminating the delay caused by primary/backup link switchover. This not only reduces the network delay and packet loss rate, but also improves reliability in industrial IoT scenarios, thereby building a highly reliable network with zero switchover.
How Does HSR Work?
HSR is implemented based on HSR rings. A simple HSR ring consists of doubly attached nodes implementing HSR (DANHs) and Redundancy Box (RedBox) nodes. Each node is connected to the ring through two interfaces.
HSR supports dual fed and selective receiving based on redundant paths (on an HSR ring). That is, the source node and intermediate nodes send frames bidirectionally. After selectively receiving the frames, the destination node sends one copy of the frames to the destination terminal.
A RedBox is a device with at least three Ethernet interfaces. At least two of these interfaces can be connected to the HSR ring, and the others are traditional Ethernet interfaces for connecting to terminals or controllers. RedBoxes are used to connect non-HSR nodes and the HSR ring.
A DANH is a device with two interfaces that are connected to the HSR ring. DANHs are used to connect to the HSR ring.
Singly Attached Nodes (SANs) are terminal nodes that do not support the HSR protocol, such as printers or PCs. SANs must be connected to the HSR ring through the RedBox. A terminal transmits all frames to the RedBox, which duplicates the frames and sends them to the destination through two different paths. A SAN that accesses the HSR ring through the RedBox is called a virtual DANH.
Packet Forwarding Mode
As shown in the following figure, a terminal transmits all frames to RedBox1, which duplicates the frames before sending them to the destination through two different paths.
- If either of the paths is abnormal (for example, a link or node fault occurs), the frames can still be sent to the destination through the other path.
- If both paths can forward frames normally, RedBox1 marks all the frames to be sent in sequence. Upon receipt of the frames, the destination device sorts and deduplicates them. The complete frames that arrive first and are in the correct sequence are forwarded, and the duplicate frames that arrive subsequently are discarded. If some frames are missing on a path, the frames that arrive first from this path are cached and sorted. After the missing frames arrive from the other path, all these frames are assembled into complete frames in sequence and then forwarded. In this way, zero packet loss is achieved.
HSR ring
To connect two HSR rings, quadruple port boxes (QuadBoxes) are required. A QuadBox is bound to two RedBoxes with different IDs and has at least four Ethernet ports. Logically, two RedBoxes form a QuadBox. The two Eth-Trunk member interfaces of each RedBox are connected to the same HSR ring.
On the network shown in Figure 1-3, to improve link reliability, QuadBoxA and QuadBoxB connect two HSR rings (HSR Ring 1 and HSR Ring 2) and achieve zero loss of service data, ensuring the link connectivity of the two HSR rings. To ensure the connectivity between two HSR rings in the case of a QuadBox failure, two QuadBoxes need to be deployed for HSR ring interconnection.
Avoiding Cyclical Forwarding of Packets in the HSR Ring
Nodes in the HSR ring do not transmit packets that are already transmitted in the same direction. This avoids cyclical forwarding of packets in the HSR ring, prevents issues such as broadcast storms and MAC address flapping, and avoids communication quality deterioration and service interruptions. The following describes how a packet is processed when a RedBox injects the packet into the HSR ring.
- Unicast packet with the destination inside the HSR ring: After the unicast packet reaches the destination node, the packet is not forwarded in the same direction.
- Unicast packet with the destination outside the HSR ring: The unicast packet with the destination outside the HSR ring is forwarded by every node in the ring until it reaches the source node.
- Multicast packet with destinations inside the HSR ring: The multicast packet with destinations inside the HSR ring is forwarded by every node in the ring until it reaches the source node.
Unicast or Multicast Packet Forwarding with Destination Nodes in Different HSR Rings
On the network shown in Figure 1-4, two QuadBoxes are deployed to implement HSR ring interconnection. The QuadBox must work in hsrredboxhsr mode. That is, HSR packets (carrying HSR tags) are forwarded across rings.
Packets are forwarded as follows in HSR in this scenario (QuadBoxA and QuadBoxB process packets in the same way):
- The RedBox (source node) sends frames bidirectionally. Specifically, it marks all the frames to be sent in sequence, makes two copies of each frame, and forwards the two copies separately in the clockwise and counterclockwise directions. For example, frame series a is sent clockwise and frame series b is sent counterclockwise. These two frame series are then forwarded by each node on HSR Ring 1 until they reach the source node.
- The QuadBoxes sort and deduplicate the frame series a and frame series b received on HSR Ring 1 based on the receiving time to form a complete packet in the correct sequence, and directly discard the duplicate frames received later. The following assumes that the packet finally formed by QuadBoxA is packet A, and that by QuadBoxB is packet B.
- QuadBoxes then forward the packets to another ring. QuadBoxA and QuadBoxB each modifies the Pathid field (specifically, the Net ID of the HSR ring) in the packet, makes two copies of the packet, and forwards the copies from two different ports on HSR Ring 2. For example, QuadBoxA modifies the Pathid field in packet A so that the field includes the Net ID of HSR Ring 2, copies packet A into frame series A1 and A2, and sends the frames from the two ports on HSR Ring 2. Similarly, QuadBoxB modifies the Pathid field, copies packet B into frame series B1 and B2, and sends the frames from the two ports on HSR Ring 2.
- The QuadBoxes do not forward the received frames repeatedly on HSR Ring 2 because the frames have the same sequence ID. For example, after receiving frame series B2 from QuadBoxB, QuadBoxA finds that the sequence ID of frame series B2 is the same as that of frame series A1 and A2. In this case, QuadBoxA discards frame series B2. Likewise, QuadBoxB discards frame series A2 after receiving them from QuadBoxA.
- Frames received by a QuadBox from another QuadBox in HSR Ring 2 are not forwarded to HSR Ring 1. On HSR Ring 2, after finding that the Pathid field includes the Net ID of HSR Ring 2, QuadBoxA or QuadBoxB does not inject the received frame series B2 or A2, respectively, into HSR Ring 1.
- Finally, the destination node on HSR Ring 2 receives frame series A1 and B1, sorts and deduplicates the frames to form a complete packet, and forwards the packet to the destination terminals.
- Author: Meng Xianhai, Fu Hai
- Updated on: 2025-10-23
- Views: 10112
- Average rating:
Export PDF