A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CAN Fieldbus Controller Components

  • Upload
    sy-ron

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    1/8

    A Proposal Modification of CAN Protocol to Support a Dynamic Priority PolicyBeing Able to be Implemented on CAN Fieldbus Controller Components.

    S.HASNAOU1, A.BOUALLEGU EEcole Nationale dIng6nieurs de Tunis, Laboratoire LSTCltcoms / ENIT

    [email protected] [email protected], le Belv tdbe 1002 Tunis, Tunisie Fax: +2 16-1-872-729

    Abstract: CAN Industrial Local Area Networks, calledController Area Network, are used in the framework ofreal time distributed industrial applications. Suchapplications cover the drinking or used water adduction;the transportation and the distribution of electricity; thesystems of purification stations; the oil or gas fieldsexploitation; the automatons and robot systems inmanufactures; the distr ibuted processing systems, etc.The bit to bit arbitration of the CAN protocoldefines a static priority to messages exchanged. Thisstatic priority is more important that the identifierattributed to the exchanged object is lower. CANnetworks guarantee sufficiently short time latency and ithas been shown tha t these systems exceed in performancetoken-based networks. Nevertheless, When the offeredtraffic approaches the system nominal bandwidth, itresults a significant growth of transmission periods to anumber of stations, from there, excluding the CAN to bea real time network.We propose in this paper a dynamic prioritypolicy, based on the reserve bits expected by the protocoland on the needs expressed in necessary bandwidth,improving message transmission periods and reducingblocking probability to the higher identifier objects.CAN controller components constructors would have toallow the configuration of reserve bits so as to leave to theuser the choice of their utilization, even if, the CANprotocol does not anticipate a precise utilization at thepresent time.Keywords: Industrial Applications Real Time and NonReal Time Objects, CAN Protocol, Distributed queuespolicy, Communication systems performance.

    I . INTRODUCTIONAN networks support the CSMA/CA access techniqueC Carrier Multiple Sense Access/ Collision Avoidance),called also CSMA/CD with non-destructive arbitration NDA

    - Non Destructive Arbitration), in comparison withIEEE802.X standards, used on local area networks.The second performance in favor of CAN networks, inaddition to the not destructive arbitration, comes frommechanisms of error detection and processing. These

    mechanisms are not subject to emission-reception ofsupervision frames, as that been made for the other protocolsHDLC or LLC for example), but just to signaling in theknowledge field of the CAN protocol and automaticremissions of the same frames, if necessary to therecalcitrance of stations having exceeded the quota of 256errors.It has been also decided, for the purpose to insure a goodelasticity of the system, to use an addressing principle, notmore based on addresses of source and destination but basedon the content of the message itself.These characteristics insure a relative guarantee ofconstant latency time for transmission requests entering incompetition to access to the bus, giving place to CANnetworks to be adapted for the real time applications.Nevertheless, due to the fact of the bit to bitarbitration principle, the identifier defines a message of staticpriority during the access to the bus. This static priority ismore important that the identifier attributed to the exchangedobject is lower.The allocation of identifiers to transmitted objects isrealized out of order before applications are begun. For thisreason, the priority of each object is fixed and can not bechanged dynamically.The first met difficulty resides in the method ofidentifier allocation to exchanged objects, due to the fact ofthe lack of information timing for non periodic datatransmissions, what renders impossible to find a staticmanner to attribute CAN identifiers to exchanged objects sothat applications periods limit can be always satisfied.The second problem appears when the systembecomes overloaded temporarily, i.e. when the offered trafficapproaches the nominal bandwidth of the system; thefundamental CAN mechanism would prevent thetransmission of a unpredictable number of objects with highidentifiers. The significant increase of transmission delaysfor stations to raised identifiers excludes the CAN to be asystem adapted for real time applications.The third problem appears when one or manynetwork stations nodes) send data using the same identifier.All stations will get arbitration on the bus and start datatransmission. At some point, data will differ and generateerror. All stations will then back off and then retransmitrestarting the whole process. In this case, retransmission canlockup the network.

    0-7803-6401-5/00/ 10.00 2000 IEEE1129

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    2/8

    A reasonable approach is to allow to theapplicatipns to be capable to specify supplementarytransmission periods that can be tolerated when the generatedtraffic nears or exceeds temporarily the available bandwidthof the system.The performance of the communication system of thedifferent devices declines slowly when non-cyclic trafficincreases. This can be made by allowing the system tosustain classify several priority; the due performance declineto supplementary transmission delays would be the same forall objects that belong to the even classifies priority.

    2, TRAFFIC CLASSIFICATION OF INDUSTRIAL APPLICATIONSa) A range large of applications employed to control simplereal time systems base their operations on periodic requestsemit by a master unit to a totality of devices slaves) or ondata messages sent by detectors to a controller at regularintervals.In these sorts of systems, the timings implied in eachexchange of data are known in advance [ 6 ] .So, a pollingperiod is defined for each variable, which takes account theminimuT time elapsing between two any successiveexchanges of that variable.In such conditions, suitable techniques have beendeveloped to find a satisfactory way to attribute identifiers toexchanged objects, allowing all possible periods limits toapplications.b) Although it is very frequent, the scenario described aboveis not the alone possible. For example, in event drivensystems, the controlled devices are allowed to take theinitiative in the communication and to send their data to thecontroller asynchronously, when some events occur. Theminimum time, flowing out between any two subsequentexchanges of the same data, can be considerably more shortthan the effective polling period or flowing out between anytwo successive exchanges of the preceding case.Recently, also, real time distributed control systems,based on an operating system situated inside an aloneprocessQr and interconnected by a system of communication,typical CAN network, to distributed processors, bring animportarlt extension to parallel systems or distributedprocessing. Beyond to insure a simple data exchanges, theprocess have to be synchronized, i.e. that their executionshave to follow some logical intercorrelated sequences. Inthese sygtems, messages concerning the synchronization aregenerally short. Any process can create them in the system

    and have to be simultaneously receivers, to preserve theconsistepcy of a real time processing. The bursty ofexchanged messages depends on the type of the processedtask, on the average more short than the polling period.

    c) The formed squall traffic, where a short squall of data canbe followed by a long period of inactivity, is asupplementary communication example non-periodic.d) An other aspect that has to be held in account for asystem operating in an automated system is the non real timetraffic non - RT), implied in the teleprogramming, thetelediagnostic, and services of high level application. Theseoperations necessitate the exchange of a relevant sum of non-RT data through the system.

    Thus, three great categories can be distinguishedthis classification namely: the periodic traffic correspondingto the rubric a), the event driven traffic by squalls orsporadic corresponding to rubrics b) and c) and the non-RTtraffic corresponding to the rubric d).It is clear that the allocation of the higher priority class mustbe made for the category of the event driven traffic and thatthe lower priority class for the non-RT traffic. Thisclassification is in fact true to the reserve bits reserve left inthe definition of the CAN protocol CAN for ulteriorutilization.

    3. BASIC ND FULLAN CONTROLLERSThe two reserve r l and r2 bits appear in the basicand the full CAN, among the control field.The bit r l has been replaced by the bit IDE IDentifierExtension bit) for the compatibility with basic CAN CAN2.OA) frames.The RTR bit Remote Transmission Request) is equal to zeroin data frames and equal to one in the request frames andbelongs to the arbitration field. Data do n o t exist in a requestframe; the DLC Data Length Code) indicates in this case thenumber of bytes to return in a data frame. the node with thematching identifier will transmit the requested data frame.CAN Controller have practically equivalentstructures ex. PHILIPS, SIEMENS), schematized on thefigure 2[7] [8].The Bit Stream Processor BSP) is a sequencer controllingthe sequential data stream between the Tx/Rx register andthe memory, the processes of reception, arbitration,transmission and error signaling according to the CANprotocol.The memory capacity of the Siemens controller is 15positions of 15 bytes, each reserved for a message or anobject 15 objects at 15 bytes each), while that Philipscontroller is an 64 FIFO bytes.

    1130

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    3/8

    CAN 2.0A 0 RRData", CRC, ACKN, EOF11 bits identifier T r, r2 D E

    CAN 2.OBstandardFrame

    R IR E

    Data", CRC, ACKN,EOF11 bitsidentifier T D r2 DLC

    Fig. 1. CAN Frames Formatc)

    FullCAN2.OB

    Fig. 2 Bit Stream Processor (BSP) and CAN Controller memory

    S I R Data", CRC, ACKN, EOF0 1 1 bits identifier R D Extended 18 bits T rl r2 mR E identifier R

    In the first type, each new message would occupythe place that is reserved it. TO each message is associated atan interrupt level. If a higher priority interrupt lowernumber) occurs before the current interrupt is processed, thenew interrupt overrides the last one. This condition ofblockage is valid for all messages, excluding the one athigher priority.It ensues a risk of an overload of a messageby a new arriving, the same type.In the second type, the new messages will be put in a FIFOqueue. With the help of FIFO, the CPU is able to process onemessage while others messages are being received.After this traffic classification and a brief summary of CANcontrollers and their input/output components, like the BitStream Processor, we will expose firstly the real time andnon-real time applications models to be used in ourcalculation and performances analysis. We will expose amodification based on the reserve bits to leave a totallycompatibility with controllers and applications, designed towork in CAN networks.To improve access time and to reduce delays to CAN objectswith low static priority, we propose a second modification ofCAN controller architectures and we remark that the

    performances evaluated for the first case remain the same. inthe two cases, the reserve bits are not processed by theacceptance filters.

    CAN AddressGFig.3. Messages Storage in FIFOqueue PHILIPS typical CANControllers)

    1131

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    4/8

    4. REALTIMEAPPLICATIONSODELSTYPESData traffics mentioned above can be modeled byfiles M M n , M/G/n or M/D/n. Other models are to take intoaccount if these traffics are multimedia type, in the data andthe video transmission control of process by camera for

    example). The preceding classification of the traffics remainsalways valid. The change allocates the type of arrivals thatno longer will be Poisson type, but rather of the typicalMMPP Markov Modulated Poisson Process), MMDPMarkov Modulated Deterministic Process), etc.The first type is a blocking system, represented bythe model of the following figure 4.

    JNInvocation of narrivals interrupts

    Fig. 4. irth-death model, n interrupts in progress

    The state of the system of Fig.4 behaves statisticallylike a birth-death process, with arrival rate An birth process)and departure rate p, death) when n interrupts are invoked.The two state variable rates are given, respectively, by:

    O S n l Nh = (M - n)h 1 ) and p, = np 2) withThe state probability balance equation is given by:Solving equation (3) iteratively and applying the probabilitynormalization condition C n= 1 , one gets the probabilityp,of the number of invoked interrupts messages being to

    pn+l ~ + I = hn P n n (3).n

    n = O

    process): 4) with O S n S N and

    messages and the CPU treats one CAN interrupt demand andthe unconditional probability of arrival of messages. Also,Let T CA,,pn be the arrival rate averaged over allstates; and h Nbe the messages arrival rate when the systemis in state n=N [101.

    Nn=O

    The probability of loss is given by:M - ) -y

    PL = 5 ) .

    n =For N=l SIEMENS Controller) the probability of

    hP

    loss is given by: p - ( M - l ) p 6) ,with p=-.ForN=2- 1 + (M - 1)pthis probability of loss is given by:

    (M - 1XM - 2 ) ) n 26 bis).pPL = M - 1 M - 2 ) 2l + ( M - l ) P + ( )p

    The probability of message arrival p(a) multipliedby the probability pL hat a message, on arrival, finds thesystem blocked is equal the probability that the system isblocked pB multiplied by P N a ) that a message arriveswhen the system is blocked i.e. p L p ( a ) = p B p N ( a )lo][111, that implies that P L ( M )= pBM - ) 7); so theblocking probability equation 6) is given by:P g ( m ) = - mp m = M - 1 .1 + m pWe are going used the blocking probability to realizecomparisons when we introduce the dynamic priority that wepropose as follows : TABLE 1r t r 20 0 Priority Queue not used0 1 and/or bit rl = IDE = 01 0 Real time traffic1 1 Non real time traffic

    Traffic type

    M[= (M -n) nThe ratio of messages lost to the total number of messagesoffered in an observational interval provides an estimate ofthe probability of loss pL 9]. Let pN a) and p a ) berespectively the conditional probability that a messagearrives when the system is blocked i.e. no room for new

    5 . PROPOSAL MODIFICATIONFCAN PROTOCOL ANDPERFORMANCESNALYSISWe suggest, nevertheless, a minor modification ofI S 0 11519 and IS0 11898, relative respectively to CAN lowspeed and CAN high speed, manner to what the IDE bitwould take the value 1 instead of the value 0 in order that the

    1 1 3 2

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    5/8

    rl and r2 bits can be used in the arbitration field and not inthe control field but with meanings that we have givenhigher. This, possible, would allow to increase the arbitrationfield of to 31 bits, while distinguishing the real time of anormal traffic, defined by the transmitter unbeknownst of thereceiver. The rl and r2 bits do not return in the frames basispriority Basis ID) ; they have not consequently a directinfluence on the mastery of the bus by the correspondingstation. A blocking model wears in it even of gaps when thetraffic increases and that the number of interruptions or the

    capacity of the CPU are reduced. A model with simple FIFOqueueing priority is also limited when one has especially toprocess frames relative to an urgent event ex. fire).The queueing model with preemptive priority class,combination of models of the two controller types citedabove, will be therefore true to generated traffics namely thereal time traffic with blockage) and the non- real time trafficqueueing system). These traffics are modeled by the figure5 .

    Real Time message objects

    Processorc 12

    Tasks server Queue - CPU or CANControilerxtemal Queue- Non real-time message objects.located in CAN Controllers)

    Fig. 5 Combined RT and non -RT traffic model

    Not exist in FIFO pr ior i ty policy.

    hz

    i I .. ot exist in FIFO

    - 1 1 1 1h h h2

    Fig.6. State diagram for RT and Non-RT traffic model.

    1133

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    6/8

    The reason from these transitions is clear. A realtime frame arriving in an infinitesimal time with aprobability XIAt preempt, immediately a non-real time framein service, causing the system to moving from the state (03)to the state ( l j ) . On the other hand when the policy ofconsidered priority is FIFO, and if the system is in the statei =0 1 real time messages are blocked until depletion ofnon-real time messages that outstrip them. It is to tell that thesystem evolves the long of the axis of the j .In the two of priority policy, when a real time message hasbeen processed, it leaves the system with the rate p1nd thesystem balance equations are given hereafter.For the state i=O ;(9) ; for j = O andG-11 + h2)PIO= hlP,h 2 ~ 0 j - l +~ P O j+l PIPI j = t i 2 ~ 2h l ) ~ o j

    (8) ; P POI +PIPI0= h2 h1)Poo

    for j r l 10).For the state i=l ;~ 2 ~ ~ j . ~ + ~ ~ ~ o j = G L ~h 2 p l j for j r l 11).For the FIFO file and for j 2 1, terms of A, are absent frompreceding equations real time messages blocked). By using

    COthe notation p i = - i and Gi(z)=Z p i j z J , =O,l 12) withPi J=ocaC p ..= lGo(l)+G1(l)13) as being the measure of

    probability, we can determine the transition matrix P definedi , j

    1 . . j-1 j j + l l .0 Po0 POI . Poj-1 Poj Poj+lP I O . P1j-1 P lj .. . . .

    . . .By using the moment-generating functions Go(z) andG,(z) . We can find it by calculating ploand polaccordingto p o o ,by multiplying equations 10) and 11) by z J , bymaking the summation for all j 1 1 and by using equations

    1(15) with poo=--p2 16).For the FIFO queue :

    1+P,

    and

    We can now determine characteristic parameters ofour model namely the number and the residence time of non-RT messages in the system as well as the blockingprobability of RT messages.-Let E(j) = jpi =E poj+ PI )=GO(l)+ G;(1) 19) andfollowing LITTLE formula, h 2 E ( T )= E(j) i.e.

    i, j = O

    h2E(T$2=E(%2 20). This equation can written asfollows :

    PPQ :Preemptive Priority Queue)

    5. RESULTS A N D COMMENTSThe blocking probability, in this priority case, is given by:pE c p , =GI 1) = 1-19), 20) and 23) gives :

    - 23).The use of equations 6 ) ,j=1 1+Pl

    The messages have tendency to reside more byreport in case that the policy of considered priority is FIFO.However, the blocking probability is the smallest by reportto FIFO policy and with uniquely blocking policy. It is animprovement of performance for RT messages and a smalldegradation for non - RT messages.

    1134

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    7/8

    In the case where the traffic with blocking does not existcase the figure 3), the blocking probability is relative to thelimitation of the length of the FIFO file Fig.10).For the comparison of the different blockingprobabilities, we have chosen p2=0.5. The queue object ofthe figure 3 PHILIPS CAN controller for example) canlodge only to the maximum 4 messages N=4) of 13 byteseach, in accordance with CAN 2.OA ; its curve of blockingprobability constant represents the first extreme case wherethere is no distinction between real time and non-real timemessages. The second extreme case SIEMENS CANcontroller for example) does not take account stocking in afile and presents a blocking probability more important thanthe other policies schematized on the figure 10.The strategy of reception based on dynamicallocation of priority and this by utilization of the reserve bitssee table 1) represents a compromise, mainly when the realtime traffic is raised.A high degree of CAN controllers and applicationscompatibility is preserved. We believe that thesupplementary cost of hardware implementation processingof the reserve bits is not raised compared to performancesobtained when input buffers of the waiting queue of the CANcontrollers are limited and the traffic approaches the CANnetwork nominal bandwidth.The intervention on the reserve bits is notunfortunately, until now, possible on the CAN controllers.Constructors of CAN controllers components would have toallow the configuration of these bits so as to leave to the userthe choice of their utilization, even if, the CAN protocol doesnot anticipate a precise utilization at the present time.Nevertheless, the displacement of the two reservebits rl and r2 to head of the arbitration field becomesnecessary to resolve increase of temporary traffic orcongestion condition. In this case, reserve bits have a directinfluence on the mastery of the bus Fig.7). The modificationof CAN protocol is strongly more important than the firstcast. The acceptance filter and applications compatibility aretotally preserved. Although, in this case, a portion of CANcontroller architecture is not preserved, namely the BitStream Processor. I r1 I r2 I29 bits arbitration fieldvri vr2 29 bits arbitration field

    I _ Iew 31 bits arbitration field_ 29 bits + 2 Driority)

    The new 31 bits of arbitration field defines a VirtualObject Address VOA). The old object address and thepriority field are combined to form VOA. Priority defines aclass of sensor or actuator, relatively to the type of input andoutput signals. A mapping is specified at a source nodebetween class of service and VOA. Each network station candynamically changes its VOA but the acceptance filter usesuniquely the basis address.To have compatibility with access techniqueCSMNCA) and VOA defined here, the aboCe tablebecomes, when keeping two classes for real time and non-real time traffics, as follows:r r2 Traffic type0 0 Real time traffic0 1 Non-real time traffic1 0 Priority queue not used1 1 Priority queue not used

    TABLE 2

    The above analysis remains valid. Priority is, infact, processed by the network stations or node) whether ornot the two reserve bits r l and r 2 are in the head of thearbitration field.The supplementary cost of the hardwareimplementation processing of the reserve bits is moreimportant than the first case, when reserve bits remain in theactual location in the CAN protocol format, but not raisedcompared to performances obtained when congestion andbandwidth limit are gained.

    IP L 0.9

    0.80.71.6

    c. 0.51n-5g 0

    0.

    4 t l l w =8M: Arrivals PoissonProcess)N: Interrupts invocationsn i". I//

    U

    0 1 1.5S traffic intensityFig.8. Influence of number of interrupt requests onProbability of loss

    2

    Fig.7. Arbitration field with dynamic priority policy orVirtual Object Address

    1135

  • 8/12/2019 A Proposal Modification of CAN Protocol to Support a Dynamic Priority Policy Being Able to Be Implemented on CA

    8/8

    1oq.- 9c-E2 80-a,5 6C-C

    70-.

    High performancedegradationE(T)ppo >> E(T)FIFO -

    g.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 9Non Real Time traffic intensity pzFig.9 Proposed dynamic priority policy and FIFO Comparison

    Low performancedegradation.-.- 40-

    I I

    [3] S.HASNAOU1, A.BOUALLEGUE, Algorithmesdoptimisation demplacement dantennes, JTEA Septembre1988.[4] S.HASNAOU1, A.BOUALLEGUE, Implementation ofthe Synchronization for Wireless Modems and whoseTransmission Channel Presents Multipath Fading andCrosstalk, IMACS-CESA98.[ 5 ] S.HASNAOU1, A.BOUALLEGUE. Influence ofmultipath Fading on the implementation of an isolatedstation on a Web CAN - based Control Systems, IEEE int.Conf. IMTC99, Venice - Italy, 24-26, 1999.[6] Gianluca Cena, Andriano Valenzano. : An ImprovedCAN FieldBus for industrial Applications, IEEE Trans.Indus. Elect., Vol. 44, No.4, August 1997.[7] SIEMENS, 16 bit microcontrollers, users manual, V2.0,Mar 1996[8] PHILIPS, SJAlOOO Stand-alone CAN controller, DataSheet, Nov 1997.[9] B.KRAIMECHE, M.Schwartz, Analysis of traffic accesscontrol strategies in integrated service, IEEE Trans. OnComm., vol.COM 33, no.10, oct 1985, pp 1085-1093.[lo] M.Schwartz, Computer-Communication. Networkdesign and analysis, Prentice-Hall, Englwood Clifs, N.J.,1977.

    3c-0LL 20L\a 10-

    0.90.80.7

    g 0.62 0.5

    0.4C

    v 0.30i3 0.20.1

    .aL

    E(T)ppQ T)FIFO

    [ l l ] H. KOBAYASHI, Modeling and Analysis. Anintroduction to system performance evaluation methodology,Addison-Wesly, Reading Mass., 1978.[ 121 S.HASNAOU1, A.BOUALLEGUE. CAN Fieldbus forQuality Supervision Superseding the Computer System, 15thInt. Conf. CAD/CAM Robotics Factories of the Future,Brasilia, August 1999.

    0 0.5 1 1.5 2Real Time traffic intensity PIFig.10Blocking probability comparison

    6 . REFERENCES[11 U.Kiencke, Controller Area Network - From concept toreality -University Karlruhe, ICC 94 - CiA publications.[2] Dominique PARET, Le Bus CAN - de la thCorie B lapratique, Collection DUNOD, 1996

    1136