File:Address space in Variable Length Subnet Masking (VLSM).svg

Summary

Description
English: The chart illustrates the IPv4 address space of the last octet and subnets obtained with Variable Length Subnet Masking (VLSM).
Date
Source Own work
Author And1mu

Source Code

created with LaTeX and PGF/TikZ
\documentclass[crop,border=3,tikz,convert={outext=.svg,command=\unexpanded{pdf2svg \infile\space\outfile}},multi=false]{standalone}
\usetikzlibrary{math}

\newcommand{\mycircle}{
  \tikzmath{\opacity=100-30*\radius;}
  \draw[fill=blue!\opacity] (A) circle (\radius);
  \foreach \a in {1,...,\lines}{
    \tikzmath{\angle=\angle-\a*(360/\lines);}
    \draw[black] (A) -- (\angle:\radius);
    \tikzmath{\bit=int(mod(1+\a,2));}
    \node at (\angle+180/\lines:\radius-0.25) {\small\texttt{\bit}};
  }
}

\begin{document}
\begin{tikzpicture}[>=latex]
  \node[anchor=center]() at (0,4.5){\large Variable Length Subnet Masking (VLSM)};
  \begin{scope}[shift={(-0.5,0)}]
    \node() at (-1,3.75){\large\texttt{192.168.2.}};
    \draw (2.445,3.6) rectangle (2.445+0.2,3.9)
    node[midway,above,shift={(0,0.1)}]{\tiny\texttt{2}};
    \draw (2.82,3.6) rectangle (2.82+0.2,3.9)
    node[midway,above,shift={(0,0.1)}]{\tiny\texttt{1}};
  \end{scope}
  \coordinate (A) at (0,0);
  \tikzmath{\angle=90;}
  \foreach \lines/\radius in {64/3,32/2.5,16/2,8/1.5,4/1,2/0.5}{
    \mycircle
    \begin{scope}[shift={(-0.7,3.6)}]
      \tikzmath{\val=int(256/\lines);}
      \draw[fill=blue!\opacity] (0.75*\radius,0) rectangle
      (0.75*\radius+0.2,0.3) node[midway,above,shift={(0,0.1)}]{\tiny\texttt{\val}};
    \end{scope}
  }
  \tikzmath{\radius=3.25;}
  \foreach \a in {0,8,...,255}{
    \tikzmath{\angle=\angle-\a*(360/256);}
    \node at (\angle:\radius) {\tiny\texttt{.\a}};
  }
\end{tikzpicture}
\end{document}

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Address%20space%20in%20Variable%20Length%20Subnet%20Masking%20(VLSM).svgCategory:Self-published work
Category:Network diagrams Category:Internet diagrams Category:Subnetting Category:VLSM
Category:CC-BY-SA-4.0 Category:Internet diagrams Category:Network diagrams Category:Self-published work Category:Subnetting Category:VLSM