Controller Area Network Schedulability Analysis
Controller Area Network Schedulability Analysis
from the computed response time values, where τ bit is the where τ bit is the transmission time for a single bit, and B m
transmission time for a single bit on the bus. is the blocking factor described below. Iteration starts with a
A message is said to be schedulable if its worst-case suitable initial value such as wm0 =C m , and continues until
response time is less than or equal to its transmission either wmn+1 + C m > E m in which case the message is not
deadline ( R m ≤ E m ) . A system is said to be schedulable if schedulable, or wmn +1 = wmn in which case the message is
all of the messages in the system are schedulable. schedulable and its worst-case response time is given by:
The following additional notation is used to describe the
R m = wmn+1 + C m (3)
properties of a set of messages that are transmitted by the
same FQ-node and so share a FIFO queue. The FIFO group As CAN message transmission is non-pre-emptable, the
M (m) is the set of messages that are transmitted by the FQ- transmission of a single lower priority message can cause a
node that transmits message m. The lowest priority of any delay of up to B m (referred to as direct blocking) between
message in the FIFO group M (m) is denoted by Lm . message m being queued and the first time that message m
C mMAX and C mMIN are the transmission times of the longest could be entered into arbitration on the bus. B m represents
and shortest messages in the FIFO group, while C mSUM is the maximum blocking time due to lower priority messages:
the sum of the transmission times of all of the messages in B m = max (C k ) (4)
∀k∈lp ( m )
the group. E mMIN is the shortest transmission deadline of any
message in the group. Alternatively, in some cases, the transmission of the
We use f m to denote the maximum buffering time from previous instance of message m could delay transmission of
message m being queued until it is able to take part in a higher priority message causing a similar delay (referred
to as push-through blocking5) of up to C m . Both direct and
push-through blocking are accounted for by the 1st term on
3
In the best case, the task could arrive the instant the event occurs and
the RHS of (2). The 2nd term represents interference from
queue the message immediately, whereas in the worst-case, there could be higher priority messages that can win arbitration over
a delay of up to the task’s period before it arrives and then a further delay message m and so delay its transmission. Note that once
of up to the task’s worst-case response time before it queues the message. message m starts successful transmission it cannot be pre-
4
Note this is a different way of defining response time to that used in [11]
which includes queuing jitter. To compensate for not including queuing
jitter in the response time, in this paper we compare response times with
5
transmission deadlines to determine schedulability. See [11] for an explanation of why push-through blocking is important.
empted, so the message’s overall response time is simply interference on lower priority messages, a FIFO-queued
the queuing delay plus its transmission time (given by (3)). message k can be viewed as if it were a priority-queued
Using (2) and (3), engineers can determine upper message with its jitter increased by f k . (Note, we will
bounds6 on worst-case response times and hence the return to how f k is calculated for FIFO-queued messages
schedulability of all messages on a network comprising later). An upper bound on the queuing delay for a priority-
solely PQ-nodes. Although the analysis embodied in (2) and queued message m can therefore be calculated via the fixed
(3) is pseudo-polynomial in complexity in practice it is point iteration given by (5).
tractable on a desktop PC for complex systems with ⎡ w n + J k + f k + τ bit ⎤
hundreds of messages. (A number of techniques are also wmn+1 = max( Bm , C m ) + ∑ ⎢ m ⎥C k (5)
available for increasing the efficiency of such fixed point ∀k∈hp ( m ) ⎢ Tk ⎥
iterations [12]). As with (3), iteration starts with a suitable initial value such
as wm0 =C m , and continues until either wmn+1 + C m > E m in
4. Schedulability Analysis with FIFO Queues which case the message is not schedulable, or wmn +1 = wmn in
In this section, we derive sufficient schedulability which case its response time is given by:
analysis for messages on networks with both PQ-nodes and
FQ-nodes. The analysis we introduce is FIFO-symmetric, by R m = wmn+1 + C m (6)
this we mean that the same worst-case response time is Note that the queuing delay and response time are only
attributed to all of the messages in a FIFO group. We note valid with respect to the values of f k used. We return to
that FIFO-symmetric analysis incurs some pessimism in this point later.
terms of the worst-case response time attributed to the 4.2. FIFO-queued messages
higher priority messages in a FIFO group; however, in We now derive an upper bound on the worst-case
practice this pessimism is likely to be small. This is because queuing delay for a FIFO-queued message m, in a system
the order in which messages are placed in a FIFO queue is with both PQ-nodes and FQ-nodes.
undefined, and so in the worst case, the highest priority As our analysis is FIFO-symmetric, we will attribute the
message in a FIFO group has to wait for an instance of each same upper bound response time to all of the messages sent
lower priority message in the group to be transmitted. by the same FQ-node. Our analysis derives this sufficient
4.1. Priority-queued messages response time by considering an arbitrary message from the
We now derive an upper bound on the worst-case FIFO group M (m) . For the sake of simplicity, we will still
queuing delay for a priority-queued message m, in a system refer to this message as message m; however our analysis
with both PQ-nodes and FQ-nodes. will be independent of the exact choice of message from the
In the case of systems with only PQ-nodes, Davis et al. FIFO group. At each stage in our analysis we will make
[11] showed that the worst-case queuing delay for a priority- worst-case assumptions, ensuring that the derived response
queued message m occurs for an instance of that message time is a correct upper bound. For example, we will frame
queued at the beginning of a priority level-m busy period7 our calculation of the queuing delay wm by assuming the
that starts immediately after the longest lower priority lowest priority Lm of any message in the FIFO group.
message begins transmission. Further, this maximal busy As every message j in M (m) has D j ≤ T j then in a
period begins with a so-called critical instant where schedulable system, when any arbitrary message from
message m is queued simultaneously with all higher priority M (m) is queued, there can be at most one instance of each
messages and then each of these higher priority messages is of the other messages in M (m) ahead of it in the FIFO
subsequently queued again after the shortest possible time queue. The maximum transmission time of these messages,
interval. Equation (2) provides a sufficient upper bound on and hence the maximum interference on an arbitrary
this worst-case queuing delay. message m, due to messages sent by the same FQ-node, is
The analysis embodied in (2) assumes that higher therefore upper bounded by:
priority messages are able to compete for access to the bus C mSUM − C mMIN (7)
(i.e. enter bus arbitration) as soon as they are queued; Indirect blocking could also occur due to the non-pre-
however, this assumption does not hold for FIFO-queued emptive transmission of a previous instance of any one of
messages. Instead a FIFO-queued message k may have to the messages in M (m) . This indirect blocking is upper
wait for up to a maximum time f k before it becomes the bounded by C mMAX . As an alternative, direct blocking could
oldest message in its FIFO queue, and can enter priority- occur due to transmission of any of the messages of lower
based arbitration. A FIFO-queued message k can therefore priority than Lm sent by other nodes. Finally, in terms of
be thought of as becoming priority queued after an interference from higher priority messages sent by other
additional delay of f k . Stated otherwise, in terms of its FQ-nodes and PQ-nodes, the argument about increased jitter
made in the previous section applies, and so the interference
6
Equation (2) is sufficient rather than exact due to the fact that push term from (5) can again be used.
through blocking may not necessarily be possible.
7
Considering all of the above, an upper bound on the
A priority level-m busy period is a contiguous interval of time during queuing delay for an arbitrary message m belonging to the
which there is always at least one message of priority m that has not yet
completed transmission. FIFO group M (m) is given by the solution to the following
fixed point iteration: decreasing with respect to the response times calculated via
wmn+1 = max( B L , C mMAX ) + (C mSUM − C mMIN ) + (8) & (9). Hence by using an outer loop iteration, and
m repeating response time calculations until the buffering
⎡ wmn + J k + f k + τ bit ⎤ times no longer change, we can compute correct upper
∑ ⎢
Tk
⎥C k (8) bound response times and hence schedulability for all
∀k∈hp ( Lm ) ∧ k∉M ( m ) ⎢ ⎥ messages, as shown in Algorithm 1. (Note, to speed up the
Iteration starts with a value of wm0 = max( B L , C mMAX ) schedulability test, for each message m, the value of wm
m
+ (C mSUM − C mMIN ) and continues until either computed on one iteration of the while loop (lines 3 to 23)
n +1 MIN MIN
wm + C m > E m in which case the set of messages can be used as an initial value on the next iteration).
M (m) is declared unschedulable, or wmn +1 = wmn in which 1 repeat = true
case all of the messages in M (m) are deemed to have a 2 initialise all f k = 0
response time of: 3 while(repeat){
R m = wmn +1 + C mMIN (9) 4 repeat = false
Equations (8) and (9) make the worst-case assumption 5 for each priority m, highest first{
that interference from higher priority messages can occur up 6 if (m is FIFO-queued){
to a time C mMIN before transmission of message m 7 calc Rm according to Eqs (8) & (9)
completes. We note that this is a pessimistic assumption 8 if( Rm > E mMIN ) {
with respect to those messages belonging to the FIFO group 9 return unschedulable
that have transmission times8 longer than C mMIN . 10 }
11 if( f m ! = wm ){
4.3. Schedulability test with arbitrary priorities 12 f m= wm
We now derive a schedulability test from (5) & (6) and 13 repeat = true;
(8) & (9). The basic idea is to avoid having to consider the 14 }
potentially complex interactions between the FIFO queues 15 }
of different nodes. This is achieved by abstracting the FIFO 16 else {
behaviour of messages sent by other nodes as simply 17 calc Rm according to Eqs (5) & (6)
MIN
additional jitter f k before each message k can enter priority 18 if( Rm > E m ) {
based arbitration on the bus. When calculating the response 19 return unschedulable
time of a given message, we therefore need only consider 20 }
the behaviour of the node that sends that message (PQ-node 21 }
or FQ-node) and the buffering delays of messages sent by 22 }
other nodes9. 23 }
An upper bound on the buffering time f m of a FIFO- 24 return schedulable
queued message m is: Algorithm 1: FIFO Symmetric Schedulability Test
f m = Rm − C mMIN (10) Algorithm 1 provides a sufficient schedulability test for
When the priorities of messages in different FIFO FIFO-queued and priority-queued messages in any arbitrary
groups are interleaved, this leads to an apparently circular priority ordering.
dependency in the response time calculations. For example, 4.4. Partial priority ordering within a FIFO group
let m and k be the priorities of messages in two different In this section, we consider an appropriate priority
FIFO groups with interleaved priorities (i.e. k ∈ hp ( Lm ) ordering for messages within a FIFO group.
and m ∈ hp ( Lk ) ). The response time Rk of message k, and
hence its buffering time f k , depend on the buffering time Definition 2: A FIFO-adjacent priority ordering is any
f m of message m as m ∈ hp ( Lk ) ; however, the buffering priority ordering whereby all of the messages sharing a
time f m of message m depends on its response time Rm FIFO queue are assigned adjacent priorities.
which in turn depends on f k as k ∈ hp ( Lm ) . This apparent Theorem 1: If a priority ordering Q exists that is
problem can be solved by noting that the response times schedulable according to the FIFO-symmetric schedulability
calculated via (5) & (6) and (8) & (9) are monotonically analysis of Algorithm 1 then a schedulable FIFO-adjacent
non-decreasing with respect to the buffering times, and that priority ordering P also exists.
the buffering times given by (10) are monotonically non- Proof: Let m be a FIFO-queued message that is not the
lowest priority message in its FIFO group. Now consider a
8
In practice all messages sent on CAN often have the maximum length (8 priority transformation whereby message m is shifted down
data bytes) so as to minimise the relative overheads of the other fields in in priority so that it is at a priority level immediately above
the message (ID, CRC etc). In this case, no additional pessimism is that of the lowest priority message in its FIFO group. We
introduced by this assumption. will refer to the old priority ordering as Q and the new
9
If the message belongs to a PQ-node, then the other messages sent by the
same node have buffering delays of zero, if it belongs to an FQ-node, then priority ordering as Q’.
the buffering delays for other messages sent by the same node are not We observe from (5) and (8), that given the same fixed
needed in the calculations (8) &(9).
set of buffering times f k , then (i) the response time levels is all that is needed to determine schedulability. In
computed for message m is the same for both priority other words, lines 11-14 of Algorithm 1 can be omitted
orderings, and (ii) the response times computed for all other when considering FIFO-adjacent priority orderings. This
messages are no larger in priority ordering Q’ than they are revised schedulability test therefore dominates the test given
in priority ordering Q. Due to the mutual monotonically in section 4.3 (i.e. Algorithm 1 with lines 11-14 present).
non-decreasing relationship between message buffering The simplified analysis given in this section is similar to
times and response times, and the fact that Algorithm 1 that provided for FP/FIFO scheduling of flows in [23] and
starts with all the buffering times set to zero, this means that for OSEK/VDX tasks in [4], [19].
on every iteration of Algorithm 1, the response times and
buffering times computed for each message under priority 5. Priority Assignment Policies
ordering Q’ are no larger than those computed on the same The schedulability test presented in section 4.5 is
iteration for priority ordering Q. Hence if priority ordering applicable irrespective of the overall priority ordering,
Q is schedulable, then so is priority ordering Q’. provided that messages sharing the same FIFO queue are
Applying the priority transformation described above to assigned adjacent priorities. Choosing an appropriate
every FIFO-queued message that is not the lowest priority priority ordering among the priority-queued messages and
message in its FIFO group transforms any schedulable the FIFO groups is however an important aspect of
priority ordering Q into a FIFO-adjacent priority ordering P, achieving overall schedulability and hence effective real-
without any loss of schedulability □ time performance.
In this section, we consider the assignment of messages
Theorem 1 tells us that regardless of the priority assignment
to priority bands, where a priority band comprises either a
applied to priority-queued messages, we should ensure that
single priority level containing one priority-queued
all of the messages that share a single FIFO queue have
message, or a number of adjacent priority levels containing
adjacent priorities. In terms of CAN message IDs we note
a FIFO group of messages. We derive priority assignment
that this does not require that consecutive values are used
policies that are optimal with respect to the schedulability
for the IDs, only that there is no interleaving with respect to
analysis given in section 4.5.
the priorities of other messages. In practice message IDs can
be chosen to meet these requirements, while also providing 5.1. Optimal priority assignment
appropriate bit patterns for message filtering. Davis et al. [11], showed that, assuming solely priority
queuing, Audsley’s Optimal Priority Assignment (OPA)
4.5. Schedulability test for FIFO-adjacent priorities
algorithm [1], [2] provides the optimal priority assignment
In this section, we derive an improved schedulability
for CAN messages. We now show that with an appropriate
test that is only valid for FIFO-adjacent priority orderings.
modification to handle FIFO groups, Audsley’s algorithm is
Recall that Davis et al. [11] showed that the worst-case
also optimal with respect to the schedulability test given in
queuing delay for a priority-queued message m occurs
section 4.5. The pseudo code for this OPA-FP/FIFO
within the priority level-m busy period that starts with a
algorithm is given in Algorithm 2. Note that only one
critical instant. Provided that a FIFO-adjacent priority
message from each FIFO group is considered in the initial
ordering is used, then the same situation also represents the
list, as once this message is assigned to a priority band, then
worst-case scenario when higher priority messages are sent
so are the other messages in the same FIFO group.
by either PQ-nodes or FQ-nodes. This can be seen by
considering the interference on a priority-queued message m for each priority band k, lowest first
from a higher priority FIFO-queued message k. As message {
for each message msg in the initial list {
k is of higher priority than message m, then so are all of the if msg is schedulable in priority band k according to
other messages in the same FIFO group (i.e. M (k ) ). Thus schedulability test S with all unassigned priority-
any message in M (k ) that is queued prior to the start of queued messages / other FIFO groups assumed to be
transmission of message m will be sent on the bus before in higher priority bands {
message m, irrespective of the order in which the messages assign msg to priority band k
in M (k ) are placed in the FIFO queue. In effect all of the if msg is part of a FIFO group {
additional jitter on message k is already accounted for by assign all other messages in the FIFO group
interference on message m from other messages in the same to adjacent priorities within priority band k
}
FIFO group ( M (k ) ). In this case, there is no additional break (continue outer loop)
jitter on message k caused by messages of lower priority }
than m. Hence for each FIFO message k, we can set f k = 0, }
and use (5) & (6) to calculate the queuing delay and worst- return unschedulable
case response time of each message m. The same argument }
applies when we consider the schedulability of a FIFO- return schedulable
queued message m. In this case we can use (8) & (9) to Algorithm 2: Optimal Priority Assignment
calculate the queuing delay and worst-case response time, (OPA-FP/FIFO)
with all buffering times f k = 0. Further, as the buffering
times are all fixed at zero, a single pass over the priority In [14] Davis and Burns showed that Audsley’s OPA
algorithm is optimal with respect to any schedulability test larger with increasing priority this is always counteracted by
that meets three specific conditions. According to a decrease in interference that is at least as large; hence the
Theorem 1, we need only consider the priority bands length of the queuing delay cannot increase with increasing
assigned to each priority-queued message, and each FIFO priority, and so neither can the response time □
group (as all messages in a FIFO group have adjacent For N priority-queued messages / FIFO groups, the
priorities in an optimal priority ordering). We therefore re- OPA-FP/FIFO algorithm performs at most N(N-1)/2
state these three conditions in the context of priority-queued schedulability tests and is guaranteed to find a schedulable
messages and FIFO groups. priority assignment if one exists. It does not however
The three conditions refer to properties or attributes of specify an order in which messages should be tried in each
the messages. Message properties are referred to as priority band. This order heavily influences the priority
independent if they have no dependency on the priority assignment chosen if there is more than one ordering that is
assigned to the message. For example the longest schedulable. In fact, a poor choice of initial ordering can
transmission time, deadline, and minimum inter-arrival time result in a priority assignment that leaves the system only
of a message are all independent properties, while the worst- just schedulable. We suggest that, as a useful heuristic,
case response time typically depends on the message’s priority-queued messages and FIFO groups are tried at each
priority and so is a dependent property. priority level in order of transmission deadline (i.e. E m or
Condition 1: The schedulability of a message / FIFO group E mMIN ), largest value first. This will result in a priority
identified by m, may, according to test S, depend on any ordering reflecting transmission deadlines if such an
independent properties of other messages / FIFO groups in ordering is schedulable. Alternatively, approaches which
higher priority bands than m, but not on any properties of result in a robust priority assignment can be developed from
those messages / FIFO groups that depend on their relative the techniques described in [13].
priority ordering. 5.2. TDMO-FP/FIFO priority assignment
Condition 2: The schedulability of a message / FIFO group In industrial practice, CAN configurations are often
identified by m may, according to test S, depend on any designed such that all of the messages are of the same
independent properties of the messages / FIFO groups in maximum length (8 data bytes). This is done to ameliorate
lower priority bands than m, but not on any properties of the effects of the large overhead of the other fields
those messages / FIFO groups that depend on their relative (arbitration, CRC etc) in each message.
priority ordering. Definition 3: Transmission deadline monotonic priority
Condition 3: When the priorities of any two adjacent ordering for FP/FIFO (TDMPO-FP/FIFO) is a priority
priority bands are swapped, then the message / FIFO group assignment policy that assigns priority bands to priority
being assigned the higher priority band cannot become queued messages and FIFO groups according to their
unschedulable according to test S, if it was previously transmission deadlines; with a shorter transmission deadline
schedulable in the lower priority band. (As a corollary, the implying a higher priority. (Recall that the transmission
message / FIFO group being assigned the lower priority deadline of a FIFO group is given by the shortest
band cannot become schedulable according to test S, if it transmission deadline of any message in that group).
was previously unschedulable in the higher priority band). Figure 1 illustrates the TDMPO-FP/FIFO priority
Theorem 2: The OPA-FP/FIFO algorithm is an optimal assignment policy.
priority assignment algorithm with respect to the FIFO- Theorem 3: TDMPO-FP/FIFO is an optimal policy for
symmetric schedulability test of section 4.5 (Algorithm 1 assigning priority-queued messages and FIFO groups to
with lines 11-14 omitted). priority bands, with respect to the sufficient schedulability
Proof: It suffices to show that conditions 1-3 hold with test given in section 4.5 (Algorithm 1 with lines 11-14
respect to the schedulability test given by Algorithm 1 with omitted), provided that all messages have the same worst-
lines 11-14 omitted. case transmission time.
Condition 1: Inspection of (5) & (6) and (8) & (9), assuming Proof: See Appendix A.
all f k are fixed at zero, shows that the response time of
each message m is dependent on the set of messages in Corollary 1: For the case where all nodes use priority
higher priority bands, but not on their relative priority queues and all messages have the same worst-case
ordering. transmission time, TDMPO-FP-FIFO reduces to
Condition 2: Inspection of (5) & (6) and (8) & (9), shows transmission deadline monotonic priority ordering, which is
that the response time of each message m is dependent on therefore an optimal priority assignment policy with respect
the set of messages in lower priority bands via the direct to the sufficient schedulability test given by Davis et al. in
blocking term, but not on their relative priority ordering. [11] (recapitulated in section 3).
Condition 3: Inspection of (5) & (6) and (8) & (9), assuming Note that transmission deadline (i.e. Deadline minus
all f k are fixed at zero, shows that increasing the priority Jitter) monotonic priority ordering has also been shown to
band of message m cannot result in a longer response time. be an effective heuristic policy in the general case with
This is because although the direct blocking term can get mixed length messages [13].
5.3. Priority inversion schedulability analysis work with a real application we
All of the messages in a FIFO group need to have analysed a CAN bus architecture from the automotive
sufficiently high priorities that the message with the shortest domain, first presented in [22]. Figure 2 shows this
transmission deadline in the group can still meet its architecture. The system consists of a 500 kBit/s CAN bus
deadline. We have shown that with the FIFO-symmetric connecting 10 ECUs. There are a total of 85 messages sent
schedulability analysis introduced in this paper, the most on the bus. The number of messages sent by each ECU is
effective way to achieve this is to assign adjacent priorities given by the annotations in Figure 2. All messages are sent
to all of the messages in a FIFO group. Despite this, we note strictly periodically and have no offsets with respect to each
that the use of FIFO queues still typically results in priority other. We assumed that the queuing jitter for each message
inversion with respect to the priority assignment that would was 1% of its period.
be used if all nodes implemented priority queues.
The problem of priority inversion can be seen by
considering priority assignment according to the TDMPO-
FP/FIFO policy, see Figure 1 below. With only PQ-nodes,
the priority assigned to each message would depend only on
its transmission deadline, with a longer deadline implying
lower priority. With FIFO queues, there are two forms of Figure 2: CAN bus architecture
priority inversion: internal and external. Internal priority
inversion takes place within a FIFO queue when messages We compared five different configurations of the system:
with longer transmission deadlines enter the queue before, Expt. 1: All ECUs used priority queues.
and so are transmitted ahead of, messages with shorter Expt. 2: ECU3 and ECU6 used FIFO queues and the
transmission deadlines. External priority inversion occurs remaining ECUs used priority queues.
because all of the messages in a FIFO group effectively Expt. 3: All ECUs used FIFO queues.
obtain priorities based on the shortest transmission deadline Expt. 4: All ECUs used priority queues, but the priority
of any message in that group. This has the effect of creating ordering was that established by Expt 3.
priority inversion with respect to messages sent by other Expt. 5: All ECUs used priority queues, but the priority
nodes that have transmission deadlines between the ordering used was random.
maximum and minimum transmission deadlines of In each experiment we determined the lowest bus speed
messages in the FIFO group. This is illustrated in Figure 1, commensurate with a schedulable system. The minimum
where messages causing external priority inversion are bus speed was found by a binary search with the message
shaded in grey. priorities assigned according to the OPA-FP/FIFO algorithm
(Algorithm 2) using transmission deadline monotonic
PQ-msg1: E = 5
priority ordering as the reverse ordering for the initial list.
FIFO group1 PQ-msg2: E = 10 (For each FIFO group, only the message with the shortest
FQ-msg1: E = 10 Higher
FQ-msg2: E = 25 FQ-group1: EMIN = 10 priority transmission deadline was included in the initial list). Based
FQ-msg3: E = 100 on the priority ordering obtained, we analysed and simulated
PQ-msg3: E = 20
FIFO group2
the system assuming a 500 kBit/s bus. The simulated
FQ-msg4: E = 50
PQ-msg4: E = 50 network operating time was 1 hour. We used the
FQ-msg5: E = 100
FQ-msg6: E = 1000
FQ-group2: EMIN = 50 commercial simulator chronSIM from Inchron [10] to
FQ-msg7: E = 1000
PQ-msg5: E = 100
produce the simulation results.
FQ-msg8: E = 1000
There are four lines plotted on each of the graphs. The
PQ-msg6: E = 250 Lower
priority lines give the following information for each message:
PQ-msg7: E = 250 (i) transmission deadline;
PQ-msg8: E = 500 (ii) worst-case response time computed using the
analysis given in section 4.5, assuming a
Figure 1: TDMPO-FP/FIFO priority ordering 500 Kbit/s bus;
(iii) maximum observed response time found by
In Figure 1, observe that the messages within each simulation, assuming a 500 Kbit/s bus, and
FIFO group have their priorities assigned according to (iv) worst-case response time computed using the
transmission deadline monotonic priority assignment. We analysis given in section 4.5, assuming the
recommend this approach as although it does not alter the minimum schedulable bus speed for the
sufficient worst-case response times of the messages as configuration.
calculated by our analysis, in practice it could result in All of this data is plotted in ms on the y-axis using a
lower actual worst-case response times for those messages logarithmic scale. The x-axis on the graphs represents the
in the group that have shorter transmission deadlines. priority order of the messages. Hence data for the message
assigned the highest priority in a particular configuration
6. Case Study: Automotive appears on the LHS of the graph, while data for the lowest
To show that our priority assignment policies and
priority message appears on the RHS. Note the priority
order is different in each experiment.
Figure 3 depicts the results of Expt. 1, where all ECUs
used priority queues. In this case, the minimum bus speed
was 277 kBit/s, and the corresponding bus utilisation 84.5%.
We observe that with this bus speed, the 26th highest priority
message only just meets its deadline. Further, the results of
analysis and simulation for a 500 kBit/s bus are close
together. This is because the messages have no offsets, and
all of the ECUs used priority-based queues, hence there is
very little pessimism in the analysis, and the simulation
captures the worst-case scenario well.
Figure 4 depicts the results of Expt. 2, where ECU3 and
ECU6 used FIFO queues and the other ECUs used priority
queues. In this case, the minimum bus speed was 389 kBit/s,
and the corresponding bus utilisation 60.1%. Our analysis
attributes the same worst-case response time to all of the Figure 4: Response Times (FQ and PQ)
messages in a FIFO queue; this results in the horizontal
segments of the analysis lines in Figure 4. The first FIFO
queue is the 12 messages sent by ECU3, and the second, the
6 messages sent by ECU6. The minimum transmission
deadline for both FIFO queues was 13.8 ms. Observe that in
Figure 4 the results of analysis and simulation are close
together for the messages sent via priority queues, whereas
for the messages sent via FIFO queue there are larger gaps.
These gaps are predominantly due to the simulation not
capturing the worst-case scenario for all of the FIFO-queued
messages. This is evident from the variability of the
maximum response times obtained via simulation for
messages in the same FIFO group.
1600
5. PQ - Random Priorities
1. PQ (No FIFO nodes)
4. FQ (All FIFO nodes)
1400 4a. PQ (Priorities from 4.)
3. FQ and PQ (Four FIFO nodes)
1200 3a. PQ (Priorities from 3.)
5. PQ - Random Priorities 2. FQ and PQ (Two FIFO nodes)
2a. PQ (Priorities from 2.)
1000 1. PQ (No FIFO nodes)
4. FQ (All FIFO nodes)
Frequency
800
200
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95
Breakdown Utilisation
Figure 8: Frequency distribution of max. bus utilisation (8 nodes, 80 messages, 10,000 message sets)
1200
5. PQ - Random Priorities
4. FQ (All FIFO nodes)
1. PQ (No FIFO nodes)
4a. PQ (Priorities from 4.)
1000
3. FQ and PQ (Four FIFO nodes)
3a. PQ (Priorities from 3.)
2. FQ and PQ (Two FIFO nodes)
800 2a. PQ (Priorities from 2.)
5. PQ - Random Priorities 1. PQ (No FIFO nodes)
Frequency
200
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95
Breakdown Utilisation
Figure 9: Frequency distribution of max. bus utilisation (8 nodes, 40 messages, 10,000 message sets)
1000
5. PQ - Random Priorities
900 4. FQ (All FIFO nodes)
4a. PQ (Priorities from 4.) 1. PQ (No FIFO nodes)
800 3. FQ and PQ (Four FIFO nodes)
3a. PQ (Priorities from 3.)
700 2. FQ and PQ (Two FIFO nodes)
2a. PQ (Priorities from 2.)
600 1. PQ (No FIFO nodes)
Frequency
5. PQ - Random Priorities
500
4. FQ (All FIFO nodes) 2. FQ and PQ (Two FIFO
nodes)
400 3. FQ and PQ (Four FIFO
nodes)
300
200
100
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95
Breakdown Utilisation
Figure 10: Frequency distribution of max. bus utilisation (8 nodes, 20 messages, 10,000 message sets)