Rants/PPS vs BPS

From TomJudge.com
Jump to: navigation, search

Contents

PPS vs BPS

PPS
Packets Per Second
BPS
Bits Per Second

Context

In ##FreeBSD we see lots of questions about setting up routers, bridges and firewalls using FreeBSD on commodity hardware.

Background

Ethernet frames have the following structure:

  • 7 octet preamble
  • 1 octet start frame
  • 6 octet destination mac
  • 6 octet source mac
  • 2 octet ethertype field
  • payload upto 1500 octets
  • 0-48 octet pad
  • 4 octet frame check sequence
  • 12 octet interframe gap.

The data payload must be at least 48 octets, if it is less than this then the frame must be padded with 0's to make the payload longer.

Based on this we can work out the best and worst case (these are subjective terms) frame sizes:

Smallest frame
86 octets
Largest frame
1538 octets

Transmission Speeds (PPS)

As this is related to Ethernet then we will look at speeds for common Ethernet protocols.

Gigabit Ethernet
1 bit = 1ns
100 Mbit Ethernet
1 bit = 10ns
Speed Frame Size (octets) Transmission Speed (ns/bit) Transmission Time (ns/frame) Frames Per Second
Gigabit 86 1 688 1453488.37
Gigabit 1538 1 12304 81274.38
100Mbit 86 10 6880 145348.84
100Mbit 1538 10 123040 8127.44

Though put (BPS)

Speed Frame Size (octets) Useful Payload (octets/frame) Frames Per Second Though put (bps)
Gigabit 86 48 1453488.37 558139534.88
Gigabit 1538 1500 81274.38 975292587.78
100Mbit 86 48 145348.84 55813953.49
100Mbit 1538 1500 8127.44 97529258.78


So why does this matter?

For a modern system with good quality NIC's in there is very little host involvement in receiving the packet due to use of DMA and interrupt modulation. The main work load is in packet processing including (but not limited to):

  • Filtering (PF/IPFW/IPtables)
  • L3 Route lookup (In routers)
  • L2 Route lookup (in routers and bridges)

Each of these items carries with it a number of consumed cycles per packet regardless of the size of the packet. A modern server may be able to forward 500kpps with out breaking a sweat (and you can see that bps can vary largely based on the frame size). If you where to make this box a firewall as well then the PPS may drop to 200kpps.

Personal tools