Skip to content

Instantly share code, notes, and snippets.

@PatrickDehkordi
Last active September 15, 2016 21:01
Show Gist options
  • Save PatrickDehkordi/ac0b1d6a7cb406c18ff628f0f55f3d9d to your computer and use it in GitHub Desktop.
Save PatrickDehkordi/ac0b1d6a7cb406c18ff628f0f55f3d9d to your computer and use it in GitHub Desktop.
Ethernet Frame Size calculation
Layer 1 Overhead:
Preamble (8 Bytes) + Ethernet Frame + Interpacket Gap (12 Bytes) = 20 Bytes
Layer 2 Overhead:
MAC Address (12 Bytes) + VLAN (4 Bytes) + Ethertype (2 Bytes) + IP Frame + CRC (4 bytes) = 18-22 Bytes
Layer 3:
Minimum is 46 Bytes. This is also known as MTU or Payload. It includes Layers 3 Headers.
Total if including layer 1 is 20 Bytes + 18 Bytes + 46 Bytes = 84 Bytes (88 with VLAN)
Total excluding layer 1 is 18 Bytes + 46 Bytes = 64 Bytes (68 with VLAN)
PPS x Packet Size (bytes) = Bandwidth (Bps)
PPS x Packet Size x 8 = BandWidth (bps)
PPS = BW / (Min Size x 8) = 10G / (84 x 8) = 10G / 672 = 14,880,952 ~ 15 Million Packets per second.
When using MTU (payload) make sure to add Layer 1 (20 Bytes) overhead + Layer 2 (18 Bytes) overhead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment