juniper:how_many_packets_per_second_per_port_are_needed_to_achieve_wire-speed

This is an old revision of the document!


<HTML> <section slot=“article-content”>

  <strong><span style="text-transform:uppercase; font-size:135%;">Summary:</span></strong><br>
  <div class="content nonfileattachment">When evaluating or measuring an Ethernet device's (switches, routers,
      firewalls) performance capabilities, the main indicator that most will consider is the raw bandwidth that the
      device backplane can provide.<br>
      <br>
      However it is also important to make sure that the device has the capacity or the ability to switch/route as
      many packets as required to achieve wire rate performance. This metric is called the ‘Packets per Second’ or PPS
      for short.<br>
      <br>
      This article details how to calculate how many packets per second processing capabilities is required from a
      port to achieve wire-rate performance.
  </div>
  <strong><span style="text-transform:uppercase; font-size:135%;">Solution:</span></strong><br>
  <div class="content nonfileattachment">
      <p><em>Note: This article focuses on Ethernet; other mediums such as ATM will have other considerations for
              calculating PPS.</em></p>
      <p>To calculate the amount of packets per second a port must be able to handle to achieve wire-rate performance
          we need to take into consideration the fact that the IP protocol allows for variable payload sizes which in
          turn plays a part in our PPS calculation.</p>
      <p>The smaller the packet passing on the wire the more packets that need to be switched to achieve wire-rate
          performance; while on the other hand, larger packets will require less PPS throughput to achieve wire-rate.
          As such to calculate how many PPS&nbsp;needed to achieve&nbsp;wire-speed we need only be concerned with
          small packet sizes since they will be the most taxing for the switch and will yield the larger PPS number.
          Naturally we will assume that no collisions occur on the medium.</p>
      <p>We need to see how much ‘space’ each packet will occupy so we will look at the&nbsp;frame size in which the
          smallest packet will be encapsulated, as well as the inter-frame gap, and the preamble since they occupy
          ‘space’ in between frames.</p>
      <div style="margin-left:40px"><img alt=""
              src="https://kb.juniper.net/library/CUSTOMERSERVICE/14737/min_frame.JPG"
              style="height:57px; width:510px"></div>
      <div style="margin-left:40px"><strong>Figure 1: ‘Space’ Occupied by the smallest packet</strong></div>
      <p>As seen in figure 1, a packet will occupy at least 84 bytes on the wire. So taking the example of a 1G port
          we first have to convert the speed into bytes:</p>
      <p style="margin-left:40px">
          <code>1Gbps = 1,000,000,000 bits/s = (1,000,000,000 bits/s) / (8 bits/byte)= 125,000,000 bytes/s</code></p>
      <p>Then we can calculate how many packets per second need to be processed if the port is to transmit at wire
          speed:</p>
      <p style="margin-left:40px"><code>PPS = (125,000,000 bytes/s) / (84 bytes/packet) = 1,488,095 pps.</code></p>
      <p>Similarly this same calculation can be extended to different port speeds:</p>
      &nbsp;
      <div style="margin-left:40px"><img alt="" src="https://kb.juniper.net/library/CUSTOMERSERVICE/14737/Table1.JPG"
              style="height:148px; width:570px"></div>
      <div style="margin-left:40px"><strong>Table 1: PPS Calculation</strong></div>
      <p>From the above table we see how many packets per second an Ethernet device must be able to handle per port in
          order to achieve wire speed. The above calculation however does not take into consideration additional tags
          that might be available in an Ethernet frame such as VLAN tags or MPLS labels. These will be covered in the
          following sections.</p>
      <p><u><strong>VLAN Tags</strong></u></p>
      <p>VLAN Tagging or Trunking is used to carry multiple VLANs over one physical wire. To do so we need a
          distinguisher for the different VLANs traversing the link. There are multiple methods to perform the VLAN
          identification but for the scope of this article we will only look at the standards based method which is
          the IEEE 802.1q.</p>
      <p>The IEEE 802.1q standard states that Ethernet ports in trunk mode will insert a 32bit field between the
          Source MAC address and the Type field. Consequently our ‘minimum’ frame will have the following appearance
          on the wire:</p>
      &nbsp;
      <div style="margin-left:40px"><img alt=""
              src="https://kb.juniper.net/library/CUSTOMERSERVICE/GLOBAL_JTAC/14737/Figure2.JPG"
              style="height:54px; width:571px"></div>
      <div style="margin-left:40px"><strong>Figure 2: 802.1Q tagged minimum frame</strong></div>
      <p>As we can see the minimum frame has increased in size by 4 bytes. Let’s examine how this will affect the
          calculations we have performed above since the minimum ‘space’ that a frame will occupy has increased from
          84 bytes to 88 bytes while taking the wire speed of 1Gbps as an example:</p>
      <p style="margin-left:40px">
          <code>1Gbps = 1,000,000,000 bits/s = (1,000,000,000 bits/s) / (8 bits/byte)= 125,000,000 bytes/s</code></p>
      <p style="margin-left:40px"><code>PPS = (125,000,000 bytes/s) / (88 bytes/packet) = 1,420,454 pps.</code></p>
      <p>From the above calculation, it is apparent that the amount of packets that the wire can pass per second has
          decreased slightly. This is to be expected since the wire now has to carry more information for every packet
          processed.</p>
      <p>The above table is shown below with the values recalculated for 802.1Q tagged packets.</p>
      <div style="margin-left:40px"><img alt=""
              src="https://kb.juniper.net/library/CUSTOMERSERVICE/GLOBAL_JTAC/14737/Table2.JPG"
              style="height:143px; width:554px"></div>
      <div style="margin-left:40px"><strong>Table 2: PPS Calculation (802.1Q)</strong></div>
      <p>It is worth noting that within the 802.1Q standard, there is a concept of a ‘Native VLAN’. This means that
          dot1Q will not tag the frame egressing the trunk port for one select VLAN. For these particular frames, the
          first calculation will apply since they do not contain the dot1Q tag.</p>
      <p><u><strong>Q-in-Q</strong></u></p>
      <p>An amendment to the 802.1Q standard is the 802.1ad or otherwise known as Q-in-Q. The purpose of this
          amendment was to create a method for users to run their own VLANs inside the VLANs offered by a Metro
          Ethernet Service Provider. To achieve this goal a second tag is inserted in the Ethernet frame to
          distinguish the customer VLANs as shown below:</p>
      <div style="margin-left:40px"><img alt=""
              src="https://kb.juniper.net/library/CUSTOMERSERVICE/GLOBAL_JTAC/14737/Figure3.JPG"
              style="height:48px; width:576px"></div>
      <div style="margin-left:40px"><strong>Figure 3: 802.1ad tagged frame</strong></div>
      <p>For the purposes of our calculation this second tag will increase the ‘space’ a single frame will occupy by
          another 4 bytes. As such the smallest frame size will increase again from 88 bytes to 92 bytes total.
          Therefore our speeds/PPS table will look as follows:</p>
      <div style="margin-left:40px"><img alt=""
              src="https://kb.juniper.net/library/CUSTOMERSERVICE/GLOBAL_JTAC/14737/Table3.JPG"
              style="height:143px; width:553px"></div>
      <div style="margin-left:40px"><strong>Table 3: PPS Calculation (802.1ad)</strong></div>
      <p>As it is becoming readily noticeable, the more information we encode in the packet the more the maximum
          number of packets per second limit drops for each wire speed.</p>
      <p><u><strong>MPLS</strong></u></p>
      <p>Another Ethernet technology which alters the frame on the wire is Multi Protocol Label Switching (MPLS). MPLS
          operates between Layers 2 and 3 of the OSI model and is frequently referred to as a Layer 2.5 protocol. MPLS
          works by prefixing packets with an MPLS header, containing one or more 'labels'. These labels are used for
          deciding where the traffic will go to next in the network. Each label is 32 bits in length.</p>
      <p>MPLS labels can be stacked in one frame to allow more flexibility in MPLS packet handling. From the frame
          point of view, our PPS calculation will depend on how many labels are stacked in the frame. The maximum
          number of labels that can be placed on one frame depends on factors affecting the processing of the frame
          such as MTU size for that segment and the capability of the device to process frames with that amount of
          labels in them.</p>
      <p>For our example we will look at a packet with 3 labels placed in it:</p>
      &nbsp;
      <div style="margin-left:40px"><img alt=""
              src="https://kb.juniper.net/library/CUSTOMERSERVICE/GLOBAL_JTAC/doctorpeck/KB%20correction%20image.gif"
              style="height:50px; width:576px"></div>
      <div style="margin-left:40px"><strong>Figure 4: MPLS tagged frame</strong></div>
      <p>As you can see, each label will occupy 4 more bytes of ‘space’ on our wire. As such for the 3 label example
          the total size of the frame on the wire will be 96 bytes. The formula for calculating wire packets per
          second should be apparent by now and it will result in the following speeds for the 3 label example shown
          above:</p>
      <div style="margin-left:40px"><img alt=""
              src="https://kb.juniper.net/library/CUSTOMERSERVICE/GLOBAL_JTAC/14737/Table4.JPG"
              style="height:145px; width:556px"></div>
      <div style="margin-left:40px"><strong>Table 4: PPS for a 3 label MPLS packet</strong></div>
      <em><strong>References:</strong></em><br>
      <br>
      <a href="http://en.wikipedia.org/wiki/Wire_speed"
          target="_blank">http://en.wikipedia.org/wiki/Wire_speed</a><br>
      <br>
      <a href="http://en.wikipedia.org/wiki/Interframe_gap"
          target="_blank">http://en.wikipedia.org/wiki/Interframe_gap</a>&nbsp;&nbsp;<br>
      <br>
      <a href="http://www.erg.abdn.ac.uk/users/gorry/course/lan-pages/mac.html"
          target="_blank">http://www.erg.abdn.ac.uk/users/gorry/course/lan-pages/mac.html</a> &nbsp;<br>
      <br>
      <a href="http://en.wikipedia.org/wiki/IEEE_802.1Q" target="_blank">http://en.wikipedia.org/wiki/IEEE_802.1Q</a>
      &nbsp;<br>
      <br>
      <a href="http://en.wikipedia.org/wiki/IEEE_802.1ad-2005"
          target="_blank">http://en.wikipedia.org/wiki/IEEE_802.1ad-2005</a> &nbsp;<br>
      <br>
      <a href="http://en.wikipedia.org/wiki/Multiprotocol_Label_Switching"
          target="_blank">http://en.wikipedia.org/wiki/Multiprotocol_Label_Switching</a> &nbsp;<br>
      <br>
      <a href="http://www.ietf.org/rfc/rfc3032.txt" target="_blank">http://www.ietf.org/rfc/rfc3032.txt</a>
  </div>
  <style>
      jnpr-kb-article-content .table-wrapper {
          overflow-x: scroll;
          padding-top: 10px;
      }
      jnpr-kb-article-content strong span {
          padding: 1.2rem 0 0;
          display: inline-block;
      }
      jnpr-kb-article-content .content {
          color: #6c6c6c;
          line-height: 1.5rem;
      }
      jnpr-kb-article-content .content table {
          margin-top: 1rem;
      }
      jnpr-kb-article-content .content h3 {
          font-weight: 500;
          font-size: 1.5rem;
          margin: auto;
          padding-top: 20px;
      }
      jnpr-kb-article-content p {
          color: #6c6c6c;
          font-size: 16px;
          margin: 0 0 10px;
          line-height: 1.5;
      }
      jnpr-kb-article-content p.table-heading {
          margin: 0;
      }
      jnpr-kb-article-content p.article-name {
          font-size: 24px;
          color: #333;
      }
      jnpr-kb-article-content .section {
          padding: 1rem 0;
      }
      jnpr-kb-article-content .table-wrapper table {
          position: relative;
          border-collapse: collapse;
          font-weight: 500;
          width: 100% !important;
      }
      jnpr-kb-article-content .header table tbody tr:first-child {
          border: none;
          padding: 0;
          background-color: var(--table-header-bg-color);
          color: var(--table-header-text-color);
          height: 100%;
      }
      jnpr-kb-article-content .header table tbody tr:last-child {
          border-right: none;
      }
      jnpr-kb-article-content .table-wrapper table tbody tr:first-child th {
          font-size: 1rem;
          font-weight: 500;
          line-height: 1.1;
          letter-spacing: .025em;
          border-right: 2px solid #fff;
          background-clip: padding-box;
          text-align: left;
          vertical-align: middle;
          padding: 10px;
          width: 5%;
      }
      jnpr-kb-article-content .table-wrapper table tbody tr:not(:first-child):not(.reverse) th:first-child {
          background-color: var(--table-sub-header-bg-color) !important;
          color: var(--table-sub-header-text-color);
      }
      jnpr-kb-article-content .table-wrapper table tbody tr:first-child th strong {
          color: #fff;
      }
      jnpr-kb-article-content .table-wrapper table tbody tr {
          padding: 20px;
          border-bottom: 1px dotted gray;
      }
      jnpr-kb-article-content .table-wrapper table tbody tr:last-child {
          border-bottom: 1px solid var(--table-header-bg-color);
          ;
      }
      jnpr-kb-article-content .table-wrapper table tbody td {
          font-size: 13.6px;
          padding: 10px;
          background-clip: padding-box;
          position: relative;
          background-size: 100% 100%;
          box-sizing: border-box;
          table-layout: auto;
          width: 100px !important;
      }
      jnpr-kb-article-content .table-wrapper.no-header table tbody td {
          padding: 0 5px;
      }
      jnpr-kb-article-content .table-wrapper.no-header table tbody td a {
          color: var(--table-header-bg-color);
          width: 100%;
          display: inline-block;
          padding: 5px;
          text-decoration: underline;
      }
      jnpr-kb-article-content .table-wrapper table tbody tr td:nth-child(odd) {
          background-color: var(--table-alternate-bg-color);
      }
      jnpr-kb-article-content .table-wrapper table tbody tr.reverse td:nth-child(even) {
          background-color: var(--table-alternate-bg-color);
      }
      jnpr-kb-article-content .table-wrapper table tbody tr.reverse td:nth-child(odd) {
          background-color: var(--table-header-text-color);
      }
      jnpr-kb-article-content .table-wrapper table tbody td:last-child {
          border-right: none;
      }
      jnpr-kb-article-content pre {
          white-space: pre-wrap !important;
          margin: 1rem;
          word-break: break-all;
      }
      jnpr-kb-article-content blockquote {
          margin: 1rem;
      }
      jnpr-kb-article-content h4 {
          font-size: 1.2rem;
      }
      @media only screen and (max-width: 639px) {
          jnpr-kb-article-content .table-wrapper {
              border: 1px solid #ccc;
              box-shadow: inset 0 0 10px #ccc;
          }
      }
  </style>
  </jnpr-kb-article-content>

</section>

</HTML>

juniper/how_many_packets_per_second_per_port_are_needed_to_achieve_wire-speed.1641358633.txt.gz · Last modified: 2022/01/04 23:57 by aperez

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki