Ethernet is a well-established network protocol that has excellent bandwidth, scalability, compatibility and cost properties . However, it was not suitable for real-time and safety critical applications . Distributed safety-critical applications, like those found in the aerospace, automotive and industrial automation domains, require certification evidence for the correct real-time behavior of critical communication. Therefore, several extensions to the Ethernet protocol have been proposed, such as, ARINC 664 Specification Part 7 , TTEthernet , and EtherCAT . In 2012, the IEEE 802.1 Time-Sensitive Networking (TSN) Task Group  has been founded to define standard real-time and safety-critical enhancements for Ethernet.
TSN integrates multiple traffic types and supports interactions in several combinations. In this paper we consider a TSN solution supporting Credit-Based Shaper (CBS), previously defined for Audio-Video Bridging (AVB) in 802.1BA , currently in [7, § 220.127.116.11], with enhancements for Scheduled Traffic (previously defined in 802.1Qbv , now in [7, § 18.104.22.168]) based on Gate-Control Lists (GCLs). We call this architecture TSN/GCL+CBS. We consider three traffic-types with varying criticalities: Scheduled Traffic (ST) which is also known as Time-Triggered (TT) traffic, AVB traffic and Best-Effort (BE) traffic. ST traffic supports hard real-time applications that require very low latency and jitter (e.g., industrial control requires 1–10 milliseconds latency and microseconds jitter). It is transmitted based on schedule tables called GCLs that rely on a global synchronized clock (802.1ASrev ). AVB traffic is intended for applications that require bounded end-to-end latencies, but has less time-critical compared with ST traffic. It uses the CBS to prevent the starvation of lower priority AVB traffic. The TSN Task Group has extended AVB architecture, allowing the definition of multiple CBS [7, § 22.214.171.124], so we consider any number of AVB classes. BE traffic is used for applications that do not require any timing guarantees and is mapped to the remaining queues.
The schedulability of the scheduled ST traffic can be guaranteed during design phase by considering individual scheduling of ST flows and synthesizing the GCLs . For more generic window-based GCLs, Zhao et al.  have proposed a Network Calculus (NC)-based method to analyze the latency bounds for flexible window-based ST traffic. Researchers have extended the analysis to the preemption mode using Real-Time Calculus . Moreover, AVB in TSN can be used for time-critical applications that require bounded latency even though it has lower time-critical than ST traffic. Hence it is very important to have a safe and guaranteed WCD analysis for AVB that takes into account the ST flows. Although latency analysis methods have been successfully applied to AVB traffic in AVB networks [14, 15, 16], they do not take account for the interference of ST traffic on the AVB traffic and only consider two or three AVB classes. Recently, Cao et al.  have proposed an eligible interval based formal analysis on the calculation of worst-case performance bounds for multiple classes of AVB traffic. However, they do not consider the effect of ST traffic on AVB traffic, and focus only on the “relative delay” on a single hop. Network Calculus-based analyses have been proposed  to compute the WCDs of Rate-Constrained (RC) traffic with the consideration of the ST (also named Time-Triggered, or TT) frames in TTEthernet, but the techniques are not applicable for TSN: RC traffic has no CBS, the integration modes are different in TSN and TTEthernet and TSN schedules ST traffic differently from TTEthernet: individual ST frames are considered in TTEthernet, whereas TSN schedules ST windows which may include several ST frames.
The timing analysis of non-ST traffic types in TSN has been addressed in , considering closed-gate blocking, strict priorities and a “Peristaltic Traffic Shaper”. However, their analysis is not applicable to AVB, which uses CBS. Researchers , have proposed the latency bounds for AVB traffic affected by control-data-traffic (CDT) in TSN, but assuming CDT as leaky bucket (LB) or length rate quotient (LRQ), which does not fit for the ST traffic. The AVB Latency Math equation has been extended to consider the ST traffic in TSN . However, it does not consider the actual situations for AVB flows in the network, but just assumes that maximum allowable bandwidth is occupied by the corresponding AVB traffic class, thus causing overly pessimistic, i.e., leading to overly large WCDs. In addition,  can only be used to determine the WCDs of AVB Class A traffic. Researchers have extended the Eligible Interval Analysis (EIA) to calculate the delay of two classes of AVB traffic in TSN . However, it does not consider relative offsets between ST windows, but just assumes the ST windows always arranging back-to-back. The initial idea for the two classes of AVB analysis under the influence of ST traffic in TSN network based on the Network Calculus has been given by , and then credit bounds for CBS are improved in . However, all these analyses above are based on a credit behavior deviating from the standard 802.1Q-2018 , i.e., assuming credit frozen during guard band before gate closing. Moreover, the latest standard 802.1Q supports any number of AVB classes, which are not supported in previous analysis work. Thus, in this paper, we are interested to propose a formal performance analysis method for arbitrary number of AVB classes in TSN networks, under both behaviors of frozen and non-frozen credit during guard band (GB, cf. Sect. III for details).
The main contributions of our paper are as follows:
To the best of our knowledge, our analysis is the first one to prove the credit bounds of CBS in the cases of frozen and non-frozen credit during guard band. The analysis is able to handle with arbitrary number of AVB classes under the influence of ST traffic for the whole TSN network.
We reduce the pessimism of the analysis and this provides tighter latency bounds for AVB, by introducing the limitations from the physical link rate and the output of CBS, which are denoted as the link and CBS shaping curves with the consideration of ST traffic.
We evaluate the proposed approach on both synthetic and real-world test cases, comparing AVB latencies in cases of frozen and non-frozen credit during guard bands, and comparing with related work and simulation results to show the significant reduction of pessimism on latency bounds, and to validate the correctness and the scalability of our implementation.
The paper is organized as follows. Sect. II presents the system model. Sect. III introduces TSN. Sect. IV briefly introduces the Network Calculus concepts needed for the analysis. Sect. V gives the proof of credit bounds for multiple classes of AVB traffic respectively under frozen and non-frozen behaviors of credit during GB and presents tighter AVB latency bounds by introducing shaping curves. Sect. VI evaluates the proposed analysis and Sect. VII concludes the paper.
Ii System Model
A TSN network is composed of a set of end systems (ES) and switches (SW) also called nodes, connected via physical links. In this paper, we assume, without loss of generality, that all physical links have the same rate . The links are full duplex, allowing thus communication in both directions, and the networks can be multi-hop. The output port of a SW is connected to one ES or an input port of another SW.
The messages are sent from ESes via flows, which have a single source and may have multiple destinations. Each source ES is able to send multiple flows to the network. As mentioned, our TSN solution supports three traffic types: ST [7, § 126.96.36.199], AVB [7, § 188.8.131.52] and BE. We assume that the traffic type for each application has been decided by the designer. The subscripts () for AVB denote respectively the different AVB traffic classes. For ST traffic, we know the GCLs in each output port of nodes, i.e., the opening and closing time of ST traffic (named as ST window) and GCL period (). For an AVB flow , we know its frame size , the minimum frame interval in the source ES and the traffic class it belongs to. The AVB Class has higher priority than the AVB Class . The flows assigned the same AVB traffic class are served in FIFO order. Moreover, we know the maximum frame size of BE traffic.
Iii TSN/GCL+CBS Output Port
The TSN Task group has defined a set of schedulers, which can interact in several combinations. In this paper, we assume a specific configuration, called TSN/GCL+CBS architecture to provide different real-time guarantees and will present how ST and AVB flows are transmitted in this case, as shown in Fig. 1. Each one has eight queues for storing frames that wait to be forwarded on the corresponding link, one or more for ST queues, two or more () for AVB queues (respectively for Class ) and the remaining queues are used for BE. Every queue has a gate with two states, open and closed. Frames waiting in the queue are eligible to be forwarded only if the associated gate is open.
The gates for each queue are controlled by GCLs, which are created offline and contain the times when the associated gates are open and closed . In this study, we assume that when associated gate for ST traffic is open, the remaining gates for other traffic (AVB and BE) are closed, and vice versa (aka. exclusive gating). Therefore, AVB traffic is prevented from transmitting in the time windows reserved for ST frames.
In addition, two integration modes are introduced to solve the issue when an AVB frame is already in transmission at the beginning of time window for ST, i.e., non-preemption [7, Annex Q] and preemption [7, Annex S] modes. In this paper, we focus on the discussion of the non-preemption integration mode (see Fig. 2) and the analysis model is also suitable for the preemption integration mode combined with HOLD/RELEASE. The non-preemption mode uses a “guard band” before each ST window to prevent the AVB frame from initiating transmission if there is insufficient time available to transmit that entire frame before the open event of ST gate. The preemption mode combined with HOLD/RELEASE also uses a guard band, but with a rather smaller size [7, Annex S.4]. The “guard band” will lead to wasted bandwidth due to the guard band, but it ensures no delay for ST traffic.
An enqueued AVB frame is transmitted only if the associated gate is open and the Credit-Based Shaper (CBS) [7, § 184.108.40.206] permits it. Each AVB queue has a credit value, initialized to zero. When the AVB gate is closed, the associated credit is “frozen”. When the associated AVB gate is open, the variation of credit is the same as the one in AVB networks , i.e., decreasing with a send slope () during the transmission of an AVB frame and increasing with an idle slope () when AVB frames are waiting to be transmitted due to other higher priority AVB frames or the negative credit. This is illustrated for example in Fig. 3, where we have three AVB classes (), and show the variation of credit for respective AVB class. Particularly, during guard bands, we assume two behaviors of the credit for AVB traffic. One is “non-frozen”, obeying the behavior of credit in the standard. The other is “frozen”, of which the behavior deviating from the standard, but is a model assumption for most existing work. Daigmorte et al.  have shown that the credit evolution rule with guard band in the standard is unfair, which is an argument for an update of the standard to consider the credit evolution rule to be frozen.
Iv Network Calculus Background
Network Calculus  is a mature theory proposed for deterministic performance analysis. It is used to construct arrival and service curve models for the investigated flows and network nodes. Network Calculus functions mainly belong to non-decreasing functions and null before 0: . Two basic operators on are the convolution ,
and deconvolution ,
where means infimum and means supremum.
An arrival curve is a model constraining the arrival process of a flow, in which represents the input cumulative function counting the total data bits of the flow that has arrived in the network node up to time . We say that is constrained by iff for all ,
A service curve models the processing capability of the available resource. Assume that is the departure process, which is the output cumulative function that counts the total data bits of the flow departure from the network node up to time . There are several definitions for service curve. We say that the network node offers the min-plus minimum service curve for the flow iff
and offers the strict service curve iff
during any backlog period . In addition, in order to evaluate service curves we will use the non-decreasing non-negative closure defined by
A shaping curve characterizes the maximum number of bits that are served during a period of time , which means that the departure process from the server always respects the shaping curve. A server offers a shaping curve iff could be an arrival curve for all output cumulative function (Eq. 3). Note that the shaping curve from the output can also be said as an arrival curve for the subsequent nodes.
If a flow of arrival curve crosses a server with the service curve , then the output flow can be bounded by the arrival curve ,
It can also be taken as an arrival curve of input flow for the next node.
Let us assume that the flow constrained by the arrival curve traverses the network node offering the service curve . Then, the latency experienced by the flow in the network node is bounded by the maximum horizontal deviation between the graphs of two curves and ,
The network end-to-end delay of a frame along its route is defined as the time duration between the instant it is transmitted by the source ES on the link and the instant it is fully received by the destination ES. The worst-case end-to-end delay of the flow can be bounded by the sum of latency bounds in each network nodes along its route.
V Worst-case Analysis for AVB Traffic
V-a Service Curve for AVB Traffic
In this section, we will extend the service curve in  to multiple AVB Class () with respectively (i) non-frozen and (ii) frozen credit during guard band. The service curve for AVB traffic depends on the working mechanism of CBS. As can be seen from Fig. 3, no matter the case (i) or (ii) for each AVB traffic Class , any time interval can be decomposed into
where (resp. ) represents the accumulated length of all period where the credit increases (resp. decreases), and is the frozen time of credit. The service could only be supplied for AVB traffic during the descent time of credit. Then, the service curve for multiple classes of AVB traffic is given by the following theorem.
The min-plus minimum service curve for AVB Class () under non-preemption mode in an output port is given by
where represents the behavior of credit during GB, and is the arrival curve with regard to credit frozen. In case of , i.e., (i) non-frozen credit during GB, is only related to higher priority ST traffic, while in case of , i.e., (ii) frozen credit during GB, should additionally take guard band slots into account. and are respectively given by Lemma 1 and Lemma 2 in Sect. V-C. is the upper bound of credit of Class under cases of (i) non-frozen or (ii) frozen credit during GB, and given by Eqs. (11) or (12). The proof of credit bound has to be extended to an arbitrary number of AVB classes and to consider different behaviors of credit during guard band, which is one of the challenges in this paper and will be discussed in Sect. V-B. The proof Theorem 1 is similar as the one given in , hence it will not be further discussed in this paper.
V-B Bounding the Credit for AVB Traffic
In this section, we bound the credit for AVB traffic. Let us recall from Sect. III how AVB is transmitted.
Before we start to prove the upper bound of credit, let us define some notations. Let denotes the same or higher priority AVB queues and denotes the lower priority AVB queues. Then for , the interval can be partitioned into several kinds of intervals: let and respectively denote the duration of emissions of frames from the queue and of high priority frames from the queue ; is the time slot reserved for ST traffic, i.e., the duration where the gates of AVB queues are closed; is the duration where a frame in waits due to a lower priority frame in queue or that is being transmitted cannot be preempted; denotes the guard band duration where for all queues with no frame can be sent, as there is no sufficient time available to transmit the entire frame before the next closing event; and is the interval except all the definitions above. Then we have .
(Higher bound of Class ) Let be the maximal frame size of a BE flow. The credit of Class is upper bounded by,
non-frozen credit during GB
frozen credit during GB
where , is the lower bound of credit of Class from Theorem 2, and and are the parameters of upper envelope related to guard band duration and satisfy for ,
which will be discussed in the end of Sect.V-C.
Proof: Considering the evolution of the credit, the maximal value of credit will only happen at the instant satisfying the following definition. Let be a time point when AVB gates are in the open state, and . Then let us define . It implies that , , , i.e., there always exists at least one queue in with some frame to send. Otherwise, we can always find another that satisfies . As it always exists one queue in with some frame to send, either it succeeds (there is a frame of emission, or a high-priority frame in emission) or is blocked (non-preemption or guard band or ST traffic transmission). Thus here. In the following, as are fixed, the will be simplified to .
(i) For the case of non-frozen credit during GB
Consider first the evolution of the credit value of between and . The credit increases at speed when the frame in the queue is waiting (during ), decreases at speed when the frame in the queue is transmitting (during ), is not modified when the gate of is closed during ST traffic transmission, and may be reduced from some positive value to 0 due to resets. Thus the variation of during is,
Since and , Eq. (14) is modified into,
Let denote the sum of credits of AVB traffic with the priority higher than . Consider three cases: first, at any instant between and either a frame of uses the link, or a low priority frame blocks the link or during GB, the credit of each non-empty queue increases with speed . Then the sum of credits increases at most at speed . Or a frame from class with higher priority than is being sent. In this case decrease at least at speed (all the classes from gain credit expect one which loses credit). The last case is like for , may decrease due to a set of resets. Then it is possible to upper bound the variation of between and ,
By definition of , it exists continuously some queue trying to send a frame. Hence there is at most one low priority frame that can get access to the link before and go on transmission due to non-preemption. Thus
Moreover, we assume that there exists and which will be discussed in Sect. V-C such that ,
Thus Eq. (16) is modified to obtain,
Considering the system is assumed to be not overloaded, we have . Thus, from Eq. (17)
By definition of s, we have and as well. Moreover, if is the lower bound of credit of Class , then so to conclude,
(ii) For the case of frozen credit during GB
The proof is similar to the above process, except the difference of the evolution of credit of during GB. The credit increases at speed during , decreases at speed during , and is not modified during guard band and ST traffic transmission . Then the variation of during is upper bounded by,
Additionally, for the sum of credits of AVB traffic with the priority higher than , it increases at most as speed when the frame of uses the link (during ) or a low priority frame blocks the link (during ),
Similarly, considering the system is assumed to be not overloaded, we have . Thus, from Eq. (20)
V-C Arrival Curve of ST/GB duration
In this section, the arrival curve of ST/GB duration is constructed. It is used to derive the leftover service curve for AVB traffic of Class , as AVB traffic cannot be transmitted when credit is frozen. As discussed above, credit will be frozen during ST time slots (windows) depending on the GCL, and whether it is frozen during GB intervals depends on the behavior selection.
ST traffic is scheduled within specific ST windows according to GCLs. The GCL for the output port is repeated after the GCL period , see the example in Fig. 4. Let be the number of ST windows in the GCL period . It is assumed that the th ST window in output port starts at and has duration , and the relative offset between the starting time of the th and th ST windows is For the case of credit non-frozen for AVB traffic during guard bands, the arrival curve for the credit frozen part is only related to ST windows, which is given by the following Lemma.
The arrival curve of the credit frozen part due to ST traffic in an output port is given by, for all
where is is one possible arrival curve by selecting th () ST window as the reference; represents the maximum number of bits the could be transmitted during the ST traffic window of length ; each staircase function shows the upper bound of ST transmission in the periodic ST windows of length , and the relative offsets give the relationships between different ST windows within the GCL period. The proof of the lemma is similar to the proof for TT flows in TTEthernet .
Moreover, for the case of credit frozen for AVB traffic of Class during GB, the arrival curve for the credit frozen part is not only related to ST windows, but also to GB intervals. A guard band may appear before a ST window, depending on the flow backlog. In the worst-case, the time duration of the guard band before the th () ST window equals to the minimum value of the maximum transmission time () of AVB frames of Class competing in output port and the idle time interval between two consecutive ST windows (th and th windows). We merge the guard band and ST window together to construct the arrival curve of the credit frozen part, the following Lemma is given,
The arrival curve of the credit frozen part due to ST traffic and guard band in an output port is given by, for all
where is is one possible arrival curve by selecting the th () ST window as the reference.
In the following, we are interested to derive and defined in Eq. (13) which is used for deriving credit upper bound of AVB Class . They are parameters (burst and long-term rate) related to the upper envelope of accumulated bits in guard band duration in any interval . Additionally, note that and are parameters defined based on in Eq. (13). The following Theorem gives the upper envelope of the guard band defined in Eq. (13) in the form of the staircase function.
The staircase upper bound on the GB duration defined from Eq. (13) for AVB Class traffic for all is as follows,
Proof: We need to upper bound the number of in . Introduce . First, consider some and , let
Noticing that , Chasle’s relation and leads to
But any infinite sum on any expression , can be decomposed as a double sum using with
The system behavior is periodic, so , , , leading to,
with . Now, remark that , ,
Combining all leads to