HAL Id: inria-00266114
https://hal.inria.fr/inria-00266114
Submitted on 21 Mar 2008
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entic research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diusion de documents
scientiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
Fine Tuning MAC Level Protocols for Optimized
Real-Time QoS
Mathieu Grenier, Nicolas Navet
To cite this version:
Mathieu Grenier, Nicolas Navet. Fine Tuning MAC Level Protocols for Optimized Real-Time QoS.
IEEE Transactions on Industrial Informatics, Institute of Electrical and Electronics Engineers, 2008,
Industrial Communication Systems, 4 (1), pp.6-15. �10.1109/TII.2008.919017�. �inria-00266114�
IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, VOL. 4, NO. 1, FEBRUARY 2008 1
Fine-Tu ning MAC-Level Protocols for
Optimized R eal-Time QoS
Mathieu Grenier, Nicolas Navet
Abstract
In distributed real-time systems, meeting the real-time constraints is mandatory but the satisfaction
of other application-dependent cr iteria is most generally required as well. In particular, Networked
Control Systems (NCS) are known to be sensitive to communication delays such as frame response
time jitters. Well known Medium Access Control (MAC) algorithms such Non-Pre emptive Deadline
Monotonic (NP-DM) or Non -Preemptive Earliest Deadline First (NP-EDF) are efficient in terms of
bandwidth usage but they may perform poorly regarding other application dependent per formance
criteria. This paper highlights a class of on- line scheduling policies targeted at scheduling frames
at the MAC level, and provides a schedula bility analysis that is valid for all policies within the
considered class. As it will be shown, these alg orithms a re implementable on COTS compon ents
(e.g., Con troller Area Network controllers) and offer good trade-offs between feasibility and the
satisfaction of other application -dependent criteria such as the respon se time jitter.
Index Terms
Real time sy stems, control systems, communication systems, scheduling, protocols, field buses.
I. INTRODUCTION
Context of paper: In distributed real-time systems, the respect of timing constraint is a basic
requirement but other application-dependent criteria besides feasibility are of interest. For instance,
in Networked Control Systems (NCS), where the control system is distributed through a network,
messag e exchanges induce non-constant d elays in the control-loop, which affects the p erformance
and even the stability of the controlled system [1], [2], [3]. The frame scheduling algorithm at the
Medium Access Control (MAC) has a large influence on these delays an d thus, should be chosen
according to the a pplication’s performance requirements.
M. Grenier and N. Navet are with the INRI A Nancy-Grand Est laboratory, Campus S ci entifique - B.P. 239, 54506
Vandoeuvre-lès-Nancy, France (e-mail: {grenier, nnavet}@loria.fr).
IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, VOL. 4, NO. 1, FEBRUARY 2008 2
Problem definition: The prob le m is to devise MAC level scheduling algorithms that a re efficient
in terms o f bandwidth usage as well as for the satisfaction of application dependent criteria. Moreover,
as far as possible, these algorithms should be implementable on COTS hardware and induce small
overhead. In the following, we will consider that the MAC scheduling algorithm is implemented on
top of a priority bus, such a s CAN [4], [5], VAN [6] or J1850 [7]. Indeed, p riority buses have proven
to be effective in a real-time co ntext, and are widely available and used (see, for instanc e, [8] for
CAN timing analysis). In this study, the case where there are statically assigned CAN identifiers is
not addressed, how to extend the proposals in that direction is sketched out in the conclusion.
Related work : Many studies have been d evoted to find scheduling solutions that are well suited
to the application’s requirements, both for the scheduling of tasks (see [9] for an overview of the
studies in that line of research) and the scheduling of messages. In particular, efficient message
scheduling sche mes have been proposed in [10] and [11] to ensure fairness and bandwidth isola tion
between streams of messag es sent on a CAN bus, respectively with a centralized (i.e., a master node
has full control over the s cheduling) and decentralized scheme.
Other studies proposed solutions for implementing Non-Preemptive Earliest De adline First (NP-
EDF) in order to a chieve a higher network utilization rate while meeting timing constraints. This
is done on C A N in [12], [13], [14 ] with solutions wh ere de adlines are encoded on a logarithmic
time scale, which has been shown to minimize the priority inversions due to the limited number of
priority bits. In [15], a NP-EDF implementation is propos ed on top o f FTT-CAN while [16] addresses
the same problem when the application makes use of the standardized CAN applica tion layers CA L
CiA [17] and CANOpen [18].
Another scheme, published in [19], allows to reduce the response time jitter due to bit-stuffing
by introducing some restrictions on the priorities that can be allocated to the stream o f frames on a
CAN network. To achieve the same goal, the authors in [20], [21] propose a genetic algorithm to
adjust the initial offsets of messages in order to reduc e transmission jitter (same go al as [22] for the
uniprocessor case).
Overview of the approach: In this study, the problem addresse d is to efficiently grant access to
the network at the MAC level. The performance criteria are the schedulability of the systems and the
satisfaction of application dep endant criteria. The metho d can handle any criterion as long as there
is a way to evaluate the criterion value for all possible configurations. Here, since NCS is the focus
of the paper, the res ponse time jitter is the criterion of interest and it is evaluated by simulation. The
proposal is comprised of three distinct steps:
1) define the properties that a “good” MAC-level real-time sched uling policy must possess a nd
identify a sub-class, particularly p romising in terms of performances,
2) derive a sc hedulability an alysis for this sub-class class of scheduling policies and address the
IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, VOL. 4, NO. 1, FEBRUARY 2008 3
implementation issues,
3) explore the search space and find out the most efficient policies. Two cases can be distinguished .
The case where the policy has to be efficient on average (it can be used with different traffic
streams whose characteristics are a priori not known). An d, the case where the policy should
be fine tuned for a particular application.
Organisation of the paper: In se ction II, the computational model is stated. In section III, the
properties required from a “good” scheduling algorithm in the real-time context are exhibited. A mong
this set of “good” policies, the sub-class considered in the following is pre sented. In section IV, the
implementation issu es on top of the CAN priority bus are discussed. Section V is devoted to the
schedulability analysis. Finally, experiments showing the effectiveness of the propos al are summarized
in s ection VI.
II. NETWORK MODEL
This study deals with the scheduling of frames at the Medium Acce ss Control level; in particular
it is assumed that segmentation takes place in the upper layers of the communication stack. The
access to the bus is g ra nted b y an algorithm (e.g., priority based, token bus, etc.) that is termed the
scheduling policy in the res t of the paper.
A. Traffic stream mod el
A set F of m traffic streams is considered. Nod es, interconnected through a network, send the
streams. There may be several traffic streams sent b y the same node. Each traffic stream f
k
generates
and queues periodically frames, where f
k,n
denotes the n
th
frame of the traffic stream f
k
. By analogy
to the periodic task model used in CPU scheduling, a traffic strea m f
k
is characterized by a triple
(C
k
,
D
k
, T
k
) where C
k
is the worst-case transmission time of a frame belonging to the strea m, D
k
the
relative deadline (i.e. max imum tolerable d elay between the transmission re quest and the reception at
all receiving nodes), and T
k
the inter-arrival time between two instances of f
k
(as classically done,
sporadic streams can be handled by considering the minimum interarrival time as the period). The
release time of a frame f
k,n
is denoted by A
k,n
. For the sake of clarity, jitters in the availability dates
are not considered here but they are treated in technical report [9].
B. Feasibility and o ptimality
A concrete traffic stream (f
i
, A
i,1
) is a stream for which the release time of its first frame A
i,1
is
known b efore run-time while the release times of non-concrete streams are unknown. A concrete set
of traffic streams ω is said feasible (or schedulable) if no frame of the system is received after its
IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, VOL. 4, NO. 1, FEBRUARY 2008 4
absolute deadline D
k,n
= A
k,n
+
D
k
. A non-concrete set of traffic streams Ω is fea sible, if all the
concrete sets ω, which can be generated from Ω, are feasible.
A sc heduling policy is optimal with respect to a certain criterion (e.g. feasibility, average response
time) within its class if no other policy of the class performs better with respec t to the criterion.
In the following, optimal is used to mean optimal with respect to feasibility. A scheduling policy is
non-concrete optimal (with respe ct to feasibility) if it successfully schedules all the non-concrete s ets
that are schedulable with a policy of the class. As shown in [23], Non-Preemptive Earliest Dea dline
First (NP-EDF - smaller the absolute deadline, greater the priority) is non-co ncrete optimal within
the class of non-idling policy, where non-idling means that the network is not idle when there are
frames waiting for transmission.
C. Defining policies through priority function.
Priority functions are a convenient way of formally defining in a non-ambiguo us manner scheduling
policies, which to our best knowledge, was introduced for the first time in [24]. The priority function
Γ
k,n
(t) indicates the priority of a frame f
k,n
at time t . The network is allocated, at eac h time,
according to the Highest Priority First (HPF ) paradigm.
Function Γ
k,n
(t) takes its value from a totally ordered set P , which is chosen in [24] to be
the set of multi-dimensional IR-valued vectors P = {(p
1
, ..., p
n
) ∈ R
n
| n ∈ N} p rovided with
a lexicographical order. Between two vectors, coordinates are compared one by one starting from
the left, the first different coordinate decides the priority order with the convention “the smaller the
numerical value, the higher the priority”. For instance, Γ
i,j
(t) = (3, 4, 5) and Γ
k,n
(t) = (3, 4, 6)
implies that f
i,j
has a high er priority than f
k,n
at time t. Priority vectors of different sizes can be
compared with the same rule as above and the convention that a missing coordinate is the lowest
numerical value (e.g., Γ
i,j
(t) = (3, 4, 5) a nd Γ
k,n
(t) = (3, 4) means that f
k,n
has a high er priority
than f
i,j
at time t). Finally, two vectors are equal iff they have the same size and if the components
are equ al one by one. As it will be explained in section IV, on a p riority bus s uch as CAN, the
priority vector can be mapped to the priority coded in the Identifier field of the frames. This allows
to ta ke advantage of the “native” arbitration mechanism of the priority bus to perform the arbitration
according to the s cheduling policy de fined by the priority function Γ
k,n
(t).
Most real-time scheduling policies can be defi ned easily using priority functions. For insta nce, the
priority o f a frame f
k,n
under NP-EDF becomes:
Γ
NP −EDF
k,n
(t) =
(A
k,n
+
D
k
, k, n) if t < B
k,n
(−∞, k, n) if t ≥ B
k,n
(1)
where B
k,n
is the transmission beginning of f
k,n
(the last two coordina tes k, n are needed to