Embedding network calculus and event stream theory
in a common model
21st IEEE Int. Conf. on Emerging Technologies and Factory
Automation [ETFA 2016]
Track 3 : Real-Time and (Networked) Embedded Systems
[RTNES]
Marc Boyer
Pierre Roux
Wednesday, September 7th, 2016
1/1
M. Boyer, P. Roux NC/CPA common model
Outline
2/1
M. Boyer, P. Roux NC/CPA common model
Outline
3/1
M. Boyer, P. Roux NC/CPA common model
Global context
Kind of systems
real-time system
Kind of property
worst case response time
4/1
M. Boyer, P. Roux NC/CPA common model
Global context
Kind of systems
Distributed real-time system
C1
Kind of property
worst case response time
4/1
C2
C3
C4
C5
M. Boyer, P. Roux NC/CPA common model
Global context
Kind of systems: flow/component
Distributed real-time system
Components (computation node,
bus, switch, etc.)
Event flows between components
Event reception triggers a local
workload (computation,
data forwarding...)
C1
A
C2
C
Kind of property
worst case response time
4/1
C4
M. Boyer, P. Roux NC/CPA common model
X
B
C3
E
C5
Y
Global context
Kind of systems: flow/component
Distributed real-time system
Components (computation node,
bus, switch, etc.)
Event flows between components
Event reception triggers a local
workload (computation,
data forwarding...)
C1
A
C2
C
Kind of property
Bounds on worst case response time
4/1
C4
M. Boyer, P. Roux NC/CPA common model
X
B
C3
E
C5
Y
Global context
Kind of systems: flow/component
Distributed real-time system
Components (computation node,
bus, switch, etc.)
Event flows between components
Event reception triggers a local
workload (computation,
data forwarding...)
C1
A
C2
C
Kind of property
Bounds on worst case response time
C4
local latency
end-to-end latency
4/1
M. Boyer, P. Roux NC/CPA common model
X
B
C3
E
C5
Y
Two flow/component models
Event Stream/CPA
E
Flow model
Contract
∀t, d > 0
C
E
Network Calculus
0
A
C
E (t): number of events
up to time t
η+, η−:
event arrival
functions
A(t): amount of data up
to time t
α: arrival curve
E (t + d) − E (t) 6 η + (d)
A(t + d) − A(t) 6 α(d)
−
E (t + d) − E (t) > η (d)
Flow transformation
Busy window
Residual service
Two very close models
No best method (depends on the system)
5/1
A0
M. Boyer, P. Roux NC/CPA common model
Toward unifying model
Goals
more accurate results
better understanding
of each theory
modelling of new kind of
components: CAN/AFDX
gateway, per block memory
allocation...
6/1
M. Boyer, P. Roux NC/CPA common model
Toward unifying model
Goals
more accurate results
better understanding
of each theory
modelling of new kind of
components: CAN/AFDX
gateway, per block memory
allocation...
6/1
Success criteria
accurate
easy to use
modelling
proofs
M. Boyer, P. Roux NC/CPA common model
Toward unifying model
Goals
more accurate results
better understanding
of each theory
modelling of new kind of
components: CAN/AFDX
gateway, per block memory
allocation...
Success criteria
accurate
easy to use
modelling
proofs
Guidelines
a compositional model
an algebraic model
6/1
M. Boyer, P. Roux NC/CPA common model
Outline
7/1
M. Boyer, P. Roux NC/CPA common model
The global picture
8/1
M. Boyer, P. Roux NC/CPA common model
Definition of the new model
Arrival curve
A : R+ → R+
A(t):
amount of
data up to t
Packet count
P : R+ → N
P(d): number of full
packets in the d first
“bits”
NC
CPA
z}|{
z}|{
Event count
E : R+ → N
E (t): number of full
packets up to t
P( A ) = E
| {z }
1
1
Packet-Curves-ValueTools-2012.
Packet-Curves-ValueTools-2012.
1
Packet-Curves-ValueTools-2012.
1
Packet-Curves-ValueTools-2012.
1
9/1
M. Boyer, P. Roux NC/CPA common model
Illustration
A(t)
E (t)
P(d)
4
4
4
3
3
3
2
2
2
1
1
1
1
2
3
4
t
1
2
3
4
t
Scenario:
First packet: size 1, throughput 1
Second packet: size 1, throughput 1/2
Third packet: size 2, throughput 2
Fourth packet: size 1, throughput 1
10/1
M. Boyer, P. Roux NC/CPA common model
1
2
3
4
d
Illustration
A(t)
E (t)
P(d)
4
4
4
3
3
3
2
2
2
1
1
1
1
2
3
4
t
1
2
3
4
t
Scenario:
First packet: size 1, throughput 1
Second packet: size 1, throughput 1/2
Third packet: size 2, throughput 2
Fourth packet: size 1, throughput 1
10/1
M. Boyer, P. Roux NC/CPA common model
1
2
3
4
d
Illustration
A(t)
E (t)
P(d)
4
4
4
3
3
3
2
2
2
1
1
1
1
2
3
4
t
1
2
3
4
t
Scenario:
First packet: size 1, throughput 1
Second packet: size 1, throughput 1/2
Third packet: size 2, throughput 2
Fourth packet: size 1, throughput 1
10/1
M. Boyer, P. Roux NC/CPA common model
1
2
3
4
d
Illustration
A(t)
E (t)
P(d)
4
4
4
3
3
3
2
2
2
1
1
1
1
2
3
4
t
1
2
3
4
t
Scenario:
First packet: size 1, throughput 1
Second packet: size 1, throughput 1/2
Third packet: size 2, throughput 2
Fourth packet: size 1, throughput 1
10/1
M. Boyer, P. Roux NC/CPA common model
1
2
3
4
d
Interval Bounding Pair (IBP)
Real behaviours are unknown at design
Performance studies based on contract
Interval Bounding Pair: renaming of arrival curves/event
stream
φ = (φ, φ) is an Interval Bouding Pair (IBP) of f iff
∀t, d > 0 : φ(d) 6 f (t + d) − f (t) 6 φ(d)
Handle the contract tuple hα, π, ηi where α, π, η are
respective IBPs of A, P, E
11/1
M. Boyer, P. Roux NC/CPA common model
Outline
12/1
M. Boyer, P. Roux NC/CPA common model
Taking in hand the model
Defining a new model is easy
Model evaluation is hard
Taking in hand the model:
basic properties of the model itself
modelling basic component
1
2
packetizer
aggregation
model accuracy (new)
13/1
M. Boyer, P. Roux NC/CPA common model
Mathematical operators
Min/max-plus convolution: associative, commutative, monotonous
(f ∗ g)(t) = inf f (t − s) + g(s)
06s6t
(f ∗ g)(t) = sup f (t − s) + g(s)
06s6t
Composition:associative, monotonous
(f ◦ g)(t) = f (g(t))
Pseudo-inverses
f −1 (y )
f (x )
x
14/1
f −1 (y )
y
M. Boyer, P. Roux NC/CPA common model
y
Intrinsic properties
IBP properties (from NC and CPA)
15/1
M. Boyer, P. Roux NC/CPA common model
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
15/1
M. Boyer, P. Roux NC/CPA common model
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
15/1
M. Boyer, P. Roux NC/CPA common model
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
Between IBP (contribution): from two IBPs, build the missing
one
15/1
M. Boyer, P. Roux NC/CPA common model
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
Between IBP (contribution): from two IBPs, build the missing
one
A
(α, α)
15/1
P
(π, π)
M. Boyer, P. Roux NC/CPA common model
E
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
Between IBP (contribution): from two IBPs, build the missing
one
A
(α, α)
15/1
P
(π, π)
M. Boyer, P. Roux NC/CPA common model
E
(π ◦ α, π ◦ α)
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
Between IBP (contribution): from two IBPs, build the missing
one
A
(α, α)
15/1
P
(π, π)
E
(π ◦ α, π ◦ α)
(π, π)
(η, η)
M. Boyer, P. Roux NC/CPA common model
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
Between IBP (contribution): from two IBPs, build the missing
one
A
(α, α)
−
1
(π ◦ η, π −1 ◦ η)
15/1
P
(π, π)
E
(π ◦ α, π ◦ α)
(π, π)
(η, η)
M. Boyer, P. Roux NC/CPA common model
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
Between IBP (contribution): from two IBPs, build the missing
one
A
(α, α)
−
1
(π ◦ η, π −1 ◦ η)
P
(π, π)
E
(π ◦ α, π ◦ α)
(π, π)
(η, η)
(α, α)
15/1
(η, η)
M. Boyer, P. Roux NC/CPA common model
Intrinsic properties
IBP properties (from NC and CPA)
0
min/max: if (φ, φ) and (φ0 , φ ) are IBP of f , also is
0
(max(φ, φ0 ), min(φ, φ ))
∗
Kleene star closure: if (φ, φ) is an IBP of f , also is (φ∗ , φ )
where ·∗ , ·∗ are Kleene-star of min/max convolutions.
Between IBP (contribution): from two IBPs, build the missing
one
A
(α, α)
−
1
(π ◦ η, π −1 ◦ η)
(α, α)
15/1
P
(π, π)
E
(π ◦ α, π ◦ α)
(π, π)
(η l ◦ α −1 , η r ◦ α −1 )
(η, η)
M. Boyer, P. Roux NC/CPA common model
(η, η)
Packetizer
A, E , P
A0 , E 0 , P 0
S
Packetizer:
store bits, up to end-of-packet
A0 := P −1 ◦ P ◦ A
instantaneous packet output
E 0 := E
model: E , P unchanged
P 0 := P
A(t)
E (t)
t
16/1
A0 (t)
P(d)
t
M. Boyer, P. Roux NC/CPA common model
d
t
Packetizer
A, E , P
S
A0 , E 0 , P 0
Packetizer:
store bits, up to end-of-packet
A0 := P −1 ◦ P ◦ A
instantaneous packet output
E 0 := E
model: E , P unchanged
P 0 := P
α0 := π −1 ◦ η
α0 := π −1 ◦ η
16/1
M. Boyer, P. Roux NC/CPA common model
Aggregation
A1 , E1 , P1
S
A2 , E2 , P2
A, E , P
Aggregation:
mix of flows
A := A1 + A2
“sum” of flows
is a flow
E := E1 + E2
P(A1 + A2 ) := P(A1 ) + P(A2 )
no delay
α := α1 + α2
α := α1 + α2
η := η 1 + η 2
η := η 1 + η 2
π := π1 ∗ π2
17/1
π := dπ1 ∗ π2 e
M. Boyer, P. Roux NC/CPA common model
Case study
Two data flows, F1 , F2 , from S to C
Using a link of throughput 1
Flow
F1
F2
Packet size
1/2
1
Burst
1
1
Throughput
1/4
1/4
Goal: evaluation of the packet throughput
F = F1 + F2
what is η ?
challenge: modelling the link shaping
18/1
M. Boyer, P. Roux NC/CPA common model
αi
x/4 +1
x/4 +1
πi
d2x e
dx e
Packet throughput: no shaping
No shaping :
x
+2
2
x
+1
η 2 = π 2 ◦ α2 =
4
η 6 η1 + η2
η 1 = π 1 ◦ α1 =
19/1
η1
M. Boyer, P. Roux NC/CPA common model
η2
Packet throughput: with shaping
Link throughput: λ(t) = t
Shaping reduces data
throughput
λ ∧ α1
α1
for each flow,
αsi = λ ∧ αi
for the aggregate flow:
αs1+2 = λ ∧ (α1 + α2 )
Impact on packet
throughput
per flow: η si = π i ◦ αsi
aggregate flow:
η s1+2 = dπ 1 ∗ π 2 e ◦ αs1+2
both η s1 + η s2 and η s1+2 are
packet throughput bounds
20/1
(λ ∧ α1 ) + (id ∧ α2 )
λ ∧ (α1 + α2 )
M. Boyer, P. Roux NC/CPA common model
Numerical results
the shaping only affects start of curve
the simple method has better long term throughput
the new method is locally better
21/1
M. Boyer, P. Roux NC/CPA common model
Outline
22/1
M. Boyer, P. Roux NC/CPA common model
Conclusion
A new model, unifying NC and Event-Stream/CPA
Taking the model in hand
algebraic results
some accuracy gains
Next steps
composition implementation
aggregation improvement
realistic case study
23/1
M. Boyer, P. Roux NC/CPA common model
Toward unifying model
Figure: http://xkcd.com/927/
24/1
M. Boyer, P. Roux NC/CPA common model
© Copyright 2026 Paperzz