Data Rate vs Line Rate

Ostinato Team bio photo By Ostinato Team

To understand the difference between data rate and line rate, we need to first look at the Ethernet frame format.

This guide will explain in context of Ethernet frames, but the same principles apply to other link layer protocols.

Ethernet Frame Format

This is the Ethernet frame format that we are all familiar with:

+=========+=========+=========+===============+=========+
|   DMAC  |   SMAC  |   Type  |    Payload    |   FCS   |
| 6 bytes | 6 bytes | 2 bytes | 46-1500 bytes | 4 bytes |
+=========+=========+=========+===============+=========+

When this frame is carried on the Ethernet link, additional fields are added to the frame.

+=========+=========+=========+===============+=========+
|   DMAC  |   SMAC  |   Type  |    Payload    |   FCS   |
| 6 bytes | 6 bytes | 2 bytes | 46-1500 bytes | 4 bytes |
+=========+=========+=========+===============+=========+
 \                                                     /
  \                                                   /
   +--------------+                    +-------------+
                   \                  /
+==========+========+================+=================+
| Preamble |   SFD  | Ethernet Frame | Inter-Frame Gap |
|  7 bytes | 1 byte |  64-1518 bytes |    12 bytes     |
+==========+========+================+=================+

This adds 20 bytes of overhead per Ethernet frame.

When we talk about Ethernet frame sizes, we always talk about the frame size including FCS but without this overhead.

Ostinato also uses this frame size definition when configuring the stream’s frame size.

The rest of this guide will also mean this when referring to “frame size”.

Data Rate and Line Rate

When you calculate bit rate using frame size (without overhead) you get the data rate.

When you calculate bit rate using frame size (with overhead) you get the line rate.

The data rate will ALWAYS be less than the line rate.

Let’s see an example.

For an Ethernet port transmitting 512-byte frames at 1000 frames per second,

  • The data rate is 1000 frames/second * 512 bytes/frame * 8bits/byte = 4,096,000 bits/s or 4.1 Mbps.
  • The line rate is 1000 frames/second * (512 bytes/frame + 20 bytes/frame overhead) * 8bits/byte = 4,256,000 bits/s or 4.3 Mbps.

That difference of 0.2 Mbps between data rate and line rate may not seem like much, but the difference changes depending on the frame size and sometimes significantly.

To understand more let’s compare the percentage overhead.

Percentage Overhead

The overhead of 20 bytes is always fixed for all frame sizes. But the percentage overhead changes depending on the frame size.

  • 20 byte overhead for 1518-byte frame = 20/1518 = 1.32%
  • 20 byte overhead for 512-byte frame = 20/512 = 3.91%
  • 20 byte overhead for 64-byte frame = 20/64 = 31.25%

Let’s see the impact of this overhead with an example.

For a 1G Ethernet port transmitting 64-byte frames at full line rate (1000 Mbps),

  • Frame rate = 1000 Mbps / ((64 bytes/frame + 20 bytes/frame overhead) * 8bits/byte) = 1,488,095 frames/second or 1.49 million frames/second

Converting this frame rate to data rate,

  • Data rate = 1,488,095 frames/s * 64 bytes/frame * 8bits/byte = 761,904,640 bits/s or 761.9 Mbps.

In summary, for 64-byte frames, the line rate of 1000 Mbps corresponds to data rate of only 761.9 Mbps. This is because of the high overhead for small frames.

Which rate does Ostinato use?

When configuring port or stream bitrate, you are configuring the line rate.

When displaying Port Stats and Stream Stats, Ostinato displays line rate.

Why does Ostinato always use line rate?

This is because when we talk about 1G or 10G NIC speeds, we are talking about the line rate. So Ostinato always uses line rate to make it easier to compare the actual Tx/Rx rate against the maximum possible rate for the port.