Created
January 26, 2018 18:07
-
-
Save basus/77441dde61f79189303e10d2af5e4e8b to your computer and use it in GitHub Desktop.
Drawing network topology diagrams with Tikz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{tikz} | |
\usetikzlibrary{arrows.meta,bending,automata,shapes} | |
\begin{tikzpicture}[,>={Stealth[round]},shorten >=1pt,auto,semithick] | |
\tikzstyle{host}=[rectangle,draw=black,minimum size=30pt,inner sep=0pt] | |
\tikzstyle{switch}=[circle,draw=black,minimum size=30pt,inner sep=0pt] | |
\tikzstyle{middlebox}=[diamond,draw=black,minimum size=30pt,inner sep=0pt] | |
\node[host] (h1) at (1,0) {\texttt{h1}}; | |
\node[host] (h2) at (5,0) {\texttt{h2}}; | |
\node[switch] (s1) at (3,0) {\texttt{s1}}; | |
\node[middlebox] (l1) at (3,-2) {\texttt{l1}}; | |
\node[middlebox] (l2) at (3,2) {\texttt{l2}}; | |
\path (h1) edge (s1) | |
(h2) edge (s1) | |
(l1) edge (s1) | |
(l2) edge (s1) ; | |
\end{tikzpicture} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍