%%
\section{GL.inet board description}
GL.inet Smart Router is a remake of a common TP-Link router TL-WR703N. The board changes include, but are not limited to, increased RAM and Flash memory, custom firmware and what is the most important - 5 usable GPIO pins exposed to the 2cm pin header for utility. Whole thesis is revolving around taking advantage of this fact. Basic information about the router are shown in Table \ref{t:charact}. 

\begin{table}[h] 
\caption{The basic characteristics of the GL.inet board}\label{t:charact}
\medskip
\centering
\def\arraystretch{1.5}
\setlength{\tabcolsep}{12pt}
\begin{tabular}{|l|l|}
\hline
Model     & GL-iNet 6408A / 6416A                                 	\\ \hline
CPU       & Atheros 9331, 400MHZ                                   	\\ \hline
RAM/ROM   & DDR 64MB                                              	\\ \hline
ROM       & Flash 8MB (6408A) / 16M (6416A)                        	\\ \hline
Interface & 1 WAN, 1 LAN, 1 USB2.0, 1 Micro USB(Power), 5 GPIO 		\\ 
\hline
Wireless  & IEEE802.11n/g/b, IEEE802.3, IEEE802.3u                	\\ \hline
\end{tabular}
\end{table}



\subsection{Atheros 9331 Wi-fi System-on-Chip}
The Atheros AR9331 is a highly integrated and cost effective IEEE 802.11n 1x1 2.4 GHz Systemon-a-Chip (SoC) for wireless local area network (WLAN) AP and router platforms. The block diagram of the chip can be seen on Figure \ref{f:ar_block}. The main processor frequency is 400 MHz and it is suited for running Linux distributions for embedded devices, preferably OpenWrt or DD-Wrt. 

Features of this SoC are following:

\begin{itemize}
	\item Complete IEEE 802.11n 1x1 AP or router in a single chip
	\item MIPS 24K processor operating at up to 400 MHz
	\item External 16-bit DDR1, DDR2, or SDRAM memory interface
	\item SPI NOR Flash memory support
	\item No external EEPROM needed
	\item 4 LAN ports and 1 WAN port IEEE 802.3 Fast Ethernet switch with auto-crossover, auto polarity, and auto-negotiation in PHYs
	\item Fully integrated RF front-end including PA and LNA
	\item Optional external LNA/PA
	\item Switched antenna diversity
	\item High-speed UART for console support
	\item I\textsuperscript{2}S/SPDIF-out audio interface
	\item SLIC for VOIP/PCM
	\item USB 2.0 host/device mode support
	\item GPIO/LED support
	\item JTAG-based processor debugging supported
	\item 25 MHz or 40 MHz reference clock input
	\item Advanced power management with dynamic clock switching for ultra-low power modes
	\item 148-pin, 12 mm x 12 mm dual-row LPCC package
\end{itemize}

\begin{figure}[ht!]
\centering
\includegraphics[width=.8\textwidth,angle=0]{AR9331_block.jpg}
\caption{The block diagram of the Atheros AR9331 SoC used as a main processing unit on GL.inet board}\label{f:ar_block}
\end{figure}

\subsection{From TL-WR703N to GL.inet}
TP-Link TL-WR703N router is a popular choice among hacker community because of it's cheap price tag compared to processing power and usage of a full-grown Linux distribution. People have figured out how to upgrade RAM / Flash memories or to make use of not used GPIO / UART ports for their own needs. These solutions however were mostly crude and expensive to replicate. The GL.inet team saw an opportunity to grasp this public knowledge and rolled out their own improved board clone to the marked.

Whole printed circuit board of TL-WR703N was remade by the GL.inet team to expose the unused GPIO ports on the SoC, utilize two Ethernet port instead of one and utilize the USB 2.0 port. Memory chips were replaced by their higher capacity alternatives.

\begin{figure}[ht!]
\centering
\includegraphics[width=.8\textwidth,angle=0]{gl-inet_pcb_up.jpg}
\caption{The front side of the GL.inet board exposing the main Atheros SoC, RAM and interfaces}\label{f:board_front}
\end{figure}


\begin{figure}[ht!]
\centering
\includegraphics[width=.8\textwidth,angle=0]{gl-inet_pcb_down.jpg}
\caption{The back side of the GL.inet board exposing the Flash memory and a main voltage regulator}\label{f:board_back}
\end{figure}