Description

When assessing the performance of Ethernet devices such as switches, routers, or firewalls, it’s common to look first at the raw backplane bandwidth they support.

However, achieving true wire‑rate performance also depends on how many packets per second the device is able to switch or route per port. This capability—measured in Packets per Second (PPS)—indicates whether the device can switch or route the required number of packets per port to fully utilize its bandwidth.

This article explains how you can calculate the number of packets per second a port needs to process to achieve optimal wire-rate performance.

Solution

Note: This article focuses on Ethernet; other mediums such as ATM will have other considerations for calculating PPS.

To calculate the number of packets per second a port must be able to handle to achieve wire-rate performance, you need to also take into consideration the variable payload sizes that the IP protocol allows. If the packet passing on the wire is smaller, more packets need to be switched to achieve wire-rate performance; on the other hand, larger packets will require less PPS throughput to achieve wire-rate. Therefore, to calculate how many packets per second are needed to achieve wire-speed per port, you need be concerned only with the small packet sizes since they will be the most taxing for the switch. Note that you are also assuming that no collisions are occurring on the medium.

You will need to see how much "space" each packet will occupy. So you need to look at the frame size in which the smallest packet will be encapsulated, the inter-frame gap, and the preamble since it occupies "space" in between the frames.

alt

Figure 1: ‘Space’ Occupied by the smallest packet

As seen in figure 1, a packet will occupy at least 84 bytes on the wire. So in a 1G port, for example, you first must convert the speed into bytes:

1Gbps = 1,000,000,000 bits/s = (1,000,000,000 bits/s) / (8 bits/byte)= 125,000,000 bytes/s 

Then you can calculate how many packets per second need to be processed if the port is to transmit at wire speed:

PPS = (125,000,000 bytes/s) / (84 bytes/packet) = 1,488,095 pps. 

Similarly this same calculation can be extended to different port speeds: 

alt

Table 1: PPS Calculation

From the above table, you can 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.

VLAN Tags

VLAN Tagging or Trunking is used to carry multiple VLANs over one physical wire. To do so, you need a distinguisher for the different VLANs that are traversing the link. There are multiple methods to perform VLAN identification but for the scope of this article, we will only look at the standards based method, which is the IEEE 802.1q.

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 the "minimum" frame will have the following appearance on the wire: 

alt

Figure 2: 802.1Q tagged minimum frame

As you 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:

1Gbps = 1,000,000,000 bits/s = (1,000,000,000 bits/s) / (8 bits/byte)= 125,000,000 bytes/s 
PPS = (125,000,000 bytes/s) / (88 bytes/packet) = 1,420,454 pps.

From the above calculation, it is apparent that the number 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.

The above table is shown below with the values recalculated for 802.1Q tagged packets.

alt

Table 2: PPS Calculation (802.1Q)

It is worth noting that within the 802.1Q standard, there is a concept of "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.

Q-in-Q

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:

alt

Figure 3: 802.1ad tagged frame

For the purposes of our calculation, this second tag will increase the "space" that 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 speed/PPS table will look as follows:

alt

Table 3: PPS Calculation (802.1ad)

As you see, if we encode more information in a packet, the maximum number of packets per second limit drops further for each wire speed.

MPLS

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 to decide where traffic will go to next in the network. Each label is 32-bits in length.

MPLS labels can be stacked in one frame to allow more flexibility in MPLS packet handling. From a 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.

For our example, we will look at a packet with three labels placed in it:

alt

Figure 4: MPLS tagged frame

As you can see, each label will occupy 4 more bytes of "space" on our wire. Therefore, for the three-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 three-label example shown above:

alt

Table 4: PPS for a 3 label MPLS packet

 

Modification History

2020-03-22: Article reviewed for accuracy; no changes required

2026-02-03: Minor, non-technical changes made for search optimization

 

Related Information

References