# Synchronizing TSN Devices via 802.1 AS over 5G Networks
## 2 Time-Sensitive Networking
### Time Synchronization  
Time synchronization is a key requirement of real-time networks; thus, it is of utmost importance and a basic component of TSN. It enables TSN devices to adjust and correct their local clocks in reference to the Grand Master clock. This is a prerequisite for gate-scheduling mechanisms, path reservation, traffic filtering and forwarding and traffic shaping via TAS or CBS. Time synchronization for TSN is standardized in IEEE 802.1 AS with the gPTP profile for the IEEE 1588v2 Precision Time Protocol (PTP). It provides sub-microsecond accuracy in synchronization. The time synchronization mechanisms are shown in Figure 1.  
In Figure 1, 'r' is the ratio of the clock oscillator frequencies of the Requester and the Responder node. Since each node has an oscillator drift, i.e., oscillator frequencies of nodes are different, the rate ratio is used to establish a common frequency baseline during Propagation Delay calculation.  
The synchronization procedure consists of the Requester entity (TSN device which wants to synchronize to the master) requesting the Responder entity (TSN device to which all other TSN devices synchronize to) to initialize the synchronization process. After initialization, the Requester sends a path delay measurement request to the Responder, which responds with a path delay measurement response and a follow-up message. In this three-message exchange, the Requester gathers four timestamps, as shown in Figure 1. In the propagation delay measurement process, a symmetric link is assumed. This is true for wired networks, but for wireless networks, with asymmetric links, this assumption can adversely affect the outcome of the synchronization, as we will see in the Section 5 of this paper.  
After the propagation delay measurement process, a synchronization message and a synchronization follow-up message are sent by the Responder with the current timestamp (preciseOriginTimestamp). Using the current time, the previously computed propagation delay, and the correction field (in case if the Responder is not the Grand Master), the Requester computes the actual time using the following equation and adjusts its local clock accordingly.  
Corrected Time = preciseOriginTimestamp + Propagation Delay + correction field  
For integration of TSN and the 5G network, it is important for the 5G network to provide the required QoS to the TSN communication streams. This also implies that the time synchronization messages of the TSN network shall traverse through the 5G system  
Figure 1: IEEE 802.1 AS time synchronization procedure in wired networks.  
in order for TSN end devices on the either side of 5 GS to synchronize. But the handovers in 5 GS and channel access grants for UE to access the channel for data transmission result in irregular propagation delay calculations, which decreases the synchronization accuracy as compared to a symmetric 5G link, i.e., there is the same propagation delay in uplink and downlink.  
IEEE 802.1 AS being a Layer 2 protocol generates Ethernet frames, and with the 5G TSN integration, the 5G system must support the Ethernet PDU transmissions over the 5G network. In addition, the 5G system can have its own Grand Master keeping the TSN and 5G time domains separate. Thus, TSN synchronization frames traversing through the 5G network must also be updated with the ingress and egress timestamps, which is a function of the Network Side-Time Translator (NW-TT) and Device Side-Time Translator (DS-TT) entity in the 5G network. Furthermore, being in the different time domains, correction fields of the synchronization that might be passing through the 5G system also need to be updated.  
In addition to Ethernet PDU support, DS-TT, and NW-TT functionality, the mapping of TSN QoS values to the 5G QoS values (5 QI) is also required. This is achieved via the mapping tables and communication between the 5G TSN Application function and TSN Central Network Configurator (TSN CNC).