Abstract
Network Calculus (NC) is an algebraic theory that represents traffic and service guarantees as curves in a Cartesian plane, in order to compute performance guarantees for flows traversing a network. NC uses transformation operations, e.g., minplus convolution of two curves, to model how the traffic profile changes with the traversal of network nodes. Such operations, while mathematically welldefined, can quickly become unmanageable to compute using simple pen and paper for any nontrivial case, hence the need for algorithmic descriptions. Previous work identified the class of piecewise affine functions which are ultimately pseudoperiodic (UPP) as being closed under the main NC operations and able to be described finitely. Algorithms that embody NC operations taking as operands UPP curves have been defined and proved correct, thus enabling software implementations of these operations. However, recent advancements in NC make use of operations, namely the lower pseudoinverse, upper pseudoinverse, and composition, that are welldefined from an algebraic standpoint, but whose algorithmic aspects have not been addressed yet. In this paper, we introduce algorithms for the above operations when operands are UPP curves, thus extending the available algorithmic toolbox for NC. We discuss the algorithmic properties of these operations, providing formal proofs of correctness.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Network Calculus (NC) is an algebraic theory where traffic and service guarantees are represented as functions of time. The I/O transformations that network traversal imposes on an input traffic can be represented as operations of minplus algebra involving these curves. This allows one to compute worstcase performance guarantees for a flow traversing a network. NC dates back to the early 1990s, and it is mainly due to the work of Cruz (Cruz 1991a; 1991b), Le Boudec and Thiran (Le Boudec and Thiran 2001), and Chang (Chang 2000). Originally devised for the Internet, where it was used to engineer models of service (Le Boudec 1998b; Firoiu et al. 2002; Le Boudec 1998a; Bennett et al. 2002; Fidler and Sander 2004), it has found applications in several other contexts, from sensor networks (Schmitt and Roedig 2005) to avionic networks (Charara et al. 2006; Bauer et al. 2010), industrial networks (Zhang et al. 2019; Maile et al. 2020; Zhao et al. 2021), automotive systems (Rehm et al. 2021), and systems architecture (Andreozzi et al. 2020; Boyer et al. 2020).
NC characterizes constraints on traffic arrivals (due to traffic shaping) and on minimum received service (due to scheduling) as curves, i.e., functions of time.^{Footnote 1} These curves are then used with operators from minplus and maxplus algebra to derive further insights about the system. For example, the perflow service curve of a scheduler, such as Weighted Round Robin, or performance bounds on the traffic such as an endtoend delay bound. While these operations can be computed with pen and paper for simple examples, in most practical cases the application of NC requires the use of software. To this end, works (Bouillard and Thierry 2008; Bouillard et al. 2018) provide an “algorithmic toolbox” for NC: they show that piecewise affine functions that are ultimately pseudoperiodic (UPP) represent good models for both traffic and service guarantees. Moreover, they prove that this class of functions is closed under the main NC operations and can be described with a finite amount of information. Additionally, they introduce the algorithms that embody the main NC operations, computing UPP results starting from UPP operands. The results in these works cover the main operations used in NC, such as minimum, minplus convolution, minplus deconvolution, etc. (see (Bouillard et al. 2018) for a complete list). The toolbox was first implemented in the COINC free library (Bouillard et al. 2009), which is not available anymore, and later by the commercial library RTaWPegase (RealTimeatWork: RTaWPegase (min +) library 2022).
However, other NC operators, i.e., the composition and lower and upper pseudoinverse, have been the focus of recent NC literature. In (Bouillard et al. 2018, Theorem 8.6), lower pseudoinverse and composition are used to compute the perflow service curve for a Weighted RoundRobin scheduler; in (Tabatabaee et al. 2021, Theorem 1), a similar result is shown for an Interleaved Weighted RoundRobin scheduler, using again lower pseudoinverse and composition; in (Tabatabaee and Le Boudec 2022), authors show that several service curves can be found for a flow scheduled in a Deficit RoundRobin scheduler, under different hypotheses regarding crosstraffic. Works (Mohammadpour et al. 2019; 2022) use pseudoinverses and compositions to study properties of IEEE TimeSensitive Networking (TSN) (IEEE: Timesensitive networking (TSN) task group 2020), a standard relevant for many applications. Work (Liebeherr 2017) shows the duality between minplus and maxplus models, and how the lower and upper pseudoinverses can be used to switch between the two models. This is exploited in Pollex et al. (2011) to devise an alternative algorithm for minplus convolution, which transforms it into a maxplus convolution, obtaining a considerable speedup in the settings discussed in that paper. We can therefore obtain the results presented in these papers, using arbitrarily complex UPP curves as inputs.
While the algebraic formulation of these three operations is well known, their algorithmic aspects have not been addressed, to the best of our knowledge. This means that we do not have publicly known algorithms that compute these operations yet. In this paper, we aim to fill this gap and extend the existing algorithm toolbox to include lower and upperpseudo inverses and composition of functions.
We show that the UPP class is closed with respect to these operations, and provide algorithms to compute the result of each one. We prove that all of them have linear complexity with respect to the number of segments that represent the operands. We design specialized, more efficient versions of the composition algorithm that leverage characteristics of the operand functions – notably, their being Ultimately Affine (UA) or Ultimately Constant (UC) (Bouillard et al. 2018). Last, we exemplify our findings on a comprehensive proof of concept, showing how to compute the perflow service curve of (Tabatabaee et al. 2021, Theorem 1). The algorithms described in this paper, together with those for known NC operators, are implemented in the Nancy opensource toolbox (Zippo and Stea 2022a), which, to the best of our knowledge, is the only public one to implement UPP algorithms.
The rest of this paper is organized as follows: Section 2 briefly introduces NC notation and some basic results. Section 3 introduces the definitions and notation used throughout the paper, and discusses the kind of results that we need to provide for each operator to enable their implementation. In Section 4, we present the results for the lower and upper pseudoinverse operators, including their properties for UPP curves and algorithms to compute them. Section 5 shows our results for the composition operator, including its properties on UPP curves and an algorithm to compute it. In Section 6, we report a proofofconcept evaluation, by computing the results of a recent NC paper via our algorithms. Finally, Section 7 draws some conclusions and highlights directions for future works.
2 Network calculus basics
This section briefly introduces Network Calculus (NC). We use here the same notation as in (Le Boudec and Thiran 2001), to which the interested reader is referred for a more indepth explanation. A NC flow is represented by a function of time A(t) that counts the amount of traffic arrived by time t. Such function is necessarily nondecreasing. It is often assumed to be leftcontinuous, i.e., A(t) represents the number of bits in [0,t[. In particular, A(0) =0.
Flows can be constrained by arrival curves. A nondecreasing function α is an arrival curve for a flow A if
For instance, a leakybucket shaper, with a rate ρ and a burst size σ, enforces the affine arrival curve
as shown in Fig. 1. In particular, this means that the longterm arrival rate of the flow cannot exceed ρ. Leakybucket shapers are often employed at the entrance of a network, to ensure that the injected traffic does not exceed the negotiated amount.
Let A and D be nondecreasing functions that describe the same data flow at the input and output of a lossless network element (or node), respectively. ^{Footnote 2} If that node does not create data internally (which is often the case), causality requires that A ≥ D. We say that the node guarantees to the flow a (minimum) service curveβ if
We call the operation on the right the minplus convolution of A and β. Several network elements, such as delay elements, schedulers or links, can be modeled through service curves.
A very frequent case is the one of ratelatency service curves, defined as
for some rate R > 0 and latency 𝜃 ≥ 0. We write \(\left [\cdot \right ]^+\) to denote \(\max \limits \left \{\cdot , 0\right \}\). For instance, a constantrate server (e.g., a wired link) can be modeled as a ratelatency service curve with zero latency. Figure 2 shows the lower bound of D obtained by computing A ⊗ β, with β = β_{R,𝜃}.
A point of strength of NC is that service curves are composable: the endtoend service curve of a tandem of nodes traversed by the same flow can be computed as the minplus convolution of the service curves of each node.
For a flow that traverses a service curve (be it the one of a single node, or the endtoend service curve of a tandem computed as discussed above), an upper bound on the delay can be computed by combining its arrival curve α and the service curve β itself, as follows:
The quantity h(α,β) is in fact the maximum horizontal distance between α and β, as shown in Fig. 3. Therefore, computing the endtoend service curve of a flow in a tandem traversal is the crucial step towards obtaining its worstcase delay bound.
The above introduction, albeit concise, should convince the alert reader that algorithms for automated manipulation of curves, implementing NC operators, are necessary to reap the benefits of NC algebra in practical scenarios. Many such algorithms have been discussed in (Bouillard and Thierry 2008; Bouillard et al. 2018). The next section describes the generic algorithmic framework exposed in these papers, which we extend in this work.
3 Mathematical background and notation
In this section, we provide an overview of the mathematical background for this paper, including the definitions used and the results we aim to provide.
NC computations can be implemented in software. In order to do so, one needs to provide finite representations of functions and wellformed algorithms for NC operations. According to the widely accepted approach described in Bouillard and Thierry (2008) and Bouillard et al. (2018), a sufficiently generic class of functions useful for NC computations is the set \(\mathcal {U}\) of (i) ultimately pseudoperiodic (ii) piecewise affine \(\mathbb {Q}_{+} \rightarrow \mathbb {Q} \cup \{+\infty , \infty \}\) functions. We define both properties (i) and (ii) separately:
Definition 1 (Ultimately PseudoPeriodic Function (Bouillard and Thierry 2008, p. 8) )
Let f be a function \(\mathbb {Q}_{+}\rightarrow \mathbb {Q} \cup \{+\infty , \infty \}\). Then, f is ultimately pseudoperiodic (UPP) if there exist \(T_{f}\in \mathbb {Q}_{+},d_{f}\in \mathbb {Q}_{+}\setminus \{0\},c_{f}\in \mathbb {Q} ~\cup ~\{+\infty , \infty \}\) such that ^{Footnote 3}
We call T_{f} the (pseudoperiodic) start or length of the initial transient, d_{f} the (pseudoperiodic) length, and c_{f} the (pseudoperiodic) height.
Definition 2 (Piecewise Affine Function (Bouillard and Thierry 2008, p. 9))
We say that a function f is piecewise affine (PA) if there exists an increasing sequence \((a_{i}), {i\in \mathbb {N}_{0}}\) which tends to \(+\infty \), such that a_{0} =0 and \(\forall i \in \mathbb {N}_{0}\), it either holds that f(t) = b_{i} + ρ_{i}t for some \(b_{i}, \rho _{i} \in \mathbb {Q}\), or \(f(t) = +\infty \), or \(f(t) = \infty \) for all \(t \in \left ]a_{i}, a_{i+1}\right [\). The a_{i}’s are called breakpoints.
In Bouillard and Thierry (2008), this class of functions is shown to be stable w.r.t. all minplus operations, while functions \(\mathbb {R}_{+} \rightarrow \mathbb {R} \cup \{+\infty , \infty \}\) are not.^{Footnote 4}
We remark that functions in \(\mathcal {U}\) are not necessarily widesense increasing. While NC functions are usually assumed to be so, in order to implement minplus operations it is sometimes useful to include nonmonotonic functions as well. Similarly, functions in \(\mathcal {U}\) can assume infinite values. This is also useful for algebraic manipulations, e.g., to express a function as a minimum of two or more functions.
Throughout this paper, we will consider all functions to be in \(\mathcal {U}\), hence, piecewise affine and UPP. For such functions, it is enough to store a representation of the initial transient part and of one period, which is a finite amount of information. This is exemplified in Fig. 4.
Accordingly, we call a representationR_{f} of a function f the tuple (S,T,d,c), where T,d,c are the values described above, and S is a sequence of points and open segments describing f in [0,T + d[. We use both points and open segments in order to easily model discontinuities. We will use the umbrella term elements to encompass both when convenient.
Definition 3 (Point)
We define a point as a tuple
Definition 4 (Segment)
We define a segment as a tuple
which describes f in the open interval \( \left ]t_{i}, t_{i+1} \right [ \) in which it is affine, i.e.,
where we used the following shorthand notation for onesided limits:
If r =0, we call s_{i} a constant segment.
Definition 5 (Sequence)
We define a sequence \({S^{D}_{f}}\) as on ordered set of elements \({e_{1}, \dots , e_{n}}\) that alternate between points and segments and describe f in the finite interval \(D \subset \mathbb {Q}_{+}\).
For example, given \(D = \left [ 0, T \right [\), then \({S^{D}_{f}} = \{p_{1}, s_{1}, p_{2}, \dots , p_{n}, s_{n}\}\) where \(p_{1} = \left (0, f(0)\right )\) and, assuming \(p_{n} = \left (t_{n}, f(t_{n})\right )\) for some 0 < t_{n} < T, \(s_{n} = \left (t_{n}, T, f(t_{n}^{+}), f(T^{})\right )\).
Note that, given R_{f}, one can compute f(t) for all t ≥ 0, and also \({S^{D}_{f}}\) for any interval D. Furthermore, being finite, R_{f} can be used as a data structure to represent f in code. As discussed in depth in Zippo and Stea (2022b), R_{f} is not unique, and using a nonminimal representation of f can affect the efficiency of the computations. Work (Zippo and Stea 2022b) also describes an efficient algorithm that minimizes a representation R_{f} (i.e., computes the smallest T_{f}, d_{f} that are required to represent f ). Given a sequence S, let \(n\!\left (S\right )\) be its cardinality. As it is useful in the following, we define Cut to be an (obvious) algorithm that, given R_{f} and D, computes \({S^{D}_{f}}\). With a little abuse of notation, we use minplus operators directly on finite sequences such as \({S^{D}_{f}}\). For instance, given the lower pseudoinverse of f, \(\left (f\right )^{1}_{\downarrow }\) (its formal definition is in the next section), we will write \(\left ({S^{D}_{f}}\right )^{1}_{\downarrow }\), to express that we are computing it on f over the limited interval D.
A NC operator can then be defined computationally as an algorithm that takes UPP representations of its input functions and yields a UPP representation of the result, provided that the class of UPP functions is closed with respect to such operator. Considering a generic unitary operator [⋅]^{∗}, in order to compute f^{∗} we need an algorithm that computes \(R_{f^*}\) from R_{f}, i.e., \(R_{f} \rightarrow R_{f^*}\). We call this bycurve algorithm. This process can be divided in the following steps:

1.
compute valid parameters \(T_{f^*}, d_{f^*}\) and \(c_{f^*}\) for the result;

2.
compute \({S^{D}_{f}} \rightarrow S_{f^*}\), i.e., use an algorithm that computes the resulting sequence from the sequence of the operand. We call this bysequence algorithm for operator [⋅]^{∗}. In order to run this algorithm, a suitable domain D must be identified, based on the properties of operator [⋅]^{∗}, and, accordingly, one must compute sequence \({S^{D}_{f}} = \text {Cut}(R_{f}, D)\);

3.
return \(R_{f^*} = (S_{f^*}, T_{f^*}, d_{f^*}, c_{f^*})\).
We therefore need to provide the following results:

a proof that the result of the operator [⋅]^{∗}, applied to a UPP function, yields a UPP result;

a way to compute UPP parameters \(T_{f^*}, d_{f^*}\) and \(c_{f^*}\) from R_{f};

a valid domain D, again to be computed from R_{f};

a bysequence algorithm.
Combining the above results, we can then construct the bycurve algorithm for operator [⋅]^{∗}, which allows one to compute [⋅]^{∗} for any UPP curve.^{Footnote 5}
We exemplify the above by showing the bycurve algorithm for the left shift of a function by τ ≥ 0. Given f(t), whose representation is R_{f} = (S_{f},T_{f},d_{f},c_{f}), we want to compute the representation R_{g} = (S_{g},T_{g},d_{g},c_{g}) of g(t) = f(t + τ). Quite intuitively, it is T_{g} = [T_{f} − τ]^{+}, d_{g} = d_{f}, c_{g} = c_{f}. Moreover, the valid domain D where we need to define sequence \({S^{D}_{f}}\) for the bysequence algorithm is \(D=\left [\tau , \max \limits \{\tau ,T_{f}\} + d_{f}\right [\). We leave it to the interested reader the straightforward (yet tedious) task of deriving sequence S_{g} from \({S^{D}_{f}}\), i.e., of figuring out the bysequence algorithm for this operator.
Works (Bouillard and Thierry 2008; Bouillard et al. 2018) provided such computational descriptions for fundamental NC operators such as minimum, sum, convolution, and many others. In this paper, we extend the above toolbox by adding the lower pseudoinverse, upper pseudoinverse, and composition operators. To the best of our knowledge, no computational description of the above has been formalized before, despite their relevance in the NC literature.
Before presenting our contribution, we introduce two more definitions that will be used throughout the paper.
Definition 6 (Ultimately Affine Function)
Let f be a function \(\mathbb {Q}_{+}\rightarrow \mathbb {Q} \cup \{+\infty , \infty \}\). Then, f is Ultimately Affine (UA), if either there exist \({T_{f}^{a}} \in \mathbb {Q}_{+}, \rho _{f} \in \mathbb {Q}\) such that
or \(f(t) = +\infty \), or \(f(t) = \infty \) for all \(t \ge {T_{f}^{a}}\).
Note that this definition differs from the one in the literature (Bouillard and Thierry 2008), but we prove their equivalence in Appendix A. UA functions are (obviously) UPP as well, their period being a single segment of slope ρ_{f} and arbitrary length starting at \({T_{f}^{a}}\). They occur quite often in NC, e.g., the arrival curve of a leakybucket shaper or a ratelatency service curve are both UA. An Ultimately Constant (UC) function is UA with ρ_{f} =0. Similarly, an Ultimately Infinite (UI) function is UA with \(f(t) = +\infty \), or \(f(t) = \infty \) for all \(t \ge {T_{f}^{a}}\).
Unlike UPP, the class of UA functions is not closed with respect to NC operations. For instance, Zippo and Stea (2022b) shows that flowcontrolled networks with ratelatency (hence UA) service curves yield closedloop service curves that are UPP, but not necessarily UA again. Moreover, in many cases, the service curves of individual flows served by RoundRobin schedulers are UPP, but not UA either (see, e.g., Boyer et al. 2012; Tabatabaee et al. 2021; Tabatabaee and Le Boudec 2022). However, there are cases when simpler algorithms for NC operations can be derived if one assumes that operands are UA. For this reason, there are NC toolboxes that only consider UA functions, e.g., Bondorf and Schmitt (2014). A possible approach to NC analysis is thus to approximate UPP (nonUA) functions with UA lower/upper bounds, trading some accuracy for computation time (Guan and Yi 2013; Lampka et al. 2017). Throughout this paper, we provide general algorithms for UPP functions. However, we also show what is to be gained – in terms of domain compactness and/or algorithmic efficiency – when we can make stronger assumptions on the operands.
4 Lower and upper pseudoinverse of UPP functions
In this section, we discuss the lower and upper pseudoinverse operators for UPP functions. Henceforth, we will omit the lower or upper attribute when the discussion applies to both.
First, we provide formal definitions.
Definition 7 (Lower and Upper PseudoInverse)
Let \(f\in \mathcal {U}\) be nondecreasing. Then its lower pseudoinverse is defined as
and its upper pseudoinverse is defined as
We can find an equivalent definition as follows.
Proposition 8
Let f𝜖U be nondecreasing. For all y > f(0), its lower pseudoinverse is equal to
and for all y ≥ f(0), its upper pseudoinverse is equal to
Note that Liebeherr (2017) reports a slightly different definition, because functions are defined in \(\mathbb {R} \rightarrow \mathbb {R}\). Our functions in \(\mathcal {U}\) are defined in \(\mathbb {Q}_{+} \rightarrow \mathbb {Q}\), hence our domain is lower bounded. The consequences of this difference are discussed in Appendix B, which also contains a proof of Proposition 8.
Note that the lower pseudoinverse is leftcontinuous and the upper pseudoinverse is rightcontinuous (Liebeherr 2017, p. 64). Moreover, we have in general that (Liebeherr 2017, p. 61)
An example of these operators is shown in Fig. 5.
Figure 5 shows a UPP function and its lower and upper pseudoinverses. In NC, both pseudoinverses are useful to switch from minplus to maxplus algebra and vice versa (Liebeherr 2017). Later on, in Section 5, we provide the examples of Eq. 15 which uses the lower pseudoinverse in conjunction with the composition operator, and of Algorithm 3 which shows that the lower pseudoinverse is required to compute the composition between two UPP curves.
The rest of this section is organized as follows. In Section 4.1 we show that the pseudoinverse of a UPP function is still UPP, and provide expressions to compute its UPP parameters a priori. In Section 4.2 we discuss, first through a visual example and then via pseudocode, how to algorithmically compute the pseudoinverse. In Section 4.3 we conclude with a summary of the bycurve algorithm, some observations on the algorithmic complexity of this operator. In Section 4.4 we discuss corner cases.
4.1 Properties of pseudoinverses of UPP functions
We discuss our properties for a generic function f, excluding the cases of UC and UI functions. These two cases are treated separately for ease of presentation. At the end of this section, we report the necessary information for the alert reader to retrace the steps exposed hereafter to include these two corner cases. We remark that the Nancy software library (Zippo and Stea 2022a) computes pseudoinverses of generic (nondecreasing) UPP functions, including UC and UI ones.
Theorem 9
Let \(f \in \mathcal {U}\) be a nondecreasing function that is neither UC nor UI. Then, its lower pseudoinverse \(f^{1}_{\downarrow }(x)=\inf \left \{ t\mid f(t)\ge x\right \} \) is again a function \(\in \mathcal {U}\) with
Proof
Let t_{1} ≥ T_{f} + d_{f} and x := f(t_{1}). Moreover, we define
By definition, it is clear that t_{0} ≤ t_{1} (t_{1} satisfies the condition inside the infimum, and t_{0} is its largest lower bound). Moreover, since it holds that f(t + d_{f}) = f(t) + c_{f} for all t ≥ T_{f}, we can conclude that, for all τ ≥ T_{f} + d_{f},
Thus,
Since f is nonUC (i.e., c_{f} > 0), and we have by definition t_{1} ≥ T_{f} + d_{f}, it follows that
where we used in the strict inequality that f is not UC and thus t_{0} > T_{f}. Therefore, for any \(k \in \mathbb {N}\),
□
It follows from Theorem 9 that, in order to compute a representation \(R_{f^{1}_{\downarrow }}\), we need only to compute \(S^{D^{\prime }}_{f^{1}_{\downarrow }}\) where
If there is no leftdiscontinuity in T_{f} + 2 ⋅ d_{f}, it follows that
where
Otherwise, let \(x_{1} = f \left ((T_{f} + 2 \cdot d_{f})^{} \right )\) and \(x_{2} = f \left (T_{f} + 2 \cdot d_{f} \right )\), then x_{1} < x_{2}, and therefore \(S^{D^{\prime }}_{f^{1}_{\downarrow }}\) must end with a constant segment defined in ]x_{1},x_{2}[ with ordinate T_{f} + 2 ⋅ d_{f}. Such segment must be added manually at the end of \(\left ({S^{D}_{f}}\right )^{1}_{\downarrow }\).
A similar result can be derived for the upper pseudoinverse.
Theorem 10
Let \(f \in \mathcal {U}\) be a nondecreasing function that is neither UC nor UI. Then, the upper pseudoinverse \(f^{1}_{\uparrow }(x)=\sup \left \{ t\mid f(t)\leq x\right \} \) is again a function \(\in \mathcal {U}\) with
Proof
The proof follows the same steps as the one for the lower pseudoinverse. Let t_{0} ≥ T_{f} and x := f(t_{0}). Moreover, we define
By definition, it is clear that t_{0} ≤ t_{1} (t_{0} satisfies the condition in the supremum, and t_{1} is the largest to satisfy it). Since f is nonUC, and we have by definition t_{0} ≥ T_{f}, it follows that
where we used in the strict inequality that f is not ultimately constant and thus \(t_{1}<t_{0}+d_{f}<\infty \). Therefore, for any \(k \in \mathbb {N}\),
□
Similar to the previous theorem, it follows from Theorem 10 that, in order to compute a representation \(R_{f^{1}_{\uparrow }}\), we need only to compute \(S^{D^{\prime }}_{f^{1}_{\uparrow }}\), where
If there is no leftdiscontinuity in T_{f} + d_{f}, it follows that
where
Otherwise, let \(x_{1} = f \left ((T_{f} + d_{f})^{} \right )\) and \(x_{2} = f \left (T_{f} + d_{f} \right )\), then x_{1} < x_{2}, and therefore \(S^{D^{\prime }}_{f^{1}_{\uparrow }}\) must end with a constant segment defined in ]x_{1},x_{2}[ with ordinate T_{f} + d_{f}. Such segment must be added manually at the end of \(\left ({S^{D}_{f}}\right )^{1}_{\uparrow }\). The alert reader will notice that \(T_{f^{1}_{\downarrow }}\) and \(T_{f^{1}_{\uparrow }}\) differ, for which we can provide the following intuitive explanation. Consider a function f so that f(t) = k,∀t ∈]a,T + b[ with a < T,b > 0. Then \(f^{1}_{\downarrow }(k) = a\), as the lower pseudoinverse “goes backwards” to the start of the constant segment. However, since a < T, the pseudoperiodic property does not apply for f(a), i.e., we cannot say anything about f(a + d). So, in general, we cannot say \(f^{1}_{\downarrow }\) is pseudoperiodic from f(T), and we instead need to “skip” to the second pseudoperiod so that, as in the proof, T < a < T + d. The same does not apply for \(f^{1}_{\uparrow }\), however, since \(f^{1}_{\uparrow }(k) = T + b\) as the upper pseudoinverse “goes forward” to the end of the constant segment and T + b > T, thus we can rely on the pseudoperiodic property of f.
An interesting consequence of this discussion is that the representation R_{f} may change when we do not expect it to. From (Liebeherr 2017, p. 64), (Bouillard et al. 2018, p. 48), we know the following properties:

if f is leftcontinuous, \(\left (f^{1}_{\downarrow }\right )^{1}_{\downarrow } = \left (f^{1}_{\uparrow }\right )^{1}_{\downarrow } = f\),

if f is rightcontinuous, \(\left (f^{1}_{\uparrow }\right )^{1}_{\uparrow } = \left (f^{1}_{\downarrow }\right )^{1}_{\uparrow } = f\).
Thus, one may expect that applying the pseudoinverse twice would lead to a function with the same representation, i.e., that \(\left (\left ({R_{f}}\right )^{1}_{\downarrow }\right )^{1}_{\downarrow } = R_{f}\). However, as per the discussion above, the start of the pseudoperiod of the result would wove from an initial T_{f} to T_{f} + d_{f} + c_{f}. This is unavoidable – the above example shows that there exists one case when T_{f} would not be the correct starting point. However, in other cases, T_{f} would be the correct starting point for the pseudoperiodic behavior.
This is an instance of a general issue encountered with algorithms for UPP curves – also discussed in Zippo and Stea (2022b). Generic algorithms, that make no assumptions on the shape of the operands (such as the ones presented here for the pseudoinverse), may in general yield nonminimal representations of the result. Generally speaking, minimal representations are preferable, since the number of elements in a sequence affects the complexity of the algorithms. However, addressing the issue of representation minimization a priori when implementing NC operators is too hard (if doable at all), since one would need to make a comprehensive list of subcases, and, of course, as many formal proofs of correctness. It is instead considerably more efficient to devise a generic algorithm for an operator, neglecting minimization, and then use a simple algorithm a posteriori that minimizes the representation of the result – see Zippo and Stea (2022b).
4.2 Bysequence algorithm for pseudoinverses
In this section we discuss the bysequence algorithms for pseudoinverses. We recall that with “bysequence” we mean that the operand, and thus its result, is defined on a limited domain. Without loss of generality, we will focus on a sequence S representing a function f over an interval \(\left [0, t\right [\), with f(0) =0. Then, \(S^{1}_{\downarrow }\) is the sequence representing \(f^{1}_{\downarrow }\) over interval \(\left [0, f(t^{})\right [\). The same applies to \(S^{1}_{\uparrow }\).
The simplest case is when S is continuous and strictly increasing, hence bijective. In this case, both \(S^{1}_{\downarrow }\) and \(S^{1}_{\uparrow }\) are the classic inverse of S, and the algorithm consists of drawing, for each point and segment of S, its reflection over the line y = x. However, when S includes discontinuities and/or constant segments, the algorithm becomes slightly more complicated: a discontinuity in S “maps” to a constant segment in both \(S^{1}_{\downarrow }\) and \(S^{1}_{\uparrow }\), while a constant segment in S “maps” to a rightdiscontinuity in \(S^{1}_{\downarrow }\) and a leftdiscontinuity in \(S^{1}_{\uparrow }\). This is exemplified in Fig. 6.
We describe Algorithm 1 for the lower pseudoinverse (the one for the upper pseudoinverse differs in few details which we briefly discuss later). Algorithm 1 linearly scans S considering one element at a time. Based on the type of element (point or segment), as well as on its topological relationship with its predecessor, it decides what to add to \(S^{1}_{\downarrow }\).
More in detail, there are eight possible cases, shown in Table 1, which require zero, one, two, or three elements to be added to \(S^{1}_{\downarrow }\). These are reported in the same order in Algorithm 1. The rigorous (though cumbersome) mathematical justification for each case is instead postponed to Appendix C for the benefit of the interested reader.
We exemplify the above algorithm with reference to the example in Fig. 6. For each of the considered steps, we will reference the case in Table 1, the line of Algorithm 1, and the relevant equations from Appendix C proving the result. Processing each element from left to right, we calculate:

The origin (t_{1},f(t_{1})) = (0,0) for \( f^{1}_{\downarrow }(0) \).

For the segment s_{1} and its predecessor point p_{1} = (t_{1},f(t_{1})): this corresponds to Line 22 of the algorithm. Since s_{1} has a positive slope, we continue in Line 31. As the function is rightcontinuous at t_{1}, we are in case c8. We go to Line 36 and add a segment \( s = \left (f(t_{1}^{+}), f(t_{2}^{}), t_{1}, t_{2}\right ) \) to O. It can be verified that this follows Eq. 43.

For the point \(p_{2} = \left (t_{2}, f(t_{2})\right )\) and its preceding segment s_{1}, we are in case c4, corresponding to Line 18 and we therefore append the point \( p := \left (f(t_{2}), t_{2}\right ) \) to O. It can be verified that this follows Eq. 35.

For the constant segment s_{2} with preceding point \(p_{2} = \left (t_{2}, f(t_{2})\right )\), we are in case c6, corresponding to Line 28, and no element is added. This follows Eq. 39.

For the point \( p_{3} = \left (t_{3}, f(t_{3})\right ) \) with preceding constant segment s_{2}, we are in case c2, corresponding to Line 10, and no element is added. This follows Eq. 31.

For a segment s_{3} with preceding point \(\left (t_{3}, f(t_{3})\right )\), we are in case c8, Line 36, and append \( s := \left (f(t_{3}^{+}), f(t_{4}^{}), t_{3}, t_{4}\right ) \) to O (verified in Eq. 43).
We note that, since \(S^{1}_{\downarrow }\) is leftcontinuous, when a continuous sequence of a point, a constant segment, and a point is encountered in S, they all “map” to the inverse of the first (leftmost) point of this sequence. This justifies the fact that nothing has to be added to \(S^{1}_{\downarrow }\) in these cases (e.g., 2 and 6).
The algorithm for \(S^{1}_{\uparrow }\), that we omit here for brevity, differs from the one provided only in how constant segments are handled, that is, by appending the inverse of the last (rightmost) point instead of the first (recall that the upper pseudoinverse is rightcontinuous). This requires the algorithm for \(S^{1}_{\uparrow }\) to look ahead to the next element during the linear scan. We leave the (tedious, but simple) task of spelling out the minutiae of this algorithm to the interested reader.
4.3 Bycurve algorithm for pseudoinverses
We can now discuss the bycurve algorithm by combining the results presented in Sections 4.1 and 4.2. In Algorithm 2, we show the pseudocode to compute \(f^{1}_{\downarrow }\) for a UPP function f. The analogous for upper pseudoinverse, which we omit for brevity, can be similarly derived from the results in the sections above.
Regarding the complexity of Algorithm 2, we note that the main cost is computing \(\left ({S^{D}_{f}}\right )^{1}_{\downarrow }\). Since Algorithm 1 is a linear scan of the input sequence, the resulting complexity is \(\mathcal {O}\left (n\!\left ({S^{D}_{f}}\right )\right )\).
4.4 Corner cases: UC and UI functions
We conclude this section by discussing the two corner cases that we had initially left out, i.e., those when f is either Ultimately Constant (UC) or Ultimately Infinite (UI).
To obtain a representation of a UC or UI function, it is enough to find anyT_{f} for which f(t) = C, \(C \in {\mathbb {Q}}\), (UC) or \(f(t) = +\infty \) (UI) for any t ≥ T_{f}. ^{Footnote 6} However, as we show in this section, the infima of the infinitely many points that verify the above play an important role in computing their pseudoinverses. We provide formal definitions below:
Definition 11
Let \(f \in \mathcal {U}\) be UC, and let \(C := \lim _{t \rightarrow +\infty } f(t)\), \(C \in \mathbb {Q}\), be its (ultimately) constant value. Then, we define
to be the infimum of its pseudoperiodic starts.
Note that we use an infimum, instead of a minimum, because f may not be rightcontinuous in T_{C}. In that case f(t) = C,∀t > T_{C}, but f(T_{C})≠C.
Definition 12
Let \(f \in \mathcal {U}\) be UI. Then, we define:
and
i.e., L is the rightmost finite value of f.
Again, we use the infimum to include functions such that \(f(t) = +\infty , \forall t > T_{I}\), but \(f(T_{I}) = L < +\infty \).
As we assume in this section all functions to be nondecreasing, using Definition 11 we have that a UC function is such that
whereas using Definition 12 a UI function is such that
For these, some mathematical inconsistencies need be resolved first. For example:

if f is UC, Algorithm 2 would yield \(d_{f^{1}_{\downarrow }} = 0\),

if f is UI, it would yield \(T_{f^{1}_{\downarrow }} = +\infty \).
We treat these two cases in the following propositions.
Proposition 13
Let \(f \in \mathcal {U}\) be a nondecreasing, UC function with \(T_{C} \in \mathbb {Q}_{+}\). If f(T_{C}) < C, its lower pseudoinverse \( f^{1}_{\downarrow }(y) \) is
and its upper pseudoinverse \( f^{1}_{\uparrow }(y) \) is
Otherwise, i.e., if f(T_{C}) = C, its lower pseudoinverse \( f^{1}_{\downarrow }(y) \) is
and its upper pseudoinverse \( f^{1}_{\uparrow }(y) \) is
In other words, both pseudoinverses are UI with T_{I} = C.
Proposition 14
Let \(f \in \mathcal {U}\) be a nondecreasing, UI function with \(T_{I} \in \mathbb {Q}_{+}\). Then, its lower pseudoinverse \( f^{1}_{\downarrow }(y) \) is
and its upper pseudoinverse \( f^{1}_{\uparrow }(y) \) is
In other words, both pseudoinverses are UC with T_{C} = L.^{Footnote 7}
Starting from the above results, one can derive the few modifications to the algorithms described so far in this section to include these two corner cases. We leave this simple (yet tedious) task to the interested reader.
5 Composition of UPP functions
In this section, we discuss the composition operator for UPP functions, i.e., (f ∘ g)(t) = f(g(t)).
Some explanations are due regarding the physical meaning of the above operation. In NC, functions are usually meant to map time to bits, hence one might legitimately wonder what the physical meaning of composition is in this setting. The answer largely depends on the object of a particular study. For instance, in the already quoted literature examples that employ composition (e.g., Tabatabaee et al. 2021; Tabatabaee and Le Boudec 2022), g maps bits to bits. Specifically, f is the (strict) service curve of a link managed by a roundrobinlike scheduler, and g carves out from f the (strict) service curve for the flow under analysis. As another example, (Le Boudec and Thiran 2001, p. 128) shows that the horizontal deviation in Eq. 2 can be computed as:
In the above, α maps time to bits, whereas \(\beta ^{1}_{\downarrow }\) maps bits to time. Note that the above example also requires pseudoinverses. We will show later on that pseudoinversion is required in the algorithm for the composition operator.
This section is organized as follows. In Section 5.1 we show that the composition of UPP functions is again UPP, and provide expressions to compute its UPP parameters a priori. In Section 5.2 we discuss, first via an example and then via pseudocode, how to compute the composition algorithmically. In Section 5.3 we conclude with a summary of the bycurve algorithm and some observations on the algorithmic complexity of this operator.
5.1 Properties of composition of UPP functions
We assume that the inner function g is not UI.^{Footnote 8} We initially provide the result for generic f and g. Later on, we show that, if either or both are UA or UC, we can improve upon this result.
Theorem 15
Let f and g be two functions \(\in \mathcal {U}\) with g being nonnegative, nondecreasing and not UI. Then, their composition h := f ∘ g is again a function \(\in \mathcal {U}\) with
where \(p_{d_{f}}, p_{c_{g}}\in \mathbb {N}_{0}\), and \(q_{d_{f}},q_{c_{g}} \in \mathbb {N}\) such that \(d_{f}=\frac {p_{d_{f}}}{q_{d_{f}}}\), and \(c_{g}=\frac {p_{c_{g}}}{q_{c_{g}}}\). Note that c_{g} ≥ 0 as g is nondecreasing.
Proof
Let \(k_{h}\in \mathbb {N}\) be arbitrary but fixed. Since g is UPP, it holds for all t ≥ T_{g} that
where we used the UPP property of g in the last line. Note that \(k_{g}:= k_{h}\cdot \frac {d_{h}}{d_{g}}\in \mathbb {N},\) since \(\frac {d_{h}}{d_{g}}\overset {(17)}{=}p_{d_{f}}\cdot q_{c_{g}} \in \mathbb {N},\) where we used the fact that d_{f} > 0. Moreover, since f is UPP, too, we have under this additional assumption of g(t) ≥ T_{f} that
Note that \(k_{f}:= k_{h}\cdot \frac {d_{h}\cdot c_{g}}{d_{g}\cdot d_{f}}\in \mathbb {N}_{0}\), since \(\frac {d_{h}\cdot c_{g}}{d_{g}\cdot d_{f}}\overset {(17)}{=}\frac {p_{d_{f}}}{d_{f}}\cdot q_{c_{g}}\cdot c_{g}=q_{d_{f}}\cdot p_{c_{g}}\in \mathbb {N}_{0}\) and we used that c_{g} ≥ 0.
We set t ≥ T_{g} and g(t) ≥ T_{f}, thus ensuring that both f and g are in their periodic part. Exploiting the notion of a lower pseudoinverse and g being nondecreasing, the latter expression implies that \(t\geq g^{1}_{\downarrow }(T_{f})\) (Liebeherr 2017, p. 62). Therefore, we require
This concludes the proof. □
Remark 16
Note that the above is also true for the particular case in which \(d_{f}\in \mathbb {N},c_{g}\in \mathbb {N}_{0}\). In fact, it follows that \(p_{d_{f}}=d_{f}\) and \(q_{c_{g}}=1\) and thus
and the properties are then verified since \(\frac {d_{h}}{d_{g}}=d_{f}\in \mathbb {N}_{0}\) and \(\frac {d_{h}\cdot c_{g}}{d_{g}\cdot d_{f}}=c_{g}\in \mathbb {N}_{0}\). The corresponding c_{h} is c_{f} ⋅ c_{g}.
It follows from Theorem 15 that, in order to compute the representation R_{h}, we only need to compute \(S^{D_{h}}_{h}\), where
It follows that
where
The reason D_{f} needs to be rightclosed is that \(S^{D_{g}}_{g}\) may end with a constant segment. If this happens, \(\exists \overline {t} \in D_{g}\) such that \(g(\overline {t}) = g\left ((T_{h} + d_{h})^{}\right )\), thus we will need to compute \(f \left (g \left (\overline {t} \right ) \right ) = f \left (g\left ((T_{h} + d_{h})^{}\right ) \right )\), and that is in fact the right boundary of D_{f}. On the other hand, if \(S^{D_{g}}_{g}\) ends with a strictly increasing segment, it is safe to have D_{f} rightopen.
Hereafter, we show that the above result can be improved when either or both functions are UA. First, we consider the case when only g is UA.
Proposition 17
Let f and g be two functions \(\in \mathcal {U}\) that are not UI, with g being nonnegative, nondecreasing, UA, with ρ_{g} > 0 (hence not UC). Then, their composition h := f ∘ g is again a function \(\in \mathcal {U}\) with
Proof
Let \(k_{h}\in \mathbb {N}\) be arbitrary but fixed. Since g is assumed to be UA, it holds for all t ≥ T_{h} that
□
Again, in order to compute the representation R_{h}, we only need \(S_{h}^{D_{h}}\), where
It follows that
where
Here, we observe that domain D_{f} is smaller than the one obtained by applying directly Theorem 15, due to the disappearance of a factor \(q_{d_{f}} \cdot p_{c_{g}} \geq 1\). In fact, with Theorem 15 we would have:
As specified in the statement of Proposition 17, we exclude the case when g is UC. This is because of Eq. 20 where ρ_{g} is in the denominator, hence cannot be zero. However, if g is UC, a stronger proposition can be found as reported in Appendix D.
Next, we consider the case when only f is UA.
Proposition 18
Let \(f \in \mathcal {U}\) be UA and \(g \in \mathcal {U}\) be nonnegative, nondecreasing and not UI. Then, their composition h := f ∘ g is again \(\in \mathcal {U}\) with
Proof
Let \(k_{h}\in \mathbb {N}\) be arbitrary but fixed. Since f is assumed to be UA, it holds for all t ≥ T_{h} that
□
Again, for representation R_{h}, we only compute \(S_{h}^{D_{h}}\), where
It follows that
where
Again, domain D_{g} is smaller than the one that Theorem 15 would yield, due to the disappearance of a factor \(p_{d_{f}} \cdot q_{c_{g}} \geq 1\). For comparison, Theorem 15 yields
When both functions are UA, we obtain a stronger result by showing that the composition is UA again.
Proposition 19
Let \(f \in \mathcal {U}\) and \(g\in \mathcal {U}\) be UA functions with g being nonnegative, nondecreasing and not UI. Then, their composition h := f ∘ g is again UA with
Proof
If f is UI, the result is trivial. Let us assume that f is not UI. Define \({T_{h}^{a}}:=\max \limits \left \{ g^{1}_{\downarrow }({T_{f}^{a}}),{T_{g}^{a}}\right \} \). Then we have that, for any \(t \ge {T_{h}^{a}}\),
□
Considering Eq. 19, we observe how taking these results into account will yield tighter D_{f},D_{g} than what we obtain with Theorem 15.
Finally, we mention that, if either or both f and g are UC, then the composition can be simplified further, even with respect to the above properties. We report the results in Appendix D.
5.2 Bysequence algorithm for composition
In this section, we discuss the bysequence algorithm for the composition. Without loss of generality, we focus on sequences S_{g}, representing a nonnegative and nondecreasing function g over an interval \(\left [0, t\right [\), and S_{f}, representing a function f defined over the interval \(\left [g(0), g(t^{})\right ]\).^{Footnote 9} Then, S_{h} = S_{f} ∘ S_{g} is the sequence representing h = f ∘ g over the interval \(\left [0, t\right [\). We use the example shown in Fig. 7, where t =6 and g(t^{−}) =4.
First, we consider the shape of f ∘ g on an interval \(\left ]a,b\right [ \subset \left [0, t\right [\), \(a,b\in \mathbb {Q}_{+}\). Consider the case in which, for this interval, there exist \(\rho _{g},\rho _{f}\in \mathbb {Q}_{+}\) so that
where we use the shorthand notation
with \(y_{0}:=\lim _{x\to a^{+}}g(x)\).
More broadly speaking, we have segment of g mapping to a segment of f. In the example of Fig. 7, ]4,6[ is such an interval. Then, in this interval we can apply the chain rule and find that \(h^{\prime }(x)=f^{\prime }(g(x))\cdot g^{\prime }(x)=\rho _{g}\cdot \rho _{f}\) for all \(x\in \left ]a,b\right [\). Thus, h is also a segment on \(\left ]a,b\right [\).
If either of the equations in Eq. 27 does not apply, it means that one function has one or more breakpoints over this interval. Assume initially that this is g. Let this finite sets of breakpoints be \(t_{0},\dots ,t_{n}\), with a < t_{0} < ⋯ < t_{n} < b. Then, the intervals \(\left ]a,t_{0}\right [,\dots ,\left ]t_{n},b\right [\) verify the properties in Eq. 27 while for any breakpoint t_{i} we can just compute f(g(t_{i})). A similar reasoning can be done for f: consider the finite set of breakpoints \(y_{0},\dots ,y_{m}\), with g(a^{+}) < y_{0} < ⋯ < y_{m} < g(b^{−}). Then, we can use the lower pseudoinverse of g to find the corresponding \(\overline {t}_{i}=g^{1}_{\downarrow }(y_{i})\).^{Footnote 10} The set \(\left \{ t_{1},\dots ,t_{n}\right \} \cup \left \{ \overline {t}_{1},\dots ,\overline {t}_{m}\right \}\), preserving the ascending order, defines a finite set of breakpoints for f ∘ g. Then, we have again a finite set of points \(\left (t_{i}, f(g(t_{i}))\right )\), and open intervals for which we compute h as a segment with ρ_{h} = ρ_{f} ⋅ ρ_{g}. In the example of Fig. 7, ]0,4[ is such an interval:

for S_{g} we find the set {t_{1} =1};

for S_{f} we find the set \(\{y_{1} = 1\} \rightarrow \left \{ \overline {t}_{1} = \frac {1}{2} \right \}\);

the combined set of breakpoints is then \(\left \{ \frac {1}{2}, 1 \right \}\), and the open intervals that verify Eq. 27 is \(\left \{ \left ]0, \frac {1}{2}\right [, \left ]\frac {1}{2}, 1\right [, ]1, 4[ \right \}\).
By generalizing this reasoning, we obtain Algorithm 3.
5.3 Bycurve algorithm for composition
We can now discuss the bycurve algorithm, by combining the results presented in Sections 5.1 and 5.2. In Algorithm 4 we show the pseudocode to compute the composition h = f ∘ g of UPP functions f and g, in the most general case. The analogous for the more specialized cases, i.e., ultimately affine or ultimately constant operands, which here we omit for brevity, can be similarly derived by adjusting the parameter and domain computations.
Regarding the complexity of Algorithm 4, we note that the main cost is computing \(S_{h} \gets S^{D_{f}}_{f} \circ S^{D_{g}}_{g}\). Since Algorithm 3 is a linear scan of \(S^{D_{f}}_{f}\) and \(S^{D_{g}}_{g}\), the resulting complexity is \(\mathcal {O}\left (n\!\left (S^{D_{f}}_{f}\right ) + n\!\left (S^{D_{g}}_{g}\right )\right )\). Note that given the expressions in Theorem 15, this computational cost highly depends on the numerical properties of the operands, i.e., numerators and denominators of UPP parameters, rather than simply the cardinalities of R_{f} and R_{g}. Thus, using the specialized properties of Propositions 17 to 19 yields performance improvements, since D_{f} and D_{g} are smaller.
We remark again that the result of the composition may have a nonminimal representation (see the discussion at the end of Section 4.1).
6 Proof of concept
In this section, we show how the algorithms presented in this paper allow one to replicate the result appeared in a recent NC paper (Tabatabaee et al. 2021).
The algorithms described in this paper, including variants and corner cases omitted for brevity, are implemented in the publicly available Nancy NC library (Zippo and Stea 2022a). Nancy is a C# library implementing the UPP model and its operators, as described in Bouillard and Thierry (2008) and Bouillard et al. (2018). Moreover, it implements stateoftheart algorithms that improve the efficiency of NC operators, described in Zippo and Stea (2022b), and lower pseudoinverse, upper pseudoinverse and composition operators, described in this paper. Nancy makes extensive use of parallelism. However, the NC operators described in this paper are implemented as sequential.
As a notable example, we implemented the results from (Tabatabaee et al. 2021, Theorem 1), which uses the composition operator, using the same parameters of the example in (Tabatabaee et al. 2021, Fig. 3). The above theorem allows us to compute the service curve for a flow served by an Interleaved Weighted RoundRobin scheduler, once a) the weight of the flow; b) the minimum and maximum packet length for each flow, and c) the (strict) service curve for the entire aggregate of flows β(t) are known. The complete formulation of the theorem – which is rather cumbersome – is postponed to Appendix E. For the purpose of this proof of concept, the important bit is that computing the service curve of the flow involves computing a function γ_{i} that takes into account flow i’s characteristics (e.g., weight, packet lengths), and then, given β as the (strict) service curve of the server regulated by IWRR, computing the (strict) perflow service curve for flow i as β_{i} = γ_{i} ∘ β.^{Footnote 11} In the example in (Tabatabaee et al. 2021, Fig. 3), β is a constantrate service curve, thus UA, while γ_{i} is, in general, a UPP function. On the one hand, this confirms that limiting NC algorithms to UA curves only is severely constraining – in this example, one could not compute flow i’s service curve without an algorithm that handles UPP curves. On the other hand, it means that we can obtain the same result by applying both Theorem 15 and its specialized version for UA inner functions Proposition 17, and that we can expect the latter to be more efficient due to the tighter D_{f}, as explained below Eq. 22.
Our experiments confirm the above intuition. We run the computation on a laptop computer (i710750H, 32 GB RAM). As shown in Table 2, when using Theorem 15, computing the result took a median of 1.11 seconds. On the other hand, using Proposition 17 the same result is obtained in 0.55 milliseconds in the median, an improvement of three orders of magnitude. Listing 1 and Fig. 8 report, respectively, the code used and the resulting plot.
It is worth noting that (Tabatabaee and Le Boudec 2022, Theorem 1) describes a similar result for the Deficit RoundRobin scheduler, under similar hypotheses, still making use of composition, with the outer curve being nonUA. The derivations in this section apply to this case as well, with minimal obvious modifications. Several other results in (Tabatabaee and Le Boudec 2022) make use of composition as well.
7 Conclusions
Automated computation of Network Calculus operations is necessary to carry out analyses of nontrivial network scenarios. Therefore, algorithms that transform representations of operand functions into result functions are required for each “useful” NC operator. Recently, pseudoinverses and composition operators have been repeatedly used in NC papers. To the best of our knowledge, these operators lacked an algorithmic description that would allow their implementation in software.
This paper fills the above gap, by providing algorithms for lower and upper pseudoinverses and composition of operators. We have presented algorithms that work under general assumptions (i.e., UPP operands), as well as specialized ones that leverage the fact that operands are UA (or UC) to compute results faster. We have discussed the complexity of these algorithms, as well as corner cases, with a rigorous mathematical exposition. Beside the theoretical contribution, we provided a practical one by including the above algorithms (together with the others known from the literature) in an opensource free library called Nancy. This allows researchers to experiment with our results to study complex scenarios, or support the generation of novel theoretical insight.
Future work on this topic will include studying the computational and numerical properties of NC operators. As the example in Section 6 shows (not to mention those in (Zippo and Stea 2022b), by the same authors), exploiting more knowledge on the operands allows one to compute the same results via specialized versions of the algorithms, often in considerably shorter times (some by orders of magnitude). We believe that this is an avenue of research worth pursuing, with the aim of enabling largerscale realworld performance studies.
Notes
We use the terms function and curve interchangeably.
The function argument t is omitted whenever it is clear from the context.
We denote the set of nonnegative numbers \(\{0, 1, 2, 3, \dots \}\) by \(\mathbb {N}_{0}\) and the set of strictly positive numbers \(\{1, 2, 3, \dots \}\) by \(\mathbb {N}\).
An alternative class of functions with such stability is \(\mathbb {N} \rightarrow \mathbb {R}\), however this is only feasible for models where time is discrete.
The same process applies also, with minor adjustments, to binary operators.
The definition of UI includes also \(f(t) = \infty \) for all t ≥ T_{f}. However, since the pseudoinverse operations only apply to nondecreasing functions, we do not consider such case here.
The only exception being the (uninteresting) case of f such that f(0) > 0 and T_{I} =0, for which \(f^{1}_{\downarrow }(y) = f^{1}_{\uparrow }(y) = 0 ~ \forall y \ge 0\).
If, for t > T_{I}, \(g(t) = +\infty \) then \(f(g(t)) = \lim _{y \rightarrow +\infty } f(y)\). The fact that f is UPP does not guarantee that such limit exists, e.g., when f is periodic.
We consider D_{f} to be always rightclosed since it yields the correct result for both cases discussed in the previous section. The right boundary of D_{f} is never used as a breakpoint in the algorithm anyway, as imposed by the condition y_{m} < g(b^{−}) discussed below.
Following the discussion in Section 4, \(\left (S_{g}\right )^{1}_{\downarrow }\) is sufficient for this computation.
Recall that composition requires the lower pseudoinverse of the inner function to be computed, hence this example makes use of both the algorithms presented in this paper.
We note however that Lemma 3.2 in Bouillard et al. (2018, pp. 46) is incomplete, since it does not account for the case y ≤ f(0) – see our counterexample above.
References
Andreozzi M, Conboy F, Stea G, Zippo R (2020) Heterogeneous systems modelling with adaptive traffic profiles and its application to worstcase analysis of a DRAM controller. In: 2020 IEEE 44th annual computers, software, and applications conference (COMPSAC). IEEE, pp 79–86
Bauer H, Scharbarg JL, Fraboul C (2010) Worstcase endtoend delay analysis of an avionics AFDX network. In: 2010 design, automation & test in Europe conference & exhibition (DATE 2010). IEEE, pp 1220–1224
Bennett JC, Benson K, Charny A, Courtney WF, Le Boudec JY (2002) Delay jitter bounds and packet scale rate guarantee for expedited forwarding. IEEE/ACM Trans Network 10(4):529–540
Bondorf S, Schmitt JB (2014) The DiscoDNC v2 – A comprehensive tool for deterministic network calculus. In: Proc. of the international conference on performance evaluation methodologies and tools. ValueTools ’14, pp 44–49. https://dl.acm.org/citation.cfm?id=2747659
Bouillard A, Boyer M, Le Corronc E (2018) Deterministic network calculus: from theory to practical implementation. Wiley, Hoboken
Bouillard A, Cottenceau B, Gaujal B, Hardouin L, Lagrange S, Lhommeau M, Thierry E (2009) COINC library: a toolbox for the network calculus. In: Proceedings of the 4th international conference on performance evaluation methodologies and tools, ValueTools (Vol. 9, p. 01).
Bouillard A, Thierry É (2008) An algorithmic toolbox for network calculus. Discrete Event Dynamic Systems 18(1):3–49
Boyer M, Graillat A, de Dinechin BD, Migge J (2020) Bounding the delays of the MPPA networkonchip with network calculus:models and benchmarks. Perform Evaluation 143:102–124. https://doi.org/10.1016/j.peva.2020.102124
Boyer M, Stea G, Sofack WM (2012) Deficit Round Robin with network calculus. In: 6Th international ICST conference on performance evaluation methodologies and tools, cargese, corsica, france, october 912, 2012, pp 138–147. https://doi.org/10.4108/valuetools.2012.250202
Chang CS (2000) Performance guarantees in communication networks. Springer, New York
Charara H, Scharbarg JL, Ermont J, Fraboul C (2006) Methods for bounding endtoend delays on an AFDX network. In: 18th Euromicro conference on realtime systems (ECRTS’06). IEEE, p 10
Cruz RL (1991) A calculus for network delay, part I: network elements in isolation. IEEE Trans Inform Theory 37(1):114–131
Cruz RL (1991) A calculus for network delay, part II: network analysis. IEEE Trans Inform Theory 37(1):132–141
Fidler M, Sander V (2004) A parameter based admission control for differentiated services networks. Comput Netw 44(4):463–479
Firoiu V, Le Boudec JY, Towsley D, Zhang ZL (2002) Theories and models for internet quality of service. Proc IEEE 90(9):1565–1591
Guan N, Yi W (2013) Finitary realtime calculus: efficient performance analysis of distributed embedded systems. In: 2013 IEEE 34Th realtime systems symposium, pp 330–339
IEEE: Timesensitive networking (TSN) task group (2020) [Online]. https://1.ieee802.org/tsn/. Accessed: 20220516
Lampka K, Bondorf S, Schmitt JB, Guan N, Yi W (2017) Generalized finitary RealTime calculus. In: Proc. of the 36th IEEE international conference on computer communications (INFOCOM 2017)
Le Boudec JY (1998) Application of network calculus to guaranteed service networks. IEEE Trans Inf Theory 44(3):1087–1096. https://doi.org/10.1109/18.669170
Le Boudec JY (1998) Application of network calculus to guaranteed service networks. IEEE Trans Inform Theory 44(3):1087–1096
Le Boudec JY, Thiran P (2001) Network calculus: a theory of deterministic queuing systems for the internet. Springer, Berlin
Liebeherr J (2017) Duality of the maxplus and minplus network calculus. Foundations and Trends in Networking 11(34):139–282. https://doi.org/10.1561/1300000059
Maile L, Hielscher KS, German R (2020) Network Calculus results for TSN: an introduction. In: 2020 information communication technologies conference (ICTC). IEEE, pp 131–140
Mohammadpour E, Stai E, Boudec JYL (2019) Improved delay bound for a service curve element with known transmission rate. IEEE Netw Lett 1 (4):156–159
Mohammadpour E, Stai E, Boudec JYL (2022) Improved network calculus delay bounds in timesensitive networks. IEEE/ACM Transactions on Networking, https://doi.org/10.1109/TNET.2023.3275910
Pollex V, Lipskoch H, Slomka F, Kollmann S (2011) Runtime improved computation of path latencies with the realtime calculus. In: Proceedings of the 1st international workshop on worstcase traversal time, pp 58–65
RealTimeatWork: RTaWPegase (min +) library (2022) https://www.realtimeatwork.com/rtawpegaselibraries/. Accessed: 20220405
Rehm F, Seitter J, Larsson JP, Saidi S, Stea G, Zippo R, Ziegenbein D, Andreozzi M, Hamann A (2021) The road towards predictable automotive highperformance platforms. In: 2021 design, automation & test in europe conference & exhibition (DATE). IEEE, pp 1915–1924
Schmitt JB, Roedig U (2005) Sensor network calculus–a framework for worst case analysis. In: International conference on distributed computing in sensor systems. Springer, pp 141–154
Tabatabaee SM, Le Boudec JY (2022) Deficit roundrobin: A second network calculus analysis. IEEE/ACM Transactions on Networking
Tabatabaee SM, Le Boudec JY, Boyer M (2021) Interleaved weighted RoundRobin: a network calculus analysis. IEICE Trans Commun 104 (12):1479–1493
Zhang J, Chen L, Wang T, Wang X (2019) Analysis of TSN for industrial automation based on network calculus. In: 2019 24th IEEE international conference on emerging technologies and factory automation (ETFA). IEEE, pp 240–247
Zhao L, Pop P, Zheng Z, Daigmorte H, Boyer M (2021) Latency analysis of multiple classes of AVB traffic in TSN with standard credit behavior using Network Calculus. IEEE Trans Ind Electron 68(10):10291–10302. https://doi.org/10.1109/TIE.2020.3021638
Zippo R, Stea G (2022a) Nancy: an efficient parallel Network Calculus library. SoftwareX, https://doi.org/10.1016/j.softx.2022.101178
Zippo R, Stea G (2022b) Computationally efficient worstcase analysis of flowcontrolled networks with Network Calculus. IEEE Transactions on Information Theory, https://doi.org/10.1109/TIT.2023.3244276
Acknowledgements
This work was partially supported by the Italian Ministry of Education and Research (MIUR) in the framework of the FoReLab project (Departments of Excellence), and by the University of Pisa, through grant “Analisi di reti complesse: dalla teoria alle applicazioni”  PRA 2020.
Funding
Open access funding provided by Università degli Studi di Firenze within the CRUICARE Agreement.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of Interests
The authors declare that they have no conflict of interest.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix A: Properties of Ultimately Affine (UA) Functions
Proposition 20
A function \(f \in \mathcal {U}\) is Ultimately Affine (UA) (defined in Eq. 4) iff there exist \(T\in \mathbb {Q}_{+},\sigma ,\rho \in \mathbb {Q}\) such that either
or if \(f(t) = \infty \) or \(f(t) = +\infty \) for all t ≥ T.
Proof
The proof is trivial for f being \(\infty \) or \(+\infty \) for all t ≥ T. Therefore, we limit ourselves to the cases of f being finite.
“⇒” Let f be UA. Define \(T := {T_{f}^{a}}\), \(\sigma := f\left ({T_{f}^{a}}\right ) \rho _{f} \cdot {T_{f}^{a}}\) and ρ := ρ_{f}. Then, it holds for all t ≥ T that
“⇐” Assume f to verify the condition in Eq. 28. Therefore, assume that f(t) = ρt + σ for all t ≥ T. Define \({T_{f}^{a}} := T\), ρ_{f} := ρ. Then for all \(t \geq {T_{f}^{a}}\)
This concludes the proof. □
Appendix B: Differences in pseudoinverses definitions
In Liebeherr (2017, p. 60), which considers functions from \(\mathbb {R} \to \mathbb {R}\), lower and upper pseudoinverses are introduced as
However, when one considers a domain bounded from below by 0, such as in our case, the rightmost equalities do not hold for y ≤ f(0). As a counterexample, consider y = f(0). Then,
Proposition 8 states a weaker form of equivalence for functions in \( \mathcal {U} \). We provide here a proof.
Proof
The proof follows mostly along the lines of Lemma 3.2 in Bouillard et al. (2018, pp. 46). ^{Footnote 12}

1.
Lower pseudoinverse: first, note that \(\left \{ t \ge 0 \mid f(t) < y \right \}\) and \(\left \{ t \ge 0 \mid f(t) \geq y \right \}\) form a partition of \(\mathbb {Q}_+\). Moreover, as f is nondecreasing and y > f(0), \(\left \{ t \geq 0 \mid f(t) \geq y \right \}\) is a nonempty interval of the form \([{b, +\infty }[\) or \(]{b, +\infty }[\) for some b > 0. As a consequence, \(\left \{ t \ge 0 \mid f(t) < y \right \}\) is a nonempty interval of the form \(\left [{0, b}\right ]\) or [0,b]. Thus, we have \(b = \inf \left \{ t \geq 0 \mid f(t) \geq y \right \} = \sup \left \{ t \geq 0 \mid f(t) < y \right \} \).

2.
Upper pseudoinverse: for y > f(0), the proof is the almost same as in 1., we just replace \(\left \{ t \geq 0 \mid f(t) < y \right \}\) by \(\left \{ t \geq 0 \mid f(t) \leq y \right \}\) and \(\left \{ t \ge 0 \mid f(t) \geq y \right \}\) by \(\left \{ t \ge 0 \mid f(t) > y \right \}\). Then, \(b = \sup \left \{ t \geq 0 \mid f(t) \leq y \right \} = \inf \left \{ t \geq 0 \mid f(t) > y \right \} \).
Next, consider the case y = f(0). Let us define \(t_1 := \sup \left \{t \geq 0 \mid f(t) = f(0)\right \} \in \mathbb {Q}_+ \cup \{+\infty \}\). It holds that
$$ \begin{array}{@{}rcl@{}} \sup\left\{ t \geq 0 \mid f(t) \leq y \right\} &=& \sup\left\{ t \geq 0 \mid f(t) \leq f(0) \right\} \\ &=& t_1 \end{array} $$as well as
$$ \begin{array}{@{}rcl@{}} \inf\left\{ t \geq 0 \mid f(t) > y \right\} &=& \inf\left\{ t \geq 0 \mid f(t)> f(0) \right\} \\ &=& \inf\left\{ t \geq t_1 \mid f(t)> f(0) \right\} \\ &=& t_1, \end{array} $$where we used in the second line that t_{1} is a lower bound for the set \( \left \{ t \geq 0 \mid f(t) > f(0)\right \} \).
□
Appendix C: Calculation of lower and upper pseudoinverses
We report here the rigorous mathematical derivations for cases c1c8 in Table 1.
1.1 C.1: Point after segment (cases c1c4)
In these cases we have, in general, an f such that
Since f is nondecreasing, \(b_{1} + \rho \left (x  t_{1}\right )\leq b_{2}\leq b_{3}\) for all \(x\in \left ]t_{1},t_{2}\right [\).
We then distinguish four cases based on two properties:

Whether or not the segment is constant, i.e., \(\rho = 0 \rightarrow b_{1} = b_{2}\);

Whether or not there is a discontinuity at t_{2}, i.e., b_{2} < b_{3}.
Case c1: ρ =0 and b _{1} = b _{2} < b _{3} (constant segment followed by a discontinuity).
It holds that
and
Case c2: ρ =0 and b _{1} = b _{2} = b _{3} (constant segment without any discontinuity).
It holds that
However, we do not add a value as it is processed in the “segment after point” section. Moreover,
Case c3: ρ > 0 and b _{2} < b _{3} (nonconstant segment followed by a discontinuity).
and
Case c4: ρ > 0 and b _{2} = b _{3} (nonconstant segment without any discontinuity).
and
1.2 C.2: Segment after point (cases 58)
In these cases we have, in general, an f such that
We then distinguish four cases based on two properties:

Whether or not the segment is constant, i.e., \(\rho = 0 \rightarrow b_{2} = b_{3}\);

Whether or not there is a discontinuity at t_{1}, i.e., b_{1}≠b_{2}.
Case c5: b _{1} < b _{2} = b _{3} and ρ =0 (discontinuity followed by a constant segment).
It holds that
and
Case c6: b _{1} = b _{2} = b _{3} and ρ =0 (no discontinuity and a constant segment).
Then it holds that
However, we do not add a value as it is processed in the “point after segment” section. Moreover,
Case c7: b _{1} < b _{2} and ρ > 0 (discontinuity followed by a nonconstant segment).
We have
and
Case c8: b _{1} = b _{2} and ρ > 0 (no discontinuity and nonconstant segment).
We have
and
Appendix D: Composition of Ultimately Constant (UC) functions
Proposition 21
Let f and g be two functions \(\in \mathcal {U}\) that are not UI, with g being nonnegative, nondecreasing and UC. Then, their composition h := f ∘ g is again UC with
Proof
For t ≥ T_{g}, it holds that
□
Proposition 22
Let f be UC and g be a function \(\in \mathcal {U}\) that is nonnegative and nondecreasing. Then, their composition h := f ∘ g is again UC with
Proof
For \( t \geq g^{1}_{\downarrow }(T_{f}) \), it holds that
□
Proposition 23
Let f and g be UC functions, with g being nonnegative and nondecreasing. Then, their composition h := f ∘ g is again UC with
Proof
The proof is simply a combination of the previous two propositions. □
Appendix E: Service curve of a flow in interleaved weighted round robin
We report here the statement of Theorem 1 in Tabatabaee et al. (2021), for ease of reference. We slightly rephrased it to aid comprehension.
Theorem 24 (Strict PerFlow Service Curves for IWRR)
Assume n flows arriving at a server performing interleaved weighted round robin (IWRR) with weights \(w_{1},\dots ,w_{n}\). Let \( l_{i}^{\min \limits } \) and \( l_{j}^{\max \limits } \) denote the minimum and maximum packet size of the respective flow. Let this server offer a superadditive strict service curve β to these n flows. Then,
is a strict service curve for flow f_{i}, where
β_{1,0} is a constantrate function with slope 1, and the stair function ν_{h,P}(t) is defined as
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Zippo, R., Nikolaus, P. & Stea, G. Extending the network calculus algorithmic toolbox for ultimately pseudoperiodic functions: pseudoinverse and composition. Discrete Event Dyn Syst 33, 181–219 (2023). https://doi.org/10.1007/s10626022003735
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10626022003735