Deadline-Aware Online Scheduling of TSN Flows for Automotive Applications

The Time-Sensitive Networking (TSN) set of standards allows to support on the same channel the different kinds of traffic flows that are typically found in automotive scenarios. This article proposes the introduction of online Earliest Deadline First-based scheduling in TSN to provide support for event-driven real-time traffic. The proposed approach, called Deadline-TSN, is an online approach, and therefore, unlike other approaches in the literature, it does not require complex offline schedule calculations. Moreover, Deadline-TSN is able to uniformly deal with real-time periodic and event-driven traffic flows. This article presents Deadline-TSN and provides both worst-case response time analysis and simulative assessments in realistic automotive scenarios.


I. INTRODUCTION
T HE IEEE 802.1 Time-Sensitive Networking (TSN) set of standards enables properties, such as time synchronization, reliability, and determinism, that are very suitable for industrial and automotive [1] communications over Ethernet links. The TSN standards realize a converged network able to support multiple traffic flows, with different timing and reliability requirements, on the same channel. Depending on the mechanisms implemented to fulfil the diverse requirements of the supported traffic flows, the design of TSN networks may require complex and time-consuming configurations [2], [3] through the usage of Satisfiability Modulo Theories (SMT) solvers [4] or mapping tools based on heuristics [5].
This article focuses on TSN for in-car automotive communications. The motivating scenarios include autonomous driving applications, such as obstacle detection and traffic sign recognition, which generate event-driven (ED) traffic that requires bounded and very low end-to-end delays (E2EDelays). Such delays range from hundreds of microseconds to tens of milliseconds [6], but as of today, the TSN support to different classes of ED real-time flows is limited. In addition, the need to meet the timing requirements of real-time traffic flows with different generation patterns, i.e., periodic, sporadic, and ED, suggests to explore the case for online scheduling approaches over TSN as an alternative to complex offline configurations of the network parameters. Moreover, offline scheduling requires that all the characteristics of the flows are known in advance, but in automotive applications not all the flows start at the system startup or at known points of time. New flows can be actually activated during the system operation by an event whose occurrence is not known a priori, e.g., when trailers are connected to cars or trucks. For example, in the work of Haeberle et al. [7], when the trailer is coupled with the vehicle, the advanced driver assistance systems (ADAS) need to handle the new real-time flows generated by the rear-view camera and park distance control sensors installed on the trailer. To support applications, such as the ones described previously, in-car networks may benefit from online scheduling algorithms, as such algorithms take the decision at run time based on the actual frames to be transmitted. In particular, if the scheduling decision is based only on the frame absolute deadline, which depends on the frame arrival time and is known at run time, all the real-time traffic classes, i.e., periodic or ED, can be managed in a uniform way. The novel contribution of this article is the introduction of online Earliest Deadline First (EDF) scheduling in TSN to support real-time ED traffic. To the best of our knowledge, this topic has not been addressed in previous work so far.
The presented approach, called Deadline-TSN (D-TSN), offers the following advantages: 1) no need for offline schedule calculations, as it is an online scheduling approach, 2) the support for multiple classes of ED real-time traffic, thanks to the availability of multiple priority levels, and 3) no additional frame overhead, as the standard Ethernet frame format is maintained. This article presents and discusses the following. 1) The design of D-TSN.
2) The relevant worst-case response time analysis.
3) Simulative assessments in realistic automotive scenarios. The rest of this article is organized as follows. Section II deals with related works, while Section III provides a background on the TSN standards on which D-TSN builds upon. Section IV presents the D-TSN design. Section V provides the worst-case response time analysis. Section VI presents the results of simulative assessments obtained through OMNeT++ simulations. Finally, Section VII concludes this article.

II. RELATED WORK
Several works in the literature addressed the suitability of the TSN standards for industrial and automotive contexts [8]- [10]. In particular, as in these scenarios, the timing constraints of the real-time traffic flows have to be guaranteed, a number of research works focused on schedulability analysis and schedule generation algorithms for traffic flows in TSN-based networks [11]- [15]. Some works [16]- [18] proposed offline EDF scheduling of periodic traffic flows over TSN. These works exploit the time-aware shaping under the assumption that the arrival times and periods of the frames are a priori known. Consequently, such approaches cannot deal with ED real-time traffic, as the frame arrival times of ED flows are not known a priori. Conversely, D-TSN supports both periodic and ED real-time traffic in a uniform way, as it schedules the frames online based on their arrival times and absolute deadlines.
Several approaches were proposed for scheduling periodic real-time flows over TSN networks. For example, the algorithms presented in [19] and [20] deal with scheduling of timetriggered flows for industrial communications in the context of Time-Sensitive software-defined networks. Moreover, the bandwidth partitioning system proposed in [21] enables to introduce new flows in TSN-based in-vehicle networks without affecting the already existing traffic. However, unlike D-TSN, none of the abovementioned approaches addresses ED real-time traffic flows. In [22], a framework that automates offline scheduling in TSN networks through an SMT-based solver is presented. However, such a framework cannot cope with ED traffic, and it also entails complex and time-consuming schedule calculations. As far as providing support to real-time ED traffic is concerned, the work in [23] proposes a traffic management scheme, called EDSched, which introduces explicit support for ED real-time traffic. EDSched guarantees temporal isolation to time-driven flows using the transmission gates of the IEEE 802.1Q-2018 standard and introduces a novel traffic class, the ED class, to reduce the delay of ED flows. However, unlike D-TSN, ED-Sched is not able to distinguish between the diverse classes of ED flows. In [24], a joint algorithm that fragments messages into frames of optimized sizes and schedules them under hard real-time constraints is presented. The approach combines the fragmentation of messages with no-wait scheduling to reduce the latency. In small networks, it uses optimization modulo theories solvers to find the optimal configuration in the source nodes, whereas in the case of large networks, it adopts an iterative algorithm. Conversely, D-TSN does not require complex calculations in the end nodes and in the switches, as the frames are scheduled according to an EDF-based policy. A different approach to support real-time traffic without the need for clock synchronization is the Asynchronous Traffic Shaping (ATS), introduced by the IEEE 802.1Qcr-2020 [25] standard. The ATS applies a token-bucket shaping on a per-flow basis and can also be adopted for the transmission of ED real-time traffic. According to the ATS specifications, each flow is associated with a shaper instance and has its own bucket size (which defines the maximum burst size that can be transmitted) and token generation rate (which determines the bandwidth assigned to the flow). The ATS assigns to each shaper an eligibility time, after which the head frame of the shaper's queue is sent to the transmission queues. The work in [4] proposes a design-time solution to configure the ATS parameters, such as the assignment of the real-time flows to the queues and the specific priority level to each queue, which exploits an SMT solver. However, as the SMT solution does not scale well for large networks, it may take a long time to compute a schedule [26]. Conversely, D-TSN enables transmission scheduling of diverse kinds of realtime traffic flows without resorting to complex calculations and configurations.

III. BACKGROUND
D-TSN combines the Per-Stream Filtering and Policing (PSFP) and strict priority scheduling mechanisms of the IEEE 802.1Q-2018 standard [27] with the clock synchronization provided by the IEEE 802.1AS-2020 standard. Fig. 1 shows a scheme of the forwarding process with the first two mechanisms.
According to the IEEE 802.1Q-2018 standard, each Ethernet port maintains up to eight transmission queues, ordered by priority. The PSFP allows for stream filtering, policing, and queueing decisions and defines three main components on top of the transmission queues, i.e., the stream filters, stream gates, and flow meters. The stream filters associate each frame with a stream, and the mapping is made on the basis of a stream_handle value (as defined in the IEEE 802.1CB standard) and/or on the Priority Code Point (PCP) value encoded within the virtual LAN (VLAN) tag of the processed Ethernet frame. Each stream is, in turn, mapped onto a single stream gate. The flow classification rules may use one or more fields, such as the destination MAC address, source MAC address, virtual LAN identifier (VID), and priority [27], to associate a stream with a single stream gate.
Stream gates maintain a state value (i.e., open or closed) and an Internal Priority Value (IPV). If the stream gate state is open, the frames mapped onto the stream gate are allowed to be enqueued in the transmission queue corresponding to the current IPV of the stream gate. Conversely, if the stream gate is closed, the frames mapped onto the stream gate are dropped. The stream gate state values and the IPVs can change at runtime, according to a predefined time schedule that cyclically repeats. The stream filters also map a stream to a flow meter, which is in charge of marking the frames, on the basis of defined stream specifications, and dropping them, if the frames do not comply with these specifications. Flow meters are not detailed here, as they are not needed in D-TSN. When a frame arrives at the ingress port of the switch, the stream filters map the frame to a stream gate. Stream gates cyclically execute a stream gate control list (there is one list for each stream gate). Each entry of the gate control list specifies the stream gate state and the IPV, which is used to map the frame to the transmission queue with the corresponding priority. For example, if the IPV of a stream gate is 7, the incoming frames traversing the stream gate will be inserted in the highest priority transmission queue. At the end of PSFP process, the frames are enqueued in the transmission queues according to the IPV of the traversed stream gate. The strict priority selection algorithm picks for transmission the frame that is the head of the highest nonempty priority queue and transmits it.
The following section describes how D-TSN makes use of the abovementioned mechanisms to realize EDF scheduling.

IV. DEADLINE-TSN
D-TSN inserts the frames in the transmission queues of the Ethernet port based on their absolute deadline, leveraging on the PSFP ability to change the flows' priority following a time schedule. More details are provided in the following.

A. System Model and Notation
The system model consists of a network made up of switches and end nodes. The switches are full duplex, provide multiple Ethernet ports, and are fully compliant with the IEEE 802.1Q-2018 and 802.1AS-2020 standards. The end nodes, instead, are equipped with a single Ethernet port. Both the switches and end nodes are connected through a full-duplex Ethernet physical layer operating at a fixed data rate (δ). Table I shows the notation. Each connection between two nodes is represented by two unidirectional links L<s, r>. Each source node generates one or multiple traffic flows. Each flow F i is characterized by a period P i , a relative deadline D i (i.e., the maximum allowed time span between the frame generation and delivery to destination), and a source-to-destination path ζ i , defined as a sequence of H i links ζ i = {L 0 , L 1 , . . .L H−1 }. Each Ethernet port on the path provides multiple transmission queues ordered by priority. Hereinafter, we assume Q = 8, i.e., the maximum number according the IEEE 802.1Q-2018 standard, but a lower number of queues does not invalidate the proposed approach. The switches need to be fully compliant with the PSFP, while the end nodes do not. D-TSN adopts a number N of stream gates to enable deadline-based frame priority. The N value depends on the adopted hardware. In commercial-off-the-shelf switches, the maximum number of stream gates is limited, (e.g., up to 128 in [28]). In D-TSN, N is configured to be a multiple of Q. This way, N/Q stream gates are mapped onto a transmission queue.

B. Design
D-TSN provides two frame transmission mechanisms, one for the end nodes and one for the switches. Such mechanisms differ for the frame parameter that drives the selection of the queue the frame has to be inserted in, as the end nodes use the PCP value, whereas the switches use the VID value. The source nodes use a software transmission mechanism, which computes the PCP and VID values for each frame and transmits the frame to the Ethernet port within a calculated time window. The VID is encoded in each frame by the source node once, and for all. The switches do not play any role in assigning the frame VIDs and shall not modify them. In the Ethernet port of the source nodes, the frames are selected for transmission according to the strict priority selection defined in [27]. The switches use a specific configuration of the PSFP that allows to change hop-by-hop, based on the frame VID, the queue in which the frame is inserted. In particular, in the switches, the control list of each stream gate is configured so that the frame priority increases as the deadline approaches. This is accomplished by changing the IPVs in each stream gate control list accordingly. The switch configuration required by D-TSN consists in setting the stream gate control lists, i.e., the way the IPVs change over time. This means setting for each stream gate, identified by a VID value, a sequence of {State, Interval, IPV} triplets, which cyclically repeats. Such a configuration is made only once, at the network deployment time, and shall be the same for all the network switches. The PSFP configuration through the IPV associated with a frame determines the priority of the queue, in which the frame will be inserted. Consequently, the frame scheduling is defined once the frame has assigned the IPV (i.e., the queue) and inserted in the queue. The scheduling then depends on the strict priority selection and on the frame position in the queue, i.e., on the frame arrival time. In fact, the queue will be selected for transmission according to the strict priority selection and, within the queue, the enqueued frames will be handled in First-In First-Out (FIFO) mode.
The PSFP in the switches is implemented in hardware.
The details are presented in the following sections. 1) Switch Forwarding and Transmission: In D-TSN, a frame arriving to an Ethernet port is assigned to a stream gate based on its VID value, which is a function of the frame absolute deadline (d). Each stream gate maintains an IPV, which specifies the transmission queue to be assigned to the incoming frames. The IPV changes at fixed time instants within the gate cycle, following a stream gate control list that cyclically repeats. This allows for dynamically changing the association between the stream gates and the transmission queues. D-TSN exploits this property to implement EDF scheduling within the switches. This way, the highest priority is assigned to the frames with the closest absolute deadline. D-TSN requires to configure the stream gate control lists only once, i.e., when the network is deployed.
In D-TSN, the frames are identified only based on the VID, and each VID is associated with a single stream gate. In D-TSN, each switch uses a stream filter to get the frame VID and to associate a frame with a stream gate. For the sake of readability, hereinafter, each stream gate is identified by the VID value. The first VID starts from VID 0 , which is the VID that is mapped onto the stream gate no. 0. The other streams are identified with consecutive values, i.e., VID N −1 = VID 0 + (N − 1). The stream gates are always open, while their IPV is recalculated at a constant configurable interval, here called a time unit (u). Moreover, the time unit is used as the time interval for assigning the priority to a frame based on its absolute deadline. In general, the shorter the time unit, the higher the granularity of the absolute deadlines that can be encoded. For example, if a frame has an absolute deadline equal to 50 μs and the time unit is equal to 10 μs, such a frame will be assigned the same VID of all the frames with absolute deadlines in the range (41μs, 50 μs). If multiple frames are enqueued in the same transmission queue, they will be transmitted in FIFO order.
For each VID, the stream gate control list follows a cyclical priority shifting, with a period equal to the number of stream gates used in D-TSN multiplied by the time unit. The number of rules is equal to the number of queues used by D-TSN. Each stream gate G has to be configured so as to change its IPV at time t = n × u ∀n ∈ N 0 according to the following function: where G is the stream gate index, and s(t) is the number of time units elapsed since a reference time t 0 calculated as The example in Fig. 2 shows a table with the matching between the stream gates and the transmission queues over time (i.e., at every time unit u) with Q = 8 and N = 16. The VID value of each stream gate is the number inside the table element.
For instance, given the case in Fig. 2 with u = 100, at time t = 0 a frame with VID field equal to 5 is inserted in the transmission queue no. 2, while at time t = 200, the same frame will be inserted in the transmission queue no. 3.
The VID calculation, which is up to the end nodes, is presented in the following.
2) End-Node Transmissions: The end nodes generate frames and assign to them the VID and the PCP values of the Ethernet VLAN tag.
When the jth frame of the ith flow (i.e., f i,j ) is generated, its absolute deadline d i,j is given by the frame arrival time a i,j plus the relative deadline D i of the ith flow. The VID value V i,j for f i,j is calculated mapping the absolute deadline to a priority, which is an integer number in the range {VID 0 , . . ., VID N −1 }, calculated as where τ b is the time required to transmit 1 b. The floor function argument is the length, measured in time units, of the time interval between the absolute deadline and the start of the cycle time, defined as T C = N × u. T C represents the scheduling temporal horizon and limits the furthest absolute deadline that will be considered by the scheduler (i.e., that will be assigned a VID) during the current time unit u. The cycle time shifts every u, thus progressively extending the schedule to the frames with further absolute deadlines. In D-TSN, each sender node is allowed to transmit a frame to the Ethernet port only when the time remaining before the frame deadline expires is lower than or equal to N * u (i.e., T C ) and higher than the time unit duration, i.e., when where t is the current time. Before transmitting a frame to the Ethernet port, the sender node assigns to the frame a PCP value calculated as follows: where t is the current time, i.e., the instant at which the sender node runs the PCP calculation. It is the PCP in the sender node that determines the transmission queue in which the frame will be inserted, as the PSFP in the end nodes is not required by D-TSN and, if present, has to be disabled. For example, with u = 100, Q = 8, and N = 8, using (5), the frame f i,j with d i,j = 800 is mapped to: 1) the lowest priority queue  (4) is not met.

C. Running Example
In the example shown in Fig. 3, two sender nodes (S1 and S2) periodically transmit (with period P i ) three flows (f 1 , f 2 , and f 3 ) to the receiver node (R) through the switch B. All the links L x,y operate at 1 Gbps, so the transmission time of a maximum-sized Ethernet frame is shorter than 13 μs.
The relative deadline D i of the frames of the ith flow is equal to the flow period. In this example, the time unit u is set to 10 μs, the number of stream gates is eight (N = 8), and the number of transmission queues used in D-TSN is eight (Q = 8). At time t 0 = 0, one frame for each flow is generated. The frame f 2,1 generated by S1 is immediately transmitted to the Ethernet port of S1 because Condition (4) is met, as t 0 is greater than d i − (N × u), i.e., 0 ≥ 50 − 80 μs. The PCP value of f 2,1 is equal to 3, according to (5), i.e., PCP 2,1 = 8 − 1 − 4 = 3, so the frame is assigned to the queue no. 3 (Q3 in Fig. 3), and the VID value V 2,1 is equal to 4 according to (3). Conversely, before being transmitted to the S2 Ethernet port, the frame f 3,1 has to wait until the condition t ≥ 100 − 80 μs is met (i.e., t ≥ 20 μs) and, according to (3) and (5), at time t = 20 μs its PCP value is set to 0 and its VID value is set to 7. However, at time t = 20 μs, according to (1), the IPV is equal to 0 for the frames enqueued with V 3,1 = 7, and therefore, the frame f 3,1 will be inserted in the queue no. 0 (i.e., Q0). Finally, at time t = 920 μs the frame f 1,1 is transmitted to the S1 Ethernet port, with the PCP value set to 0 and V 1,1 = 5, and mapped to the Q0 queue. In the switch, the frames are inserted in a higher priority queue than the source queue, as their transmission time exceeds the time unit u. As a consequence, during the frame transmissions, the stream gates shift their IPV, thus mapping the frame VID value onto a higher priority queue.

D. Discussion on the D-TSN Configuration Parameters
D-TSN schedules the transmissions based only on the frame absolute deadline. Consequently, it does not require complex network configurations. The only two parameters to be computed are the number of stream gates N to be used, which depends on the adopted hardware and shall be set as higher as possible, and the time unit u, i.e., the interval at which the stream gates calculate (and may change) their IPV.
According to the IEEE 802.1Q standard, the number of queues for each Ethernet port is limited to eight. Consequently, frames with different absolute deadlines may end up in the same queue. A large value for N provides the absolute deadlines encoded in the VID with a finer granularity, which allows to better differentiate between the frames mapped to the same queue. In D-TSN, all the frames hop-by-hop shift their priority over time, depending on their VIDs. In particular, the frames with higher VIDs will increase their priority faster than the ones with lower VIDs. As a result, the frames ended up in the same queue at a given hop may eventually split on different queues, based on their VIDs, on the next hops. Consequently, a large value for N is advisable, as it nicely complements the priority shifting mechanism.
The u parameter impacts on both the scheduling granularity, which improves while reducing the u value, and the E2EDelays, which reduce while increasing the u value. This means that, while increasing u, the number of frames that will be scheduled with the same priority may also increase, if their arrival times are the same. As the frame transmissions have to meet Condition (4), an increase of the u value enables the nodes to transmit earlier, thus resulting in lower delays. In this article, we set the u parameter according to (6), which allows for calculating the time unit (u) so that the first inequality of Condition (4) is always met, otherwise by design the frames would not be transmitted [first argument in (6)], and at the same time it allows for improving the scheduling granularity, by reducing the time unit until the waiting time at the source node increases [second argument in (6)]

E. Hands-On Example
D-TSN is implemented in software in the end nodes and in hardware exploiting the PSFP in COTS switches. To enable a temporally consistent view of the absolute deadline of each frame among all the end nodes and switches, they shall be synchronized using the IEEE 802.1AS standard, which guarantees a synchronization error lower than 1 μs. In the end nodes, when a frame is generated, the absolute deadline is calculated as d i,j = a i,j + D i . If Condition (4) is met, the VID and the frame priority are calculated and assigned to the VLAN Tag of the frame using (5) and (3), respectively, and the frame is transmitted to the Ethernet port. Conversely, if Condition (4) is not met, the frame transmission should be postponed to time t tx >= d i,j − T C . At time t tx , the VID and the frame priority are calculated and assigned to the VLAN Tag of the frame using (5) and (3), respectively, and the frame is transmitted. The switches have to be configured once when the network is deployed using a number N of stream gates. Each stream gate is associated with a VID starting from VID 0 to VID 0 + N . The stream gate control list of each stream gate has to be configured so as to switch the IPV according to (1). For each VID, the stream gate control list follows a cyclic priority shifting, and the number of rules is equal to the number of queues (Q) used by D-TSN. For instance, in the running example in Fig. 3, the stream gate control list for VID=1 and VID=4 of the Switch B port that is connected to the node R should be configured, as shown in Fig. 4, where Interval is the duration of a rule, and a State value equal to "o" means that the stream gate is open. No other configurations are required.

V. WORST-CASE RESPONSE TIME ANALYSIS
In this section, the D-TSN worst-case response time (WCRT) analysis is presented to verify if a flow set is schedulable. To this aim, the EDF worst-case response time analysis [29], [30] approach is adapted to D-TSN.
In D-TSN, a frame is transmitted to the transmission queue immediately after being generated if Condition (4) is met or after a waiting time , if its relative deadline is greater than the cycle time The worst-case response time R i for the ith flow is defined as the maximum time a frame belonging to the flow takes from its generation at the source node up to the delivery to the destination node. A flow is schedulable if and only if its worst-case response time is lower than or equal to its relative deadline (R i ≤ D i ). A flow set is schedulable if and only if all of the flows in the set are schedulable. In D-TSN, R i is given in the following: where, as shown in Table I, T sw is the switch fabric delay, C i is the worst-case transmission time of an Ethernet frame belonging to F i , and T Q L y i is the maximum queuing time of a frame belonging to F i in the transmission port of the yth link. We recall that H i is the number of links traversed by a frame of F i from the source to the destination. Here, it is assumed that all the frames belonging to F i follow the same path, i.e., ζ i = {L 0 , . . ., L H−1 }. C i is calculated as the ratio between the size (in bits) of the largest Ethernet frame of the F i flow and the network data rate (δ).
T Q L y i includes two components. The first one, blocking, is due to any lower priority frame being transmitted when the f j,i frame arrives in the transmission port of the L y link. The second component, interference, is due to the frames that are in the higher priority queues or in the same queue when the f j,i frame arrives.
The mapping of a frame f i,j to a transmission queue depends on the frame absolute deadline d i,j , which is encoded in the VID field. The frame VID corresponds to a stream gate, which maintains the IPV that, in turn, is mapped on a transmission queue. Due to the limited number of queues in the Ethernet switches, it may happen that frames with different absolute deadlines are mapped onto the same queue. For this reason, to identify the frames that may interfere with the transmission of f i,j , a function, called Conf_d(t), is introduced as follows: Conf_d(t) is used to cap the set of interfering frames for a given frame f i,j . In particular, Conf_d(t) calculates the upper bound of a temporal range that starts at the arrival time a i,j of a frame f i,j with a deadline d i,j , i.e., [a i,j , Conf_d(t)]. All the frames with arrival time earlier than a i,j and absolute deadline within the range [a i,j , Conf_d(d i,j )] are interfering frames for the frame f i,j . Fig. 5 shows the graphical representation of (9). The blue stepped line represents the queue to which a frame f i,j with absolute deadline d i,j is assigned. The figure shows that other frames with absolute deadline higher than d i,j , but lower than Conf_d(t), go to the same queue of f i,j .
Here, the worst-case response time analysis in [29] is applied using the Conf_d(d i,j ) value to identify the interfering frames  for f i,j . The worst-case response time analysis adopts the busy period concept, and here, the busy period of a frame f i,j is defined as the interval [0, t e ] during which all the frames with absolute deadlines lower than or equal to Conf_d(d i,j ) keep the transmission channel busy, and therefore, the frame f i,j is transmitted within t e . According to Spuri [29], the worst-case response time of F i is found in a busy period in which all other flows are released synchronously at the beginning of the busy period and then are transmitted at their maximum rate. Hence, we only need to calculate the length of the busy periods of the frames with priority higher than or equal to that of f i,j , with different arrival pattern of f i,j . The detailed calculation follows the analysis provided in Spuri [29]. Here, the D-TSN queuing delay computation is not presented for the sake of space, but readers can refer to the technical report [31].

VI. SIMULATIVE ASSESSMENT
This Section presents a performance assessment of D-TSN obtained using the OMNeT++ simulation environment, with the NeSTiNg [32] simulator extended to model D-TSN. The performance metrics, here considered, are the E2EDelay and the deadline miss ratio (DMR). The E2EDelay is defined as the time interval between the frame generation at the source node (GenTime) and its complete delivery at the destination node (RxTime), measured at the application level. The DMR is defined as the ratio between the number of frames that missed their deadline and the overall number of transmitted frames.
In the following, D-TSN simulative assessments in two different scenarios are presented.

A. Scenario A
The modeled scenario, shown in Fig. 6, is an automotive network with a zonal architecture inspired by the one presented in [33]. It consists of 37 end nodes, i.e., one central controller  All the flows from these sensors arrive to the CC, which processes the data and transmits both a video flow, augmented with additional graphics to assist the driver (DA-CAM), to the HU and control traffic to the CU.
Moreover, the video flows from the MC 1...2 and RC are activated by particular conditions, e.g., during the vehicle maneuvers. The link from SW1 and CC is offered the highest load, i.e., 88% of the bandwidth. Table II shows the characteristics of the main traffic flows in Scenario A.
In Table II, ADAS-Sensors1 and ADAS-Sensors2 are two ED flows consisting of frame bursts generated following a random distribution (e.g., maps relevant to obstacle detection), which each ZC transmits to the CC. Video refers to the flows transmitted by all the cameras, while heartbeat is a critical flow transmitted by all the nodes to report their health status.
In this scenario, D-TSN is compared with Audio Video Bridging (AVB) and with the EDSched approach presented in [8].
In the AVB network, video and audio flows are assigned to the highest priority stream reservation classes (i.e., SR Class A-queue 7-and SR Class B-queue 6-respectively) and undergo Credit-Based Shaper (CBS). The remaining flows are mapped onto the best-effort classes. Queue 5 is reserved to critical network management traffic, according to the IEEE 802.1Q-2018 standard. Critical flows, such as ADAS-Sensors, HeartBeat, Control, and DA-CAM, are assigned to Queue 4, while LiDAR, RADAR, Ultrasonics, and TelematicsData flows are mapped onto queue 3. The EDSched network is configured in the same way as AVB, with the difference that the ED traffic is mapped onto the ED traffic class (i.e., the highest priority transmission queue) and the bandwidth assigned to the SR traffic is calculated according to the method described in [8].
In this scenario, several simulations were run with a different number (N ) of stream gates, i.e., N = 64, 80, 96, 112, 128. Each simulation was repeated five times with different random generator seeds. The maximum E2EDelays obtained for the most noteworthy flows are shown in Figs. 7-10, in which the results are aggregated and the maximum E2EDelay result is presented for each simulation. The dashed red line represents the flow's relative deadline, while the solid line indicates the WCRT obtained by the analysis. Fig. 7 shows the maximum E2EDelays obtained by the video flows. The results show that when the number of stream gates N is equal to 64, the maximum delay obtained by D-TSN is higher than the relative deadline. This result depends on both the number of stream gates (N) and the time unit (u) value chosen in this case, which determine a short cycle time and make it necessary to postpone the transmissions of the generated bursts.
Here, we recall that T C limits the furthest absolute deadline that will be considered by the scheduler during the current time unit u. When N increases, the cycle time also increases, transmissions are not postponed, and, consequently, the E2EDelays decrease. In fact, when N ≥ 80, D-TSN does not experience deadline miss. Moreover, the WCRT values obtained by the analysis show that E2EDelays in D-TSN are lower than the relative deadline with N = 96, 112, and 128. As far as the AVB simulations are concerned, the video flows always meet the deadline, thanks to both their high priority and the effect of the CBS. This result is not surprising, as AVB was specifically designed to handle this kind of real-time traffic. The EDSched simulations obtained E2EDelays similar to the AVB ones. This is because EDSched adjusts the bandwidth reserved to the video flows in the SR Class so as to compensate for the higher priority assigned to the ED class. Moreover, both EDSched and AVB take advantage of the CBS when dealing with video traffic bursts.   show that all the three approaches, i.e., D-TSN, AVB, and EDSched, always meet the deadlines of such flows. In particular, D-TSN experienced no deadline miss with all the N values here considered, whereas the analytical WCRT results are lower than the relative deadline only when N ≥ 96. In both the AVB and EDSched simulations, these flows meet their deadlines. The reason is that, being critical flows, they are mapped onto a high priority best-effort queue, i.e., queue 4 in AVB and queue 3 in EDSched. Note that the maximum E2EDelay of the Control5ms flow with EDSched is equal to 17 μs, but it is not visible in Fig. 8, as it is significantly lower than the other values. Fig. 9 gives the maximum E2EDelays for the LiDAR, RADAR, and Ultrasonics flows. The results show that with D-TSN the deadlines are always met, while this is not always the case for LiDAR and RADAR flows with AVB and EDSched. This is because such flows are mapped onto queue 3 in AVB and queue 2 in EDSched, and therefore, they suffer from the interference of multiple flows, i.e., the critical flows (HeartBeat, TelematicsData, and Control5ms), the video flows, and the ED ADAS flows. Consequently, when an interfering frame burst arrives, such flows experience very high delays (and sometimes exceed the deadlines). D-TSN overcomes such a limitation, as it assigns the priorities online in a frame-by-frame way based on the absolute deadline. Fig. 10 shows the maximum E2EDelays obtained by the two ED flows, i.e., ADAS-Sensors 1 and ADAS-Sensors 2, the DA-CAM flow, and the Control flow with period 1 ms  (Control1ms). With both D-TSN and EDSched no deadline miss occurs. Moreover, the simulation results of the two approaches are very close to each other, and this means that the D-TSN performance are very good even in comparison with an approach that gives the highest priority to ED traffic. Conversely, in the AVB case, although the flows in Fig. 10 are mapped onto the critical flows queue (i.e., Queue 4), some deadline miss occurs for the ED flows, i.e., ADAS-Sensors 1 and ADAS-Sensors 2, and the Control1ms flow.
Finally, Table III shows the deadline miss ratio obtained via simulation. Note that the flows not shown in Table III do not experience any deadline miss.With AVB, the deadline miss ratio of the ADAS-Sensors 1 and LiDAR flows is higher than 1%, a very high value for such critical flows. With EDSched some deadline miss occurs for LiDAR and RADAR flows. Conversely, with D-TSN some deadline miss occurs for video flows when N=64, while when the number of stream gates increases, no deadline miss is experienced.
Summarizing, the results of the comparison with AVB and EDSched demonstrate the D-TSN ability to handle real-time flows with very diverse characteristics, arrival patterns, and timing requirements, including ED bursts, without the need for traffic shaping.

B. Scenario B
For the sake of comparison with an approach that, unlike AVB, does not bind a flow to a specific traffic class (e.g., stream reservation and best effort), but relies on a configuration that takes into account the characteristics of each flow, here a comparative assessment between D-TSN and ATS is presented. The addressed scenario, shown in Fig. 11, is based on the one considered in [34]. In the ATS simulation, the strict priority scheduling mechanism is applied on three kinds of flows, i.e., the low-priority (LP) flows (dashed dotted blue arrow in Fig. 11), medium-priority (MP) flows (dashed red arrows), and high-priority (HP) flows (solid  red arrows). Conversely, in the D-TSN simulation, the frames are scheduled based on their absolute deadline. The data rate is set to 1 Gbps for all the links. In the ATS simulation, the three kinds of flows are mapped onto three different queues of increasing priority (i.e., LP on queue 5, MP on queue 6, and HP on queue 7). Transmissions undergo a token-bucket traffic shaping [25], and the shaper parameters of each flow are sized, such as in [34]. Conversely, in the D-TSN simulation, the relative deadline of each flow is set, as given in Table IV, N is chosen equal to 32 (a realistic value for several switches, e.g., [28]), and the time unit u value is set to 32 μs, according to (6). Note that this is, by design, an unfavorable corner scenario for D-TSN, as the flows are periodic, multiple flows have the same relative deadline, and the arrival time of the first frame is the same for all the flows. The workload on the links that transmit the highest load (i.e., L SW1,SW2 and L SW3,SW4 ) is 688.3 Mbps. Table IV shows the flow parameters (on the left-hand side) and the maximum E2EDelays obtained (on the right-hand side).
The results show that the deadlines are met in all cases. Moreover, with D-TSN the E2EDelays for the flow groups [45-47] and [48-54] are 30.7% lower than those obtained with the ATS. In fact, these flows are the LP ones for ATS, and therefore, they suffer from the interference of multiple frames belonging to the higher priority flows. Conversely, D-TSN uses a per-frame priority, and therefore, the frames of the LP flows will not be delayed by the frames with a higher absolute deadline, thus obtaining lower delays than with ATS. Moreover, while with ATS the frames undergo traffic shaping, in D-TSN, there is no shaping, thus improving the bandwidth utilization. Finally, the EDF schedule in D-TSN does not need per-flow configurations, whereas the ATS may require the adoption of SMT solvers [4] to configure on a per-flows basis the maximum token capacity and refill rate of the token bucket and the priority mapping.
To assess the network E2EDelay performance with different time unit (u) values, the network in Fig. 11 was simulated with N = 32 and u = {10, 20. . ., 100 μs}. Table V shows the obtained results. When the u value is very low, i.e., u ≤ 20 μs, the maximum E2EDelay is high, as the frame waiting time at the source is not equal to zero. When the time unit increases, the E2EDelays decrease up to u = 40 μs. A higher time unit value entails a lower deadline granularity. This means that the same VID, i.e., the same priority, is assigned to frames with quite different absolute deadlines. These frames are scheduled in FIFO order, and therefore, their delays also depend on their frame arrival time. Consequently, when u is greater than or equal to 50 μs the maximum E2EDelays show a fluctuating trend. This result is more significant for the flows with shorter relative deadlines, i.e., the flows [0-4], [5][6][7][8][9], and [10][11][12][13][14].

VII. CONCLUSION
This article proposed D-TSN, which supports real-time flows with different arrival patterns, including ED ones, applying online EDF scheduling without offline schedule calculation, shaping or additional frame overhead. D-TSN is fully compliant with the IEEE 802.1Q-2018 standard and can be implemented on COTS devices with no hardware modifications. Future work will address the integration of scheduled traffic support and experimental evaluations on TSN-compliant switches [28].