\section{Forwarding performance}
\label{chap:fwd-performance}


This tests aim at verifying the forwarding performance of the switch in terms of latency
and frame loss.
Spirent tester (sTester) and WR Switch (wrSwitch) under test with ports connected in the following way
\begin{table}[ht!]
\begin{tabular}{ l  l l}
sTester-port:0  & to & wrSwitch-port:0  \\
sTester-port:1  & to & wrSwitch-port:17  \\
sTester-port:2  & to & wrSwitch-port:1  \\
sTester-port:3  & to & wrSwitch-port:16  \\
wrSwitch-port:2  & to & wrSwitch-port:3  \\
wrSwitch-port:4  & to & wrSwitch-port:5  \\
wrSwitch-port:6  & to & wrSwitch-port:7  \\
wrSwitch-port:8  & to & wrSwitch-port:9  \\
wrSwitch-port:10  & to & wrSwitch-port:11  \\
wrSwitch-port:12  & to & wrSwitch-port:13  \\
wrSwitch-port:14  & to & wrSwitch-port:16  \\
\end{tabular}
\end{table}
% \paragraph{Test setup}
% \begin{table}[ht!]
%   \begin{tabular}{r l l}
%     WR Switch : & {\bf port 0}    & connected to port 0 Networking tester\\
%     WR Switch : & {\bf port 17}   & connected to port 1 Networking tester\\
%     WR Switch : & {\bf port 1}    & connected to port 2 Networking tester\\
%     WR Switch : & {\bf port 16}   & connected to port 3 Networking tester\\
%   \end{tabular}
% \end{table}
\begin{itemize*}
  \item All connections shall be done with fibers of max 10m length (~50ns latency) - this
        transletes max cable-latency-contribution of $\sim0.55 [us] = \sim50ns * 11 [cables]$ 
\end{itemize*}


\paragraph{Switch Configuration}

Each test shall be performed for two switch configurations:
\begin{enumerate*}
  \item Default configuration (PTPd ON)
  \item With PTPd not running.
\end{enumerate*}

\paragraph{Tester Configuration}

The configuration shall be changed to cover all the possible combinations:
\begin{table}[ht!]
\begin{tabular}{ l  l l l}
FRAME  & increment size [bytes]   & 64-1522 with step of 1  \\
       & loads [\%]               & 10, 30, 50, 70, 80, 85, 90, 92,95,97,99,100  \\
       & number                   & $10^9$    \\
\end{tabular}
\end{table}\\
Additionlly, the following configurations shall be tested:
\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME  & increment size [bytes]   & 64,65, 700,701, 1521, 1522\\
       & loads [\%]               & 50, 80, 95,100  \\
       & time of burst            & 5 min\\
\end{tabular}
\end{table}\\
Before the tests, learning process shall be perform to learn MAC addresses of the tester's ports.
The learning process is not part of the test.

\paragraph{Parameters recorded}
For each test and each tested configuration, the following parameters should be recorded:
\begin{itemize*}
\item Frame loss in \% per port per stream per direction,
\item Frame latency (average, max, min),
\item Test result (for a given configuration): failed/passed.
\end{itemize*}
After each tested configuration (within the same test), the following should happen:
\begin{itemize*}
\item State of debug parameters (e.g.: free pages number, port states,....) shall
      compared with the desired idle state
\item If the parameters indicate anormalies, the parameters shall be recorded and the switch
      restarted.
\end{itemize*}


\newpage
\subsection{4 ports}

The purpose of the test is to check forwarding performance of the switch forwarding
traffic point to point (only 4 ports busy) - light stress tests.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Unicast -- one-to-one streams -- adjacent ports}

\paragraph{Description} 

Unicast forwarding.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l l}
VLAN  & port 0:      & VID=0, & QMODE=unqualified\\
      & port 1:      & VID=0, & QMODE=unqualified\\
      & port 16:     & VID=0, & QMODE=unqualified\\
      & port 17:     & VID=0, & QMODE=unqualified\\
      & other ports: & VID=0, & QMODE=trunk (to avoid loops)\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:        & no VLAN tag, dstMAC=unicast  \\
        &                &                  \\ 
TRAFFIC & send to:       & port 0, 1,16,17  \\
        & receive on:    & port 0, 1,16,17  \\
STREAMS & bi-directional & port 0  $<->$ port 1  \\
        & bi-directional & port 16 $<->$ port 17 \\
\end{tabular}
\end{table}


\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received only on port 1
\item All frames sent to port 1 are received only on port 0
\item All frames sent to port 16 are received only on port 17
\item All frames sent to port 17 are received only on port 16
\end{itemize*}

\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Unicast -- one-to-one streams -- extreme ports}

\paragraph{Description} 

Unicast forwarding.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l l}
VLAN  & port 0:      & VID=0, & QMODE=unqualified\\
      & port 1:      & VID=0, & QMODE=unqualified\\
      & port 16:     & VID=0, & QMODE=unqualified\\
      & port 17:     & VID=0, & QMODE=unqualified\\
      & other ports: & VID=0, & QMODE=trunk (to avoid loops)\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:        & no VLAN tag, dstMAC=unicast  \\
        &                &                  \\ 
TRAFFIC & send to:       & port 0, 1,16,17  \\
        & receive on:    & port 0, 1,16,17  \\
STREAMS & bi-directional & port 0  $<->$ port 17  \\
        & bi-directional & port 1  $<->$ port 16 \\
\end{tabular}
\end{table}


\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received only on port 17
\item All frames sent to port 17 are received only on port 0
\item All frames sent to port 1 are received only on port 16
\item All frames sent to port 16 are received only on port 1
\end{itemize*}

\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Unicast -- many-to-many stream}

\paragraph{Description} 

Unicast forwarding.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l l}
VLAN  & port 0:      & VID=0, & QMODE=unqualified\\
      & port 1:      & VID=0, & QMODE=unqualified\\
      & port 16:     & VID=0, & QMODE=unqualified\\
      & port 17:     & VID=0, & QMODE=unqualified\\
      & other ports: & VID=0, & QMODE=trunk (to avoid loops)\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:         & no VLAN tag, dstMAC=unicast  \\
        &                 &                  \\ 
TRAFFIC & send to:        & port 0, 1,16,17  \\
        & receive on:     & port 0, 1,16,17  \\
STREAMS & uni-directional & port 0  $->$ port 1, 16, 17  \\
        & uni-directional & port 1  $->$ port 0, 16, 17  \\
        & uni-directional & port 16 $->$ port 0, 1,  17  \\
        & uni-directional & port 17 $->$ port 0, 1,  16  \\
\end{tabular}
\end{table}


\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received on ports 1, 16, 17
\item All frames sent to port 17 are received on ports 0, 1, 16
\item All frames sent to port 1 are received on ports 0, 16, 17
\item All frames sent to port 16 are received on ports 0, 1, 17
\end{itemize*}


\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{VLAN, broadcast}

\paragraph{Description} 

Braodcast forwarding.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l l}
VLAN  & port 0:      & VID=\{0, 1\}, & QMODE=trunk\\
      & port 1:      & VID=\{0, 1\}, & QMODE=trunk\\
      & port 16:     & VID=\{0, 2\}, & QMODE=trunk\\
      & port 17:     & VID=\{0, 2\}, & QMODE=trunk\\
      & other ports: & VID=0,        & QMODE=trunk\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1Q:     & port 0  \& 1 : VID=1, PRIO=0, dstMAC=broadcast \\
        &             & port 16 \& 17: VID=2, PRIO=0, dstMAC=broadcast \\
        &             &                  \\ 
TRAFFIC & send to:    & port 0, 1,16,17  \\
        & receive on: & port 0, 1,16,17  \\
STREAMS & bi-directional & port 0  $<->$ port 1  \\
        & bi-directional & port 16 $<->$ port 17 \\
\end{tabular}
\end{table}

\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received only on port 1
\item All frames sent to port 1 are received only on port 0
\item All frames sent to port 16 are received only on port 17
\item All frames sent to port 17 are received only on port 16
\end{itemize*}


\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{VLAN, broadcast, tagging/untagging}

\paragraph{Description} 

Broadcast forwarding.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l l}
VLAN  & port 0:      & VID=\{0, 1\}, & QMODE=access, VID-untagged=1\\
      & port 1:      & VID=\{0, 1\}, & QMODE=access, VID-untagged=1\\
      & port 16:     & VID=\{0, 2\}, & QMODE=access, VID-untagged=2\\\
      & port 17:     & VID=\{0, 2\}, & QMODE=access, VID-untagged=2\\
      & other ports: & VID=0,        & QMODE=trunk\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:     & no VLAN tag dstMAC=broadcast \\
        &             &                  \\ 
TRAFFIC & send to:    & port 0, 1,16,17  \\
        & receive on: & port 0, 1,16,17  \\
STREAMS & bi-directional & port 0  $<->$ port 1  \\
        & bi-directional & port 16 $<->$ port 17 \\
\end{tabular}
\end{table}

\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received only on port 1
\item All frames sent to port 1 are received only on port 0
\item All frames sent to port 16 are received only on port 17
\item All frames sent to port 17 are received only on port 16
\end{itemize*}

\newpage
\subsection{Snake}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Uniformly distributed load on all ports}

\paragraph{Description} 

The test verifies performance of the switch under extreme load on all ports.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{l l l l l}
VLAN  & port 0:      & VID=\{0, 1\}, & QMODE=access, FIX\_PRIO=0, PVID=1, VID-untagged=1\\
      & port 1:      & VID=\{0, 2\}, & QMODE=access, FIX\_PRIO=0, PVID=2, VID-untagged=2\\
      & port 2:      & VID=\{0, 2\}, & QMODE=access, FIX\_PRIO=0, PVID=2, VID-untagged=2\\
      & port 3:      & VID=\{0, 3\}, & QMODE=access, FIX\_PRIO=0, PVID=3, VID-untagged=3\\
      & port 4:      & VID=\{0, 3\}, & QMODE=access, FIX\_PRIO=0, PVID=3, VID-untagged=3\\
      & port 5:      & VID=\{0, 4\}, & QMODE=access, FIX\_PRIO=0, PVID=4, VID-untagged=4\\
      & port 6:      & VID=\{0, 4\}, & QMODE=access, FIX\_PRIO=0, PVID=4, VID-untagged=4\\
      & port 7:      & VID=\{0, 5\}, & QMODE=access, FIX\_PRIO=0, PVID=5, VID-untagged=5\\
      & port 8:      & VID=\{0, 5\}, & QMODE=access, FIX\_PRIO=0, PVID=5, VID-untagged=5\\
      & port 9:      & VID=\{0, 6\}, & QMODE=access, FIX\_PRIO=0, PVID=6, VID-untagged=6\\
      & port 10:     & VID=\{0, 6\}, & QMODE=access, FIX\_PRIO=0, PVID=6, VID-untagged=6\\
      & port 11:     & VID=\{0, 7\}, & QMODE=access, FIX\_PRIO=0, PVID=7, VID-untagged=7\\
      & port 12:     & VID=\{0, 7\}, & QMODE=access, FIX\_PRIO=0, PVID=7, VID-untagged=7\\
      & port 13:     & VID=\{0, 8\}, & QMODE=access, FIX\_PRIO=0, PVID=8, VID-untagged=8\\
      & port 14:     & VID=\{0, 8\}, & QMODE=access, FIX\_PRIO=0, PVID=8, VID-untagged=8\\
      & port 15:     & VID=\{0, 9\}, & QMODE=access, FIX\_PRIO=0, PVID=9, VID-untagged=9\\
      & port 16:     & VID=\{0, 9\}, & QMODE=access, FIX\_PRIO=0, PVID=9, VID-untagged=9\\
      & port 17:     & VID=\{0, 1\}, & QMODE=access, FIX\_PRIO=0, PVID=1, VID-untagged=1\\

\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:     & no VLAN tag   \\
        &             &               \\ 
TRAFFIC & send to:    & port 0,1,2,3  \\
        & receive on: & port 0,1,2,3  \\
STREAMS & bi-directional & port 0  $<->$ port 17  \\
        & bi-directional & port 1  $<->$ port 16 \\
\end{tabular}
\end{table}

\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received only on port 17
\item All frames sent to port 17 are received only on port 0
\item All frames sent to port 1 are received only on port 16
\item All frames sent to port 16 are received only on port 1
\item All received frames are untagged  (i.e. 802.1 with no VLAN tag)
\end{itemize*}

\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Non uniformly distributed load on ports}

\paragraph{Description} 

The test verifies how forwarding performance (latency, frame loss) is influenced by independent
streams on independent ports.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{l l l l l}
VLAN  & port 0:      & VID=\{0, 1\}, & QMODE=access, FIX\_PRIO=0, PVID=1, VID-untagged=1\\
      & port 1:      & VID=\{0, 2\}, & QMODE=access, FIX\_PRIO=0, PVID=2, VID-untagged=2\\
      & port 2:      & VID=\{0, 2\}, & QMODE=access, FIX\_PRIO=0, PVID=2, VID-untagged=2\\
      & port 3:      & VID=\{0, 3\}, & QMODE=access, FIX\_PRIO=0, PVID=3, VID-untagged=3\\
      & port 4:      & VID=\{0, 3\}, & QMODE=access, FIX\_PRIO=0, PVID=3, VID-untagged=3\\
      & port 5:      & VID=\{0, 4\}, & QMODE=access, FIX\_PRIO=0, PVID=4, VID-untagged=4\\
      & port 6:      & VID=\{0, 4\}, & QMODE=access, FIX\_PRIO=0, PVID=4, VID-untagged=4\\
      & port 7:      & VID=\{0, 5\}, & QMODE=access, FIX\_PRIO=0, PVID=5, VID-untagged=5\\
      & port 8:      & VID=\{0, 5\}, & QMODE=access, FIX\_PRIO=0, PVID=5, VID-untagged=5\\
      & port 9:      & VID=\{0, 6\}, & QMODE=access, FIX\_PRIO=0, PVID=6, VID-untagged=6\\
      & port 10:     & VID=\{0, 6\}, & QMODE=access, FIX\_PRIO=0, PVID=6, VID-untagged=6\\
      & port 11:     & VID=\{0, 7\}, & QMODE=access, FIX\_PRIO=0, PVID=7, VID-untagged=7\\
      & port 12:     & VID=\{0, 7\}, & QMODE=access, FIX\_PRIO=0, PVID=7, VID-untagged=7\\
      & port 13:     & VID=\{0, 8\}, & QMODE=access, FIX\_PRIO=0, PVID=8, VID-untagged=8\\
      & port 14:     & VID=\{0, 8\}, & QMODE=access, FIX\_PRIO=0, PVID=8, VID-untagged=8\\
      & port 15:     & VID=\{0, 9\}, & QMODE=access, FIX\_PRIO=0, PVID=9, VID-untagged=9\\
      & port 16:     & VID=\{0, 9\}, & QMODE=access, FIX\_PRIO=0, PVID=9, VID-untagged=9\\
      & port 17:     & VID=\{0, 1\}, & QMODE=access, FIX\_PRIO=0, PVID=1, VID-untagged=1\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 
 
\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:     & no VLAN tag   \\
        &             &               \\ 
TRAFFIC & send to:    & port 0,1,2,3  \\
        & receive on: & port 0,1,2,3  \\
STREAMS & bi-directional & port 0  $<->$ port 17  \\
        & bi-directional & port 1  $<->$ port 16 \\
\end{tabular}
\end{table}
Each combination of the following configuration :
\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME  & increment size [bytes]   & 64,65, 700,701, 1521, 1522\\
       & loads [\%]               & 50, 80, 95,100  \\
       & time of burst            & 5 min\\
\end{tabular}
\end{table}\\
shall be set for frame streams between ports 0 and 1 (direct connection). For each such 
combination, all config combinations shall be sent on ports 2 and 3 (snake).
This way, influence of switch load of 16 ports on the reminding two ports can be observed.

\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received only on port 17
\item All frames sent to port 17 are received only on port 0
\item All frames sent to port 1 are received only on port 16
\item All frames sent to port 16 are received only on port 1
\item All received frames are untagged  (i.e. 802.1 with no VLAN tag)
\end{itemize*}


\newpage 
\subsection{Frame storms}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Unicast}

\paragraph{Description} 

Unicast forwarding of a storm of unrecognized frames.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l l}
VLAN  & port 0:      & VID=0, & QMODE=unqualified\\
      & port 1:      & VID=0, & QMODE=unqualified\\
      & port 16:     & VID=0, & QMODE=unqualified\\
      & port 17:     & VID=0, & QMODE=unqualified\\
      & other ports: & VID=0, & QMODE=trunk (to avoid loops)\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:         & no VLAN tag, dstMAC=unicast  \\
        &                 &                  \\ 
TRAFFIC & send to:        & port 0, 1,16,17  \\
        & receive on:     & port 0, 1,16,17  \\
STREAMS & bi-directional  & port 0  $<->$ port 17 \\
        & bi-directional  & port 1  $<->$ port 16 \\
\end{tabular}
\end{table}
No learnig performed before sending traffic !
Time of burst: 1min (override default test config).

\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received on port 17
\item All frames sent to port 17 are received on port 0
\item All frames sent to port 1 are received on port 16
\item All frames sent to port 16 are received on port 1
\end{itemize*}


\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{VLAN, broadcast, tagging/untagging}

\paragraph{Description} 

Broadcast forwarding of a storm of unrecognized frames.

\paragraph{Switch Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l l}
VLAN  & port 0:      & VID=\{0, 1\}, & QMODE=access, VID-untagged=1\\
      & port 1:      & VID=\{0, 2\}, & QMODE=access, VID-untagged=2\\
      & port 16:     & VID=\{0, 2\}, & QMODE=access, VID-untagged=2\\
      & port 17:     & VID=\{0, 1\}, & QMODE=access, VID-untagged=1\\
      & other ports: & VID=0,        & QMODE=trunk\\
\end{tabular}
\end{table}

\paragraph{Tester Configuration} 

\begin{table}[ht!]
\begin{tabular}{ l  l l }
FRAME   & 802.1D:     & no VLAN tag dstMAC=broadcast \\
        &             &                  \\ 
TRAFFIC & send to:    & port 0, 1,16,17  \\
        & receive on: & port 0, 1,16,17  \\
STREAMS & bi-directional & port 0  $<->$ port 17  \\
        & bi-directional & port 1  $<->$ port 16 \\
\end{tabular}
\end{table}
No learnig performed before sending traffic !
Time of burst: 1min (override default test config).

\paragraph{Test passed if}

\begin{itemize*}
\item All frames sent to port 0 are received only on port 17
\item All frames sent to port 17 are received only on port 0
\item All frames sent to port 1 are received only on port 16
\item All frames sent to port 16 are received only on port 1
\end{itemize*}
