pushing the limits of controller area network (can)
Post on 13-Sep-2014
2.886 views
DESCRIPTION
Slides of a talk given at ERTS2008 in Toulouse. Abstract: with the increasing amount of electronics, making best usage of the bandwidth becomes of primary importance in automotive networks. One solution that is being investigated by car manufacturers is to schedule the messages with offsets, which leads to a desynchronization of the message streams. As it will be shown, this “traffic shaping” strategy is very beneficial in terms of worst-case response times. In this slides, the problem of choosing the best offsets is addressed in the case of Controller Area Network, which is a de-facto standard in the automotive world. Comprehensive experiments shown give insight into the fundamental reasons why offsets are efficient, and demonstrate that offsets actually provide a major performance boost in terms of response times. These experimental results suggest that sound offset strategies may extend the lifespan of CAN further, and may defer the introduction of FlexRay and additional CAN networks.TRANSCRIPT
![Page 1: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/1.jpg)
Pushing the limits of CAN -Pushing the limits of CAN -Scheduling frames with offsets Scheduling frames with offsets
provides a major performance boostprovides a major performance boost
Nicolas NAVETINRIA / RealTime-at-Work
http://www.loria.fr/~nnavet
http://www.realtimeatwork.com [email protected]
ERTS – 30/01/2008
Joint work with Mathieu GRENIER and Lionel HAVET
![Page 2: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/2.jpg)
2
In-vehicle networking : In-vehicle networking : will CAN be able to keep up the pace?will CAN be able to keep up the pace?
Typically max. bus load is set to 35% Not enough wrt to short/medium term bandwidth
needs … Solution 1: multiple CAN networks … but
gateways induce heavy overhead Solution 2: switch to FlexRay … expensive for
bandwidth alone Solution 3: optimize the scheduling of CAN
frame .. Offsets provide a solution to make CAN predictable at higher network load (≥60%)
![Page 3: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/3.jpg)
3
Scheduling frames with offsets ?!Scheduling frames with offsets ?!
000
1050
1555
0 10 20 30 40 50 60 70 80 90 100 110
Periods 20 ms 15 ms 10 ms
0 10 20 30 40 50 60 70 80 90 100
52,50
110
52,50
Periods 20 ms 15 ms 10 ms
Principle: desynchronize transmissions to avoid load peaks
Algorithms to decide offsets are based on arithmetical properties of the periods and size of the frame
![Page 4: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/4.jpg)
4
System model (1/2) System model (1/2)
ECUFrame Transmission request
task
Frame response time
Performance metric: worst-case response time
CANHigher prio. frames
frame
![Page 5: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/5.jpg)
5
System model (2/2) System model (2/2) The offset of a message stream is the time at which
the transmission request of the first frame is issued
Complexity: best choosing the offsets is exponential in the task periods → approximate solutions
Middleware task imposes a certain granularity Without ECU synchronisation, offsets are local to ECUs
![Page 6: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/6.jpg)
6
But task scheduling has to be But task scheduling has to be adapted… adapted…
ECUFrame Transmission request
task
Frame response time
In addition, avoiding consecutive frame constructions on an ECU allows to reduce latency
CANHigher prio. frames
frame
![Page 7: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/7.jpg)
7
Time 0 2 4 6 8 10 12 14 16 18
Frame
Offsets Algorithm (1/3)Offsets Algorithm (1/3) Ideas:
assign offsets in the order of the transmission frequencies release of the first frame is as far as possible from adjacent
frames identify “least loaded interval”
Ex: f1=(T1=10), f2=(T2=20), f3(T3=20)
f1,1 f1,2f2,1 f3,1
![Page 8: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/8.jpg)
8
Offsets Algorithm applied on a typical Offsets Algorithm applied on a typical body networkbody network
21 ms
65 ms
![Page 9: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/9.jpg)
9
Offsets Algorithm (3/3)Offsets Algorithm (3/3)
Low complexity and efficient as is but further improvements possible: add frame(s) / ECU(s) to an existing design user defined criteria : optimize last 10 frames,
a specific frame, take into account priorities optimization algorithms: tabu search, hill
climbing, genetic algorithms …
![Page 10: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/10.jpg)
10
Efficiency of offsets : Efficiency of offsets : some insight (1/2)some insight (1/2)
Almost a straight line, suggests that our algorithm is near-optimal
Work = time
to transmit the CAN
frames sent
by the station
s
![Page 11: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/11.jpg)
11
Efficiency of offsets : Efficiency of offsets : some insight (2/2)some insight (2/2)
A larger workload waiting for transmission implies larger response times for the low priority frames ..
![Page 12: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/12.jpg)
Computing worst-case response times with offsets
![Page 13: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/13.jpg)
13
Computing frame worst-case Computing frame worst-case response time with offsetsresponse time with offsets
CAN Controller
buffer Tx
CAN Bus
AUTOSAR COM
Frame-packing task5ms
9 6 8
1
2
Waiting queue:
-FIFO
-Highest Priority First (HPF - Autosar)
-Carmaker specific
Requirements :
- handle 100+ frames
- very fast execution times
- ≠ waiting queue policy at the microcontroller level
- limited number of transmission buffers
![Page 14: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/14.jpg)
14
WCRT : State of the art WCRT : State of the art
Scientific literature: Complexity is exponential No schedulability analysis with offsets in the
distributed non-preemptive case Offsets in the preemptive case : not suited for
> 10-20 tasks WCRT without offsets: infinite number of Tx
buffers and no queue at the microcontroller level
Our software: NETCAR-Analyzer
![Page 15: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/15.jpg)
15
NETCAR-Analyzer : developed at INRIA, then RealTime-at-Work
![Page 16: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/16.jpg)
16
NETCAR-Analyzer : an overview Worst-case response time on CAN with and without offsets Proven near-optimal offsets assignments with user-defined performance criteria (e.g. WCRT of the 10 lowest prio. frames)
Exhibit the situations leading to the worst-case (results can be checked by simulations/testing)
Enable to dimension transmission/reception buffers (RAM) Handle both FIFO and prioritized ECUs Fast multi-core implementation (<1mn for 100 frames) Industrial use since December 2006
![Page 17: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/17.jpg)
Experimental Setup WCRT of the frames wrt random offsets and lower bound WCRT reduction ratio for chassis and body networks Load increase : add new ECUs / add more traffic
Performance evaluation :
![Page 18: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/18.jpg)
18
Experimental SetupExperimental Setup
Body and chassis networks
Network #ECUs #M essages Bandwidth Frame periodsBody 15-20 ¼70 125Kbit/ s 50ms-2s
Chassis 5-15 ¼60 500Kbit/ s 10ms-1s
Set of frames generated with NETCARBENCH (GPL-licenced)
With / without load concentration: one ECU generates 30% of the load
![Page 19: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/19.jpg)
19
Offsets in practice : large response Offsets in practice : large response time improvements (1/2)time improvements (1/2)
21
17
32
65 ms
![Page 20: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/20.jpg)
20
WCRT Reduction RatioWCRT Reduction Ratio
Body Networks Chassis Networks
Results are even better with loaded stations
![Page 21: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/21.jpg)
21
Offsets allow higher network loadsOffsets allow higher network loads
Typically: WCRT at 60% with offsets WCRT at 30% without offsets
![Page 22: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/22.jpg)
22
Partial offset usagePartial offset usage
34
17
42
65 ms
![Page 23: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/23.jpg)
23
ConclusionsConclusions
Offsets provide an cost-effective short-term solution to postpone multiple CANs and FlexRay
Tradeoff between Event and Time Triggered
Further large improvements are possible by synchronizing the ECUs …
ET CAN CAN with offsets TT-CAN
+ Complexity+ Determinism
![Page 24: Pushing the limits of Controller Area Network (CAN)](https://reader034.vdocument.in/reader034/viewer/2022052409/54136dc18d7f728a698b45dd/html5/thumbnails/24.jpg)
24
Questions, feedback? Questions, feedback? please contact me atplease contact me at
[email protected]@realtimeatwork.com