Distributed Hard Real-time Systems with

Time-Triggered Protocol

And Controller Area Network Protocol

v Time-Triggered vs. Event-Triggered

¨  Time-Triggered

¨  Typically implemented using non-preemptive static cyclic scheduling

¨  Event-Triggered

¨  Typically implemented using preemptive priority-based scheduling

¨  Static Scheduling

¨  Dynamic Scheduling

¨  Interrupt driven

¨  An Event creates an interrupt and a response to an interrupt is invoked to service it

¨  The right approach is selected depending on the application and the hardware platform

¨  Time-Driven (Clock-Driven) Systems

¨  Processes are time-triggered

¨  Event-Driven (Priority-Driven) Systems

¨  Processes are event-triggered

¨  Weighted (Priority) Round-Robin Systems

¨  Multi-Cluster Systems

¨  Some processes are time-triggered and some event-triggered

§  Distributed system architecture

§  Static and Dynamic communications with Time Triggered and Event-Triggered processes sharing the same bus!

v Hardware Platform

¨  Several connected networks connected via gateway nodes

¨  Each network can have it’s own protocols

¨  Hardware components (processing nodes) can be of different types

¨  Nodes consist of Communication controller (bridge), CPU, RAM, ROM, I/O interface to sensors and actuators

v Time-Triggered Protocol (TTP)

¨  Developed at Vienna University of Technology and meets FAA standard DO 178B Level A, used on Boeing 787 and Airbus 380

¨  Used for safety critical applications

¨  Designed for distributed real-time applications with predictability and reliability requirement

¨  Provides services needed for Fault-Tolerant Real-Time processing

¨  Full hand-shack (ACK) messaging

¨  Deterministic and low latency

¨  Clock Synchronization down to a microseconds

¨  Broadcast communications

¨  Uses Time-Division Multiple Access (TDMA) bus access

¨  Each node can only send messages during it’s predetermined TDMA slot

§  One or multiple messages, packaged into the node’s message frame can be sent during each TDMA slot by the slot node owner

¨  Sequence and length of each slot is equal every cycle

§  Length of each message frame can be different from cycle to cycle but must always be less than the slot size

¨  Communications with the CPU is performed independent of the CPU cycles and via Message Base Interface (MBI)

§  Usually implemented via dual-ported RAM

¨  TDMA access scheme imposed by message descriptor located in TTP controller

§  Message descriptor list (MEDL) contains:

·  Time when Frame is to be sent or received (schedule table)
·  Frame address
·  Frame size

¨  TTP architecture relies on a replicated TTP bus

¨  Every message is replicated by the Bus Guardian

¨  Bus Guardian monitors access pattern to the bus and terminates any node controller operation if it violates timing access pattern

¨  Therefore a timing violation will not result in message transmission at incorrect time, hence will not impact operation of other system nodes

¨  TTP Controller provides CPUs with a timer interrupt

¨  Local CPU clocks are synchronized with the TTP timer, which is the global system clock

¨  A distributed clock synchronization algorithm is used for TTP which does not rely on a central time server

¨  Systems using TTP can be implemented in Bus or Star network topologies

¨  TTP communications tolerates a single node fault

¨  Tolerance of a single arbitrary node failure is ensured by Triple Modular Redundancy voting scheme used in TTP

¨  A Bus Guardian guaranties that a faulty node cannot prevent correct nodes from exchanging data and that a node can only send once in a TDMA round

¨  Each node in the network maintains a membership list of all good nodes in the cluster

¨  Data transmission Cyclic Redundancy Check and transmitted data reflect local view of receiving nodes on all other nodes

¨  On each message transmission, the transmitting node seeks acknowledgment from other nodes to determine if message was received and accepted by the receiver

¨  If message was not received and accepted by the receiver, re-transmission of the state message is done in the next cycle

v Controller Area Network (CAN) Protocol

§ Priority serial bus with collision avoidance

¨  Priority based bus

¨  Frame with highest priority wins contention on the bus and is transmitted

¨  Unique frame priorities are in the frame ID (Arbitration bit field) at the start of the frame

v Time-Driven Systems

¨  Messages transmitted using a time-driven communications protocol like TTP

¨  Process scheduling is static and cyclic

¨  Processors (nodes) have real-time OS kernel

¨  Schedule table is part of the system node kernel

¨  Worst case OS system call overhead must be deterministic and known

¨  No interrupts in the system other than timer interrupts

¨  Polling for I/O

¨  Each process has it’s own mapped memory locations for out going and incoming messages

¨  Processes are activated according to the schedule table

¨  If two processes are within the same node, the completed processes message is copied from it’s memory to the memory of the next process to activate

¨  If two processes are within different nodes, at the scheduled time, message is sent from one node to the other by placing message on the TTP controller and into the an MBI frame

¨  TTP controller broadcasts message by placing the frame in the right slot on the bus

¨  Message is picked up from the slot by the receiving node TTP Controller and placed in the process memory address

v Event-Driven Systems

¨  Priority preemptive scheduling

¨  Event trigger protocol such as CAN bus

¨  Event driven scheduler built into the RT-Kernel decides what process is activated when based on the process priority and state

¨  Messages transmitted between processes within the same node are passed through common objects

¨  Message transmitted from one node to another is placed on the RT-Kernel’s queue and then MBI

¨  Message passing may employ the TTP just as Time-driven systems

v Multi-Cluster Systems

¨  Several clusters connected via gateways

¨  Cluster is a group of nodes sharing a broadcast communication channel

¨  Time-triggered cluster

¨  Event-triggered cluster

¨  Gateways are responsible for real-time routing of inter cluster messages

¨  Real-time kernel is used on each node to activate processes and perform message passing

12