0

I understand it will depend on the speed of the ethernet 10 Mbit to 100 Gbit. Given an ethernet speed, how do I calculate the time spend in the wire from NIC-to-NIC? I am assuming here that the machines are in the same room, not across the country of course.

chrisapotek
  • 585
  • 2
  • 6
  • 17

1 Answers1

3

It doesn't matter if the distance is 10m or 3000km, the calculation is the same, as long as it's just a wire and no active components are involved.

A napkin type calculation, assuming speed of light: c = 300,000,000 m/s and lots of idealizations:

time on wire = distance / c   +  bits in MTU / data rate in bps

so, with a wire length of 10 m and 1 Gbps ethernet, you end up with:

t = 10 m  / 300,000,000 m/s  +  12,000 bit / 1,000,000,000 bit/s 
t =   0,00000003333333 s   +  0,000012 sec
t ~ 0,00001203s

or roughly 10 μs.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • I think you are wrong. You have to multiply this by 2, one for each NIC (i.e. the one sending and the one receiving). No? – chrisapotek Feb 01 '13 at 18:41
  • No. It's the time one packet will need to travel the distance to the other NIC. Sending a confirmation packet is a completely different operation (and is *much* faster, as it will be a lot smaller). – Sven Feb 01 '13 at 18:47
  • I will have to double-check because I was under the impression that you need a send operation and a receive operation, therefore there is time spent on EACH NIC on two different operations and each one take time. – chrisapotek Feb 01 '13 at 18:51
  • 1
    The time from NIC to NIC including all the processing the NIC and the OS has to do has nothing to do with the on-the-wire time (which is the time the electric signal takes to traverse the wire). This is not easy to calculate (if at all) as this depends on a lot of other factors. – Sven Feb 01 '13 at 18:58
  • The OS is excluded from the question. I know there is a way to calculate the Nic-to-Nic time. – chrisapotek Feb 01 '13 at 22:15
  • What do want to know exactly? The time the signal spend on the wire? That's about all where you have a chance to calculate the time because it's just simple physics. Everything beyond that is dependent on the hardware. What is your problem anyway? – Sven Feb 01 '13 at 22:22
  • "is is dependent on the hardware" - YES, it is dependent on the NIC. So maybe all you have to do is take the ethernet SPEED, multiply by 2 (two nics) and that's it. – chrisapotek Feb 01 '13 at 22:23
  • If you don't explain what time period it is exactly you want (and why, iow. what your problem is), we can discuss back and forth without coming to a solution. I can guarantee though that at no point you'll end up with multiplying some value by 2 because two NICs are involved. – Sven Feb 01 '13 at 22:29