3

What is the common practice of calculating a speed of an ethernet enabled device, and which standard (IEC or JEDEC) is used?

I'm developing and testing a product that is interconnected via ethernet.

The test is basically sending several thousand packets, of specified "effective" size in bytes (without the header), and receiving a time it takes to process all of them.

My intentions are to get a speed that can be compared to a speed of a switch or a router.

I'm confused by how is the resulting speed calculated.

The base equation in my case is:

(packet_size * packet_count) / time_total = speed_in_Bps

But when i neet to get Mb/s is it:

(speed_in_Bps * 8) / (1024 ^ 2)

or:

(speed_in_Bps * 8) / (10 ^ (3 * 2))

or is it some other way that these speeds are calculated?

An example of results with 256MB * 10000 packets processed at 300ms, the fist one gives me speed of 65.1 Mb/s and the second one gives 68.2 Mb/s

5
  • did you have a look at iperf? – JFL Aug 28 '17 at 10:37
  • @JFL that is great, but my use case requires a lot of processing on both ends, which has to be taken into account, and so i can't use it. – The guy Aug 28 '17 at 12:30
  • Ok, I was actually wondering if you were measuring the network performance or the hosts processing time. – JFL Aug 28 '17 at 12:36
  • When discussing network speed, you use powers of 10, not powers of 2, for measuring. For example, 1000 bps is 1 Kbps; don't use 1024 bps as 1 Kbps. Also, ethernet has a lot of overhead with the Preamble, SoF Delimiter, Frame Header, FCS, and Inter-packet Gap. – Ron Maupin Aug 28 '17 at 13:37
  • If you're using TCP for transport, the L1+L2+L3+L4 overhead per packet is 78 bytes. So, if you're using MTU-sized packets, 1460 payload create a 1538 byte Ethernet packet + IPG on the wire with a maximum throughput of 118.66 MB/s per gigabit link speed. If you're using "raw" Ethernet, the overhead reduces to 38 bytes with a payload of 1500 bytes (121.9 MB/s per Gbit/s). – Zac67 Aug 28 '17 at 17:49
3

EDITED

Despite the extended usage of binary in computer world and power of two based units (Byte, 32-bits word etc...), network bandwidth is commonly expressed in power of ten units.

So it is (speed_in_Bps * 8) / (10 ^ (3 * 2)) (or /50^3)

10
  • 1
    Are you sure? I have never seen bandwith being calculated as powers of 2, and en.wikipedia.org/wiki/Data_rate_units seems to agree. – Teun Vink Aug 28 '17 at 13:09
  • @TeunVink you're right. Shame on me... it's the other way around. – JFL Aug 28 '17 at 13:16
  • No worries :) I suggest you fix your answer, especially since it got accepted. – Teun Vink Aug 28 '17 at 13:17
  • @JFL Thanks for fixing it, even tho it made me confused for a while ;) – The guy Aug 28 '17 at 14:57
  • It absolute makes no sense to use binary prefixes in communications. Binary prefixes only make sense where sizes are naturally based on the binary system, ie. in RAM. They're also historically used for storage (HDDs, file sizes) in various OSes but that doesn't make too much sense either. However, they're never (seriously) used for communication, not even historically. – Zac67 Aug 28 '17 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.