% path model design

\subsection{Tree structure}

The Section~\ref{sec:cloud_infrastructure} shows all the possible pattern of traffic and where the packets flow inside the cloud infrastructure.
The \textit{Path model} has the purpose to represent these flows into an high level view.

First of all, the representation of the nodes involved into packet forwarding process is defined. These points comes out from the previous Della Chiesa infrastructure analysis. The result is a Tree data structure view of the deployment.
The nodes into a tree structure are divided into tree types:
\begin{itemize}
	\item
	root element
	\item
	leaf element
	\item
	intermediate element
\end{itemize}

Each forwarding point is mapped into one of these categories, all the physical servers and the virtual switches are labeled as \textit{intermediate} elements, because they are neither the source or the destination of the traffic.
The \textit{leaf} element are defined both as Virtual Machines and Services, because they are the basic element that could generate traffic or the one which receives packets. The \textit{root} element is fake, there is no item which could be mapped with it, but it represent the possibility to reach each node directly, instead of passing through another intermediate element.
\pagebreak

\subsection{Forwarding models}

From this starting point, the ``Path model'' pulls out a set of ``submodels'' which are useful to describe the forwarding role into the tree structure, based on the traffic path. This models are defined in the Appendix \ref{cap:pathModels}, each one with the description of how the traffic flows into them and with a graphic representation.

The definition of these models allow mapping in the following schema all the entities at stake:

\begin{itemize}
	\item 
	virtual machines: they could be mapped as A, B, C or D model;
	\item
	virtual switches: they could be mapped as all the model from E to L model;
	\item
	 physical servers: they could be mapped as E and F model.
\end{itemize}

To achieve the goal to find all the filtering points for each traffic path, it is necessary to find an algorithm to explore the structure represented in the Figure \ref{fig:tree_model}.
This could be a very expensive computational task to be done, if standard graphs exploring algorithms are used to seek from which node the traffic starts and on which nodes the traffic lends.\newline 

To improve computing performance and to have an efficient search, the tree nodes has additional informations about what nodes are above them and what nodes are children of them.\newline

The path model exploits the concept of ``Condition Clause'', taken from the \textit{TORSEC} work during the development of \textit{policy tool library}, which is used here as a formal representation of an identifier for leaf elements.

\subsection{UML representation}

The UML diagram class depicted in this Figure \ref{fig:tree_model} is a formal representation of a tree structure, in which the main attributes and methods are highlighted.\newline
This classes allows to:

\begin{itemize}
	\item
	efficiently find a node in the deployment structure without a big effort in computational power;
	\item
	effective realize an exploration of the nodes that are crossed by a specific traffic pattern.
\end{itemize}

The relationships described between the UML-classes are an important aspect, because they described the association structure and the direction of it.
\clearpage

\paragraph{UML class diagram}
$ $\\
\newline
The diagram depicted below shows the Tree data structure representing the physical and virtual topology with pruning information and the main methods.

\hfill
\begin{figure}[H]
	\hfill
	\begin{center}
		\begin{tikzpicture}
		
		\umlclass[]{root}{
			child-Condtion : \texttt{list<ConditionClause>}\\
		}{
			\umlvirt{hasChildCondtion(c : ConditionClause) : boolean}
		}
	
		\umlclass[y=-6]{intermediate}{
			child-destinations : \texttt{list<ConditionClause>}\\
			father-destinations : \texttt{list<ConditionClause>}
		}{
			\umlvirt{hasChildCondtionB(c : ConditionClause) : boolean}\\
			\umlvirt{hasFatherCondtionB(c : ConditionClause) : boolean}
		}
		
		\umlclass[y=-12]{leaf}{
			services : Service \\
			father-destinations : \texttt{list<ConditionClause>}
		}{
			\umlvirt{hasFatherCondtionB(c : ConditionClause) : boolean}
		}
		
		\umluniassoc[geometry=-|, arg1=father, mult1=1, pos1=1.9, arg2=children, mult2=*, pos2=1.3]{root}{intermediate}
		\umluniassoc[geometry=-|, arg1=father, mult1=1, pos1=1.9, arg2=children, mult2=*, pos2=1.38]{intermediate}{leaf}
		\umluniassoc[arg=children, mult=1..*, pos=0.8, angle1=0, angle2=-18.5, loopsize=3.5cm]{intermediate}{intermediate}
		\umluniassoc[arg=children, mult=1..*, pos=0.8, angle1=180, angle2=198.5, loopsize=3cm, color=white]{intermediate}{intermediate}
		
		\end{tikzpicture}
	\end{center}
	\caption{Tree model representation.
	\label{fig:tree_model}}
\end{figure}
