Markov Chain-Based Performance Evaluation of Flexray Dynamic Segment
Total Page:16
File Type:pdf, Size:1020Kb
Markov Chain-based Performance Evaluation of FlexRay Dynamic Segment Jimmy Jessen Nielsen Hans-Peter Schwefel Amen Hamdan Aalborg University, Department of Electronic Systems BMW Car IT GmbH Fredrik Bajers Vej 7, DK-9220, Aalborg Petuelring 116, D-80809, München {jjni03, hps}@kom.aau.dk [email protected] Abstract Besides providing strict determinism, the FlexRay pro- tocol supports priority based media access in the dynamic With the launch of the new BMW X5, the FlexRay proto- segment via a Flexible Time Division Multiple Access col for in-car communication has found its way to series- (FTDMA) scheme. The properties of the FTDMA scheme produced vehicles. The FlexRay protocol supports both is discussed in [2]. The flexibility provided by this media deterministic and non-deterministic transmission of data access scheme allows frames to be displaced and thus de- frames. FlexRay data frames that are being transmitted in layed in adverse situations. This dynamism combined with the non-deterministic dynamic segment might become dis- the increasing number of applications motivates the need placed under adverse circumstances. In the design of a for quantitative performance evaluation of the network. FlexRay network it is important to have sound understand- The Byteflight protocol is nearly identical in function- ing of any implications of certain design decisions on the ality to the FlexRay dynamic segment as it is also based on performance of the overall network, here specifically the FTDMA. The authors in [3] present an analysis of the Byte- displacements in the dynamic segment. flight protocol, where they investigate the performance- This paper proposes a novel approach to performance related consequences of different design choices. Particu- analysis of the dynamic segment based on Markov chain larly, they identify that network designers need to make a transient analysis. The model of the dynamic segment is trade-off between flexibility and performance. This issue a two-dimensional discrete-time Markov chain, where the applies similarly to the FlexRay dynamic segment, and is discrete time steps represent minislots of the dynamic seg- discussed further in Section 2. Currently available tools for ment. Model properties and assumptions are discussed and performance evaluation of specific FlexRay traffic models expressions for calculating performance metrics are pro- focus on simulation. Simulation tools such as [8] and [7] vided. Finally, measurements obtained from a real FlexRay may be used to make a quantitative performance analysis, network are used to test model assumptions and to validate by defining the traffic model using virtual traffic generators. the accuracy of model output. However, the process of obtaining a sufficient level of con- fidence with a simulation is typically very time-consuming Keywords - flexray, in-car networks, dynamic segment, compared to analytical approaches. markov chain, transient analysis, performance analysis This paper presents an approach to performance assess- ment of the dynamic segment in FlexRay that is based on 1 Introduction transient analysis of a Markov Chain (MC). This perfor- mance assessment is less time-consuming than simulation The increasing number of x-by-wire applications in cars and can be made prior to implementing a simulation or pro- entails that requirements on safety and hard real-time of the totype. in-car network are becoming more strict [4]. Protocols such Specifically, this paper contributes to the literature by 1) as Byteflight and FlexRay, where FlexRay is a recent exten- demonstrating how the FlexRay communication cycle can sion of Byteflight, have been developed and used for satis- be modeled as a MC, 2) specifying how performance met- fying the requirements of x-by-wire applications. The first rics are extracted from MC model, and 3) validating the re- series car to use a FlexRay in-car network is the new BMW sults obtained from the model by comparing to measure- X5, which has recently been introduced by BMW Group. ments from an actual FlexRay network. In near future FlexRay is expected to connect multiple Elec- In Section 2 a brief description of the relevant FlexRay tronic Control Units (ECUs) implementing chassis, power- properties is given and the main motivation for the model is train, and driver assistance applications [6]. presented. Next, the FlexRay model is discussed and pre- 1 sented in Section 3. The following Section 4 specifies how mitted in each communication cycle varies, it may occur performance metrics are calculated from the model. Section that a frame cannot be successfully transmitted within the 5 presents a validation of the model based on measurements available minislots. In that case the frame will not be from an actual FlexRay network. Finally, Section 6 contains transmitted in the current communication cycle. Instead the conclusion of this paper. the frame is displaced to a later communication cycle with enough available minislots. More specifically, a frame is 2 FlexRay Dynamic Segment displaced if the minislot counter exceeds the threshold pLat- estTx that is configured in each FlexRay node. pLatestTx is the last minislot in which the node can successfully transmit The following gives a brief introduction to FlexRay and a frame with the maximum allowed frame size. especially the dynamic segment, which is the focus of this Displacements may occur even with a low number of paper. More information on FlexRay is available in [5]. used dynamic slots. If for example the communication cy- In FlexRay the communication cycle is the fundamental cle is configured for a length of 250 minislots, and a frame element of the media access scheme. The communication has a frame ID of 230 and takes up 5 minislots to transmit, cycle is divided into four segments as depicted in Fig. 1. no more than 15 earlier minislots may be included in frame transmissions in a communication cycle, before the frame cannot be transmitted and is displaced. In order to reduce the number of displacements, the FlexRay network designer should aim at using as low frame Figure 1. The FlexRay communication cycle. IDs as possible. However, this is typically inappropriate with respect to compatibility and upgradability. The de- Within a communication cycle, ECUs may transmit signer therefore needs to determine a configuration of the frames in the static and dynamic segments. At design-time network that provides an acceptable trade-off between flex- an ECU has been assigned one or more slot IDs in which it ibility and performance. Besides displacements, other as- may transmit. Each slot ID is only used by one ECU, and in pects of performance could be relevant to consider. In this this way collisions will never occur. In the static segment, paper the last dynamic slot is also calculated. where a Time Division Multiple Access (TDMA) scheme The modeling approach proposed in this paper provides is used, the transmission of frames is completely determin- the network designer with a tool for making quantitative istic. The dynamic segment uses a dynamic mini-slotting performance evaluation of different network configurations scheme, also generally referred to as FTDMA. This scheme and traffic models in order to rapidly iterate over the design is not deterministic since the offset from the beginning of of the network. a communication cycle until an ECU may transmit, varies with the number of frames already sent in the same com- 3 FlexRay Model munication cycle. Fig. 2 exemplifies the concept of this scheme. In this section the approach to modeling the dynamic An unused dynamic slot has the duration of one minis- segment is described in detail. The performance metrics lot, which is the common time unit in a FlexRay network, described in the following are the desired outputs from the and the length of the communication cycle is a fixed num- model. ber of minislots. If a dynamic slot is used for transmitting a frame, the duration of the dynamic slot is extended to sev- Last Dynamic Slot (LDS) distribution: The LDS is the eral minislots, depending on the payload size of the frame. value of the dynamic slot counter at the end of a commu- This is exemplified for dynamic slots m + 3 and m + 6 in nication cycle. The more minislots that have been used for the figure. Every ECU maintains a local counter of both the transmitting frames, the lower the value of the LDS. The current minislot ID and the current dynamic slot ID. Both network designer may use the LDS as an indicator of the are reset at the beginning of each cycle. level of utilization and as an indication of which frames dynamic slot could not have been transmitted in the communication cy- counter cle. If the LDS has a lower slot ID than the ID used by a m m+1 m+2frame ID m+3 m+4 m+5frame ID m+6 m+7 nn+1 n+2n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11 n+12 n+13 n+14 ... certain ECU, that ECU could have had a frame scheduled minislot counter minislot for transmission that it was not allowed to transmit in the corresponding communication cycle. Figure 2. Dynamic minislotting scheme. Frame displacement probability: The objective of this Since the payload length and the number of frames trans- metric is to quantify the risk of frame displacements for a specific frame ID. The network designer may use this met- The validity of these simplifying assumptions is discussed ric to determine the quality of service in relation to displace- further in Section 5. ments that the network delivers for a given configuration. 3.2 Detailed Model De¯nition 3.1 Model Framework The model is based on a non-homogenous MC us- The following description of the FlexRay model assumes ing a two-dimensional state space (a; b).