Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Traversal time for weakly synchronized CAN bus
Hugo Daigmorte, Marc Boyer
ONERA – The French aerospace lab
24th International Conference on Real-Time Networks and SystemsRTNS’2016
19th October 2016C
onsi
st
ent *
Complete
* Well d
ocu
mented * Easy to
reuse
* * E
valuate
d *
RTN
S *
Artifact
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 1 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Context and goalGlobal clockLocal clockBounded phases
Table of Contents
1 Context and goalContext and goalGlobal clockLocal clockBounded phases
2 Computing an upper bound on network delay
3 Experimental results
4 Conclusion
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 2 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Context and goalGlobal clockLocal clockBounded phases
Context
Context
Real-time networked system
Bus network: CAN
Periodic flows with Offsets
reduces contentions ⇒ reduces delaysrequires synchronization
CAN Node n°N
CAN Node n°2
CAN Node n°1
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 3 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Context and goalGlobal clockLocal clockBounded phases
Model and Goal
Model
Flows Fi : Pi ,Si ,Oi
N nodes, each node j has a clock: cj (t)
Sending frame k: cj (t) = Oi + kPi
Goal
Accurate bound on network traversal time
aka Worst Case Traversal Time (WCTT)
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 4 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Context and goalGlobal clockLocal clockBounded phases
Global clock
∀j , j ′ : cj (t) = cj ′(t)
Advantage: efficient schedule ⇒ no contention
Drawback: perfect synchronization (HW/SW cost)
A,1 B,1 A,2
C,3C,1 C,2
A,1 B,1 A,2C,1 C,2 C,3BUS
N1
N2
BUS
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 5 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Context and goalGlobal clockLocal clockBounded phases
Local clock
Advantage:
efficient schedule ⇒ no contention intra-nodes
efficient schedule ⇒ workload spread over time
N1
N2
BUSBUS
A,1 B,1 A,2
C,3C,1 C,2
A,1 B,1 A,2C,1 C,2 C,3
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 6 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Context and goalGlobal clockLocal clockBounded phases
Bounded phases
∀j , j ′ : cj (t)− cj ′(t) ≤ Φj ,j ′
Objectives:
affordable synchronization
reduces delays wrt no sync/local clock
N1
N2
BUSBUS
A,1 B,1 A,2
C,3C,1 C,2
A,1 B,1 A,2C,1 C,2 C,3
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 7 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
Table of Contents
1 Context and goal
2 Computing an upper bound on network delayNetwork CalculusMethodology
3 Experimental results
4 Conclusion
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 8 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
Reality modeling
Network Calculus is a theory designed to compute memory anddelay bounds in networks.
A αA+A′
Flow : Cumulative curve AA(t) : amount of data sent up to time tProperties: null at 0 (and before), non decreasing
Server: simple arrival/departure relation:Property: departure produced after arrival:
AS−→ D =⇒ A ≥ D
Worst delay:d(A,S) = sup
t∈R+{inf{d ∈ R+|A(t) ≤ D(t + d)}}
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 9 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
Arrival curve and services
Real behaviors are unknown at design time ⇒ use of contracts
Traffic contract: arrival curve
A flow A has arrival curve α iff:
∀t, d ∈ R+ : A(t + d)− A(t) ≤ α(d)
Server contract: service curve
For t, s in the same busy/backlogged period, a server S offers astrict minimal service of curve β iff:
D(t)− D(s) ≥ β(t − s)
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 10 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
A common period
Problem transformation
Initial problem: Flow : Fi =< Ti ,Oi , Si >, F = {F1, ..,Fn}1 sourceperiodic messagesSize, Period, OffsetPriority
Transformed problem: A = {A1, ..,Am}Period T = ppcm(Ti )Offset Oj
Size Sj
Donner un exemple (avec figure)
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 11 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
A common period
Problem transformation
Initial problem: Flow : Fi =< Ti ,Oi , Si >, F = {F1, ..,Fn}1 sourceperiodic messagesSize, Period, OffsetPriority
Transformed problem: A = {A1, ..,Am}Period T = ppcm(Ti )Offset Oj
Size Sj
Donner un exemple (avec figure)
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 11 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
A common period
Problem transformation
Initial problem: Flow : Fi =< Ti ,Oi , Si >, F = {F1, ..,Fn}1 sourceperiodic messagesSize, Period, OffsetPriority
Transformed problem: A = {A1, ..,Am}Period T = ppcm(Ti )Offset Oj
Size Sj
Donner un exemple (avec figure)
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 11 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
Arrival curve
Arrival curve α1..k (Theorem 5)
Capture the synchronization
Efficient algorithm
Required common period
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 12 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
AO
P α
A′
O ′P α
A + A′2α αA+A′
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 13 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
State of the art: hDev(Ai ,Di ) ≤ hDev(αi , β −∑j<iαj − L)
1 Method 1: hDev(Ai ,Di ) ≤ hDev(αi , β − α1..i−1 − L)
Taking into account synchronization between flows A1..Ai−1
αi
β − α1..i−1 − LhDev(αi , βi − α1..i−1)
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 14 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
2 Method 2: hDev(Ai ,Di ) ≤ (β − α1..i − L)−1(0)
Bound busy period for high priority flows (1..i)Pessimistic if several messages of the same flow are in thesame busy period
( - β α1.. i - L)-1(0)
i,1
i,2
i,1 i,2
8,6cm
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 15 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Network CalculusMethodology
3 Method 3 (Theorem 3): hDev(Ai ,Di ) ≤ hDev(Ai ,Di)
Requires good knowledge of Ai
Ai
DiDi
hDev(Ai ,Di )
hDev(Ai ,Di)
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 16 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Phases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
Table of Contents
1 Context and goal
2 Computing an upper bound on network delay
3 Experimental resultsPhases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
4 Conclusion
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 17 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Phases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
Configuration under study
250 kbit/s
10 nodes
62 flows
Load: 35%
Period: {20,50,100,200,500,1000}Payload: 1-8 bytes
0 1 2 3 4 5 6 7 8 9Frame payload (bytes)
101
102
103
Perio
d(m
s)
1
1
1
1
2
3
2
1
3
1
2
1
2
2
1
1
1
1
2
3
1
3
2
1
1
1
4
2
3
2
1
3
1
1
3
1
Method Synchronization WCTT
Method 1 Phases BoundMethod 2 Phases BoundMethod 3 Phases BoundMethod 4 Local clocks ExactMethod 5 Global clock BoundMethod 6 No offsets Exact
Phases : cj (t)− c ′j (t) ≤ Φ, Local clocks : Φ =∞,
Global clocks : Φ = 0, No offset : Oi = 0/unknown
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 18 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Phases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
0 10 20 30 40 50 60Frame by decreasing priority
0
2
4
6
8
10
12
14R
espo
nse
times
inm
s
Local clocks: Method 4Global clock: Method 5No offsets: Method 6
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 19 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Phases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
0 10 20 30 40 50 60Frame by decreasing priority
0
2
4
6
8
10
12
14R
espo
nse
times
inm
s
Phases: Method 1Phases: Method 2Phases: Method 3Local clocks: Method 4Global clock: Method 5No offsets: Method 6
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 20 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Phases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
0 10 20 30 40 50 60Frame by decreasing priority
0
2
4
6
8
10
12
14R
espo
nse
times
inm
s
Phases: Method 1Phases: Method 2Phases: Method 3Local clocks: Method 4No offsets: Method 6
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 21 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Phases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
0 10 20 30 40 50 60Frame by decreasing priority
0
2
4
6
8
10
12
14R
espo
nse
times
inm
s
Phases: Method 1Phases: Method 2Phases: Method 3Local clocks: Method 4No offsets: Method 6
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 22 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Phases bounded by 0msPhases bounded by ±1msPhases bounded by ±5msPhases bounded by ±10ms
0 10 20 30 40 50 60Frame by decreasing priority
0
2
4
6
8
10
12
14R
espo
nse
times
inm
s
Phases: Method 1Phases: Method 2Phases: Method 3Local clocks: Method 4No offsets: Method 6
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 23 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Offsets pro/cons
Pro: reduced contention and delaysCons: global clock has HW/SW cost
Is there a benefit even with a weak inter-nodessynchronization ?
Great results
Phases 10% minimal period ⇒ Gains 75%Phases 50% minimal period ⇒ Gains 45%
Further work
Model clock drift and re-synchronizationEnhance the analysisCompare analytic results to simulation resultsCreate a dedicated offset algorithm
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 24 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Offsets pro/cons
Pro: reduced contention and delaysCons: global clock has HW/SW cost
Is there a benefit even with a weak inter-nodessynchronization ?
Great results
Phases 10% minimal period ⇒ Gains 75%Phases 50% minimal period ⇒ Gains 45%
Further work
Model clock drift and re-synchronizationEnhance the analysisCompare analytic results to simulation resultsCreate a dedicated offset algorithm
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 24 / 24
Context and goalComputing an upper bound on network delay
Experimental resultsConclusion
Offsets pro/cons
Pro: reduced contention and delaysCons: global clock has HW/SW cost
Is there a benefit even with a weak inter-nodessynchronization ?
Great results
Phases 10% minimal period ⇒ Gains 75%Phases 50% minimal period ⇒ Gains 45%
Further work
Model clock drift and re-synchronizationEnhance the analysisCompare analytic results to simulation resultsCreate a dedicated offset algorithm
H. Daigmorte, M. Boyer Traversal time for weakly synchronized CAN bus 24 / 24