%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% paper.tex = template for real-time Linux workshop papers
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{multicol}
\usepackage{listings}
\usepackage{epsfig}
\newcounter{figcounter}
\def\epsin #1#2#3#4{
	\refstepcounter{figcounter} \label{#3}
	\[
	\mbox{
		\epsfxsize=#2mm
		\epsffile{./img/#1.eps}
	}
	\]
	\begin{center}
		\parbox{7cm}{{\bf FIGURE \arabic{figcounter}:}\quad {\it #4 } } \\
	\end{center}
}

\setlength{\paperheight}{297mm}
\setlength{\paperwidth}{210mm}
\setlength{\voffset}{-12mm}
\setlength{\topmargin}{0mm}
\setlength{\headsep}{8mm}
\setlength{\headheight}{10mm}
\setlength{\textheight}{235mm}
\setlength{\hoffset}{-4mm}
\setlength{\textwidth}{166mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\marginparwidth}{0mm}
\setlength{\marginparpush}{0mm}
\setlength{\columnsep}{6mm}
\setlength{\parindent}{6mm}

%% insert eps pictures
%% use as \epsin{epsfile}{width_in_mm}{label}{caption}

%% insert table
%% use as \tabin{size_in_mm}{label}{caption}{table_data}
\newcounter{tabcounter}
\def\tabin #1#2#3#4{
\refstepcounter{tabcounter} \label{#2}
\[ \makebox[#1mm][c]{#4} \]
%\vspace{0mm}
\begin{center}
  \parbox{7cm}{{\bf TABLE \arabic{tabcounter}:}\quad {\it #3 } } \\
\end{center}
}

\title{\LARGE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TITLE OF PAPER (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Real-Time CORBA performance on Linux-RT\_PREEMPT
}

\author{\large
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% AUTHOR (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\bf Manuel Traut }\\ 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% AFFILIATION (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Linutronix GmbH\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% STREET ADDRESS (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Auf dem Berg 3, 88690 Uhldingen, Germany\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% E-MAIL (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
manut$@$linutronix.de \\
\vspace{8mm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% AUTHOR (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{\bf Li Su}\\ 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% AFFILIATION (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%CASC Long March Launch Vehicle Technology CO. LTD\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% STREET ADDRESS (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%7 Building, 15 Block, NO.188 West Road, the forth South Round, BeiJing\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% E-MAIL (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%sudanlina$@$yahoo.com.cn \\
}
\date{}


\begin{document}

\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ABSTRACT (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{abstract}
Automation technology lacks an established platform independent, high-level, object oriented real-time capable communication standard, which is based on standard Ethernet hardware and drivers. ACE/TAO is an Open Source implementation of the OMG Real-Time CORBA Specification and might fill this gap. It is designed platform independent, implemented in C++ and provides a standardized communication framework. Real-Time CORBA is already used in industrial environments, e.g. aircraft, naval equipment and others. This paper explains the basics of the ACE/TAO framework and its usage in industrial communication. On the basis of a real-world example - transmission of an 1 KiB data frame - two communication methods are evaluated: the RT-CORBA Remote Procedure Call and the TAO Real-Time Event-Channel. The performance measurement methods are explained in detail. Measurement results under various system loads and a comparison of ACE/TAO on top of a vanilla Linux kernel and a RT\_PREEMPT enabled Linux kernel provide a meaningful insight in the capabilities of RT-CORBA. Finally, the paper provides an analysis of functionality which needs to be improved in the operating system to provide real deterministic communication through a standardized framework.
\end{abstract}

\vspace{10mm}

\begin{multicols}{2}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% SECTION (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}

Currently communication in automation is mainly realized with a huge number of different fieldbuses. However since 2005 there is an increasing trend, for using ethernet based communication methods. Another trend is, using PCs and software for simulating PLCs. But why not combine these two trends, to control machines in real-time with object-orientated middleware? The infrastructure is already given\dots

\subsection{CORBA}
CORBA is a Middleware, which allows RPC\footnote{Remote Procedure Call}-based IPC\footnote{Inter Process Communication} between different operating systems and different programming languages (Figure 1).
\epsin{orb}{80}{fig1:f1}{CORBA Architecture}
The communication interfaces are defined in IDL\footnote{Interface Definition Language}. The IDL files are compiled into, e.g. c++, java, \dots, code which does the (de)serialization of the datatypes. The interface implementations (CORBA objects) are registered at language specific ORB\footnote{Object Request Broker}s. Each CORBA process owns one ORB, which handles the function requests and returns the calculated values.

\subsection{real-time CORBA}
\epsin{rtcorbaext}{80}{fig1:f2}{Real-time CORBA}
As shown in figure 2, a real-time capable ORB extends a standard ORB with the following features: locating objects in constant time, preallocation of resources, operating system independent priority handling, priority based scheduling.

\subsection{ACE/TAO}
ACE is an open-source c++ framework for platform-independent system- and network-programming. TAO is a real-time CORBA implementation build on top of ACE (Figure 3).

\epsin{ace}{80}{fig1:f3}{ACE/TAO framework}

The ACE/TAO package is available for all important operating systems. The hole framework is trimmed for embedded systems: Each application described in this paper consumes less than 1 MByte of RAM. Also the consumed CPU time is suprisingly low.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NEXT SECTION (OPTIONAL)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Performance Measurements}

The measurements were made on embedded systems (Intel Mobile CPU 600 MHz, 512 MB RAM, Intel e100 NIC) with digital I/0 ports. A square-pulse generator is connected with the digital input on the first embedded system (sender) and channel 1 of the oscilloscope. The digital outputs of the embedded systems 2 and 3 (receivers) are connected with channel 2 and 3 of the oscilloscope.

\epsin{versuch1}{80}{fig1:f4}{Measurement environment}

\subsection{RPC}

Each receiver hosts an object, for writting values to its digital output:

\begin{lstlisting}
module benchmark{
  interface Put{
    void Port( in short portNo, 
               in short value   );
  };
};
\end{lstlisting}

The \textit{Port} function is called by the \textit{sender} as soon as the state of one of its digital inputs changes. The real end to end latency is meassured with the oscilloscope.

\epsin{sequenzV1}{80}{fig1:f5}{RPC measurement: sequence diagramm}

To simulate the transmission of bigger process data images, a parameter \textit{in string data} was added to the \textit{Port} function. The string was read in from a text file, so his length, could be changed after compile time, by editing the text file.

For testing the priorization based scheduling, the following interface was added:

\begin{lstlisting}
  interface Data{
    void Send(in string data);
  };
\end{lstlisting}

Each time \textit{Send} was called, the Receiver did a calculation of faculty(100). The \textit{Data} interface was hosted with lower priority, then the Put interface.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% SUB SECTION (OPTIONAL)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{TAO real-time Event-Channel}

The TAO real-time Event-Channel is a CORBA Messaging Service. Suppliers are sending messages to the Messaging Service. A client can subscribe for messages at the Messaging Service.

As soon as the value of the digital input of the Supplier changes, the new value of the digital input port is send to the Messaging Service. The Messaging Service sends this value, to all subscribed clients. A client writes the values from the messages, to their digital output.

\epsin{sequenzV2}{80}{fig1:f6}{Event-Channel measurement: sequence diagramm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NEXT SECTION (OPTIONAL)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Needed operating system functionalities}


\section{Conclusion}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% REFERNCES (REQUIRED)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{thebibliography}{9}%use this if you have <=9 bib refs
%\begin{thebibliography}{99}%use this if you have >9 bib refs
\bibitem{book1},{\it PCI 9656BA Data Book Version 1.0},2003, PLX Technology, Inc.
\bibitem {book2},{\it RTLinux3.1 Getting Started with RTLinux},2001, {\sc FSM Labs, Inc.}
\bibitem {paper1},{\it Advanced filesystem implementer��s guide, introducing XFS}, Daniel Robbins,01 Jan 2002,{\sc Gentoo Technologies��Inc.}
\bibitem {paper2},{\it http://www.realtimelinuxfoundation.org/home.html}
\bibitem {paper3},{\it http://compreviews.about.com/od/storage/l/aaRAIDPage1.htm}
\end{thebibliography}

\end{multicols}
\end{document}
