A Hybrid Trafﬁc Scheduling Strategy for Time-Sensitive Networking

: The trafﬁc scheduling mechanism in Time-Sensitive Networking (TSN) is the key to guaranteeing the deterministic transmission of trafﬁc. However, when time-sensitive trafﬁc and non-time-sensitive trafﬁc are transmitted together, trafﬁc scheduling conﬂicts are easy to occur in TSN. As a result, the deterministic transmission of time-sensitive trafﬁc will be disrupted, and non-time-sensitive trafﬁc may be preempted for a long time. To optimize the performance of multi-type hybrid trafﬁc scheduling in TSN, we ﬁrstly establish a collaborative scheduling framework that incorporates Time Aware Shaping (TAS) and Cyclic Queuing and Forwarding (CQF) mechanisms. We then design a trafﬁc shaping method in this framework based on Least Laxity First (LLF), which considers trafﬁc characteristics to dynamically arrange the time slot injection sequence for different types of trafﬁc. Finally, the trafﬁc schedulability is evaluated based on the scheduling constraints of different types of trafﬁc. Compared with the existing scheduling strategies, the proposed hybrid trafﬁc scheduling strategy can schedule more non-time-sensitive trafﬁc and achieve better delay performance of rate-constrained trafﬁc in different hybrid trafﬁc scenarios. When the number of ﬂows is 100, the time slot injection ratio is increased by 24.3% compared with the LLF_TAS method.


Introduction
With the current rapid development of the Internet application industry, the emergence of new industries such as industrial Internet, telemedicine, and autonomous driving has accelerated the integration of Information Technology (IT) and Operational Technology (OT). Increasingly, the resulting need for low latency and highly reliable transmission of network data is becoming apparent [1]. For example, the end-to-end delay requirement for industrial automation scenarios is 250 µs-10 ms and the delay requirement for autonomous driving is 100-250 µs. Although the deterministic transmission requirement for audio and video traffic is slightly less stringent, it is also necessary to ensure that the end-to-end delay is in the range of 2-50 ms, and the jitter requirements for the above scenarios are all in the microsecond scale [2].
According to the communication requirements of application data in different network scenarios, the types of traffic can be classified as periodic time-sensitive traffic, periodic large bandwidth rate-constrained (RC) traffic, and best-effort (BE) traffic. Time-sensitive traffic, also known as time-triggered (TT) traffic, has real-time transmission requirements with deterministic bounded low latency. However, traditional Ethernet can only address non-real-time, best-effort data transmission, making it difficult to meet the diverse and hybrid traffic service transmission requirement of the emerging industry for communication networks, and even less able to converge the transmission of the three types of traffic mentioned above. Although industrial networks such as PROFINET [3], POWERLINK [4], and EtherCAT [5] are known to meet the corresponding real-time transmission performance requirements to varying degrees, these technologies are less compatible and interoperable due to the proprietary nature of their mechanisms.

•
We establish a hybrid traffic cooperative transmission framework, which combines TAS with the CQF mechanism. It can meet the mixed transmission requirements of different types of traffic in the same network and has strong flexibility and robustness.

•
We propose a traffic shaping method based on Least Laxity First, which considers traffic characteristics to adaptively determine and dynamically arrange the scheduling sequence of different types of traffic. • Based on the traffic scheduling sequence and the injected time slots, we design scheduling constraints for different types of traffic and evaluate the schedulability of the solved hybrid traffic scheduling scheme.
The rest of the paper is organized as follows. Section 2 discusses related work, while Section 3 details the system model and problem description. A hybrid traffic scheduling strategy is introduced in Section 4, while Section 5 evaluates the schedulability of the resulting configuration scheme. The results of the simulation experiments are shown and analyzed in Section 6. Finally, Section 7 summarizes this paper and looks at the prospects of subsequent work.

Related Work
Traffic scheduling is the core mechanism to guarantee the transmission of TSN traffic. Of the three types of traffic, TT traffic, RC traffic, and BE traffic, TT traffic has the highest priority and its deterministic transmission requirements need to be guaranteed. To optimize the scheduling performance of this critical class of traffic, time-sensitive traffic scheduling in TSN has been extensively researched in recent years. In recent studies, some works [9,10] apply the TAS mechanism to off-line calculation and configuration of TT traffic. After setting the corresponding scheduling objective, the scheduling sequence configuration of the outgoing traffic port is calculated. The work in [9] selects the minimized transmission delay of TT traffic as the scheduling objective and maps the traffic scheduling of TSN to a no-wait job shop scheduling problem. It uses a heuristic tabu algorithm to search and compute the scheduling scheme, after which the number of guard bands is reduced by 24% using scheduling compression. To achieve the conflict-free scheduling of TT traffic, the key configuration parameters required for TT traffic in a multi-hop TSN environment are determined in [10]. According to the parameters of traffic load and period, the constraints of off-line scheduling, such as frame isolation, are designed and the scheduling scheme with a minimum queue number and schedulability is obtained by Satisfiability Modulus Theory (SMT)/Optimization Modulo Theories (OMT).
To further improve the schedulability of TT traffic, the TSN scheduling mechanism used in [11,12] not only considers the offline scheduling constraints but also further combines the traffic characteristics and relevant routing metrics to jointly schedule the traffic with routing. Falk et al. [11] provides a solution for path planning of TT traffic through the configuration method of searching independent vertex sets covering traffic in the conflict graph. Atallah et al. [12] calculates the conflict degree according to the transmission path, load, period, and other parameters to group the traffic. The routing and packet scheduling scheme with the minimum transmission conflict between flows is then calculated by greedy randomized adaptive search and integer linear programming, and the packet scheduling result of the previous packet is used as the prior constraint of the subsequent packet. Finally, the success ratio of packet scheduling was improved from 47% to 90%.
In addition, the transmission links used in TSN traffic scheduling are all full-duplex fiber links. In order to ensure the optimal delay of TT traffic transmission in the link, the work in [13][14][15][16] studied the path selection in TT traffic scheduling. A real-time routing scheduling algorithm is proposed in [13], which assigns priority according to the traffic period and determines the processing sequence of traffic routing. This enables all TT traffic to complete transmission within the deadline, which provides a schedulability guarantee for TT traffic. A reliability-aware scheduling and routing method is designed in [14]; at the same time, the reliability constraint and end-to-end deadline constraint of TT traffic are considered and solved using SMT, which effectively solves the transient failure scenario that may occur in TSN. Although the redundancy scheduling method of off-line calculation can improve the reliability of TT traffic scheduling, it will also increase the scheduling cost. A Time-Sensitive Software-Defined Network (TSSDN) architecture [15] is used to design a TT traffic incremental scheduling method, which reduces scheduling costs by setting a goal of minimizing the maximum link load occupation and dynamically calculating the routing and scheduling configuration for TT traffic. Kong et al. [16] solved alternative paths when the redundant scheduling was running and analyzed the impact of alternative paths on the reliability of TT traffic scheduling. Compared with static redundancy scheduling, it has better routing efficiency and less bandwidth redundancy. However, if the focus is only on the generation of the TT traffic scheduling table and RC traffic is ignored, it will lead to a large amount of RC traffic with transmission delay beyond its deadline, resulting in its non-schedulability.
The above traffic scheduling works studied TT traffic scheduling from different aspects but did not consider the impact of TT traffic on the transmission of RC and BE traffic. In addition, there are few studies on periodic non-real-time RC traffic and BE traffic in TSN. The following studies have analyzed the worst end-to-end delay of periodic non-real-time Audio Video Bridging (AVB) traffic with large bandwidth. The AVB traffic delay without using the TAS mechanism in TSN is analyzed in [17], and it establishes a credit-based shaping mechanism based on the size and burstiness of the traffic, to calculate the worst end-to-end delay of the traffic. The delay of the proposed methods increases linearly with an increase of the number of flows, but does not exceed 300 µs. Due to the preferential transmission of periodic real-time traffic under the TAS mechanism, AVB traffic has a Electronics 2022, 11, 3762 4 of 22 transmission delay. The work in [18] gives a method for calculating the worst end-to-end delay of AVB traffic, with the optimal transmission delay reaching 165 µs in the case study. There, the traffic is transmitted in order strictly according to its priority scheduling and only the delay analysis of a single output port is performed, without considering the delay analysis in a multi-hop network environment. A method based on network calculus is used to determine the worst end-to-end delay of AVB traffic in two modes of preemption and non-preemption in TSN, and the case analysis is conducted in a multi-hop network [19].
There have been related works on multi-type mixed traffic scheduling. The work in [20] considers the lower priority AVB traffic while analyzing the TT traffic routing and scheduling. By corrupting and repairing the search solution, both TT traffic and AVB traffic can be scheduled before the deadline. A scheduling mechanism for joint traffic type assignment is proposed in [21]. It uses the meta-heuristic algorithm based on tabu search to exchange all types of traffic and search for feasible scheduling solutions, and then continuously updates the optimal scheduling scheme according to the defined traffic cost function, which improves the overall scheduling performance of non-TT traffic. On the premise of meeting the real-time requirements of TT traffic, the work in [22] proposes a bandwidth allocation method based on network calculus theory for periodic non-realtime traffic. The bandwidth allocation policy is formulated according to the credit value. However, it is proved that reserving too much bandwidth does not necessarily improve the scheduling bottleneck of periodic non-real-time traffic, and the bandwidth resource utilization of TSN still needs to be further optimized. To achieve cooperative transmission of heterogeneous hybrid traffic, Yuan et al. [23] analyzes the traffic response latency and then defines temporary priorities for different traffics, before adopting an adaptive priority adjustment scheduling method to further reduce the worst-case end-to-end delay. In the case of high network utilization, the total traffic scheduling delay and TT traffic scheduling delay are reduced by 21% and 11%, respectively.
However, as most of the above studies adopt the TAS mechanism and the gating configuration is complex, Yan et al. [24] chooses the CQF mechanism with coarse scheduling granularity to schedule TT traffic. Compared with the fine-grained TAS mechanism, the CQF mechanism relaxes the traffic scheduling constraints, and the solution of the scheduling scheme and the delay analysis are simpler, but it is not suitable for the transmission of large-scale TT traffic. Therefore, if the fine-grained TAS mechanism is combined with the CQF mechanism, multi-type hybrid traffic can coexist in the same network and be transmitted separately.
In summary, most of the existing TSN traffic scheduling methods are oriented to TT traffic. Even in studies considering other types of traffic, static scheduling is only performed in fixed priority order after analyzing traffic delay. However, in a real network environment, there is more than just TT traffic. Moreover, transmission conflicts are prone to occur when various types of traffic are aggregated, resulting in poor overall traffic scheduling performance. Therefore, we study the TSN hybrid traffic scheduling problem and propose a hybrid traffic scheduling mechanism combining the TAS and CQF mechanisms. Under the premise of meeting the schedulability of TT traffic, the overall scheduling sequence of hybrid traffic is arranged dynamically according to the traffic laxity, which ensures the efficient scheduling of multi-type hybrid traffic in TSN.

System Model and Problem Description
In this section, we present our system model and the problem that we focus on. The main notations that we use are listed in Table 1. Table 1. The main notations used in the system model and problem description.

Notation Explanation
The source node of f i f i .dest The destination node of f i f i .S The load size of f i f i .T The sending period of f i f i .φ The offset time relative to the initial sending time in the sending period of The deadline of f i f i .J max The jitter limit of f i f i .pri The priority of f i hp The hyper period Ts j The j-th scheduling slot unit in the hyper period map i The time slot injection decision variable path( f i ) The set of switch node paths traversed by f i

Topology and Traffic Model
We model TSN as an undirected graph G = (V, E), where V = H ∪ S represents all node sets in TSN, H represents the two types of terminal nodes that send and receive, and S represents the time-sensitive switching node. E indicates the link set, where one of the links v i , v j ∈ E consisting of two node connections. v i and v j are the previous and successor nodes of the link v i , v j , respectively. All the links are full-duplex optical fibers with a transmission rate of 1 Gbps. For example, Figure 1 contains a total of nine nodes and nine links, and the route between two terminal nodes is represented as a collection of several different links,

System Model and Problem Description
In this section, we present our system model and the problem that we focus on. The main notations that we use are listed in Table 1.
The source node of .
The destination node of .
The load size of .
The sending period of .
The offset time relative to the initial sending time in the sending period of .
The deadline of .
The jitter limit of .
The priority of ℎ The hyper period The -th scheduling slot unit in the hyper period The time slot injection decision variable ℎ( ) The set of switch node paths traversed by

Topology and Traffic Model
We model TSN as an undirected graph = ( , ), where = ∪ represents all node sets in TSN, represents the two types of terminal nodes that send and receive, and represents the time-sensitive switching node.
indicates the link set, where one of the links [ , ] ∈ consisting of two node connections. and are the previous and successor nodes of the link , , respectively. All the links are full-duplex optical fibers with a transmission rate of 1 Gbps. For example, Figure 1  According to the traffic priority of the IEEE802.1Q standard and the practical application of TSN in the field of industrial control, the set of all types of flow in the network is defined as = ∑ . There are three traffic types, namely, TT traffic, RC traffic, and BE traffic. TT traffic has the highest priority, which is set to 7, and has a strict period. It has deterministic constraints on response latency and jitter, and is used to transmit timesensitive real-time data such as synchronization and control information with the highest quality of service guarantees; TT traffic is defined as tuple =< According to the traffic priority of the IEEE802.1Q standard and the practical application of TSN in the field of industrial control, the set of all types of flow in the network is defined as F = ∑ n i=1 f i . There are three traffic types, namely, TT traffic, RC traffic, and BE traffic. TT traffic has the highest priority, which is set to 7, and has a strict period. It has deterministic constraints on response latency and jitter, and is used to transmit time-sensitive real-time data such as synchronization and control information with the highest quality of service guarantees; TT traffic is defined as tuple f TT i = < src, dest, S, T, φ, D max , J max , pri >. RC traffic transmits large bandwidth periodic traffic with non-critical information in TSN, such as audio and video traffic, etc. Compared with TT traffic, RC traffic has low requirements on delay and jitter but it has a large load. It is represented by tuple f RC i = < src, dest, S, T, φ, D max , pri > with priority 5 and 6. BE traffic has no QoS requirement for deterministic transmission, defining the tuple as f BE i = < src, dest, S, φ, pri >, which has the lowest priority and is set to 0. When data traverse the network, f sion path v x , v y ; the link v x , v y connected by v x and v y only represents one link in the flow transmission path. As the application scenario of TSN is a local area network, the transmission offset time of traffic on v x is set to be the same as that of link v x , v y .

System Architecture
This section focuses on the switching mechanisms for securing the transport of hybrid traffic in TSN. The TSN switching architecture is shown in Figure 2. The proposed hybrid traffic scheduling combines the TAS mechanism with the CQF mechanism, allowing multiple types of hybrid traffic to coexist and be transmitted in the same network. The TSN traffic scheduling architecture has eight switching queues, each of which corresponds to a different priority. Queue 7 has the highest priority and is used to transmit TT traffic. In the previous TSN switching mechanism, each queue transmitted its own traffic without any connection to each other. We improve the switching mechanism by taking queue 5 and queue 6 in the TAS mechanism as a set of parity ping-pong queues and using the CQF mechanism to transmit RC traffic, while the remaining queues transmit lower-priority BE traffic. The corresponding time-aware gate is set after each queue.
with non-critical information in TSN, such as audio and video traffic, etc. Compared with TT traffic, RC traffic has low requirements on delay and jitter but it has a large load. It is represented by tuple =< , , , , , , >with priority 5 and 6. BE traffic has no QoS requirement for deterministic transmission, defining the tuple as =< , , , , >, which has the lowest priority and is set to 0. When data traverse the network, , . denotes the transmission offset of at the outgoing port of the node on the transmission path , ; the link [ , ] connected by and only represents one link in the flow transmission path. As the application scenario of TSN is a local area network, the transmission offset time of traffic on is set to be the same as that of link [ , ].

System Architecture
This section focuses on the switching mechanisms for securing the transport of hybrid traffic in TSN. The TSN switching architecture is shown in Figure 2. The proposed hybrid traffic scheduling combines the TAS mechanism with the CQF mechanism, allowing multiple types of hybrid traffic to coexist and be transmitted in the same network. The TSN traffic scheduling architecture has eight switching queues, each of which corresponds to a different priority. Queue 7 has the highest priority and is used to transmit TT traffic. In the previous TSN switching mechanism, each queue transmitted its own traffic without any connection to each other. We improve the switching mechanism by taking queue 5 and queue 6 in the TAS mechanism as a set of parity ping-pong queues and using the CQF mechanism to transmit RC traffic, while the remaining queues transmit lowerpriority BE traffic. The corresponding time-aware gate is set after each queue.  TAS adopts the idea of Time Division Multiple Access (TDMA) to divide the communication time of traffic transmission into some transmission periods, and each transmission period is divided into several time slots. After the transmission of all data frames in the network, the gating strategy is combined to control the offset of transmission. Each time-aware gate has two states, and its state determines whether the frame in the queue is transmitted. A state of "0" indicates that the gate is closed and does not allow the transmission of data, while a state of "1" indicates that the gate is open and the newly arriving data can be transmitted. The gate state corresponding to each time slot is specified by the TAS adopts the idea of Time Division Multiple Access (TDMA) to divide the communication time of traffic transmission into some transmission periods, and each transmission period is divided into several time slots. After the transmission of all data frames in the network, the gating strategy is combined to control the offset of transmission. Each time-aware gate has two states, and its state determines whether the frame in the queue is transmitted. A state of "0" indicates that the gate is closed and does not allow the transmission of data, while a state of "1" indicates that the gate is open and the newly arriving data can be transmitted. The gate state corresponding to each time slot is specified by the gate control list, so the TAS mechanism can ensure the determined end-to-end transmission delay by providing the determined time slot for the high-priority TT traffic.
When the TAS mechanism is used, the traffic transmission delay and gating configuration scheme need to be accurately calculated. The CQF mechanism adopted by queue 5 and queue 6 uses a periodic cyclic alternation of ping-pong queues when receiving and transmitting traffic. It can reduce the control accuracy of transmission time and ensure the certainty of the upper bound of forwarding delay, which greatly reduces the difficulty of gating configuration. The enqueue and dequeue mechanism in the CQF is shown in Figure 3, and consists of a cyclic timer and two ping-pong transmission queues. In odd time slots, the time-aware gate of queue 5 is open to transmit packets only, while the time-aware gate of queue 6 is closed to receive packets only. In even time slots, the state of receiving and forwarding packets of the two queues switches. The CQF mechanism limits the delay value of data frames in a single node to 2Ts, in which the ping-pong queue transmits and receives packets alternately to avoid hungry blocking, and has a deterministic upper bound of scheduling delay. If the number of transmission hops of a certain RC flow is n, its maximum and minimum delay are (n + 1)Ts and (n − 1)Ts, respectively. slots, the time-aware gate of queue 5 is open to transmit packets only, while the timeaware gate of queue 6 is closed to receive packets only. In even time slots, the state of receiving and forwarding packets of the two queues switches. The CQF mechanism limits the delay value of data frames in a single node to 2 , in which the ping-pong queue transmits and receives packets alternately to avoid hungry blocking, and has a deterministic upper bound of scheduling delay. If the number of transmission hops of a certain RC flow is , its maximum and minimum delay are ( + 1) and ( − 1) , respectively. Since RC traffic with periodic large bandwidth only needs to ensure the upper bound of deterministic delay, the CQF mechanism can be used to transmit RC traffic, which is co-configured with the TAS mechanism on queue and gating. In addition, the CQF mechanism transmits RC traffic following the policy of taking one step per time slot, which can limit the excessive bandwidth occupation of low-priority traffic, burst transmission load, and malicious endpoint demand.

Problem Description
This paper focuses on the hybrid scheduling problem of multi-type traffic in TSN, which can be divided into two parts. The first part is the design of the TSN switching mechanism in hybrid traffic scheduling, which combines two scheduling mechanisms of the TAS and CQF for mixed transmission of three types of traffic, and has been explained in the system architecture of Section 3.2. The second part is the traffic injection problem of the traffic to be scheduled and mapped to the time slot. It is necessary to design a hybrid traffic scheduling strategy in the above switching mechanism, in order to improve the success ratio of RC traffic and BE traffic scheduling on the premise of meeting the schedulability of TT traffic.
The traffic scheduling sequence has an important impact on its scheduling success ratio. The sequence of packets in the scheduling cycle and the location of time slot injection determines the delay and jitter. There are already some basic shaping methods to inject hybrid traffic into transmission time slots sequentially, such as time slot pre-allocation after arranging them in ascending or descending order according to traffic characteristics including period and load. However, the traffic characteristics considered when applying Since RC traffic with periodic large bandwidth only needs to ensure the upper bound of deterministic delay, the CQF mechanism can be used to transmit RC traffic, which is coconfigured with the TAS mechanism on queue and gating. In addition, the CQF mechanism transmits RC traffic following the policy of taking one step per time slot, which can limit the excessive bandwidth occupation of low-priority traffic, burst transmission load, and malicious endpoint demand.

Problem Description
This paper focuses on the hybrid scheduling problem of multi-type traffic in TSN, which can be divided into two parts. The first part is the design of the TSN switching mechanism in hybrid traffic scheduling, which combines two scheduling mechanisms of the TAS and CQF for mixed transmission of three types of traffic, and has been explained in the system architecture of Section 3.2. The second part is the traffic injection problem of the traffic to be scheduled and mapped to the time slot. It is necessary to design a hybrid traffic scheduling strategy in the above switching mechanism, in order to improve the success ratio of RC traffic and BE traffic scheduling on the premise of meeting the schedulability of TT traffic.
The traffic scheduling sequence has an important impact on its scheduling success ratio. The sequence of packets in the scheduling cycle and the location of time slot injection determines the delay and jitter. There are already some basic shaping methods to inject hybrid traffic into transmission time slots sequentially, such as time slot pre-allocation after arranging them in ascending or descending order according to traffic characteristics including period and load. However, the traffic characteristics considered when applying these methods for scheduling are relatively single and cannot weigh the scheduling urgency of global traffic, resulting in poor shaping performance. For example, the outgoing port of a switch accumulates six flows at time 0 in Figure 4. However, f RC 3 , with a load size of three transmission units, has been waiting in the queue for a long time before other flows arrive at this switch. At the time of the fourth transmission unit, f RC 3 reaches the scheduling deadline. If the sequential scheduling is determined only by traffic load, without considering traffic characteristics such as deadline and waiting time, the just-arrived low-load TT and BE flows will be transmitted first. As a result, f RC 3 , whose deadline is earlier, starts transmission at the eighth transmission unit, and its scheduling fails. port of a switch accumulates six flows at time 0 in Figure 4. However, , with a load size of three transmission units, has been waiting in the queue for a long time before other flows arrive at this switch. At the time of the fourth transmission unit, reaches the scheduling deadline. If the sequential scheduling is determined only by traffic load, without considering traffic characteristics such as deadline and waiting time, the just-arrived low-load TT and BE flows will be transmitted first. As a result, , whose deadline is earlier, starts transmission at the eighth transmission unit, and its scheduling fails. To solve the problem of time slot injection of traffic, the following definitions are given in this section: (1) Hyper period: In order to reduce the complexity of hardware design, the hyper period of gating scheduling preferentially selects the integer multiple of all the flow periods in the network, so the hyper period is defined as the least common multiple of all the flow periods in the network.
(2) Time slots: The gating policy defined in IEEE802.1Qbv implements fine scheduling control through time slots. The time slot acts as the minimum scheduling unit of the gating control list, in which the traffic to be scheduled is injected. The scheduling hyper period of TSN consists of several scheduling time slots , i.e., ℎ = ∑ . Since the driver of gated scheduling is periodic, the upper limit of scheduling time slots is selected as the greatest common divisor of all flow periods.
(3) Time slot injection ratio: The time slot injection ratio is the ratio of the time slot size occupied by the injected traffic to the time slot size. A higher slot injection ratio indicates that the network bandwidth is more fully utilized and more non-TT traffic can be scheduled. Define the injection decision variable , if = 1, it indicates that is successfully injected into the time slot and starts transmission; otherwise, = 0. It is known that the traffic injection of the corresponding time slot is required at each switching node of the traffic on its path, so there is: where , [ , ] indicates whether can be successfully injected into the -th scheduling time slot of the hyper period when flowing through link [ , ]. Thus, the global time slot injection ratio can be calculated as: To solve the problem of time slot injection of traffic, the following definitions are given in this section: (1) Hyper period: In order to reduce the complexity of hardware design, the hyper period of gating scheduling preferentially selects the integer multiple of all the flow periods in the network, so the hyper period is defined as the least common multiple of all the flow periods in the network.
(2) Time slots: The gating policy defined in IEEE802.1Qbv implements fine scheduling control through time slots. The time slot acts as the minimum scheduling unit of the gating control list, in which the traffic to be scheduled is injected. The scheduling hyper period of TSN consists of several scheduling time slots Ts, i.e., hp = ∑ m j=1 Ts j . Since the driver of gated scheduling is periodic, the upper limit of scheduling time slots is selected as the greatest common divisor of all flow periods.
(3) Time slot injection ratio: The time slot injection ratio is the ratio of the time slot size occupied by the injected traffic to the time slot size. A higher slot injection ratio indicates that the network bandwidth is more fully utilized and more non-TT traffic can be scheduled. Define the injection decision variable map i , if map i = 1, it indicates that f i is successfully injected into the time slot and starts transmission; otherwise, map i = 0. It is known that the traffic injection of the corresponding time slot is required at each switching node of the traffic on its path, so there is: where map indicates whether f i can be successfully injected into the j-th scheduling time slot of the hyper period when flowing through link [v x , v x+1 ]. Thus, the global time slot injection ratio can be calculated as:

Design of Scheduling Strategy for Hybrid Traffic
This section designs the multi-type hybrid traffic scheduling strategy in TSN. Hybrid traffic scheduling can be abstracted as a time slot injection problem in gating control strategy. In order to achieve good scheduling performance, we use the TAS+CQF hybrid scheduling mechanism to shape the hybrid traffic. After shaping the traffic according to the laxity, we can obtain the offset of traffic sending and the injection time slot.

The Objective of Traffic Shaping Objective
According to the IEEE802.1Q standard, the priority level of each traffic is specified by the priority Code Point field (PCP) in the Ethernet header, which is the priority parameter f i .p defined in Section 3.1. The inbound filtering module assigns flows to different queues based on their priorities. However, simply assigning queues according to preset traffic priorities will result in too-coarse-shaping granularity to achieve fine-grained scheduling of traffic by TSN and will not achieve the expected deterministic traffic delivery.
When scheduling traffic shaping, multiple traffic characteristics such as traffic load and deadline should be considered comprehensively, in order to flexibly determine the traffic scheduling sequence. If the fixed scheduling priority is used to determine the fixed scheduling sequence and time slot injection location of the traffic, the punctuality requirement of critical traffic cannot be guaranteed. In addition, it is easy to preempt non-critical traffic for a long time, resulting in the "starvation" phenomenon, and traffic shaping should maximize the periodic critical traffic injected into the time slot as much as possible, in order to reserve more time slots in the front for the coming traffic.
We dynamically arrange the traffic scheduling sequence according to the traffic laxity and allocate time slot resources for different types of traffic. Laxity is the slack degree to which traffic can be delayed before its required deadline. Traffic with low laxity is scheduled first in the queue. In the traffic shaping stage, the hybrid traffic scheduling strategy determines the feasible traffic scheduling sequence according to the traffic laxity and assigns different types of traffic to the corresponding queues, and then uses the TAS or CQF mechanism to inject the traffic into time slots. After the transmission time slots of TT traffic and RC traffic are well planned, more scheduling space can be reserved for cached BE traffic in low-priority queues. After the pre-injection of critical traffic such as TT traffic and RC traffic in each time slot, there may be unutilized remaining time slots of different sizes at the tail end of the time slot; the remaining available time slots are then searched in a sliding manner to inject BE traffic, thereby maximizing the throughput of BE traffic.
In hybrid traffic scheduling, different types of traffic have different scheduling objectives. On the premise of meeting the deadline of TT traffic, we try to improve the scheduling success ratio of RC traffic and minimize the sum of end-to-end response delay of global critical traffic. After TT traffic and RC traffic have been deployed to the network, the scheduling goal for BE traffic is to inject more BE frames to maximize the utilization of time slots. In this way, increasing the slot injection ratio can avoid more useless network bandwidth overhead caused by BE traffic retransmission.

The Details of Shaping Implementation
Due to the limited port resources on the network, the injection time of the time slot needs to be properly scheduled based on gating control policies to ensure the priority scheduling of critical traffic and avoid the congestion of output ports. This section comprehensively considers the different characteristics of TSN hybrid traffic. We first propose a hybrid traffic shaping method based on least laxity, which determines the sequence of traffic injection and transmission slots in the queue according to the laxity. The shaping stage process is shown in Figure 5. To meet the requirements of TSN for delay control and deterministic transmission, the TSN hybrid traffic scheduling strategy takes the initial priority of traffic as a reference, and shapes traffic according to traffic characteristics such as traffic period and load to determine the scheduling sequence. Traffic shaping can provide better deterministic realtime scheduling performance for critical flows and reserve more scheduling space for noncritical flows.
If the queue scheduling sequence is determined according to a single index such as traffic priority, traffic load, or traffic period, it is difficult to ensure the global schedulability of critical flows. The traffic laxity designed by the proposed method integrates the global information of the scheduled traffic and takes into account parameters such as the traffic deadline .
, the waiting time . , the traffic period . , and the load size . . The waiting time . is the queuing time caused by the traffic not being injected into the slot and forwarded immediately when it arrives at a node. In the scheduling shaping stage, the time slot is mapped according to the laxity calculated during the traffic scheduling, and the traffic with the minimum laxity is selected to inject into the current link's time slot. For TT traffic and RC traffic, traffic with a small load, earlier deadline, short period, and long waiting time should be prioritized. Therefore, the traffic laxity is defined as Equation (5): The goal of hybrid traffic scheduling is to ensure that TT traffic and RC traffic are successfully scheduled. According to traffic characteristics, periodic critical TT traffic and RC traffic and non-critical BE traffic are scheduled in strict priority during shaping. Therefore, the laxity of BE traffic is higher than that of TT traffic and RC traffic. To meet the requirements of TSN for delay control and deterministic transmission, the TSN hybrid traffic scheduling strategy takes the initial priority of traffic as a reference, and shapes traffic according to traffic characteristics such as traffic period and load to determine the scheduling sequence. Traffic shaping can provide better deterministic realtime scheduling performance for critical flows and reserve more scheduling space for non-critical flows.
If the queue scheduling sequence is determined according to a single index such as traffic priority, traffic load, or traffic period, it is difficult to ensure the global schedulability of critical flows. The traffic laxity designed by the proposed method integrates the global information of the scheduled traffic and takes into account parameters such as the traffic deadline f i .D max , the waiting time f i .w, the traffic period f i .T, and the load size f i .S. The waiting time f i .w is the queuing time caused by the traffic not being injected into the slot and forwarded immediately when it arrives at a node. In the scheduling shaping stage, the time slot is mapped according to the laxity calculated during the traffic scheduling, and the traffic with the minimum laxity is selected to inject into the current link's time slot. For TT traffic and RC traffic, traffic with a small load, earlier deadline, short period, and long waiting time should be prioritized. Therefore, the traffic laxity is defined as Equation (5): The goal of hybrid traffic scheduling is to ensure that TT traffic and RC traffic are successfully scheduled. According to traffic characteristics, periodic critical TT traffic and RC traffic and non-critical BE traffic are scheduled in strict priority during shaping. Therefore, the laxity of BE traffic is higher than that of TT traffic and RC traffic.
Since BE traffic is not periodic and has no deadline requirement, its laxity is higher than other traffic. The maximum laxity of other traffic is max f j .S MTU + e f j .T + 1. Therefore, according to the sum of the packet load size of BE traffic and the maximum laxity of non-BE traffic, its laxity can be determined as follows: We select the traffic with the least laxity degree to schedule first, and the waiting time f i .w of all traffic is 0 in the initial stage of shaping. When any traffic is injected into the time slot in each switching node of its transmission path, the waiting time f i .w of the remaining traffic will change node by node. Therefore, the laxity of any f i varies dynamically at different switching nodes. The core of this shaping method is to dynamically determine the ) of the traffic flowing through each switching node and then inject scheduling slots sequentially. The smaller the traffic laxity in the same queue, the earlier the traffic is scheduled. The minimum laxity value is 0, in which case the priority of this traffic injected into the time slot is the highest.
The sequence of flow injection time slots can be determined after the traffic shaping, and the injection sequence of traffic in Figure 4 can be adjusted as shown in Figure 6 according to this method. Although f TT 2 delays two transmission units to start transmission, the adjusted scheduling sequence can ensure the successful scheduling of both TT traffic and RC traffic.
Since BE traffic is not periodic and has no deadline requirement, its laxity is higher than other traffic. The maximum laxity of other traffic is . + . + 1. Therefore, according to the sum of the packet load size of BE traffic and the maximum laxity of non-BE traffic, its laxity can be determined as follows: We select the traffic with the least laxity degree to schedule first, and the waiting time . of all traffic is 0 in the initial stage of shaping. When any traffic is injected into the time slot in each switching node of its transmission path, the waiting time . of the remaining traffic will change node by node. Therefore, the laxity of any varies dynamically at different switching nodes. The core of this shaping method is to dynamically determine the ( [ , ] ) of the traffic flowing through each switching node and then inject scheduling slots sequentially. The smaller the traffic laxity in the same queue, the earlier the traffic is scheduled. The minimum laxity value is 0, in which case the priority of this traffic injected into the time slot is the highest. The sequence of flow injection time slots can be determined after the traffic shaping, and the injection sequence of traffic in Figure 4 can be adjusted as shown in Figure 6 according to this method. Although delays two transmission units to start transmission, the adjusted scheduling sequence can ensure the successful scheduling of both TT traffic and RC traffic. It should be noted that the hybrid traffic scheduling strategy proposed in this paper applies the CQF mechanism to RC traffic. The CQF mechanism uses both odd and even queues to receive and forward RC traffic cyclically. Although RC traffic also needs to be sorted by laxity, each traffic is required to be sequentially injected with a different time slot after sorting. If multiple RC flows reach the switch at the same time and queue, only one RC flow is injected into each time slot. In this way, RC traffic in the ping-pong queue is distributed to different time slots, which prevents traffic congestion. Compared with only using the TAS mechanism, the hybrid traffic scheduling strategy reduces the fine constraint discrimination for RC traffic. It uses the RC traffic transmission rules specified in the CQF mechanism for time slot injection, which can improve the success ratio of RC traffic scheduling on the premise of meeting the TT traffic requirements.
Through the above shaping stage, the sending offset of each flow can be calculated. The algorithm process of shaping according to laxity is shown in Algorithm 1. The input of the algorithm is a hybrid traffic set , traffic path information ℎ( ), and switch slot setting . The output is the laxity of the traffic , at each node and the transmission offset of the traffic [ , ] . at the outgoing port of the switch on the transmission path. It should be noted that the hybrid traffic scheduling strategy proposed in this paper applies the CQF mechanism to RC traffic. The CQF mechanism uses both odd and even queues to receive and forward RC traffic cyclically. Although RC traffic also needs to be sorted by laxity, each traffic is required to be sequentially injected with a different time slot after sorting. If multiple RC flows reach the switch at the same time and queue, only one RC flow is injected into each time slot. In this way, RC traffic in the ping-pong queue is distributed to different time slots, which prevents traffic congestion. Compared with only using the TAS mechanism, the hybrid traffic scheduling strategy reduces the fine constraint discrimination for RC traffic. It uses the RC traffic transmission rules specified in the CQF mechanism for time slot injection, which can improve the success ratio of RC traffic scheduling on the premise of meeting the TT traffic requirements.
Through the above shaping stage, the sending offset of each flow can be calculated. The algorithm process of shaping according to laxity is shown in Algorithm 1. The input of the algorithm is a hybrid traffic set F, traffic path information path( f i ), and switch slot setting Ts. The output is the laxity of the traffic laxity f Output: laxity f Sort path( f i ) in ascending order of hops and add it to pathset 2 for each traffic path v x , v y in pathset 3 Calculate all laxity f If f i is not the traffic with the minimum value of laxity f for Ts j in hp 11 If Ts k − Ts j .unused 13 At the beginning of scheduling shaping, the set of paths for all flows is sorted in ascending hop count order and added to the global pathset (line 1). Each link in the global traffic pathset is then traversed in order and the time slot injection is analyzed for each link one by one: firstly, the laxity of all traffic flowing through this link is calculated, and the traffic with the least laxity is selected for time slot injection of this link, and its transmission duration f m .L is recorded (lines 2-5). We traverse all traffic flowing through the link and update its waiting time if it does not have the least laxity (lines 7-8). If the traffic has the least laxity, the time slot injection operation starts to traverse the time slot resources of the current link. The transmission offset of this flow at this node can be calculated according to the packet length and the remaining available capacity of the time slot. If the remaining amount of the current time slot cannot accommodate the traffic with the least laxity, it will enter the next time slot for traffic injection. If the remaining amount of this time slot is sufficient to inject new incoming traffic, set the offset of this traffic on this node and update the remaining amount of this time slot (lines 9-15); After that, when the traffic arrives at a new switching link each time, all the laxity with the same number of hops passing through this link is recalculated and the above operation is repeated.

The Scheduling Constraints
Different scheduling mechanisms have different time slot injection rules and scheduling constraints. The deterministic transmission of the traffic to be scheduled can be completed only when it meets the transmission constraints of the corresponding scheduling mechanism. Therefore, this section determines whether the traffic transmission offset and injection time slot meet the scheduling constraints of the corresponding mechanism. According to the TAS mechanism in Figure 2, the TT traffic in TSN needs to have strict transmission offset and periodicity requirements, and the CQF mechanism shows that RC traffic has a hop-by-hop deterministic delay upper bound in the transmission process. Based on the TSN network and traffic model, this section designs the following constraints to ensure the deterministic scheduling delay of TT traffic and RC traffic according to traffic characteristics such as the frame transmission offset and occupied time slot.

Frame Offset Constraint
The frame offset of the traffic transmission should not be earlier than the transmission start time, and the transmission should be completed within its flow period. We assume that the global earliest transmission start time is 0. In addition, the search space of the frame offset can be reduced by constraining the frame offset within the period range. The constraint of the frame offset is shown in Equation (8) .L are the offset and transmission time of the j-th frame of f i sent by v a to the link [v a , v b ], respectively.

End-to-End Delay Constraint
To ensure the QoS of traffic transmission, the time difference between receiving by the receiver and sending by the sender must be less than or equal to the maximum end-to-end response time, otherwise, the scheduling fails. For TT traffic, the following end-to-end delay constraints are introduced to specify the transmission delay between the sender and the receiver.

Flow Jitter Constraint
TSN should ensure low jitter transmission of critical traffic. Since it is sensitive to the low-jitter service quality of TT traffic transmission at the receiver, the perception of transmission jitter at intermediate nodes is weak. Therefore, the flow jitter constraint only applies to the sending node of the last hop before the receiver. As shown in Equation (10)

Periodic Constraints
According to the periodic characteristics of TT traffic in TSN, all time-sensitive data of the same terminal device need to be sent periodically. In addition, a fixed period is required between every two flows, that is, after the injection time slot of the first packet of the TT flow is determined, the injection time slot of the subsequent packets of the flow can also be determined.

CQF Time Slot Transmission Constraints
In the hybrid traffic scheduling strategy, CQF queues with priority 5 and priority 6 are used to transmit RC traffic. According to the traffic characteristics of RC traffic, we design a coarse-grained forwarding delay upper bound constraint, that is, when the CQF mechanism is used to transmit RC traffic, its forwarding delay upper bound value in a single switch can be determined. Therefore, the end-to-end delay of RC traffic is distributed to each switching node to ensure the successful scheduling of RC traffic. The CQF mechanism must follow the following two rules when transmitting RC traffic.

Rule 1:
For different switching nodes, the time slot in which the previous switching node sends the packet and the time slot in which the next switching node receives this packet are required to be in the same time slot. As shown in constraint (12) below, if the CQF queue of the (n − 1)-th switching node sends a message at the m-th time slot, then the time slot in the CQF queue of the n-th node that receives and forwards this message is also in Ts m .

Rule 2:
For the same switching node, when the CQF mechanism is used to transmit RC traffic, the packets received in the last time slot must be forwarded in the next time slot. Therefore, there are the following constraints (13): Combining the above two rules of transmitting RC traffic by applying the CQF mechanism, the CQF time slot transmission constraint can be obtained as: Specifically, if the packet sent by the previous node is in the previous time slot Ts m , the latter node receives the packet in the same time slot Ts m , and the latter node forwards the packet in the later time slot Ts m+1 .

Schedulability Evaluation Algorithm
Schedulability is an important index to evaluate the performance of the hybrid traffic scheduling mechanism. Periodic traffic such as TT traffic and RC traffic is scheduled successfully when it is successfully injected into the time slot and meets the correspond-ing TSN constraints, while BE traffic is scheduled successfully as long as it is injected into the transmission time slot. Meeting schedulability means that the scheduling performance requirements of different types of traffic in TSN can be guaranteed. After the flow shaping and being injected into the time slot, whether the flow sending offset meets the constraints is the key to schedulability evaluation. Therefore, we apply the flow sending offset and injection decision variables obtained by Algorithm 1 to design the schedulability evaluation algorithm.
We need to focus on the relationship between the time slot injection and schedulability of TT and RC traffic. Successful time slot injection is a necessary condition for successful traffic scheduling. If map i = 0, the necessary condition for schedulability is not satisfied and this traffic cannot be scheduled. Scheduling constraints are sufficient conditions for successful traffic transmission. After a flow is injected into the time slot, it is still necessary to check that the flow satisfies map i = 1. When the above constraints of Section 5.1 are satisfied, the traffic of the scheduling configuration in TSN can be judged to be successfully scheduled.
If the traffic to be scheduled is TT traffic, then determine whether f .φ satisfies constraints (8)- (11). If it is RC traffic, since the proposed hybrid traffic scheduling strategy combines the CQF mechanism and traffic shaping, so that the offset time of RC traffic after pre-shaping that is mapped into the time slot can meet the CQF constraint (14), that is, the scheduling is successful. In this way, the strictness of traffic scheduling constraints is reduced while meeting scheduling requirements. If it is BE traffic, there is no constraint requirement and the scheduling is successful as long as map i = 1. We define the schedulability indicator variable sched i , with sched i = 1 indicating that f i can be successfully scheduled. The detailed schedulability evaluation algorithm is shown in Algorithm 2.

Experiments and Evaluation
To verify the TSN hybrid traffic scheduling policy design proposed in Section 4, we present the experimental results in this section. We give the experimental parameter settings and then the performance of the proposed scheduling strategy is evaluated, including RC traffic scheduling success ratio, time slot injection ratio, and scheduling delay.

Experiment Setup
In this section, we design the experiment of the hybrid traffic scheduling strategy and verify its performance. Simulation experiments were conducted using MATLAB2018b, running on a Windows computer with Intel(R) Core(TM) i7-10700 2.90 GHz CPU and 32GB RAM.
Assuming that global clock synchronization has been completed on the devices in TSN and the link transmission rate is set to 1 Gbps, the transmission delay of the Maximum Transmission Unit (MTU) is 12.336 µs and the processing delay of the switch for all three types of traffic is 1 µs. We used the Orion Crew Exploration Vehicle (CEV) topology [21] for the simulation, which is shown in Figure 7.

Experiments and Evaluation
To verify the TSN hybrid traffic scheduling policy design proposed in Section 4, we present the experimental results in this section. We give the experimental parameter settings and then the performance of the proposed scheduling strategy is evaluated, including RC traffic scheduling success ratio, time slot injection ratio, and scheduling delay.

Experiment Setup
In this section, we design the experiment of the hybrid traffic scheduling strategy and verify its performance. Simulation experiments were conducted using MATLAB2018b, running on a Windows computer with Intel(R) Core(TM) i7-10700 2.90 GHz CPU and 32GB RAM.
Assuming that global clock synchronization has been completed on the devices in TSN and the link transmission rate is set to 1 Gbps, the transmission delay of the Maximum Transmission Unit (MTU) is 12.336 µs and the processing delay of the switch for all three types of traffic is 1 µs. We used the Orion Crew Exploration Vehicle (CEV) topology [21] for the simulation, which is shown in Figure 7. According to the guidance of industrial interconnection communication traffic characteristics in the DetNet use case standard [25], the traffic parameters in the experiment are set as Table 2. To ensure the effectiveness of TT traffic and RC traffic scheduling, we set .
of TT traffic and RC traffic to be less than the sending period of the traffic. The experiment can be divided into two parts. The first part is to select a traffic shaping method. It includes Least Laxity First (LLF), Earliest Deadline First (EDF), Shortest Period First (SPF), and Shortest Data packet First (SDF). The second part is to select the traffic scheduling mechanism, including the hybrid scheduling mechanism using According to the guidance of industrial interconnection communication traffic characteristics in the DetNet use case standard [25], the traffic parameters in the experiment are set as Table 2. To ensure the effectiveness of TT traffic and RC traffic scheduling, we set f i .D max of TT traffic and RC traffic to be less than the sending period of the traffic. The experiment can be divided into two parts. The first part is to select a traffic shaping method. It includes Least Laxity First (LLF), Earliest Deadline First (EDF), Shortest Period First (SPF), and Shortest Data packet First (SDF). The second part is to select the traffic scheduling mechanism, including the hybrid scheduling mechanism using TAS+CQF and the direct scheduling mechanism using only TAS. To verify the performance of the hybrid traffic scheduling strategy, the methods in the above two parts are sequentially arranged and combined under the same experimental scenario, which is used as the method of the comparative experiment in this paper. In addition, we also use the Simulated Annealing Multi-CQF (SA_MCQF) method proposed by Alexandris et al. [26] as a comparison method. The MCQF mechanism uses queue 7-1 as three groups of CQF queues to transmit periodic traffic, with queue 0 used to transmit BE traffic.

Hybrid Traffic Scheduling Mechanism
To verify the influence of the proposed scheduling mechanism on the scheduling success ratio of RC traffic, this experiment compares the scheduling strategy of SA_MCQF, LLF_TAS using the TAS mechanism, and LLF_TC combining the TAS and CQF mechanisms. The LLF_TAS and LLF_TC scheduling strategies both adopt traffic shaping based on traffic laxity.
The hybrid traffic scheduling mechanism adopted in the LLF_TC strategy combines the CQF mechanism. For RC traffic, the CQF mechanism adopts the time slot injection rule of parity cyclic injection. When there is an RC flow, each time slot will reserve a transmission space for RC traffic. However, when multiple RC flows converge in the same time slot of the same switching node, only one can be injected at most, in order to avoid preempting the transmission space of TT traffic. Therefore, the hybrid traffic scheduling mechanism reserves scheduling space for RC traffic on the premise that TT traffic is scheduled before the deadline, in order to improve its scheduling success ratio.
In this experiment, we selected 20 TT flows and 20-120 RC flows to ensure that all TT flows scheduling is successful. From the experimental results in Figure 8, it can be seen that the scheduling success ratio of RC traffic under the three scheduling strategies decreases to different degrees as the number of RC traffic increases. In the experiment using the LLF_TAS strategy, the scheduling success ratio is 95% when there are 20 RC flows, but this decreases to 54.17% when the number of flows is 120.

Different flow shaping methods
In the shaping process of TSN hybrid traffic scheduling, we should comprehensively consider the traffic characteristics. Based on ensuring the deterministic transmission of TT traffic, this experiment analyzes the method of injected traffic in the shaping stage to verify the performance of the proposed shaping method based on traffic laxity. The four shaping methods are Earliest Deadline First (EDF), Shortest Period First (SPF), Shortest Data packet First (SDF), and Least Laxity First (LLF). In this experiment, we select a total of 20 TT flows and 20-120 RC flows, and the selected scheduling mechanisms are all hybrid scheduling mechanisms that integrate the TAS and CQF mechanisms.
According to the RC flow scheduling success ratio shown in Figure 9, the proposed LLF shaping method has the optimal performance, and the performance ranking of the other three methods is EDF, SPF, and SDF. The LLF shaping method can comprehensively consider the characteristics of traffic period, load, deadline, and waiting time, in order to Since the SA_MCQF method also uses the CQF queue to transmit RC traffic, the performance of parity queue to transmit RC traffic is better than that of the TAS mechanism, so the RC traffic scheduling success rate of SA_MCQF is slightly higher than that of LLF_TAS. However, the simulated annealing method fails to dynamically arrange the scheduling sequence according to the traffic characteristics, and with the increase in the traffic scale, the CQF queue cannot schedule TT traffic well. In order to ensure the scheduling delay of TT traffic, the RC traffic scheduling success rate of SA_MCQF is inferior to that of LLF_TC. In the experiment of the LLF_TC strategy, when the number of RC flows is 120, the scheduling success ratio can still reach 79.17%, and all of them can be scheduled successfully when the number of RC flows is less than 40. Therefore, the hybrid scheduling mechanism proposed in this paper can better improve the scheduling success ratio of RC traffic without affecting the scheduling success ratio of TT traffic.

Different flow shaping methods
In the shaping process of TSN hybrid traffic scheduling, we should comprehensively consider the traffic characteristics. Based on ensuring the deterministic transmission of TT traffic, this experiment analyzes the method of injected traffic in the shaping stage to verify the performance of the proposed shaping method based on traffic laxity. The four shaping methods are Earliest Deadline First (EDF), Shortest Period First (SPF), Shortest Data packet First (SDF), and Least Laxity First (LLF). In this experiment, we select a total of 20 TT flows and 20-120 RC flows, and the selected scheduling mechanisms are all hybrid scheduling mechanisms that integrate the TAS and CQF mechanisms.
According to the RC flow scheduling success ratio shown in Figure 9, the proposed LLF shaping method has the optimal performance, and the performance ranking of the other three methods is EDF, SPF, and SDF. The LLF shaping method can comprehensively consider the characteristics of traffic period, load, deadline, and waiting time, in order to reserve more advanced time slot resources for RC flows to be scheduled. As the number of RC flows increases, the success ratio of RC traffic scheduled by the EDF, SPF, and SDF shaping methods decreases significantly. However, the LLF shaping method can schedule all RC traffic successfully when there are 40 RC flows in the network. When the number of RC flows grows to 120, the success ratio of the LLF shaping method can still reach 79.17%, while the success ratio of the sub-optimal shaping method EDF is only 53.33%. Therefore, the experimental results show that the shaping method LLF adopted by the strategy in this paper can schedule more RC traffic.

Adaptability of the Hybrid Scheduling Mechanism to Different Traffic Proportions
To verify the adaptability of the hybrid scheduling mechanism to different traffic ratios in the hybrid traffic set, four traffic ratio scenarios are designed in this experiment. The hybrid traffic set in each scenario contains 100 flows. On the premise that all TT traffic can be successfully scheduled, the RC traffic proportion in scenarios with different proportions increases gradually. The proportion of three types of traffic in each scenario is shown in Table 3. RC traffic does not require ultra-low latency during transmission, but needs to meet its deadline requirements. To analyze the adaptability of the hybrid scheduling mechanism to different traffic ratios and the scheduling delay performance of RC traffic under this mechanism, we compare the ratio of the average end-to-end delay of RC traffic to the average deadline under different mechanisms. If the ratio is greater than 1, it indicates that the overall scheduling performance of RC traffic in this scenario is poor.

Adaptability of the Hybrid Scheduling Mechanism to Different Traffic Proportions
To verify the adaptability of the hybrid scheduling mechanism to different traffic ratios in the hybrid traffic set, four traffic ratio scenarios are designed in this experiment. The hybrid traffic set in each scenario contains 100 flows. On the premise that all TT traffic can be successfully scheduled, the RC traffic proportion in scenarios with different proportions increases gradually. The proportion of three types of traffic in each scenario is shown in Table 3. RC traffic does not require ultra-low latency during transmission, but needs to meet its deadline requirements. To analyze the adaptability of the hybrid scheduling mechanism to different traffic ratios and the scheduling delay performance of RC traffic under this mechanism, we compare the ratio of the average end-to-end delay of RC traffic to the average deadline under different mechanisms. If the ratio is greater than 1, it indicates that the overall scheduling performance of RC traffic in this scenario is poor. The experimental results are shown in Figure 10. The LLF_TAS method using only the TAS mechanism has strict fine-grained gating constraints on RC traffic, which cannot guarantee that RC traffic can be injected in every time slot. Therefore, in four traffic ratio scenarios, the ratio of average end-to-end delay to average deadline of RC traffic using the LLF_TC method is lower than that using the LLF_TAS method. However, the SA_MCQF method fails to dynamically arrange the scheduling sequence according to the traffic characteristics, and the CQF queue has poor TT traffic scheduling performance due to its peristaltic plastic property, which results in the delayed scheduling of some low-priority RC traffic. Therefore, the RC traffic scheduling delay ratio is higher than that of the LLF_TC method. Moreover, in the P2 and P4 scenarios, the LLF_TC method can keep the global delay ratio lower than 1 while the LLF_TAS method performs poorly. Especially in the P4 scenario with a high RC flow ratio, the LLF_TC method can reduce the ratio by 17.8%. Therefore, it can be seen from the experimental results that the LLF_TC method can achieve good RC traffic scheduling performance under different traffic ratios, and has good adaptability to the dynamic TSN hybrid traffic set.

Influence of Hybrid Scheduling Mechanism on Slot Injection Ratio
To verify the influence of different scheduling mechanisms on the time slot injection performance, this experiment analyzes the global time slot injection situation when the traffic ratio scenario is P4. In the process of slot injection, the strategy that only adopts the TAS scheduling mechanism does not reserve transmission space for RC traffic in each slot, with the result that some RC traffic with large bandwidth cannot be injected. The CQF queue in the SA_MCQF method provides a transmission guarantee for RC traffic. However, due to its poor scheduling effect on TT traffic and unreasonable scheduling sequence, it will lead to the occurrence of time slot waste. The LLF_TC method integrates the CQF and TAS mechanisms, and injects as much RC and BE traffic as possible based on successful TT traffic injection.

Influence of Hybrid Scheduling Mechanism on Slot Injection Ratio
To verify the influence of different scheduling mechanisms on the time slot injection performance, this experiment analyzes the global time slot injection situation when the traffic ratio scenario is P4. In the process of slot injection, the strategy that only adopts the TAS scheduling mechanism does not reserve transmission space for RC traffic in each slot, with the result that some RC traffic with large bandwidth cannot be injected. The CQF queue in the SA_MCQF method provides a transmission guarantee for RC traffic. However, due to its poor scheduling effect on TT traffic and unreasonable scheduling sequence, it will lead to the occurrence of time slot waste. The LLF_TC method integrates the CQF and TAS mechanisms, and injects as much RC and BE traffic as possible based on successful TT traffic injection.
According to the experimental results shown in Figure 11, with the increase in the number of flows in the network, the slot injection ratio of LLF_TAS is lower than that of LLF_TC; the slot injection ratio grows slowly, except that the slot injection ratio of the two scheduling mechanisms is the same when the number of flows is 20. When the number of flows is 100, the time slot injection ratio of LLF_TAS is 24.3% less than that of LLF_TC. Although the hybrid traffic scheduling strategy proposed in this paper can improve the success ratio of RC traffic scheduling, it still needs to ensure that the deterministic transmission of TT traffic is not affected. Therefore, to verify the overall scheduling performance of TSN hybrid traffic, we select a total of 100 flows when the traffic ratio scenario is P4. The comparison methods are the LLF_TAS method using the TAS mechanism, the SA_MCQF method, and four scheduling strategies using different shaping methods under the hybrid traffic scheduling mechanism.
As the LLF_TC method uses the CQF mechanism to transmit RC traffic, the pingpong queue in the CQF mechanism alternately transmits and receives RC packets to avoid starvation blocking, and the transmission space is reserved for RC traffic in each transmission time slot. When there is RC traffic transmission in the network, each time slot will reserve the transmission space of one RC flow. Therefore, some TT traffic may be delayed on the premise of successful scheduling, with the LLF_TC method having a larger delay than the LLF_TAS method which does not reserve scheduling space for RC traffic.
According to the experimental results in Figure 12, the average end-to-end delay of TT traffic is the lowest when the LLF_TAS method is adopted. The average end-to-end delay of the TT traffic of the proposed LLF_TC method is slightly higher than that of the LLF_TAS method using only the TAS mechanism, but the gap between them is very small. When the number of flows is 100, the maximum delay difference is only 5.2 µs, which does not significantly degrade the delay performance of TT traffic. Moreover, the end-toend delay of TT traffic generated by the LLF method is lower than that of the EDF, SA_MCQF, SPF, and SDF methods. Therefore, the hybrid scheduling mechanism proposed in this paper can achieve a higher global slot injection ratio. Compared with the LLF_TAS method, which only uses the TAS mechanism, the LLF_TC method has higher network resource utilization, that is, more non-TT traffic can be scheduled.

Influence of Different Scheduling Strategies on Average End-to-End Delay of TT Traffic
Although the hybrid traffic scheduling strategy proposed in this paper can improve the success ratio of RC traffic scheduling, it still needs to ensure that the deterministic transmission of TT traffic is not affected. Therefore, to verify the overall scheduling performance of TSN hybrid traffic, we select a total of 100 flows when the traffic ratio scenario is P4. The comparison methods are the LLF_TAS method using the TAS mechanism, the SA_MCQF method, and four scheduling strategies using different shaping methods under the hybrid traffic scheduling mechanism.
As the LLF_TC method uses the CQF mechanism to transmit RC traffic, the pingpong queue in the CQF mechanism alternately transmits and receives RC packets to avoid starvation blocking, and the transmission space is reserved for RC traffic in each transmission time slot. When there is RC traffic transmission in the network, each time slot will reserve the transmission space of one RC flow. Therefore, some TT traffic may be delayed on the premise of successful scheduling, with the LLF_TC method having a larger delay than the LLF_TAS method which does not reserve scheduling space for RC traffic.
According to the experimental results in Figure 12, the average end-to-end delay of TT traffic is the lowest when the LLF_TAS method is adopted. The average end-to-end delay of the TT traffic of the proposed LLF_TC method is slightly higher than that of the LLF_TAS method using only the TAS mechanism, but the gap between them is very small. When the number of flows is 100, the maximum delay difference is only 5.2 µs, which does not significantly degrade the delay performance of TT traffic. Moreover, the end-to-end delay of TT traffic generated by the LLF method is lower than that of the EDF, SA_MCQF, SPF, and SDF methods.

Conclusions
This paper aims to solve the scheduling problem of multi-type traffic including periodic and aperiodic coexistence in TSN. By combining the TAS and CQF scheduling mechanisms, we reserve scheduling space for RC traffic. In addition, a shaping method based on traffic laxity is proposed. Based on traffic characteristics, we dynamically arrange the scheduling sequence of different types of traffic and design a schedulability evaluation algorithm to achieve efficient scheduling of hybrid traffic.
The experimental results show that although the average end-to-end delay performance of TT traffic is slightly lower than that of LLF_TAS using only the TAS mechanism, the proposed LLF_TC method can still ensure the deterministic transmission of TT traffic, and the global traffic scheduling performance is significantly improved. When the number of RC traffic is 120, the scheduling success ratio can reach 79.17%.
In the process of hybrid traffic scheduling, we have not considered the optimization and adjustment of the traffic that fails to be scheduled. In our future work, the scheduling mechanism of a software-defined network can be adopted to arrange the control plane and forwarding plane jointly. After traffic shaping and schedulability analysis, we can adjust the injection slot offset of the failed traffic and reduce the queue scheduling delay globally, in order to further improve the global scheduling performance.