dissertation/diagrams/tls-server-processes.tex
2022-05-26 23:13:24 +00:00

127 lines
5.7 KiB
TeX

\documentclass[12pt,crop,tikz]{standalone}
\providecommand{\rootdir}{..}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing}
\tikzstyle{arrow} = [thick,->,>=stealth]
% The Tableau20 colours
\definecolor{TabLightOrange}{RGB}{255,187,120}
\definecolor{TabOrange}{RGB}{255,127,14}
\definecolor{TabLightBlue}{RGB}{174,199,232}
\definecolor{TabBlue}{RGB}{31,119,180}
\definecolor{TabGreen}{RGB}{44,160,44}
\definecolor{TabLightGreen}{RGB}{152,223,138}
\definecolor{TabSalmon}{RGB}{255,152,150}
\definecolor{TabRed}{RGB}{214,39,40}
\definecolor{TabPurple}{RGB}{148,103,189}
\definecolor{TabLightPurple}{RGB}{197,176,213}
\definecolor{TabLightPink}{RGB}{247,182,210}
\definecolor{TabPink}{RGB}{227,119,194}
\definecolor{TabLightBrown}{RGB}{196,156,148}
\definecolor{TabBrown}{RGB}{140,86,75}
\definecolor{TabGray}{RGB}{127,127,127}
\definecolor{TabOlive}{RGB}{188,189,34}
\definecolor{TabLightOlive}{RGB}{219,219,141}
\definecolor{TabLightGray}{RGB}{199,199,199}
\definecolor{TabLightCyan}{RGB}{158,218,229}
\definecolor{TabCyan}{RGB}{23,190,207}
\begin{document}
\def\titlepad{0.1}
\def\boxspacing{40mm}
\def\layer{0.3}
\def\inner{0.3}
\def\innerspace{0.2}
\def\layerwidth{15cm}
\def\halflayerwidth{2.35cm}
\def\thirdlayerwidth{4.85cm}
\def\layerheight{0.8cm}
\def\innerwidth{4.4cm}
\def\halfinnerwidth{2.1cm}
\begin{tikzpicture}
[ every node/.style={font=\small}
, layer/.style= {rectangle, draw=black!50, thick, minimum width=\layerwidth , minimum height=\layerheight}
, halflayer/.style={rectangle, draw=black!50, thick, minimum width=\halflayerwidth, minimum height=\layerheight}
, inner/.style= {rectangle, draw=black!50, thick, minimum width=\innerwidth , minimum height=\layerheight}
, halfinner/.style={rectangle, draw=black!50, thick, minimum width=\halfinnerwidth, minimum height=\layerheight}
, dashed/.style= {rectangle, draw=black!25, dotted, thick, minimum width=\innerwidth, minimum height=\layerheight}
, red/.style={fill=TabPurple!40}
, orange/.style={fill=TabBlue!40}
, yellow/.style={fill=TabCyan!40}
, green/.style={fill=TabLightGreen!60}
, node distance = 0cm
, arrow={->,>=stealth}
]
\begin{scope}[local bounding box=std-client]
\node[layer] (ambient-authority) {Ambient Authority};
\node[layer, orange, below = 2mm of ambient-authority] (void-orchestrator) {Void Orchestrator};
\draw[->] (ambient-authority.south) -- (void-orchestrator.north);
% hack to get the spacing right
\coordinate (std-spaced_app1) at ($ (void-orchestrator.south)+(0,-\inner) $);
\begin{scope}[local bounding box=spawners]
\node[inner, red, below = \layer of std-spaced_app1, yshift=-0.2cm] (tls-handler-spawner) {TLS Handler Spawner};
\node[dashed, left = 5.5mm of tls-handler-spawner] (connection-listener-spawner) {};
\node[inner, red, right = 5.5mm of tls-handler-spawner] (http-handler-spawner) {HTTP Handler Spawner};
\end{scope}
\node[inner, green, below = 3*\layer of connection-listener-spawner] (connection-listener) {Connection Listener};
\node[inner, green, below = 3*\layer of tls-handler-spawner] (tls-handler) {TLS Handler};
\node[inner, green, below = 3*\layer of http-handler-spawner] (http-handler) {HTTP Handler};
\coordinate (spawners-nw) at ($ (spawners.north west) + (-0.3, 0.3 + \titlepad) $);
\coordinate (spawners-ne) at ($ (spawners.north east) + ( 0.3, 0.3 + \titlepad) $);
\coordinate (spawners-sw) at ($ (spawners.south west) + (-0.3,-0.3) $);
\coordinate (spawners-se) at ($ (spawners.south east) + ( 0.3,-0.3) $);
\draw[draw,thick,dotted] (spawners-nw) rectangle (spawners-se);
\node[rectangle,fill=white] at ($(spawners-nw)!0.5!(spawners-ne)$) (spawners_label) {\textit{Spawners}};
% Left line locations (to avoid spawner header)
\coordinate (left-lline) at ($ (connection-listener-spawner) + (-1.15,0) $);
\coordinate (mid-lline) at ($ (tls-handler-spawner) + (-1.15,0) $);
\coordinate (right-lline) at ($ (http-handler-spawner) + (-1.15,0) $);
\coordinate (left-rline) at ($ (connection-listener-spawner) + (1.15,0) $);
\coordinate (mid-rline) at ($ (tls-handler-spawner) + (1.15,0) $);
% Lines for the left set
\draw[->] (left-lline |- 0, 0 |- void-orchestrator.south) -- (left-lline |- 0, 0 |- connection-listener.north);
% Lines for the center set
\draw[->] (mid-lline |- 0, 0 |- void-orchestrator.south) -- (mid-lline |- 0, 0 |- tls-handler-spawner.north);
\draw[->] (mid-lline |- 0, 0 |- tls-handler-spawner.south) -- (mid-lline |- 0, 0 |- tls-handler.north);
% Lines for the right set
\draw[->] (right-lline |- 0, 0 |- void-orchestrator.south) -- (right-lline |- 0, 0 |- http-handler-spawner.north);
\draw[->] (right-lline |- 0, 0 |- http-handler-spawner.south) -- (right-lline |- 0, 0 |- http-handler.north);
% Special lines
\draw[->] (connection-listener.east) -- ($(connection-listener.east)!0.5!(tls-handler.west)$) -- ($(connection-listener-spawner.east)!0.5!(tls-handler-spawner.west)$) -- (tls-handler-spawner.west);
\draw[->] (tls-handler.east) -- ($(tls-handler.east)!0.5!(http-handler.west)$) -- ($(tls-handler-spawner.east)!0.5!(http-handler-spawner.west)$) -- (http-handler-spawner.west);
\end{scope}
\coordinate (std-client-nw) at ($ (std-client.north west) + (-\inner, \inner + \titlepad) $);
\coordinate (std-client-ne) at ($ (std-client.north east) + ( \inner, \inner + \titlepad) $);
\coordinate (std-client-sw) at ($ (std-client.south west) + (-\inner,-\inner) $);
\coordinate (std-client-se) at ($ (std-client.south east) + ( \inner,-\inner) $);
\draw[draw, thick] (std-client-nw) rectangle (std-client-se);
\end{tikzpicture}
\end{document}