\documentclass{standalone}
\usepackage{ga}
\begin{document}
\begin{tikzpicture}[x=1cm,y=1cm]
\input{../wt.tikz}
\definecolor{lb}{HTML}{2E86C1}
\tikzset{srv/.pic={\foreach \k in {0,1,2} {\fill[black!85, rounded corners=1pt] (-0.35,0.24*\k) rectangle (0.35,0.24*\k+0.2); \foreach \d in {0.12,0.2,0.28} \fill[white] (\d,0.24*\k+0.1) circle (0.025);} \draw[line width=1pt] (0,0) -- (0,-0.12) (-0.3,-0.12) -- (0.3,-0.12);},
  gw/.pic={\draw[lb, line width=1.2pt] (-0.25,-0.5) -- (0,0.3) -- (0.25,-0.5) (-0.15,-0.2) -- (0.15,-0.2) (-0.19,-0.32) -- (0.19,-0.32); \draw[lb, line width=0.9pt] (-0.18,0.38) arc (150:210:0.25) (0.18,0.38) arc (30:-30:0.25) (-0.3,0.45) arc (150:210:0.4) (0.3,0.45) arc (30:-30:0.4);},
  fld/.style={draw, line width=0.5pt, font=\tiny, minimum height=0.32cm, inner sep=0pt, anchor=south west, align=center},
  ks/.style={font=\scriptsize\bfseries, text=wtgreen, align=center}, nm/.style={font=\scriptsize\bfseries, align=center}, tag/.style={fill=wtred!70, font=\small\bfseries, inner sep=2pt}}
\node[circle, fill=lb, minimum size=0.6cm] (ed) at (0,0) {}; \node[nm] at (0,-0.7) {End device}; \node[ks] at (0,0.85) {Securely stored\\root keys};
\pic at (2.2,0) {gw}; \node[nm] at (2.2,-0.8) {Gateway};
\pic at (5.0,-0.15) {srv}; \node[nm] at (5.0,-0.75) {LoRa network\\server};
\pic at (8.0,-0.15) {srv}; \node[nm] at (8.0,-0.75) {Application\\servers};
\node[circle, fill=lb, minimum size=0.9cm] at (10.6,0.1) {}; \node[nm] at (10.6,-0.75) {Dashboards or\\data portals};
\pic at (5.0,-3.4) {srv}; \node[nm] at (5.0,-3.95) {Join server}; \node[ks] at (5.0,-4.55) {Securely stored\\root keys};
\draw[dashed, line width=0.6pt] (0.35,0.1) -- (1.85,0.1) (2.5,0.1) -- (4.6,0.1) (5.4,0.1) -- (7.6,0.1) (8.4,0.1) -- (10.1,0.1);
\draw[dashed, line width=0.6pt] (5.0,-1.2) -- (5.0,-2.75) (5.4,-2.9) -- (7.7,-1.2);
\draw[->, lb, line width=0.8pt] (4.75,-2.6) -- node[left, font=\scriptsize, black, align=right] {Network\\session key} (4.75,-1.3);
\draw[->, lb, line width=0.8pt] (6.1,-2.75) -- node[below right, font=\scriptsize, black] {Application session key} (7.4,-1.8);
\draw[<->, lb, line width=0.8pt] (3.6,1.0) -- (3.6,-3.0);
% join request
\node[tag] at (-0.2,2.85) {Join request};
\node[font=\tiny, anchor=east] at (-1.0,2.35) {Size (bytes)}; \node[font=\tiny, anchor=east] at (-1.0,2.03) {Join-request};
\foreach \x/\w/\s/\n in {-1.0/1.1/8/JoinEUI,0.1/1.1/8/DevEUI,1.2/1.2/2/DevNonce} { \node[fld, minimum width=\w cm, text width=\w cm] at (\x,2.2) {\s}; \node[fld, minimum width=\w cm, text width=\w cm] at (\x,1.88) {\n}; }
\node[font=\scriptsize, align=left, anchor=west, fill=yellow!50, inner sep=1.5pt] at (2.7,2.2) {Join server ID (EUI64)\\End device ID (EUI64)\\DevNonce is a counter of requests (incremented with every new request)};
\node[font=\scriptsize, text=wtred] at (6.6,2.85) {(These 3 items are included in the join request initiated by the end device)};
% join accept
\node[font=\tiny, anchor=east] at (-4.6,-2.35) {Size (bytes)}; \node[font=\tiny, anchor=east] at (-4.6,-2.67) {Join-accept};
\foreach \x/\w/\s/\n in {-4.6/1.3/3/JoinNonce,-3.3/1.45/3/Home\_NetID,-1.85/1.15/4/DevAddr,-0.7/1.35/1/DLSettings,0.65/1.15/1/RxDelay,1.8/1.6/(16) optional/CFList} { \node[fld, minimum width=\w cm, text width=\w cm] at (\x,-2.5) {\s}; \node[fld, minimum width=\w cm, text width=\w cm] at (\x,-2.82) {\n}; }
\node[tag] at (-2.0,-3.3) {Join accept};
\end{tikzpicture}
\end{document}
