## 3 Shaping in TSN
### Mapping of Traffic Categories to Shapers  
In this section, we discuss possible mappings between the presented traffic categories and the different shapers (e.g., SP, CBS, ATS, CQF, and TAS). Selecting a proper shaper and its configuration depends not only on the traffic mix of the use case but also on the traffic load and the available resources in the network (i.e., number of queues, queue length, bandwidth, buffer size, etc.). Intuitively, shaping is about organizing the temporal and spatial distribution of the resources among the streams. Therefore, if the resources exceed by far the need of the streams there would be less interference, and consequently, a loose traffic isolation would be enough. For example, if we place a single HTS flow in a network that does not serve any traffic, all the resources will be available for the flow. If we want to add a BE stream, it might be enough to use SP, assign to the HTS stream the highest priority, and preempt the BE stream whenever a frame of the HTS stream is ready for transmission. Frame-preemption might be not needed if the transmission speed of the egress ports is so high (e.g., 10 Gbps) that the queuing delay of the HTS frame is not negatively impacting the deadlines, even if it has to wait for the transmission of a BE MTU. On the other hand, if the network is short of resources, it might not be possible to serve all the required streams. In this case, the choice of the shaping mechanism is not important since some of the streams would starve anyway. We conclude from the above example that the first step in making the right choice is to have a clear understanding of the use -case and the available resources. However, a network designer would scale the network properly such that all the streams are served with the minimum investment. Therefore, in the rest of this subsection, we disregard the extreme cases of under-/overprovisioning and we consider only networks with reasonable resource utilization. BE traffic does not require any QoS guarantees and any shaper is applicable (for example SP, which is the easiest to configure). For all the other traffic types, SP needs to be combined with at least another shaper, which needs to provide the required QoS by managing the queues properly. SP then works as a backup shaper in case multiple queues are eligible for transmission at the same time. LTS traffic is event-triggered (i.e., non-time-triggered). Therefore, TAS is not suitable since it needs to configure the offset of the streams in the talker. For the cyclic LTS streams, CQF could be applied since it is by design operating cyclically, provides latency guarantees, and is convenient for streams with random offsets. For the acyclic nonstreams, CQF is not the most convenient as it needs to reserve slots for the streams. However, reserving transmission slots for acyclic streams wastes bandwidth that could be used to serve other traffic types. ATS or CBS, on the other hand, are more convenient and the best choice depends on the traffic load. As ATS, unlike CBS, attributes a different bucket for every stream, the queue management is on stream level. To provide the required guarantees on latency, appropriate queue configuration needs to be derived using, e.g., network calculus. However, in use cases involving time-critical events that have the highest priority (e.g., emergency traffic such as sending an event resulting from pressing a safety red button), ATS should be avoided as emergency traffic is sporadic and event-triggered. For such traffic, preservation of resources is the safest option with existing shapers (e.g., study [22] proposed enhancements to TAS to support emergency traffic). However, enabling frame-preemption and assigning the highest priority queue exclusively to the emergency traffic (exclusive assignment is needed to avoid head-of-the-queue blocking) could be an interesting solution. Finally, HTS has two traffic types (isochronous and cyclic synchronous), which can be distinguished by the delivery mode.