From 373925d2cf64914fa1aadd48387711277260d09f Mon Sep 17 00:00:00 2001 From: Adriana Draghici Date: Mon, 8 Feb 2010 17:23:25 +0200 Subject: [PATCH] report - clients instrumentation --- report/logarch/clients.tex | 54 +++++++++++++++++++++++++++++++++----- report/report.bib | 9 +++++++ 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/report/logarch/clients.tex b/report/logarch/clients.tex index 021c1ac..144573a 100644 --- a/report/logarch/clients.tex +++ b/report/logarch/clients.tex @@ -3,13 +3,55 @@ The experiments prior to our research evaluated the performances of several BitT which in the comparison proved to be the fastest solution, and \textbf{Tribler}. Libtorrent, developed by Rasterbar \cite{libt2} \cite{libt1}, is a C++ library that implements BitTorrent protocol and -its extensions. It aims to be cpu and memory efficient, easy to use and suitable for many enivornments and platforms. +its extensions. It aims to be CPU and memory efficient, easy to use and suitable for many environments and platforms. Due to its high performance it is used by many BitTorrent applications, like FireTorrent, Deluge, qBitTorrent, SharkTorrent, -Miro and Hrktorrent \cite{hrk}, the one we chosed to work with. Hrktorrent is a lightweight torrent client written in C++ and it was appropriate for our testing infrastructure because it offered a command line interface. +Miro and Hrktorrent \cite{hrk}, the one we chose to work with. Hrktorrent is a lightweight torrent client written in C++ and it was appropriate for our testing infrastructure because it offered a command line interface. -%[todo : ce versiuni de libtorrent si hrktorrent folosim?] -%[todo : sa spun ca folosim CLI interface] +Tribler \cite{tribler}, developed at the Delft University of Technology, is a BitTorrent client written in Python, aimed to enhance the user experience by offering features like online video streaming and content search. Unlike hrktorrent, Tribler is a GUI oriented client, as well providing a command line interface. It also represents a key technology in the P2P-Next project +because it allows watching BitTorrent-hosted peer-to-peer digital media distribution of video on demand and plays live Tribler streaming media \cite{tribler_wiki}. -While libtorrent provided large amounts of output that could be directly used as an example for our parsing system, +%[todo : ce versiuni de libtorrent si hrktorrent folosim?] + +In what concerns logging, libtorrent/hrktorrent provided extensive logging information\cite{rdeval}, proving after the comparison experiments large amounts of output that could be directly used as an example for our parsing system. Tribler did not offer any logging information. Therefore, we dedicated part of our research time to -modifing Tribler source code in order to obtain the necessary logs. \ No newline at end of file +modifying Tribler source code (version 5.1.2) in order to obtain the necessary logs. + +\subsubsection{Changes in Tribler source code} + + +When talking about logs, we differentiate between two categories: status logs and verbose logs. + +\textbf{Status logs} contain information about current file transfers, like download/upload speed, eta (estimated time of arrival). This information is given by the Tribler's core classes, that deal with connections, download, upload. +The command line interface mode is implemented by the file \textit{Tools/cmdlined.py}. In its original form, its does not output all the information need for status messages, lacking timestamp, number of peers and eta. It was modified to write the necessary information in a file. Additionally, \textit{Core/APIImplementation/SingleDownload.py} file now writes status information like file path, torrent name at the start-up/end of a file download. + +\textbf{Verbose data} consists of information about BitTorrent protocol messages exchanged between peers during transfers. The sources +dealing with protocol implementation are located in the \textit{Core/} directory of the Tribler code, and lack in documentation, comments. After identifying the files that need to be modified several bash scripts were created in order to automate the process of changing them. These scripts are as follows: + +\begin{enumerate} +\item modify\_all\_print.sh - add time and date information in all \textit{print} instructions, in all the source files. +\item print\_timestamp.sh - add time and date information in all \textit{print} instructions, in the files listed in a file given as argument. +\item set\_DEBUG.sh - sets DEBUG flag to a given value, in the files listed in file given as argument. +\item set\_DEBUG\_NORMAL.sh - sets DEBUG\_NORMAL flag to a given value, in the files listed in file given as argument. +\item modify\_Connecter.sh - redirect print instructions to stderr in \textit{Core/BitTornado/BT1/Connecter.py} +\item make\_changes.sh - uses the above described scripts to make all the necessary changes +\item undo\_changes.sh - uses the above described scripts to undo all the changes made, except the redirection of prints in \textit{Connecter.py} +\end{enumerate} + +In addition to these scripts, two ASCII files contain the list of files to be modified, each file on a separate line. + +\begin{itemize} + \item modified\_files\_DEBUG + \item modified\_files\_DEBUG\_NORMAL +\end{itemize} + +Almost all the source files contain the DEBUG flag that is set to True when print statements are enables, false otherwise. +All the prints statements for verbose information output it to stderr, while all status information is written to a status file, +\textit{status\_msg.log}. Unlike libtorrent, which kept separate log files for each peer, Tribler verbose logs are kept +in one file. + +The modified Tribler code and the scripts can be found in \cite{repo}. + + + + + diff --git a/report/report.bib b/report/report.bib index 832838e..87bb007 100644 --- a/report/report.bib +++ b/report/report.bib @@ -12,3 +12,12 @@ @misc{hrk, title = {http://50hz.ws/hrktorrent/} } +@misc{tribler, + title = {http://www.tribler.org/trac/wiki} +} +@misc{tribler_wiki, + title = {http://en.wikipedia.org/wiki/Tribler} +} +@misc{repo, +title={http://koala.cs.pub.ro/git/?p=cs-p2p-next.git/.git;a=tree;f=tribler-mod;h=d8516ffa338b44dcb3d6c83b9d498481c4415eb9;hb=HEAD} +} -- 2.20.1