Pushing the limits of CAN -   Scheduling frames with offsetsprovides a major performance boost Nicolas NAVET INRIA / RealT...
In-vehicle networking :will CAN be able to keep up the pace?Typically max. bus load is set to 35%Not enough wrt to short/m...
Scheduling frames with offsets ?! Principle: desynchronize transmissions to avoid load peaks0       10        15          ...
System model (1/2)                    Frame response time         taskECU           Frame Transmission request            ...
System model (2/2)The offset of a message stream is the time at whichthe transmission request of the first frame is issued...
But task scheduling has to be                adapted…                                  Frame response time           taskE...
Offsets Algorithm (1/3)Ideas:  assign offsets in the order of the transmission  frequencies  release of the first frame is...
Offsets Algorithm applied on a typical            body network                                  65 ms                     ...
Offsets Algorithm (3/3)Low complexity and efficient as is butfurther improvements possible:  add frame(s) / ECU(s) to an e...
Efficiency of offsets :               some insight (1/2) Work = time totransmitthe CAN frames sent by   the stations   Alm...
Efficiency of offsets :           some insight (2/2)   A larger workload waiting for transmission implieslarger response t...
Computing worst-caseresponse times with offsets
Computing frame worst-case        response time with offsets                       AUTOSAR COM                    5ms     ...
WCRT : State of the artScientific literature:  Complexity is exponential  No schedulability analysis with offsets in the  ...
NETCAR-Analyzer : developed at INRIA, then RealTime-at-Work                                                          15
NETCAR-Analyzer : an overview   Worst-case response time on CAN with and withoutoffsets  Proven near-optimal offsets assig...
Performance evaluation :  Experimental Setup  WCRT of the frames wrt random offsetsand lower bound  WCRT reduction ratio f...
Experimental Setup   Body and chassis networksNetwork   #ECUs    #Messages   Bandwidth    Frame periods Body      15-20   ...
Offsets in practice : large response     time improvements (1/2)                               65 ms                      ...
WCRT Reduction Ratio    Body Networks               Chassis NetworksResults are even better with loaded stations          ...
Offsets allow higher network loads Typically: WCRT at 60% with offsets ≈ WCRT at 30% without offsets                      ...
Partial offset usage                       65 ms                       42                       34                       1...
Conclusions  Offsets provide an cost-effective short-term  solution to postpone multiple CANs and FlexRay  Tradeoff betwee...
Questions, feedback?please contact me atNicolas.Navet@loria.fr                         24
Upcoming SlideShare
Loading in …5
×

Pushing the limits of CAN - Scheduling frames with offsets provides a major performance boost

461 views
402 views

Published on

M. Grenier, L. Havet, N. Navet, "Pushing the limits of CAN - Scheduling frames with offsets provides a major performance boost", Proc. of the 4th European Congress Embedded Real Time Software (ERTS 2008), Toulouse, France, January 29 - February 1, 2008.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
461
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Pushing the limits of CAN - Scheduling frames with offsets provides a major performance boost

  1. 1. Pushing the limits of CAN - Scheduling frames with offsetsprovides a major performance boost Nicolas NAVET INRIA / RealTime-at-Work http://www.loria.fr/~nnavet http://www.realtime-at-work.com Nicolas.Navet@loria.fr ERTS – 30/01/2008 Joint work with Mathieu GRENIER and Lionel HAVET
  2. 2. In-vehicle networking :will CAN be able to keep up the pace?Typically max. bus load is set to 35%Not enough wrt to short/medium term bandwidthneeds … 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%) 2
  3. 3. Scheduling frames with offsets ?! Principle: desynchronize transmissions to avoid load peaks0 10 15 Periods0 5 5 20 ms0 0 5 15 ms 10 ms0 10 20 30 40 50 60 70 80 90 100 110 5 52,5 2,5 Periods 0 0 20 ms 15 ms 10 ms0 10 20 30 40 50 60 70 80 90 100 110 Algorithms to decide offsets are based on arithmetical properties of the periods and size of the frame 3
  4. 4. System model (1/2) Frame response time taskECU Frame Transmission request Higher prio. frames frameCAN Performance metric: worst-case response time 4
  5. 5. System model (2/2)The offset of a message stream is the time at whichthe transmission request of the first frame is issuedComplexity: best choosing the offsets is exponential inthe task periods → approximate solutionsMiddleware task imposes a certain granularityWithout ECU synchronisation, offsets are local to ECUs 5
  6. 6. But task scheduling has to be adapted… Frame response time taskECU Frame Transmission request Higher prio. frames frameCAN In addition, avoiding consecutive frame constructionson an ECU allows to reduce latency 6
  7. 7. 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)Time 0 2 4 6 8 10 12 14 16 18Frame f1,1 f2,1 f1,2 f3,1 7
  8. 8. Offsets Algorithm applied on a typical body network 65 ms 21 ms 8
  9. 9. Offsets Algorithm (3/3)Low complexity and efficient as is butfurther 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 … 9
  10. 10. Efficiency of offsets : some insight (1/2) Work = time totransmitthe CAN frames sent by the stations Almost a straight line, suggests that our algorithm is near-optimal 10
  11. 11. Efficiency of offsets : some insight (2/2) A larger workload waiting for transmission implieslarger response times for the low priority frames .. 11
  12. 12. Computing worst-caseresponse times with offsets
  13. 13. Computing frame worst-case response time with offsets AUTOSAR COM 5ms Frame-packing task Waiting queue:Requirements : -FIFO 2 -Highest Priority First- handle 100+ frames (HPF - Autosar) 1 -Carmaker specific- very fast execution times- ≠ waiting queue policy at the CAN Controllermicrocontroller level 9 6 8- limited number of transmissionbuffers buffer Tx CAN Bus 13
  14. 14. WCRT : State of the artScientific 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 levelOur software: NETCAR-Analyzer 14
  15. 15. NETCAR-Analyzer : developed at INRIA, then RealTime-at-Work 15
  16. 16. NETCAR-Analyzer : an overview Worst-case response time on CAN with and withoutoffsets 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 canbe 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 16
  17. 17. Performance evaluation : Experimental Setup WCRT of the frames wrt random offsetsand lower bound WCRT reduction ratio for chassis and bodynetworks Load increase : add new ECUs / add moretraffic
  18. 18. Experimental Setup Body and chassis networksNetwork #ECUs #Messages Bandwidth Frame periods Body 15-20 ≈ 70 125Kbit/s 50ms-2sChassis 5-15 ≈ 60 500Kbit/s 10ms-1sWith / without load concentration: one ECU generates 30%of the load Set of frames generated with NETCARBENCH (GPL-licenced) 18
  19. 19. Offsets in practice : large response time improvements (1/2) 65 ms 32 21 17 19
  20. 20. WCRT Reduction Ratio Body Networks Chassis NetworksResults are even better with loaded stations 20
  21. 21. Offsets allow higher network loads Typically: WCRT at 60% with offsets ≈ WCRT at 30% without offsets 21
  22. 22. Partial offset usage 65 ms 42 34 17 22
  23. 23. Conclusions Offsets provide an cost-effective short-term solution to postpone multiple CANs and FlexRay Tradeoff between Event and Time Triggered ET CAN CAN with offsets TT-CAN + Complexity + Determinism Further large improvements are possible bysynchronizing the ECUs … 23
  24. 24. Questions, feedback?please contact me atNicolas.Navet@loria.fr 24

×