# Synchronizing TSN Devices via 802.1 AS over 5G Networks
## 5 Simulation Results and Discussion
### Simulation Scenario 2  
In simulation scenario 2, the TSN Switch synchronizes to the GM via the Ethernet link and forwards the synchronization frames to the TSN device 2. The TSN device 2 moves from the left to the right side of the simulation area as shown by the mobility direction arrow in Figure 2b. During the movement, a handover from gNodeB1 to gNodeB2 takes place.  
Figure 5a shows the time differences of the TSN Master and TSN device 1 clock to the true time for the first 5 s of simulation. The time difference after synchronization is in order of 100 nanoseconds, indicating a successful synchronization, as expected due to the direct 1 Gbps Ethernet link between them. Figure 5b shows the true time differences of the TSN Master and the TSN device 2 after synchronization. The handover event at around 95 s is clearly visible, as the difference of the TSN device 2 to the true time suddenly increases to 50 ms, and the difference between the TSN Master and TSN device 2's clocks is approx. 46 ms. The true time differences of the TSN Master and TSN device 2 before and after the handover event are also higher than the true time differences of the TSN Master and the TSN device 1. This is (like in scenario 1) due to uplink and downlink propagation delay differences. The main reason for the multiple, shorter than the highest delay difference peaks, after the handover are Layer 2 retransmissions between gNodeB and TSN device 2. Since the TSN device has just entered the coverage area of gNodeB2, therefore, L2 retransmissions of erroneous frames cause multiple smaller peaks, which disappear when the device reaches closer to gNodeB2.  
Figure 4: (**a**) Uplink and downlink propagation delay during PDelay measurement; (**b**) 802.1 AS calculated PDelay compared to uplink and downlink propagation delay during the synchronization process.  
Propagation delays in uplink and downlink direction are shown in Figure 6. An asymmetry regarding the uplink and downlink delays can be observed (similar to simulation scenario 1) as well as delay variations (caused by L2 retransmissions in a 5G network), resulting in an increased inconsistency of PDelay in its measurement. This in turn leads to a significant time difference between the TSN device 2 and the TSN Master after synchronization. The downlink and uplink delay asymmetry still remains in the simulation as discussed in the previous section, and it is often pronounced due to retransmissions, e.g., in Figure 6a between 150 and 250 s. Eventually, if in the PDelay calculation, the difference of uplink and downlink delay is considered, the average time difference between TSN device 2 and TSN Master reduces to be 681.86 microseconds (431.55 us without handover peaks) on average with some irregularities during handover and retransmissions.  
Figure 5: Time differences to the true time after synchronization for TSN Master, (**a**) for TSN device 1, and (**b**) for TSN device 2.  
Figure 6: (**a**) Uplink and downlink propagation delay during PDelay measurements; (**b**) 802.1 AS calculated PDelay compared to uplink and downlink propagation delay during synchronization process (outliers excluded).  
A possible solution to avoid synchronization errors during handover is to halt the time synchronization process during the handover process, since synchronizing during handover results in false clock time for the slaves. Once the handover is completed, the synchronization process can be started again with the new Sync and PDelay calculation frames.  
The findings from both simulations align with the results that were achieved by [1; 2], as mentioned in Section 3.