summaryrefslogtreecommitdiff
path: root/frameworks
diff options
context:
space:
mode:
authorManuel Traut <manut@linutronix.de>2009-06-23 19:27:09 +0100
committerManuel Traut <manut@linutronix.de>2009-06-23 19:27:09 +0100
commitcb5dfc68d3fb4c35295271814715d08820eb2f0a (patch)
treeac27497bdfc4a8fcd4fbcd1477eaf502e687e125 /frameworks
parent561ab506c46435031693d4f161690e6e83f586cd (diff)
middleware: added d-bus sections
Signed-off-by: Manuel Traut <manut@linutronix.de>
Diffstat (limited to 'frameworks')
-rw-r--r--frameworks/middleware/handout_middleware.tex173
-rw-r--r--frameworks/middleware/images/dbus-hal.pngbin0 -> 10529 bytes
-rw-r--r--frameworks/middleware/images/dbus.pngbin0 -> 78762 bytes
-rw-r--r--frameworks/middleware/images/qdbusviewer.pngbin0 -> 70408 bytes
-rw-r--r--frameworks/middleware/pres_middleware.tex71
5 files changed, 233 insertions, 11 deletions
diff --git a/frameworks/middleware/handout_middleware.tex b/frameworks/middleware/handout_middleware.tex
index f708883..c6e3145 100644
--- a/frameworks/middleware/handout_middleware.tex
+++ b/frameworks/middleware/handout_middleware.tex
@@ -1,5 +1,5 @@
\documentclass{lxarticle}
-\usepackage{german}
+\usepackage{english}
\usepackage[utf8]{inputenc}
\usepackage{lxheaders}
\usepackage{lxextras}
@@ -8,9 +8,162 @@
\section*{Middleware}
-\subsection*{DBUS}
+Distributed systems need to communicate with each other. Middleware assists the
+developer by delivering a communication framework. The developer doesn't need
+to care about protocols, datatype conversion, low level socket handling, \dots
-Text
+There are different kinds of middleware:
+
+\begin{description}
+\item[RPC] Remote Procedure Calls are used to trigger a function in e.g. Task\_A
+ calls a function of Task\_B
+\item[MOM] Message Orientated Middleware is used the send messages between Taks.
+(1:n and 1:1)
+\item[ORB] An Object Request Broker is used to host complete objects of an
+application in the broker. Other applications contact the broker; their object
+request is handled by the orb.
+\end{description}
+
+Also a middleware can provide different degrees of abstraction:
+
+\begin{itemize}
+\item Programming Language
+\item Operating System
+\item Communication Protocol
+\item Datatype conversions
+\item Localization of Services
+\end{itemize}
+
+\subsection*{D-Bus / Desktop Bus}
+
+D-Bus is designed for
+
+\begin{itemize}
+\item communication between application and operating system (system-bus)
+\item communication between desktop applications (session-bus)
+\end{itemize}
+
+and used by several Desktop Environments
+
+\begin{itemize}
+\item GNOME
+\item KDE4
+\item Enlightenment E17
+\item XFCE4
+\item \dots
+\end{itemize}
+
+also \cmd{HAL} host its hardware info at D-Bus.
+
+D-Bus is designed for local IPC only. It is a message based Middleware
+supporting 1:n publish/subscribe mechanism and 1:1 message passing. D-Bus has
+integrated datatype marschalling.
+
+\subsubsection*{Architecture}
+
+\begin{figure}
+\centering
+\includegraphics[width=0.8\textwidth]{images/dbus.png}
+\caption{D-Bus Architecture}
+\label{img:dbus}
+\end{figure}
+
+In the centre of the D-Bus architecture (Figure \ref{img:dbus}) is a
+\cmd{dbus-daemon}. Connections to the \cmd{dbus-daemon} are established by the
+help of the \cmd{dbus-library}. There are many language bindins for the
+\cmd{dbus-library}:
+
+\begin{itemize}
+\item C/C++
+\item JAVA
+\item Python
+\item Perl
+\item PHP
+\item Pascal
+\item Ruby
+\item Tcl
+\item Smalltalk
+\end{itemize}
+
+A higher level abstraction is served by integrating D-Bus into frameworks. If
+possible one of these libraries should be used:
+
+\begin{itemize}
+\item glib
+\item QT4 (QT3 backport exists)
+\item Mono
+\item e\_dbus (Enlightenment E17)
+\item .NET
+\end{itemize}
+
+\paragraph{Terminology}
+\begin{description}
+\item[bus address] is the name of ther underlying unix socket, e.g.
+ \cmd{/tmp/dbus\_lx.socket}
+\item[unique bus name] is generated by the daemon for every connection
+\item[well-known bus name] must be set by the user for a connection, multiple
+ names for one connection are allowed. A well known bus name has a namespace
+ and is seperated by dots, e.g. \cmd{de.linutronix.Foo}.
+\item[Object] Each Endpoint is called Object. An Object offers services on the
+ bus. A client can create multiple Objects.
+\item[Proxies] are used to access Objects. The use of Proxies and Objects are
+ defined by the language binding, to fit best in the schemantics of the
+ programming language.
+\item[Methods] may require input parameters. Each call returns its output
+ parameters or an exception if the action couldn't be performed.
+\item[Signals] are used for 1:n message passing. An application needs to be
+subscribed for a signal. A filter can be provided during subscription, to get
+only signals with certain values in its parameters.
+\item[AMI] Asynchronus Method Invocation can be used to make non blocking calls
+to Methods.
+\item[Activation] A config file can provide the information which objects are
+ hosted by an application. The dbus daemon is able, to activate those
+ applications on request or by invoking a method of an object in the context
+ of the clients well-known bus name.
+\end{description}
+
+\begin{figure}
+\centering
+\includegraphics[width=0.8\textwidth]{images/dbus-hal.png}
+\caption{D-Bus Use-Case: NetworkManager}
+\label{img:dbus-hal}
+\end{figure}
+
+Figure \ref{img:dbus-hal} shows a typical D-Bus use-case. The
+HAL\footnote{Hardware Abstraction Layer} daemon is connected with the Linux
+kernel by the Device interfaces. Objects and Methods which represent the
+hardware of the device running the Linux kernel are hosted on the D-Bus system
+message bus by HAL. The NetworkManager user daemon and the NetworkManager daemon
+are also connected to the D-Bus system bus. The NM\footnote{NetworkManager}
+user daemon is getting the Network Settings from the User via config file or
+NM Applet and sends it to the D-Bus system bus. The NM daemon listens for the
+messages from the NM user daemon and configures the networking stack via system
+calls.
+
+\subsubsection*{Tools}
+
+\paragraph{qdbusviewer}
+is a tool to browse through the hosted objects and call any method. (Figure
+\ref{img:qdbusviewer})
+
+\begin{figure}
+\centering
+\includegraphics[width=0.8\textwidth]{images/qdbusviewer.png}
+\caption{qdbusviewer}
+\label{img:qdbusviewer}
+\end{figure}
+
+\subsubsection*{Conclusion}
+
+D-Bus is good for accessing System Infos and for IPC of Desktop Applications.
+Its small API has bindings for all common languages and frameworks and is easy
+to learn.
+
+On the other hand D-Bus is limited on local IPC. Applications hosted on other
+machines cannot be reached via D-Bus. Also there are no QoS features integrated,
+to guarantee any real-time behaviour. There is even no message ordering. There
+is no guarantee which method returns first, if two methods are invoked around
+the same time.
\subsection*{CORBA}
@@ -62,9 +215,19 @@ systems. The framework can be 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.
-\subsection*{\"Ubungen}
+\subsubsection{Conclusion}
+
+CORBA offers a wide variety of middleware communication methods. There is no
+limitation for a communication between different operating systems, even the
+network protocols can be exchanged. CORBA provides a Real-time extension.
+
+On the other hand, the framework is complex and difficult to learn.
+
+\subsection*{Exercises}
+
+\subsubsection*{ACE/TAO RTCORBA ping-pong}
-\subsection*{Quellen}
+\subsubsection*{D-Bus GLib bindings ping-pong}
\begin{thebibliography}{9}%use this if you have <=9 bib refs
%\begin{thebibliography}{99}%use this if you have >9 bib refs
diff --git a/frameworks/middleware/images/dbus-hal.png b/frameworks/middleware/images/dbus-hal.png
new file mode 100644
index 0000000..12ffe37
--- /dev/null
+++ b/frameworks/middleware/images/dbus-hal.png
Binary files differ
diff --git a/frameworks/middleware/images/dbus.png b/frameworks/middleware/images/dbus.png
new file mode 100644
index 0000000..5cb84a9
--- /dev/null
+++ b/frameworks/middleware/images/dbus.png
Binary files differ
diff --git a/frameworks/middleware/images/qdbusviewer.png b/frameworks/middleware/images/qdbusviewer.png
new file mode 100644
index 0000000..a8fbb0b
--- /dev/null
+++ b/frameworks/middleware/images/qdbusviewer.png
Binary files differ
diff --git a/frameworks/middleware/pres_middleware.tex b/frameworks/middleware/pres_middleware.tex
index 4ceb79b..fbb6131 100644
--- a/frameworks/middleware/pres_middleware.tex
+++ b/frameworks/middleware/pres_middleware.tex
@@ -33,6 +33,65 @@
\maketitle
+\section{DBUS}
+
+\begin{frame}
+\frametitle{DBUS Communication Framework}
+\begin{block}{Facts}
+\begin{itemize}
+\item used by GNOME, KDE4, E17, XFCE4, HAL, \dots
+\item for message based local IPC
+\item provides 1:1 - 1:n message passing
+\end{itemize}
+\end{block}
+\end{frame}
+
+\begin{frame}
+\frametitle{DBUS Communication Framework}
+\begin{block}{Language Support}
+\begin{itemize}
+\item C / C++
+\item JAVA
+\item Python
+\item Perl
+\item PHP
+\item Pascal
+\item Ruby
+\item Smalltalk
+\item Tcl
+\end{itemize}
+\end{block}
+\end{frame}
+
+\begin{frame}
+\frametitle{DBUS Communication Framework}
+\begin{block}{Framework Support}
+\begin{itemize}
+\item QT4 (and QT3 backport)
+\item glib
+\item mono
+\item e\_dbus (Enlightenment, E17)
+\item .NET
+\end{itemize}
+\end{block}
+\end{frame}
+
+\begin{frame}
+\frametitle{Functional Principle}
+\begin{center}
+\includegraphics[height=0.8\textheight]{images/dbus.png}
+\end{center}
+Source: http://dbus.freedesktop.org
+\end{frame}
+
+\begin{frame}
+\frametitle{Desktop Integration}
+\begin{center}
+\includegraphics[height=0.8\textheight]{images/dbus-hal.png}
+\end{center}
+Source: http://www.redhat.com
+\end{frame}
+
\section{CORBA}
\begin{frame}
@@ -47,14 +106,14 @@
\end{frame}
\begin{frame}
-\frametitle{Functional principle}
+\frametitle{Functional Principle}
\begin{center}
\includegraphics[height=0.8\textheight]{images/orb.jpg}
\end{center}
\end{frame}
\begin{frame}
-\frametitle{Functional principle}
+\frametitle{Functional Principle}
\begin{block}{CORBA Services}
\begin{itemize}
\item Naming Service
@@ -73,7 +132,7 @@
\end{frame}
\begin{frame}
-\frametitle{Real-time CORBA extensions}
+\frametitle{Real-time CORBA Extensions}
\begin{center}
\includegraphics[height=0.7\textheight]{images/rtcorbaext.jpg}
\end{center}
@@ -82,10 +141,10 @@
\end{raggedright}
\end{frame}
-\subsection{ACE/TAO framework}
+\subsection{ACE/TAO Framework}
\begin{frame}
-\frametitle{Software architecture}
+\frametitle{ACE/TAO Software Architecture}
\begin{center}
\includegraphics[height=0.7\textheight]{./images/ace.jpg}
\end{center}
@@ -95,7 +154,7 @@
\end{frame}
\begin{frame}
-\frametitle{TAO, real-time CORBA distribution}
+\frametitle{TAO, Real-time CORBA Distribution}
\begin{block}{Facts}
\begin{itemize}
\item c++ implementation