## 4 Traffic Filtering-Based Techniques
### Enhanced Port Locking (EPL)
#### 4.4.2 EPL Operations  
The EPL approach works in three sequential stages:  
* The first learning stage: DANH rings locking stage.
* The second learning stage: QuadBox rings locking stage.
* The working stage.  
(a) The first learning stage: In the first learning stage, the network works as standard HSR during sending of the first frame, and all DANH rings that do not contain the destination of the frame will be pruned. At this stage, QuadBoxes that connect to the DANH rings will learn MAC addresses and build their PL locking tables. The PL locking table inside a QuadBox stores the MAC addresses of DANH nodes that do not belong to the QuadBox's DANH ring.  
(b) The second learning stage: In the second learning stage, QuadBoxes that connect to a DANH ring without a destination node will lock their DANH side's ports and forward the unicast frames in the QuadBox ring. Conversely, QuadBoxes that connect to a DANH ring with a destination node will forward the unicast frames inside the DANH ring but will not forward the frames in the QuadBox ring. In the stage, QuadBoxes that connect to two QuadBox rings will build their EPL locking tables based on the same concepts used in the PL approach. The EPL locking table inside a QuadBox contains the MAC addresses of DANH nodes that do not belong to DANH rings that connect to the QuadBox's QuadBox ring. The second learning stage starts after the first learning stage has been completed and is triggered according to the parameter \(\psi\). After receiving \(\psi\) number of returned frames, the second learning stage will be triggered, and the EPL approach will decide to lock that interface by registering the destination MAC address in the EPL locking table. Putting a MAC address inside the EPL locking table means that the QuadBox will stop forwarding any frame tagged with that MAC address as a destination in that direction.  
At the first frame, the network will work as the standard HSR protocol. From the second frame to the \(\psi^{\text{th}}\) frame, the network will work under the PL effect. And from the (\(\psi^{\text{th}}+1\)) frame, the network will work under the EPL effect.  
Figure 8 demonstrates the two learning stages in the EPL approach. Figure 8a,b represent the first learning stage, whereas Figure 8c,d represent the second learning stage of a QuadBox that connects to a DANH ring without a destination node and a QuadBox that connects to a DANH ring with a destination node, respectively.  
(c) Working stage: In the stage, QuadBoxes forward unicast frames based on PL and EPL locking tables. Therefore, only rings used to forward traffic will remain active while the unused rings will be pruned.  
Figure 9 shows the process of filtering unicast traffic for rings under the EPL approach. In the first leaning stage, QuadBox nodes 2-6 build their PL locking table. QuadBoxes 2-5 will lock their DANH side's ports since the destination of the frame belongs to DANH ring 6. In the second leaning stage, QuadBox 7 builds its EPL locking table. QuadBox 7 will lock its ports that are connected to QuadBox ring 2 after it receives \(\psi\) number of returned frames from the ring. After learning stages, QuadBox 2 blocked its DANH side's ports connected to DANH ring 2, and QuadBox 7 blocked its ports connected to QuadBox ring 2. In the working stage, the active ring path is DANH ring 1-QuadBox ring 1-DANH ring 6. In other words, the frames are delivered from source DANH ring 1 to destination DANH ring through only QuadBox rings 1. The frames are not forwarded into QuadBox ring 2, as in the PL approach. However, the unicast frames are still duplicated and circulated in active QuadBox rings (QuadBox ring 1 in this example) under the EPL approach.  
Figure 8: The two learning stages in the EPL approach.