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.
1 Answer
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.
-
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? Feb 1, 2013 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).– SvenFeb 1, 2013 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. Feb 1, 2013 at 18:51
-
1The 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.– SvenFeb 1, 2013 at 18:58
-
The OS is excluded from the question. I know there is a way to calculate the Nic-to-Nic time. Feb 1, 2013 at 22:15