Time-Sensitive Networking (TSN) is an IEEE 802.1 working group that defines networking mechanisms for supporting real-time data flows with latency guarantees and zero packet loss . TSN targets applications in avionics, automotive, industrial networks, etc., where data loss or latency violation causes catastrophic damage. One of the main building-blocks of TSN is the Credit-Based Shaper (CBS), which provides rate allocation for a number of priority classes, called Audio-Video Bridging (AVB) classes, using a credit mechanism (Section II). In recent studies [2, 3, 4], latency and backlog bounds in TSN are derived by using network calculus and service curve characterizations of CBS . The latency parameters of such service curves is directly derived from credit upper bounds, i.e. bounds on the values of the credit counters of CBS. Two sets of results were published for credit upper bounds. The former, by J. De Azua and M. Boyer, (“J-bounds”, ) applies only to the case with two AVB classes and its proof is not fully described. The latter set of bounds, by H. Daigmorte et al (“H-bounds”, ), applies to any number of AVB classes and is formally proven. For the top priority AVB class, J- and H-bounds are identical. For the second priority class, J-bounds are generally smaller than H-bounds, but not always. For third and lower priority classes, only H-bounds are available.
In this paper, we derive and formally prove credit upper bounds for CBS with any number of AVB classes, which improve on both sets of existing bounds. Specifically, our bound is the same as J- and H-bounds for the top priority AVB class. For the second priority class, our bound is lower than the H-bound and is lower than or equal to the J-bound, depending on maximum packet lengths. For all other priority classes, our bounds are lower than the only available bounds, namely the H-bounds. Moreover, we formally show that our credit bounds are tight for the two classes of highest priority, which is the first tightness result presented in the literature. In Section IV, we perform numerical evaluations and show that the improvement in latency guarantees is significant.
Ii System Model & Existing Credit Bounds
We assume a TSN scheduler with the following elements: 1) A set of queues representing a set of classes including, in decreasing priority, one Control-Data Traffic (CDT) class, AVB classes 1, 2, 3, …, , and a set of Best Effort (BE) classes; 2) A set of gates, one per queue, such that if a gate is closed, the corresponding queue cannot transmit. A Gate-Control List (GCL) contains the information of the opening/closing times of gates. Moreover, there are several integration policies that determine the preemption or non-preemption of CDT over the rest of the classes . The analysis in this paper is valid for all integration policies; 3) A set of CBSs, one per AVB queue, to control the allocated rate of each AVB class. The CBS of an AVB class has two parameters: the idle slope, , and the send slope, . Note that , where is the line transmission rate. The idle slope is interpreted as the rate guaranteed to class and therefore, the condition is assumed to hold. Packets are scheduled according to the following rules (we repeat here the description in ):
R1: If the transmission line is free, the scheduler transmits a packet of the highest priority class that satisfies all the conditions: 1) it has a positive backlog; 2) its gate is open; 3) it has a nonnegative credit if it is an AVB class.
R2: The credit of the AVB class reduces linearly with rate the send slope, , if transmits.
R3: The credit of the AVB class increases linearly with rate , when the following conditions hold simultaneously for class : 1) its gate is open; 2) it has a positive backlog; and 3) other AVB or BE classes are transmitting.
R4: The credit of an AVB class remains constant, if the corresponding gate is closed, and during any additional overhead in the case of preemption mode for CDT.
R5: When class has a positive credit and its backlog becomes zero, the credit is set to zero; this is the credit reset. If the credit is negative and the backlog becomes zero, the credit increases with rate until the zero value.
Let denote the value of the credit counter for AVB class at time . We assume that the system is idle at time and . The function may take positive or negative values and is continuous, except at credit reset times, which, by R5, may occur only when the queue of class becomes empty. At all other times it is linearly increasing, decreasing or constant. The J-bounds in  apply to the case , as:
The H-bounds in  apply to any value of and give, for :
where , and is the maximum packet length of the classes having less priority than class . These bounds are formally proven in .
When we can compare the J- and H-bounds. For class 1 the bounds are identical, i.e., . For class , whenever , which is often but not always assumed, we have ; otherwise it may happen that for some values of the system parameters.
We use the following result, proven as Theorem 7 in ; for :
Iii Improved Upper Bound on the Credit of an arbitrary AVB class
Theorem 1 (Improved Credit Bounds).
The credit of an AVB class , , is upper bounded, , by:
Consider a time and define time instant . Based on the definition of : First, . This implies no credit reset during , i.e., is continuous during this interval. Second, CDT either finishes a transmission at or is not transmitting at . Indeed, otherwise, since , and the credit of is frozen during the transmission of CDT, it would be true that and thus, .
If , then and the result is straightforward. Since is continuous in , and , then, either or . If , then and the theorem is straightforward to show. As a result, the rest of the proof focuses on the case , i.e., . The class cannot start a transmission at time , otherwise, by rule R2 since , its credit would decrease to negative values, which contradicts our assumption that . Note that since the credit of class is positive in , its backlog is also positive in .
Since and due to rule R1, a class with lower priority than cannot start a transmission in . However, in order to consider non-preemptive AVB and BE classes, we should account for the case that a lower priority class has initiated a transmission the latest on and is still transmitting at . To do so, we define the time instant , with , as the end of the transmission of the residual of a lower priority packet after time . The latter is denoted by . If there is no transmission of a lower priority packet, then . If CDT is preemptive then the transmission of may be interrupted and re-continued. Let be the aggregated time period that the credit is frozen within . Then, and we assume .
The interval can be split into a sequence of sub-intervals during which class alternates between non-transmission and transmission. Let be such a sequence, with . We allow as this makes it possible to assume that class does not transmit in the first interval (i.e., if class starts transmission at time we set ). It follows that for the even intervals , with , we have ,
. Indeed, during non transmission, the credit either increases or remains constant, by rules R3 and R4. Conversely, for the odd intervals, with , we have , .
Let us define as the aggregated time period that the credit is frozen within the even interval . Next, we study the credit variation for all classes, starting with the interval , then following with even and odd intervals in . In :
Each class gains credit if it has backlog or negative credit (rule R3), except if CDT transmits, i.e.,
By summing up for all , we have:
Class gains credit because it has backlog as explained above, except if CDT transmits
and since and , we get:
For the odd intervals, , we have:
Since the credit of class reduces, the higher priority classes do not transmit within and . They gain credit if they have positive backlog or negative credit, i.e.,
Summing them up for all :
The credit of class reduces due to transmission (R2):
In even intervals , we have:
There should exist an AVB class that transmits or all AVB and BE classes wait for CDT (for an aggregated time ). Define as the aggregated period of time that class transmits packets in . Then, by using that , we obtain,
Summing up for all , and considering that , we obtain,
The credit of class increases or is frozen for an aggregated time , i.e.,
Next, we study the credit variation within . First we assume that is odd. By summing up the credit variations for all intervals and all classes , we have:
Therefore, by setting and , we can write,
Next, by summing up the credit variations for all intervals for class and considering ,
By Eq. (4), we obtain
Eq. (20) gives an upper bound on , i.e.,
Next, considering , and since by Eq. (9) , we obtain:
By replacing the value of , the credit of class at time , where is odd, is upper bounded by given in the statement. If is even, then:
Since , it is true that . As is even, is odd. We have already found a bound for when is odd, which is . Since , and is either odd or even, then and this completes the proof. ∎
The credit bound, , given in (5) is tight for the two highest priority classes, i.e., for each set of parameter values and each class 1,2, there is a scenario for which the credit counter attains the bound.
The credit of class 1 achieves the value in the following scenario. Assume that all queues have zero backlog. Just before the backlog of class 1 becomes positive, there is an arrival of a lower priority class packet with length . This packet starts being transmitted according to R1 (assuming the gate is open for it). It takes to transmit the lower priority packet. During the transmission, since class 1 has positive backlog it gains credit according to the rule R3. At the end of the transmission, the credit of class 1 becomes i.e., equal to (Eq. (5)).
The tightness scenario for class 2 is as follows. Assume that all queues for all classes have zero backlog. Just before the backlog of class 2 becomes positive, there is an arrival of a lower priority class packet with length
. This packet starts being transmitted (rule R1) since at this moment there is no packet of class 1, 2 and the gate is open. Just after the transmission, the backlog of class 1 becomes also positive. Due to positive backlog, the classes 1,2 gain credit according to the rule R3. At the end of transmission of the lower priority packet, the credit values of classes 1 and 2 areand , respectively. Then, class 1 starts transmission for a time interval until its credit becomes zero. During the latter transmission, class 2 gains credit of . When the credit value of class 1 is zero, it transmits a packet with maximum length for a time interval , during which class 2 gains credit equal to . The total credit gained by class 2 is , which is equal to Eq. (5). ∎
We now formally compare with the existing J- and H-bounds and show that our bounds improve on all existing bounds.
and the inequality is strict if .
For , .
1) is straightforward. For 2), observe that can be obtained by replacing with in . For 3), after some algebra we find:
By hypothesis, . Since , and , it follows that , thus the last term of Eq. (25) is strictly positive. ∎
Iv Numerical Evaluation
Consider a TSN scheduler with one CDT, three AVB and one BE classes, that is connected to a link with line rate Mbps. Assume , , and are , , and of the link rate, and for any AVB class , . Also, KB, KB, and KB; KB. The CDT is is constrained by an affine arrival curve  with parameters Kbps and Kb.
The credit upper bounds for the three AVB classes computed by J-bounds (1), H-bounds (3), and Theorem 1 are shown in Table I. As we know, the bounds coincide for class 1. In contrast, for class 2, our new credit bound is less than the J-bound by 111As aforementioned, J-bounds exist only for the case . Thus, in the computation of the J-bound, class is treated as a BE class. and than the H-bound by . For class 3 the bound by Theorem 1 is less than the H-bound by , while the J-bound does not exist for class 3.
As discussed, the credit upper bound has an impact on the latency bound of a FIFO system and subsequently of the end-to-end latency, as shown in . This can be seen by the improvement in the latency term of the service curves provided to the AVB classes, analyzed below. According to Eq. (22) of  (that is the companion paper of ), a service curve for the AVB class is:
where is a credit bound for class and is the maximum packet length of all classes except CDT. For class 2, the service curve latency in microseconds is , and if computed with , and , respectively. Thus, Theorem 1 improves the service curve latency of class 2 by compared with  and by compared with . For class 3, the service curve latency in microseconds is and if computed with and , respectively. Thus, Theorem 1 improves the service curve latency of class 3 by compared with .
-  Time-Sensitive Networking (TSN) Task Group. [Online]. Available: https://1.ieee802.org/tsn/,(Accessed:15/01/2019).
-  E. Mohammadpour, E. Stai, M. Mohiuddin, and J. L. Boudec, “Latency and Backlog Bounds in Time-Sensitive Networking with Credit Based Shapers and Asynchronous Traffic Shaping,” in the 30th International Teletraffic Congress (ITC 30), vol. 02, 2018, pp. 1–6.
-  H. Daigmorte, M. Boyer, and L. Zhao, “Modelling in Network Calculus a TSN Architecture Mixing Time-Triggered, Credit Based Shaper and Best-Effort Queues,” 2018. [Online]. Available: https://hal.archives-ouvertes.fr/hal-01814211
-  L. Zhao, P. Pop, Z. Zheng, and Q. Li, “Timing Analysis of AVB Traffic in TSN Networks using Network Calculus,” in the IEEE Real-Time and Embedded Technology and App. Symp. (RTAS ’18), 2018, pp. 25–36.
-  J.-Y. Le Boudec and P. Thiran, Network Calculus: A Theory of Deterministic Queuing Systems for the Internet. Springer-Verlag Berlin Heidelberg, 2001, vol. 2050.
-  J. A. R. De Azua and M. Boyer, “Complete Modelling of AVB in Network Calculus Framework,” in the 22nd ACM Int’l Conf. on Real-Time Networks and Systems (RTNS), NY, USA, 2014, pp. 55–64.
-  E. Mohammadpour, E. Stai, M. Mohiuddin, and J.-Y. Le Boudec, “End-to-end Latency and Backlog Bounds in Time-Sensitive Networking with Credit Based Shapers and Asynchronous Traffic Shaping,” arXiv:1804.10608 [cs.NI], 2018. [Online]. Available: https://arxiv.org/abs/1804.10608/