# Network topology

> An office network: the internet, a firewall and router, a switch, and the machines behind it. A Systems and architecture example with its LaTeX source.

A Systems and architecture example in the TeXeR TikZ library: https://texer.org/library/systems/network-topology

Package: [Systems and architecture](https://texer.org/library/systems.md), on CTAN at https://ctan.org/pkg/pgf.

Tags: network, topology, LAN, infrastructure

## Source

```latex
\usetikzlibrary{shapes.symbols}

\begin{tikzpicture}[
  every node/.style={font=\small},
  device/.style={draw, thick, rounded corners, minimum width=20mm, minimum height=8mm},
  host/.style={draw, thick, minimum width=19mm, minimum height=8mm},
]
  \node[cloud, draw, thick, cloud puffs=11, aspect=2.2, minimum width=28mm] (net) at (0,4.3) {Internet};
  \node[device] (fw) at (0,2.8) {Firewall};
  \node[device] (router) at (0,1.4) {Router};
  \node[device] (switch) at (0,0) {Switch};
  \foreach \x/\name in {-3.3/Web server, -1.1/Database, 1.1/Laptop, 3.3/Printer}
  \node[host] (\name) at (\x,-1.8) {\name};

  \draw[thick] (net) -- (fw) -- (router) -- (switch);
  \foreach \name in {Web server, Database, Laptop, Printer}
  \draw[thick] (switch.south) -- ++(0,-0.45) -| (\name.north);
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usetikzlibrary{shapes.symbols}

\begin{document}

\begin{tikzpicture}[
  every node/.style={font=\small},
  device/.style={draw, thick, rounded corners, minimum width=20mm, minimum height=8mm},
  host/.style={draw, thick, minimum width=19mm, minimum height=8mm},
]
  \node[cloud, draw, thick, cloud puffs=11, aspect=2.2, minimum width=28mm] (net) at (0,4.3) {Internet};
  \node[device] (fw) at (0,2.8) {Firewall};
  \node[device] (router) at (0,1.4) {Router};
  \node[device] (switch) at (0,0) {Switch};
  \foreach \x/\name in {-3.3/Web server, -1.1/Database, 1.1/Laptop, 3.3/Printer}
  \node[host] (\name) at (\x,-1.8) {\name};

  \draw[thick] (net) -- (fw) -- (router) -- (switch);
  \foreach \name in {Web server, Database, Laptop, Printer}
  \draw[thick] (switch.south) -- ++(0,-0.45) -| (\name.north);
\end{tikzpicture}
\end{document}
```
