1
0
Fork 0
mirror of https://gitlab.com/netravnen/NetworkLabNotes.git synced 2024-06-26 11:09:04 +00:00

Updated chapter/section/spanningtree.tex

This commit is contained in:
chhan11 2017-05-24 19:55:47 +02:00
parent 46bb9f9661
commit 38c1adb67a

View file

@ -1,3 +1,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SECTION BEGIN spanning tree protocol %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Spanning Tree}
Spanning Tree exists for the \textbf{sole} reason to save "your" network and all the broadcast storms an network engineer having a bad day can by mistake create!
@ -27,50 +33,74 @@ When a switch is enabled for Spanning Tree. One of the following roles will have
\begin{itemize}
\item \textbf{Root port:} Only 1 port on any switch (non-counting the root bridge!). Is always the port with the lowest metric (aka. best path) to the root bridge.
\begin{itemize}
\item The upstream/-link port closest to the root bridge on all switches apart from the root bridge.
\end{itemize}
\item \textbf{Designated port:} A designated port is the port on any segment closest to the root bridge and forwarding traffic.
\begin{itemize}
\item The port on any switch in downstream direction closet to the root bridge.
\end{itemize}
\item \textbf{\textit{Non}-designated port:} Put in blocking mode and not currently forwarding traffic.
\begin{itemize}
\item All switch ports which did not get elected as the root or designated port.
\end{itemize}
\item \textbf{Disabled port:} The port has been one-way-or-another shut down.
\end{itemize}
\subsubsection{specific port roles}
\begin{itemize}
\item \textbf{Alternative port} is an active port in network with an alternative path to the root bridge. A port in alternative mode will remain active but \textit{discards} all traffic until the the current designated path fails.
\item \textbf{Backup port} is running in active mode and \textit{discards} all traffic it recieves until the current designated port on the segment the backup port is connected to, fails.
\end{itemize}
Election of ports goes in order of the following values (low is best): 1) root bridge id, 2) lowest path cost to root bridge, 3) sender bridge id, 4) sender port bridge id
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SECTION BEGIN standards %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Standards}
\begin{itemize}
\item STP {\scriptsize Spanning Tree Protocol}
\begin{itemize}
\item Ieee 802.1D
\item IEEE 802.1D
\item Was created in a time where bridged networks was the norm.
\item Supports a single vlan/lan.
\end{itemize}
\item CST {\scriptsize Common Spanning Tree}
\begin{itemize}
\item An evolution of stp
\item Cst still only supports one stp instance.
\item But cst do thou in contrast to stp support \textit{multiple} vlans.
\item Cst still only supports one STP instance.
\item But CST do thou in contrast to STP support \textit{multiple} vlans.
\end{itemize}
\item PVST {\scriptsize Per Vlan Spanning Tree}
\begin{itemize}
\item Now obsolute and succeded by pvst+
\item Now obsolute and succeded by PVST+
\end{itemize}
\item PVST+ {\scriptsize Per Vlan Spanning Tree Plus}
\begin{itemize}
\item Runs an instance of stp per vlan.
\item Runs an instance of STP per vlan.
\item Can guarante better utilization of available network bandwidth.
\item Root bridge and port priorities can be configured per vlan.
\item Uses the term alternate for nondesignated port.
\end{itemize}
\item RSTP {\scriptsize Rapid Spanning Tree Protocol}
\begin{itemize}
\item Ieee 802.1w
\item A future development of the original 802.1D standard meant to provide faster convergance. As the original stp standard wasn't actually that fast.
\item IEEE 802.1w
\item A future development of the original 802.1D standard meant to provide faster convergance. As the original STP standard wasn't actually that fast.
\end{itemize}
\item RPVST+ {\scriptsize Rapid Per Vlan Spanning Tree Plus}
\begin{itemize}
\item A cisco implementation of rstp based upon pvst+.
\item A cisco implementation of RSTP based upon pvst+.
\end{itemize}
\item MST {\scriptsize Multiple Spanning Tree}
\begin{itemize}
\item Originally a cisco developed protocol. Mst has since been developed as an ieee standard.
\item Mst can as cst map multiple vlans to a single stp instance.
\item Mst \textit{differently} than cst supports multiple stp instances.
\item Originally a cisco developed protocol. MST has since been developed as an IEEE standard.
\item MST can as CST map multiple vlans to a single STP instance.
\item MST \textit{differently} than CST supports multiple STP instances.
\item Fx. Instance 1: Vlan 1-99, Instane 2: Vlan 100-199.
\end{itemize}
\end{itemize}
@ -80,44 +110,108 @@ When a switch is enabled for Spanning Tree. One of the following roles will have
\subsubsection{BPDU}
\textbf{B}ridge \textbf{P}rotocol \textbf{D}ata \textbf{U}nits is on cisco equipment sent out every 2 seconds and generally catogorizes into 2 categories:
\begin{itemize}
\item \textit{Configuration} bpdu used for stp calculations and
\item \textit{Topology change notifications} bpdus used to notify other network nodes of a change in the network.
\item \textit{Configuration} BPDU used for STP calculations and
\item \textit{Topology change notifications} BPDUs used to notify other network nodes of a change in the network.
\end{itemize}
Any network node with switchports and stp + bpdu enabled sends out bpdu packets with the ports mac as the src address. The destination mac is is designated stp multicast addr 01:80:C2:00:00:00.
Any network node with switchports and STP + BPDU enabled sends out BPDU packets with the ports mac as the src address. The destination mac is is designated STP multicast addr 01:80:C2:00:00:00.
\subsubsection{Root bridge}
Using a \textbf{R}oot \textbf{B}rigde as the reference point for the stp instance and calculation of root/designated/non-designated ports.\\This election process uses a pre-configured bridge priority (ranges from $0$ to $2^{16}$) (defaults to $2^{15}$). If a tie in priority is found the switch in possession of the lowest mac address wins the root bridge election.
\subsubsection{Root Bridge}
Using a \textbf{R}oot \textbf{B}rigde as the reference point for the STP instance and calculation of root/designated/non-designated ports.\\This election process uses a pre-configured bridge priority (ranges from $0$ to $2^{16}$) (defaults to $2^{15}$). If a tie in priority is found the switch in possession of the lowest mac address wins the root bridge election.
\subsubsection{Port}
\subsubsection{Port Cost}
\begin{table}[h]
\centering
\caption{Default port cost in spanning tree}
\label{stpportcost}{!}{%
\begin{tabular}{|l|l|}
\hline
\textbf{Link} & \textbf{Default Cost} \\ \hline
10 Gbps & 1 \\ \hline
1 Gbps & 4 \\ \hline
100 Mbps & 19 \\ \hline
10 Mbps & 100 \\ \hline
\end{tabular}%
}
\end{table}
\fig{spanningtree/portroles}{stpportroles}{Port Election}
\textit{\textbf{NB:} beware that when working with bundled links (aka. ether-/port-channel). Then the link cost will be calculated based upon the summarized bandwidth accross all links.}
\fig{spanningtree/portstates}{stpportstates}{Port States}
\section{Rapid Spanning Tree Protocol}
\fig{rstp/portroles}{rstpportroles}{Port Roles}
\fig{rstp/portlinktypes{rstpportlinktypes}{Port link types}
Things to be aware of regarding RSTP port roles
\begin{itemize}
\item \textbf{Shared} port state will only ever be present on segments where a hub is present.
\item \textbf{Point-2-Point} port is connected to a single switch on the other end.
\item \textbf{Edge} port roles is only ever connected to end devices. Status as Edge port is lost if a BPDU is ever recieved.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SECTION BEGIN port roles %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Port roles}
\subsection{Fast port roles}
Cisco did on their part early on enhance the original spanning tree standard with some proprietary portroles that can (on cisco switch equipment) skip steps in the port role election process. And configure a STP switchport to a specific behavior as described below:
\begin{itemize}
\item PortFart
\item PortFast
\begin{itemize}
\item
\item Configures access port to transition directly to forwarding state
\end{itemize}
\item UplinkFast
\item UplinkFast
\begin{itemize}
\item
\item Enables fast uplink failover on access switch
\end{itemize}
\item BackboneFast
\item BackboneFast
\begin{itemize}
\item
\item Enables fast convergence in distribution or core layer when STP change occurs
\end{itemize}
\end{itemize}
\subsubsection{Loop prevention}
\subsection{Loop Prevention}
\begin{itemize}
\item BPDU Guard
\item BPDU Filter
\item Root Guard
\item Loop Guard
\item BPDU Guard
\begin{itemize}
\item Disables the PortFast-enabled port if a BPDU is received
\end{itemize}
\item BPDU Filter
\begin{itemize}
\item Suppresses BPDUs on ports
\end{itemize}
\item Root Guard
\begin{itemize}
\item Prevents external switches from becoming roots
\end{itemize}
\item Loop Guard
\begin{itemize}
\item Prevents an alternate port from becoming the designated port if no BPDUs are received
\end{itemize}
\end{itemize}
\subsubsection{Link}
\subsection{Link}
\begin{itemize}
\item Unidirectional Link Detection (UDLD)
\item FlexLinks
\end{itemize}
\section*{Online Ressources on STP}
\begin{itemize}
\item Spanning Tree \@WikiPedia \cite{wp_spanningtree}
\end{itemize}