This post in about calculating Throughput in bps (Bits per second) and pps (Packets per second)
Some Basics:
1 Megabit per second = 1e+6 Bit per second
1 Gigabit per second = 1e+9 Bit per second
Difference between the Frame and Packet:
A packet and a frame are both packages of data moving through a network.
A packet exists at Layer 3 of the OSI Model, whereas a frame exists at Layer 2 of the OSI Model.
Layer 2 is the Data Link Layer. The best known Data Link Layer protocol is Ethernet.
Layer 3 is the Network Layer. The best know Network Layer protocol is IP (Internet Protocol).
To move through a network, a packet is encapsulated into one or more frames, depending upon the MTU size.
Ethernet Frame header with and without VLAN tags:
How is Overhead Calculated?
7 bytes of Preamble + 1 byte of Start Frame Delimiter + 12 bytes of Inter Packet Gap = 20 Bytes
IF VLAN is tagged, the overhead is 24 bytes.
7 bytes of Preamble + 1 byte of Start Frame Delimiter + 12 bytes of Inter Packet Gap + 4 bytes VLAN = 24 Bytes
Throughput calculation in bps (Bits per second)
Throughput = [Frame Size / (Frame Size + Overhead)] * Switch Port Capacity
Assumptions:
Sending tagged traffic, so the overhead is 24 bytes.
Switch port capacity is 1Gbps (or) 1000 Mbps
The Throughput rate is otherwise known as the Line rate.
Let’s calculate throughput for different Fixed Packet sizes:
Packet Size | Port Capacity | Throughput Calculation | Throughput |
64 byte | 1 GE (or) 1000Mbps | [64 / (64+24)] * 1000 Mbps | 727 Mbps |
128 byte | 1 GE (or) 1000Mbps | [128 / (128+24)] * 1000 Mbps | 842 Mbps |
256 byte | 1 GE (or) 1000Mbps | [256 / (256+24)] * 1000 Mbps | 914 Mbps |
512 byte | 1 GE (or) 1000Mbps | [512 / (512+24)] * 1000 Mbps | 955 Mbps |
1024 byte | 1 GE (or) 1000Mbps | [1024 / (1024+24)] * 1000 Mbps | 977 Mbps |
1280 byte | 1 GE (or) 1000Mbps | [1280 / (1280+24)] * 1000 Mbps | 981 Mbps |
1518 byte | 1 GE (or) 1000Mbps | [1518 / (1518+24)] * 1000 Mbps | 984 Mbps |
Note: Larger the Frame size, higher is the throughput.
Throughput calculation in pps (Packets per second)
Since most of the vendor datasheet reflect in Mpps, We will be converting pps to Mpps.
Mpps stands for Mega/Million Packet per Second
Scenario:
In a switch with 24 GE ports, Each GE port can generate 1Gbps in and 1Gbps out and therefore a 24 GE port switch can generate 48 Gbps of traffic.
48Gbps is the maximum traffic that can be sent on a 24 port switch.
Now let’s calculate throughput in Mpps for 64 byte frame and 1518 byte frame.
Packet Size: 64 Byte
- Converting Gbps to bits per second
48Gbps = 48000000000 bps
- Converting bps to bytes per second (1 byte = 8 bits)
48000000000 bps/8 = 6000000000 Bps
- Calculating packets per second. Considering worst case frame size of 64 Bytes and 20 bytes of overhead. 84 byte is the minimum possible size frame.
6000000000 Bps/ (64+20) = 71,428,571 packets per second
- Converting pps to Mpps. (Mega/Million = 1e+6)
71,428,571 packets per second / 1000000 = 71.42 Mpps
Packet Size: 1518 Byte
- Converting Gbps to bits per second
48Gbps = 48000000000 bps
- Converting bps to bytes per second (1 byte = 8 bits)
48000000000 bps/8 = 6000000000 Bps
- Calculating packets per second. Considering frame size of 1518 Bytes and 20 bytes of overhead.
6000000000 Bps / (1518 + 20) = 3,901,170 packets per second
- Converting pps to Mpps. (Mega/Million = 1e+6)
71,428,571 packets per second / 1000000 = 3.9 Mpps
Note: Smaller the frame size, higher is the Mpps (Million Packets per Second) to be processed.
System Throughput capacity on an Aruba 24 port 2930M switch is 95.2 Mpps, but you actually need only 71.42 Mpps.
Even with every port running at 100% utilization with the smallest possible frame size allowed for Ethernet, the switch is not the bottleneck.
This is called non-blocking throughput.