\begin{figure}
\begin{center}
-\includegraphics[width = 6.0in, height = 2.6in]{img/Logarch_part1.png}
-\end{center}
-\caption{}
-\end{figure}
-\begin{figure}
-\begin{center}
-\includegraphics[width = 4.5in, height = 1in]{img/Logarch_part2.png}
+\includegraphics[width = 6.6in, height = 2.0in]{img/Logarch.png}
\end{center}
\caption{}
\end{figure}
+
\subsection{BitTorrent Messages}
+\input{logarch/bt.tex}
\subsection{BitTorrent Clients Instrumentation}
\input{logarch/clients.tex}
-\subsection{Parser}
+\subsection{Parsers}
\input{logarch/parser.tex}
\subsection{Database}\label{database}
--- /dev/null
+
+The BitTorrent protocol defines the followingg messages, as described in \cite{bt}
+\begin{itemize}
+\item BT\_HANDSHAKE $<pstrlen><pstr><reserved><info_hash><peer_id>$ - first message transmited by the client as the initiator of a connection
+\item BT\_CHOKE $<len=0001><id=0>$
+\item BT\_UNCHOKE $<len=0001><id=1>$
+\item BT\_INTERESTED $<len=0001><id=2>$
+\item BT\_UNINTERESTED $<len=0001><id=3>$
+\item BT\_BITFIELD $<len=0001+X><id=5><bitfield>$ - The payload is a bitfield representing the pieces that have been successfully downloaded
+\item BT\_REQUEST $<len=0013><id=6><index><begin><length>$ - used to request a block
+\begin{itemize}
+\item index: integer specifying the zero-based piece index
+\item begin: integer specifying the zero-based byte offset within the piece
+\item length: integer specifying the requested length.
+\end{itemize}
+
+\item BT\_PIECE $<len=0009+X><id=7><index><begin><block>$
+\begin{itemize}
+\item index: integer specifying the zero-based piece index
+\item begin: integer specifying the zero-based byte offset within the piece
+\item block: block of data, which is a subset of the piece specified by index.
+\end{itemize}
+\item BT\_HAVE $<len=0005><id=4><piece index>$ - inform of having a certain piece
+\item BT\_CANCEL $<len=0013><id=8><index><begin><length>$ - used to cancel block requests
+\item BT\_KEEP\_ALIVE $<len=0000>$ - must be sent to maintain the connection alive if no command have been sent for a given amount of time
+\item BT\_PORT (DHT tracker) $<len=0003><id=9><listen-port>$
+\end{itemize}
+
+
+From the messages decribed above, the most important for future analysis are those related to choking, requesting, receiving
+and canceling pieces. They provide information about the behaviour of the certain peers, and might be useful also in predictions. Moreover, the performance details of the tested client can be retrived from inspecting the occurances of this messages.