summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/Report/test.tex
diff options
context:
space:
mode:
authorRefik Hadzialic2011-10-21 15:22:34 +0200
committerRefik Hadzialic2011-10-21 15:22:34 +0200
commit6d528e6588b9c04e153cfa9b02a5092113342aba (patch)
treebedac23754659cc36327f7ebce5c38f8036bca6e /notFinishedCode/Report/test.tex
parentReport writing (diff)
downloadgsm-selftest-6d528e6588b9c04e153cfa9b02a5092113342aba.tar.gz
gsm-selftest-6d528e6588b9c04e153cfa9b02a5092113342aba.tar.xz
gsm-selftest-6d528e6588b9c04e153cfa9b02a5092113342aba.zip
Report writing
Diffstat (limited to 'notFinishedCode/Report/test.tex')
-rw-r--r--notFinishedCode/Report/test.tex29
1 files changed, 16 insertions, 13 deletions
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}
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
@@ -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}