docs/diploma

changeset 180:d75bd7a72d8b

wrote about IPC, drawed picture of new arch
author meillo@marmaro.de
date Sat, 27 Dec 2008 19:25:06 +0100
parents 7596cdcfbc1e
children 5dc8ad30760e
files thesis/input/ipc-protocol.tex thesis/input/masqmail-arch-new.tex thesis/tex/4-MasqmailsFuture.tex
diffstat 3 files changed, 127 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/thesis/input/ipc-protocol.tex	Sat Dec 27 19:25:06 2008 +0100
     1.3 @@ -0,0 +1,19 @@
     1.4 +% ipc-protocol
     1.5 +
     1.6 +\begin{verbatim}
     1.7 +
     1.8 + +---+ connect  +---+  0  +---+ send  +---+  0  +---+
     1.9 + | B |--------->| W |---->|   |------>| W |---->| S |
    1.10 + +---+ attempt  +---+     +---+ data  +---+     +---+
    1.11 +                  |                     |
    1.12 +                  | 1                   | 1
    1.13 +                  V                     V
    1.14 +                +---+                 +---+
    1.15 +                | E |                 | E |
    1.16 +                +---+                 +---+
    1.17 +
    1.18 +B: begin
    1.19 +W: wait
    1.20 +E: error
    1.21 +S: success
    1.22 +\end{verbatim}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/thesis/input/masqmail-arch-new.tex	Sat Dec 27 19:25:06 2008 +0100
     2.3 @@ -0,0 +1,48 @@
     2.4 +% masqmail-arch-new
     2.5 +{
     2.6 +%\scriptsize
     2.7 +
     2.8 +% +----------+                                                                                 +------+
     2.9 +% | sendmail |-+                                                                            +->| pipe |
    2.10 +% +----------+ |                                                                            |  +------+
    2.11 +%              |                                                                            |
    2.12 +% +-------+    |  +----------+    ==========    +----------+    ==========    +-----------+ |  +------+
    2.13 +% | smtpd |----+->| queue-in |---> incoming --->| scanning |---> outgoing --->| queue-out |-+->| smtp |
    2.14 +% +-------+    |  +----------+    ==========    +----------+    ==========    +-----------+ |  +------+
    2.15 +%              .                                                                            .
    2.16 +%              .                                                                            .
    2.17 +
    2.18 +\begin{verbatim}
    2.19 +
    2.20 + +----------+
    2.21 + | sendmail |-+
    2.22 + +----------+ |
    2.23 +              |
    2.24 + +-------+    |  +----------+
    2.25 + | smtpd |----+->| queue-in |--+
    2.26 + +-------+    |  +----------+  |
    2.27 +              .                |
    2.28 +              .                V
    2.29 +                          ==========
    2.30 +                           incoming
    2.31 +                          ==========
    2.32 +                               |
    2.33 +                               V
    2.34 +                          +----------+
    2.35 +                          | scanning |
    2.36 +                          +----------+
    2.37 +                                |
    2.38 +                                V
    2.39 +                            ==========
    2.40 +                             outgoing               +------+
    2.41 +                            ==========           +->| pipe |
    2.42 +                                |                |  +------+
    2.43 +                                |                |
    2.44 +                                |  +-----------+ |  +------+
    2.45 +                                +->| queue-out |-+->| smtp |
    2.46 +                                   +-----------+ |  +------+
    2.47 +                                                 .
    2.48 +                                                 .
    2.49 +
    2.50 +\end{verbatim}
    2.51 +}
     3.1 --- a/thesis/tex/4-MasqmailsFuture.tex	Sat Dec 27 18:47:23 2008 +0100
     3.2 +++ b/thesis/tex/4-MasqmailsFuture.tex	Sat Dec 27 19:25:06 2008 +0100
     3.3 @@ -433,16 +433,75 @@
     3.4  
     3.5  
     3.6  
     3.7 -\subsection{Intermodule communication}
     3.8 +\subsection{Inter-module communication}
     3.9 +
    3.10 +Communication between modules is required to exchange data and status information. It is also called ``Inter-process communication'' (short: \NAME{IPC}), as modules are programs being part of a larger system, and processes are generally seen as programs in execution.
    3.11 +
    3.12 +The connections between \name{queue-in} and \name{scanning}, aswell as between \name{scanning} and \name{queue-out} is provided by the queues, only sending signals to trigger instant runs may be useful. Communication between receiving and transport modules and the outside world are done using the specific protocol they do handle.
    3.13 +
    3.14 +Left is only communication between the receiver modules and \name{queue-in}, and between \name{queue-out} and the transport modules. Data is exchanged done using \unix\ pipes and a simple protocol is used.
    3.15 +
    3.16 +\begin{figure}
    3.17 +	\begin{center}
    3.18 +		\input{input/ipc-protocol.tex}
    3.19 +	\end{center}
    3.20 +	\caption{State diagram of the protocol used for \NAME{IPC}}
    3.21 +	\label{fig:ipc-protocol}
    3.22 +\end{figure}
    3.23 +
    3.24 +% timing
    3.25 +One dialog consists of the four phases: connection attempt, acceptance reply, data transfer, success reply. The order is always the same. The connection attempt and data transfer are sent by the client process; replies are sent by the server process.
    3.26 +
    3.27 +% semantics
    3.28 +The connection attempt is simply opening the connection. This starts the dialog. A positive reply by the server leads to the data transfer, but a negative reply refuses the connection and resets both client and server to the state before the connection attempt. If the connection attempt was accepted, the client sends the data ending with a terminator sequence. When this terminator appears, the server process knows the complete data was transfered. The server process takes responsibility of the data in sending a positive success reply. A negative success reply resets both client and server to the state before the connection attempt.
    3.29 +
    3.30 +The data transfered needs to be of specific format. Used is the same format in which messages are spooled in the mail queues. See the following section for details. %fixme: check if it is the following section
    3.31 +
    3.32 +% syntax
    3.33 +Data transfer is done sending plain text data. %fixme: utf8 ?
    3.34 +The terminator sequence used to indicate the end of the data transfer is a single dot on a line on its own. Line separators are the combination of \name{New Line} and \name{Carriage Return}, as it is used in various Internet protocols like \SMTP. Replys are one-digit numbers with \texttt{0} meaning success and any other number (\texttt{1}--\texttt{9}) indicate failure. %fixme: is it NL-CR or CR-NL? What are the octal values?
    3.35 +
    3.36 +Figure \ref{fig:ipc-protocol} is a state diagram for the protocol.
    3.37  
    3.38  
    3.39  
    3.40  \subsection{Spool file format}
    3.41  
    3.42 +<< talk about fanf >>
    3.43 +
    3.44 +<< inode stuff of qmail >>
    3.45 +
    3.46 +<< keep it simple! >>
    3.47 +
    3.48 +\begin{verbatim}
    3.49 +s f /          envelope data
    3.50 +p i |          NL
    3.51 +o l |       /  header lines
    3.52 +o e |  mail |  NL
    3.53 +l   \       \  mail body
    3.54 +\end{verbatim}
    3.55 +
    3.56 +
    3.57  
    3.58  \subsection{Rights and permission}
    3.59  
    3.60 +setuid/setgid or not?
    3.61  
    3.62 +how many system users?
    3.63 +
    3.64 +what permission where?
    3.65 +
    3.66 +what can crash if an attacker succeeds?
    3.67 +
    3.68 +which process runs with what rights?
    3.69 +
    3.70 +where to drop privelege?
    3.71 +
    3.72 +how is which process invoked?
    3.73 +
    3.74 +master process? needed, or wanted?
    3.75 +
    3.76 +which are the daemon processes?
    3.77  
    3.78  
    3.79