BS EN 62439-3:2012 pdf download – Industrial communication networks — High availability automation networks Part 3: Parallel Redundancy Protocol (PRP) and High-availability Seamless Redundancy (HSR)
4.1 .1 0 Duplicate handling
4.1 .1 0.1 Methods for handling duplicates Since a DANP receives the same frame over both adapters, when both are operational, it should keep one and ignore the duplicate. There are two methods for handling duplicates: a) duplicate accept, in which the sender LRE uses the original frames and the receiver LRE forwards both frames it receives to its upper protocol layers; b) duplicate discard, in which the sender LRE appends a redundancy control trailer to both frames it sends and the receiver LRE uses that redundancy control trailer to send only the first frame of a pair to its upper layers and filter out duplicates.
4.1 .1 0.2 Duplicate accept This method does not attempt to discard duplicates at the link layer. The sender LRE sends the same frame as it would in the non-redundant case over both LANs. The receiver’s LRE forwards both frames of a pair (if both arrive) to its upper layers, assuming that well-designed network protocols and applications are able to withstand duplicates – indeed IEEE 802.1 D explicitly states that it cannot ensure freedom of duplicates. The internet stack, consisting of a network layer with an UDP and a TCP transport layer, is assumed to be resilient against duplicates. The TCP protocol is designed to reject duplicates, so it discards the second frame of a pair. The UDP layer is by definition connectionless and unacknowledged.
All applications that use UDP are assumed to be capable of handling duplicates, since duplication of frames can occur in any network. In particular, a UDP frame is assumed to be idempotent, i.e. sending it twice has the same effect as sending it once. Administrative protocols of the internet such as ICMP and ARP are not affected by duplicates, since they have their own sequence numbering. Real-time stack that operate on the publisher-subscriber principle are not affected by duplicates, since only the latest value is kept. Duplicate reception increases robustness since a sample that gets lost on one LAN is usually received from the other LAN. Therefore, one can assume that handling of duplicates is taken care of by the usual network protocols, but one has to check if each application complies with these assumptions.
This simple duplicate accept method does not provide easy redundancy supervision, since it does not keep track of correct reception of both frames. The receiver would need hash tables to know that a frame is the first of a pair of a duplicate, and could for this effect store the CRC and length of each frame as a hash code. Such redundancy supervision method is however not specified in this International Standard, but it is not excluded.
4.1 .1 0.3 Duplicate discard in the link layer
4.1 .1 0.3.1 Principle
It is advantageous to discard duplicates already at the link layer. Without duplicate discard, the processor receives twice as many interrupt requests as when only one LAN is connected. To offload the application processor, the LRE can perform Duplicate Discard, possibly with an independent pre-processor or an intelligent Ethernet controller. This allows at the same time to improve the redundancy supervision. The duplicate discard protocol uses an additional four-octet field in the frame, the Redundancy Control Trailer (RCT), which the LRE inserts into each frame that it receives from the upper layers before sending, as Figure 6 shows. The RCT consists of the following parameters:
a) 1 6-bit sequence number (SequenceNr);
b) 4-bit LAN identifier (Lan);
c) 1 2 bit frame size (LSDU_size).
4.1 .1 0.3.2 Use of SequenceNr
Each time a LRE sends a frame to a particular destination, it increases the sequence number corresponding to that destination and sends both (nearly identical) frames over both LANs.
The receiving LRE can then detect duplicates based on the RCT.