%% #+TITLE: Gráfico de topología de redes wifi con TikZ
%% #+AUTHOR: Emilio Torres Manzanera
%% #+DATE: Time-stamp: <2020-07-28 11:05 emilio on emilio-XPS-15-9570>

\documentclass[tikz,margin=0.1mm]{standalone}

%% https://github.com/moepinet/moeptikz
\usepackage[shading]{moeptikz} %shapes for hubs, switches, routers, pc...
\moeptikzset{shading=true}
\usetikzlibrary{fit} % wall
\usetikzlibrary{shapes} % cloud

\usepackage{inconsolata} % Type of letter
\newcommand*{\nodelabel}[1]{{\scriptsize\bfseries\ttfamily #1}}

\begin{document}

\begin{tikzpicture}[x=1cm,y=1cm]

    % Cloud
	\node[cloud,cloud puffs=13,minimum width=3cm,
    minimum height=1.5cm,
    draw=black,line width=1pt] (inet) at (0,0) {};
	\node at (inet) {\nodelabel{Internet}};
    
	% OLT
	\node[router,minimum size=5mm,label=below:\nodelabel{OLT}] (olt) at (inet.east) {};
    % ONT
    \node[router,minimum size=5mm,label=below:\nodelabel{ONT}] (ont) at (4,0) {};
    % Router
	\node[server,minimum size=12mm,label={[name=labelrouter] below:\nodelabel{192.168.1.1}}, label={[name=labelmitra]:\nodelabel{MitraStar}}]
    (router) at (5,0) {};
    % Movistar
    \node[fit={(ont.west) (labelrouter.east) (labelmitra.north) (labelrouter.south)},draw=brown, dashed,label=\nodelabel{Movistar HGU}] (movistar) {};

    \draw[black] (olt.east) -- (ont.west);
	\draw[black] (ont.east) -- (router.west);

    % Wifi raditation I
    \fill[blue,line width=.5mm,draw=blue] (movistar.south) circle (1mm);    
    \def\max{20}
    \foreach \i in {2,...,\max} {
    \draw[blue,line width=.5mm,draw opacity={(\max-\i)/(\max-4)}]
    (movistar.south) ++(\i mm,0)
    arc[start angle=0,end angle=-180,radius=\i mm];
    }

    % Router mikrotik
	\node[switch,minimum size=12mm,label={[name=labelmikrotik] below:\nodelabel{192.168.1.199}},label={\nodelabel{MikroTik AP}}]
    (routermikrotik) at (9,0) {};

    % Wifi raditation II
    % https://tex.stackexchange.com/questions/209752/how-can-i-fill-the-corner-of-a-page-with-a-wave-like-drawing-in-tikz
    \fill[orange,line width=.5mm,draw=orange] (labelmikrotik.south) circle (1mm);    
    \def\max{20}
    \foreach \i in {2,...,\max} {
    \draw[orange,line width=.5mm,draw opacity={(\max-\i)/(\max-4)}]
    (labelmikrotik.south) ++(\i mm,0)
    arc[start angle=0,end angle=-180,radius=\i mm];
    }

 
    % Wall
    \draw[gray] (6.25,-3.2) --++(90:4cm);
    \draw[gray] (7.25,-3.2) --++(90:4cm);
    \fill[gray!30] (6.25,-3.2) rectangle ++(1,4); 
    \fill[pattern=north west lines, pattern color=gray] (6.25,-3.2) rectangle ++(1,4);
    

%    \draw[white,line width=2pt] (router.east) -- (routermikrotik.west);
    \draw[gray!10, line width=4pt] (6.24,0) -- (7.26,0);
    \draw[black] (router.east) -- (routermikrotik.west);
    
    
    \node[client,label=below:\nodelabel{PC1}] at (4,-2.5){};
    \node[notebook,label=below:\nodelabel{PC2}] at (9,-2.5){};
\end{tikzpicture}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
