From 6d528e6588b9c04e153cfa9b02a5092113342aba Mon Sep 17 00:00:00 2001 From: Refik Hadzialic Date: Fri, 21 Oct 2011 15:22:34 +0200 Subject: Report writing --- notFinishedCode/Report/test.log | 89 ++++++++++++++++----------------- notFinishedCode/Report/test.pdf | Bin 1465260 -> 1466208 bytes notFinishedCode/Report/test.tex | 29 ++++++----- notFinishedCode/Report/test.tex.backup | 9 ++-- notFinishedCode/Report/test.tex~ | 6 ++- 5 files changed, 71 insertions(+), 62 deletions(-) diff --git a/notFinishedCode/Report/test.log b/notFinishedCode/Report/test.log index 1e34c1a..1bdd313 100644 --- a/notFinishedCode/Report/test.log +++ b/notFinishedCode/Report/test.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2011.9.27) 21 OCT 2011 15:03 +This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2011.9.27) 21 OCT 2011 15:22 entering extended mode %&-line parsing enabled. **test.tex @@ -321,89 +321,88 @@ File: test_Use_case.png Graphic file (type png) File: DBRelationship.png Graphic file (type png) -[8 <./DBRelationship.png (PNG copy)>] - +LaTeX Font Info: Try loading font information for T1+cmtt on input line 164. + + +(/usr/share/texmf-texlive/tex/latex/base/t1cmtt.fd +File: t1cmtt.fd 1999/05/25 v2.5h Standard LaTeX font definitions +) [8 <./DBRelationship.png (PNG copy)>] File: activityControllerEdited.png Graphic file (type png) - + File: classDiagram.png Graphic file (type png) - + File: dbClass.png Graphic file (type png) [9 <./activityControllerEdited.png> <./classDiagram.png (PNG copy)>] - + File: serialPort.png Graphic file (type png) [10 <./dbClass.png (PNG copy)>] LaTeX Font Info: External font `cmex10' loaded for size -(Font) <9> on input line 203. +(Font) <9> on input line 206. LaTeX Font Info: External font `cmex10' loaded for size -(Font) <5> on input line 203. +(Font) <5> on input line 206. - + File: serverClass.png Graphic file (type png) - + File: ClientClass.png Graphic file (type png) -[11 <./serialPort.png (PNG copy)>] +[11 <./serialPort.png (PNG copy)>] File: ping.png Graphic file (type png) - + File: logging.png Graphic file (type png) [12 <./serverClass.png (PNG copy)> <./ClientClass.png (PNG co py)>] [13 <./ping.png (PNG copy)> <./logging.png (PNG copy)>] - + File: bb.jpg Graphic file (type jpg) [14 <./bb.jpg>] [15] - + File: protocolCommunicationHandler.png Graphic file (type png) - File: protocolCommunicationcControllerReceiver.png Graphic file (type png) - + File: protocolCommunicationcControllerCaller.png Graphic file (type png) [16 <./protocolCommunicationHandler.png (PNG copy)> <./protocolCommunicationcContr ollerReceiver.png (PNG copy)> <./protocolCommunicationcControllerCaller.png (PN G copy)>] [17] - + File: sshTunnel.png Graphic file (type png) [18 <./sshTunnel.png (PNG copy)>] [19] [20] -LaTeX Font Info: Try loading font information for OMS+cmr on input line 485. +LaTeX Font Info: Try loading font information for OMS+cmr on input line 488. (/usr/share/texmf-texlive/tex/latex/base/omscmr.fd File: omscmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions ) LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <9> not available -(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 485. +(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 488. [21] [22] [23] LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10.95> not available -(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 557. +(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 560. - + File: resultsImage.png Graphic file (type png) -[24 <./resultsImage.png (PNG copy)>] [25] [26] -LaTeX Font Info: Try loading font information for T1+cmtt on input line 587. - - -(/usr/share/texmf-texlive/tex/latex/base/t1cmtt.fd -File: t1cmtt.fd 1999/05/25 v2.5h Standard LaTeX font definitions -) -AED: lastpage setting LastPage [27] (./test.aux) ) +[24 <./resultsImage.png (PNG copy)>] [25] [26] AED: lastpage setting LastPage +[27] (./test.aux) ) Here is how much of TeX's memory you used: 4948 strings out of 495061 68792 string characters out of 1182621 @@ -412,23 +411,23 @@ Here is how much of TeX's memory you used: 17720 words of font info for 42 fonts, out of 3000000 for 9000 28 hyphenation exceptions out of 8191 36i,11n,45p,760b,1679s stack positions out of 5000i,500n,10000p,200000b,50000s - -Output written on test.pdf (27 pages, 1465260 bytes). + + +Output written on test.pdf (27 pages, 1466208 bytes). PDF statistics: - 678 PDF objects out of 1000 (max. 8388607) + 679 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) 96 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/notFinishedCode/Report/test.pdf b/notFinishedCode/Report/test.pdf index b3d1148..8fa87ed 100644 Binary files a/notFinishedCode/Report/test.pdf and b/notFinishedCode/Report/test.pdf differ diff --git a/notFinishedCode/Report/test.tex b/notFinishedCode/Report/test.tex index a94d03d..d3409a4 100644 --- a/notFinishedCode/Report/test.tex +++ b/notFinishedCode/Report/test.tex @@ -160,7 +160,10 @@ The key point in the design of our database was the simplicity and speed of acce \caption[]{Database relationship diagram} \end{figure} \par The \emph{PingResultTable} has six attributes (\emph{taskNo, sipServer, sipGate, unisip, gsmBox1, gsmBox2}), all of integer type. -The \emph{taskNo} attribute identifies the test number but not a single test (e.g. an operator user has selected three different tests to be executed, all of the three tests will have the same \emph{taskNo} to identify them together as belonging to the same test group). \emph{taskNo} is the primary and unique key in the table \emph{PingResultTable}. +The \emph{taskNo} attribute identifies the test number but not a single test (e.g. an operator user has selected three different tests to be executed, all of the three tests will have the same \emph{taskNo} to identify them together as belonging to one test group and \emph{taskId} identifies each single test and will be explained later). +\emph{sipServer} represents the Asterisk server ping result. \emph{sipGate} is used to represent the SIP Gate server for the landline calls (\url{http://www.sipgate.de}). \emph{uniSip} represents the ping results for our local University telephone network SIP server. +\emph{gsmBox1} and \emph{gsmBox2} are the two single-chip Linux computers (BeagleBoard), that controll two cell phones each one (i.e. they are also known under the name of \emph{nanoBTSx}). +\emph{taskNo} is the primary and unique key in the table \emph{PingResultTable}. Rest of the attributes (i.e. \emph{sipServer, sipGate, uniSip, gsmBox1, gsmBox2}) are used to insert the ping results, if the assigned servers are reachable or not. \newpage \section{Software design} % section 2.1 \begin{figure}[ht!] @@ -195,17 +198,17 @@ our first approach was inferior and slower. The state controlled method connecte \caption[]{GSM class diagram for controlling the cell phones} \end{figure} One can easily apply the class just by correctly defining the parameters: port address, baud rate and timeout. The former two are self-explanatory and the timeout parameter is used to define when the alarm function should raise a timeout exception. -A timeout exception gets raised when the cell phone does not respond (i.e. when the cell phone enters a deadlock or delayed state.) We had used the serial port library inside of Python although we use USB cables to connect to our cell phones. One should +A timeout exception gets raised when the cell phone does not respond (i.e. when the cell phone enters a deadlock or delayed state). We had used the serial port library inside of Python although we use USB cables to connect to our cell phones. One should be aware that our USB cables create a virtual serial port. More details on class design and an example can be found on our project wiki \cite{wiki}. \subsection{Client and Server class} Our socket communication code is based on the example given in the Python socket manual \cite{socket}. We extended it into two classes, a client and a server class. We had used the TCP protocol to base our two classes on\footnote{TCP is reliable compared to UDP (i.e. transmitted packets get also delivered), -packets are ordered when received and data are received in a stream (i.e. multiple packets can be read at once.)}. +packets are ordered when received and data are received in a stream (i.e. multiple packets can be read at once).}. The Server class can be seen in the following figure. The server class is implemented to accept only local connections\footnote{More details are given in the section 7.1}. -First we determine our IP address and then create the socket to listen only for the same IP address (with a different IP address than the selected one a connection cannot be even established.) +First we determine our IP address and then create the socket to listen only for the same IP address (with a different IP address than the selected one a connection cannot be even established). One has to define the port on which the server object should listen. When receiving data one can easily define the timeout to be raised if data are not received in the timeout range or set it to \emph{0} to infinitely wait for the buffer to be filled with received data. While testing the server class we had the problem to listen on the same port if the application was forcibly\footnote{Manually closed using CTRL+C and run again.} restarted in less than 60 seconds. We got the error message: \emph{"Address already in use"}. -This is not known as error behavior but rather an option to help the server to catch lost live packets (i.e. packets that are still in the network looking for it is goal destination.) +This is not known as error behavior but rather an option to help the server to catch lost live packets (i.e. packets that are still in the network looking for it is goal destination). We solved the problem by changing the socket options with the \emph{SO\_REUSEADDR} parameter. This enabled us to get around the error when we tried to restart our server application. Before solving the problem without using the socket parameter, we had another solution to get around this problem by killing the application running the port, this old method is obsolete now. \begin{figure}[ht!] @@ -213,7 +216,7 @@ Before solving the problem without using the socket parameter, we had another so \includegraphics[scale=0.8]{serverClass.png} \caption[]{Server class, used by the server application} \end{figure} -In the process of testing the client class we did not have any major problems. The only major flow we had to debug was when one of the sides disconnects that we get out of the waiting loop if the timeout variable was set to \emph{0} (i.e. infinite waiting loop.) +In the process of testing the client class we did not have any major problems. The only major flow we had to debug was when one of the sides disconnects that we get out of the waiting loop if the timeout variable was set to \emph{0} (i.e. infinite waiting loop). The client class can be seen in the following figure. To initialize the client object one needs to define the IP address and the port of the server application listening on it. \begin{figure}[hb!] \centering @@ -350,12 +353,12 @@ of receiving corresponding message. Otherwise it enters the exit state and then \section{Security and safety of the system} Safety and security of the software plays a major role in our project. It is of vital importance that only as few as possible people have access to our test system since the resulting data could be exploited to plan an attack -(e.g. assume the University alarm system uses the SIP gateway to connect to the outside world and to alarm the police, if one knows that the SIP gateway is not working properly, a burglar could plan to rob the University building just at that moment.) Therefore the choice to go Open Source is justified due to the fact that one should know how every single detail of the system works. +(e.g. assume the University alarm system uses the SIP gateway to connect to the outside world and to alarm the police, if one knows that the SIP gateway is not working properly, a burglar could plan to rob the University building just at that moment). Therefore the choice to go Open Source is justified due to the fact that one should know how every single detail of the system works. All the time, while we were working on the project, we were made aware of this issue by Denis and Konrad. -We decided to use asymmetric key cryptography, where each side has two keys (private and public.) In the next sections we will explain in more details how we applied the methods. +We decided to use asymmetric key cryptography, where each side has two keys (private and public). In the next sections we will explain in more details how we applied the methods. \subsection{Encryption of the communication channels} At first we thought to encrypt the data before sending them but since none of us was an expert on encryption standards the idea was rejected. Alongside the fact that none of us had been an expert in the field of cryptography, we were neither experts in the field of Internet programming. One could find maybe a way to disable our server software with various hacking methods (e.g. -trying to open the port until the system runs out of memory and in our case the system which we used on the handler side was a BeagleBoard with ARM architecture running on a single chip TI OMAP processor, refer to the picture in figure 1.) +trying to open the port until the system runs out of memory and in our case the system which we used on the handler side was a BeagleBoard with ARM architecture running on a single chip TI OMAP processor, refer to the picture in figure). We had to eliminate even the slightest possible threat in return for spending more time for debugging the test software system. Despite we were aware of all these facts, we had to choose one of the plenty implemented encryption standards on Linux. Denis and Konrad suggested using the SSH Tunneling method. @@ -365,7 +368,7 @@ Denis and Konrad suggested using the SSH Tunneling method. \caption[]{SSH Tunnel, all the communication inside the tunnel is encrypted } \end{figure} -Using the SSH Tunnel port forwarding method we could hide the real port we had used for our socket connection. On the other hand we could force the socket to accept only local connections (i.e. from the machine where the handler software was running.) +Using the SSH Tunnel port forwarding method we could hide the real port we had used for our socket connection. On the other hand we could force the socket to accept only local connections (i.e. from the machine where the handler software was running). The SSH Tunnel port forwarding method creates an encrypted tunnel between the two computers and then it creates two ports, one on the local and remote computer. All the data sent through the port on the local machine appear on the port at the remote machine. \newline The first problem we faced was that SSH required the username and password every time we tried to make an SSH connection. We could avoid this problem by copying the public key from our server (where our test software runs) to the BeagleBoard \cite{sshTunnel}. This can be performed by executing the following commands in the terminal shell. One has to create first the private and public keys on the local machine(i.e. server computer, where the test software runs): @@ -427,7 +430,7 @@ like country, state, organization name and etc which we had to enter to resume. openssl req -new -key server.key -out server.csr \end{lstlisting} \par In the next step we had to sign the certificate signing request and enter the amount of days for how long it should be valid. -In our case we entered the duration of one year, one can make it for longer periods as well (i.e. the amount of 365 has to be changed.) +In our case we entered the duration of one year, one can make it for longer periods as well (i.e. the amount of 365 has to be changed). \begin{lstlisting} openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt \end{lstlisting} @@ -466,7 +469,7 @@ refik@ubuntu:/etc/apache2/sites-available$ sudo cp default-ssl default-ssl_origi refik@ubuntu:/etc/apache2/sites-available$ sudo vim default-ssl \end{lstlisting} \par Only the beginning of the file is listed here and we have modified the line starting with \emph{DocumentRoot} -from \emph{DocumentRoot /var/www} to \emph{DocumentRoot /var/www-ssl} (i.e. we had to redefine the location of our SSL directory.) +from \emph{DocumentRoot /var/www} to \emph{DocumentRoot /var/www-ssl} (i.e. we had to redefine the location of our SSL directory). \begin{lstlisting} @@ -530,7 +533,7 @@ Since we used the Open Source platform to base our project on, it was certain we The dynamic parts of the web site were programmed using PHP and JavaScript. The GUI was done using CSS. The web site opens TCP/IP sessions between itself and the Python test software. Due reasons explained in the section above, a test user needs first to enter his username and password to acccess the web site. Then a test user can manually select what type of tests he wants to perform or he can select already defined test, -like the simple, smart or full test. (Describe here these three type of tests.) +like the simple, smart or full test. (Describe here these three type of tests). Data about the performing tests are inserted into the database only in the case if the mutex lock for the web site can be obtained\footnote{The mutex lock will be explained in the next subsection.}. This way we can avoid inserting data about the test in case there is already a test user on the website performing some tests on the system. \subsection{Communication between the web page and the test software} diff --git a/notFinishedCode/Report/test.tex.backup b/notFinishedCode/Report/test.tex.backup index bec85c1..4b3a7b7 100644 --- a/notFinishedCode/Report/test.tex.backup +++ b/notFinishedCode/Report/test.tex.backup @@ -152,14 +152,17 @@ During the development time we refined our requirements. In the next chapters we \newpage \section{Database design} As we mentined in the software requirements section, we decided to use MySQL as our database system for storing the test information and results. -It was not difficult to decide what database to use, since MySQL is one of the most supported database and one can find a library to use it with major programming languages. - +It was not difficult to decide what database to use, since MySQL is one of the most supported database and one can find a library to use it with major programming languages. +The key point in the design of our database was the simplicity and speed of accessing the data. We had decided to use seven tables. In the following paragraph we will explain each table separately and its usage. \begin{figure}[ht!] \centering \includegraphics[width=140mm]{DBRelationship.png} \caption[]{Database relationship diagram} \end{figure} - +\par The \emph{PingResultTable} has six attributes (\emph{taskNo, sipServer, sipGate, unisip, gsmBox1, gsmBox2}), all of integer type. +The \emph{taskNo} attribute identifies the test number but not a single test (e.g. an operator user has selected three different tests to be executed, all of the three tests will have the same \emph{taskNo} to identify them together as belonging to one test group and \emph{taskId} identifies each single test and will be explained later). +\emph{sipServer} represents the Asterisk server ping result. \emph{sipGate} is used to represent the SIP Gate server for the landline calls (\url{http://www.sipgate.de}). \emph{uniSip} represents the ping results for our local University telephone network SIP server. +\emph{taskNo} is the primary and unique key in the table \emph{PingResultTable}. Rest of the attributes (i.e. \emph{sipServer, sipGate, uniSip, gsmBox1, gsmBox2}) are used to insert the ping results, if the assigned servers are reachable or not. \newpage \section{Software design} % section 2.1 \begin{figure}[ht!] diff --git a/notFinishedCode/Report/test.tex~ b/notFinishedCode/Report/test.tex~ index 2506939..eaf7a09 100644 --- a/notFinishedCode/Report/test.tex~ +++ b/notFinishedCode/Report/test.tex~ @@ -159,7 +159,11 @@ The key point in the design of our database was the simplicity and speed of acce \includegraphics[width=140mm]{DBRelationship.png} \caption[]{Database relationship diagram} \end{figure} -\par The \emph{PingResultTable} has six attributes (\emph{taskNo, sipServer, sipGate, unisip, gsmBox1, gsmBox2}), all of integer type. \emph{taskNo} identifies the test +\par The \emph{PingResultTable} has six attributes (\emph{taskNo, sipServer, sipGate, unisip, gsmBox1, gsmBox2}), all of integer type. +The \emph{taskNo} attribute identifies the test number but not a single test (e.g. an operator user has selected three different tests to be executed, all of the three tests will have the same \emph{taskNo} to identify them together as belonging to one test group and \emph{taskId} identifies each single test and will be explained later). +\emph{sipServer} represents the Asterisk server ping result. \emph{sipGate} is used to represent the SIP Gate server for the landline calls (\url{http://www.sipgate.de}). \emph{uniSip} represents the ping results for our local University telephone network SIP server. +\emph{gsmBox1} and \emph{gsmBox2} are the two single-chip Linux computers (BeagleBoard), that controll two cell phones each one (i.e. they are also known under the name of \emph{nanoBTSx}) +\emph{taskNo} is the primary and unique key in the table \emph{PingResultTable}. Rest of the attributes (i.e. \emph{sipServer, sipGate, uniSip, gsmBox1, gsmBox2}) are used to insert the ping results, if the assigned servers are reachable or not. \newpage \section{Software design} % section 2.1 \begin{figure}[ht!] -- cgit v1.2.3-55-g7522