# Prototype of 5G Integrated with TSN for Edge-Controlled Mobile Robotics
## 3 Prototype of 5G Integrated with TSN
### Overall Architecture and Traffic Shaping  
To meet the requirements defined in Section 2, the jitter, the latency of the transmission and the time synchronization of the communication need to suit the use case. Despite the high performance of the 5G URLLC testbed (cf. Section 3.2.1), the wireless communication introduces a jitter that does not suit the use case of mobile robotics. The same applies for the preempted Linux PC, which can prioritize the sender application but still introduces an undesired high jitter. Therefore, shaping of the traffic needs to be carried out using the TSN features, especially IEEE 802.1 Qbv for jitter mitigation, as mentioned in Section 3.1. The traffic shaping needs to be carried out for the PC output and for over-the-air transmissions.  
To use scheduled traffic in the TSN-based network, a precise arrival time is important to meet the defined cycles. Figure 9 shows the relevant communication aspects. The allowed arrival time window for critical data at the next TSN bridge on the communication path is the period in which the critical data need to arrive at the next bridge to meet the scheduled high-priority transmission slot. Data packets outside the time window miss the cycle and are retained until the next cycle, adding a whole cycle time to the latency of the message. To meet the time window, two aspects need to be considered: the inaccuracy of the time synchronization between two consecutive bridges and the overall transmission jitter, as shown in Figure 10. When the time synchronization is off, the messages will be sent at the wrong time and arrive outside of the allowed arrival time window. If the jitter is too high, the numbers of outliers increase, i.e., messages missing the scheduled time-window.  
The scheduling of the TSN switches needs to be adapted to the performance of the end devices and the requirements from the application. As shown in Figure 10, TSN bridge 1 is able to reduce the jitter introduced by the TSN sender. By using IEEE 802.1 Qbv, the gate control at the egress port is configured to hold the packets from the TSN sender for a certain time and then release them in a narrow time window. Depending on the performance of the sender and the bridge, this can be optimized either manually or by using a Centralized Network Configuration [7]. In the 5G prototype system, IEEE 802.1 Qbv time scheduling is not implemented. Instead, the mechanism can be used at TSN bridge 2 to reduce the jitter introduced by the 5G system. Again, the messages transmitted through the 5G testbed are  
Figure 8: Overall Architecture of the Prototype of 5G integrated with TSN.  
held back until the egress gate on the bridge is scheduled for priority traffic. By shaping the traffic using the scheduled traffic mechanisms of TSN, the jitter of the transmission can be reduced to a minimum. Furthermore, the jitter and the delay of each device in the transmission pipeline are not added to the overall pipeline jitter but can be eliminated at every TSN bridge in the network, thereby resetting the overall pipeline jitter. The various steps involved in traffic shaping in the integrated 5G and TSN setup are shown in Figure 10.