Find the router delay of the route in this infrastructure.

We can't find the parameters provided by the manufacturer. We don't have other ways to test TCP packet delay in this infrastructure, either.

But we can get ICMP packet delay in this infrastructure by analyzing the "ping" result.

So if we set ICMP request size to 1472Bytes, plus ICMP header (8Bytes), IP header( 20 Bytes ) == MTU 1500 Bytes. Viewed from layer 2, the traffic is equivalent to the traffic when TCP request size is 1448Bytes. We can approximate the TCP delay by ICMP delay.

 

My calculation of the one delay by the router and wire is about 145 uSec. See the following calculation

 

Calculate the ICMP delay( uSec ). There is one telnet session to madrid. one telnet session to dublin
Connection: from madrid 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th AVG Var
Local ==>192.168.1.2 22 18 23 17 38 46 22 16 20 17 23.9 7.24
==>192.168.3.1 18 22 18 21 17 32 18 20 38 19 22.3 5.08
==>132.177.8.27 16 21 16 21 28 19 18 20 17 20 19.6 2.4
One Hop ==>192.168.1.1 340 335 338 333 340 339 336 333 334 336 336.4 2.28
==>192.168.2.1 334 341 334 335 339 336 336 332 331 339 335.7 2.5
Two Hops ==>192.168.2.2 630 626 626 622 628 628 626 620 620 624 625 2.8

The experiment raw data are: self1.2, self3.1, self8.27, oneHop1.1, oneHop2.1, twoHops2.2

Explanation: Because the first ping packet always take a lot longer to get response than the other ping packets, we did not include it in the statistics

 

Data journey

local data:   User space( ping data ) ----> Kernel Space (ICMP layer --> IP layer: Here kernel knows the packet is local, send data upwards..ICMP layer reply---> IP layer  ) --->User space

Question: How many times of copying data between user space and kernel space is done here? 2 or 4 ?

One Hop Data:  User space(Madrid: ping data )--->Kernel Space( ICMP layer-->IP layer: Here kernel decides to forward packet )--->device driver queue madri:eth1--->Sending data ...... cable delay ...... Receiving Data ---->Device driver Queue dublin:eth2-->Kernel Space(Dublin:  IP layer: Here kernel decides to send data upward--->)--->User Space (reply)-->Kernel Space(ICMP layer--->Reply --->IP layer)--->Device driver Queue dublin:eth2--->Sending Reply data .....cable delay.....Receiving Data ---->Device driver Queue madrid:eth1-->Kernel space( IP layer:---> ICMP layer)--->User space( ping result )

Two Hops Data: User space(Madrid: ping data )--->Kernel Space( ICMP layer-->IP layer: Here kernel decides to forward packet )--->device driver queue madri:eth1--->Sending data ...... cable delay ...... Receiving Data ---->Device driver Queuedublin:eth2--->Kernel Space(Dublin:  IP layer: Here kernel decides to forward data to another device driver)-->Device driver Queuedublin:eth1--->Sending data ...... cable delay ...... Receiving Data ---->Device driver Queueprague:eth1--->Kernel Space (IP layer: Here kernel decides to send data upwards)--User space(reply)-->Kernel Space(ICMP layer--->reply-->IP layer)---->Device driver Queueprague:eth1---->Sending data ...... cable delay ...... Receiving Data ---->Device driver QueueDublin:eth1--->Kernel Space (Dublin:  IP layer: Here kernel decides to forward data to another device driver)-->Device driver Queuedublin:eth2--->Sending data ...... cable delay ...... Receiving Data ---->Device driver Queuemadrid:eth1--->Kernel Space (IP layer: Here kernel decides to send data upwards-->ICMP layer--->reply-->IP layer)--->User Space( ping print)

 

How to get the time used to copy data from user space to kernel space

HERE we can see that

The process that does the One hop ping twice is actually the same as 

doing Two Hops Ping  once

 plus

4 times of copying data from user space to kernel space( or from kernel space to user space, they should be the same)

So the time to copying data from user space to kernel space is   (336*2-625)/4 = 47/4 =11.75   (uSec)

This result is approximate to the result from ping local time 23.9/2 = 11.95 (uSec)

 

How to get the time used to copy data from device driver to kernel space

The copying speed should exceed the speed the NIC card can send data which is 100Mb/sec

So the copying time should be a maximum of:    1526Bytes/(100Mb/sec) =  122.08 uSec

Note: Although the ICMP request size is 1472 Bytes. There are IMCP headers, IP headers, Ethernet frame wrapper. So the data seen from device driver is 1526 Bytes

The Two Hops Ping data shows that the time used to copy data from device driver to kernel space is much less than 122.08uSec because

122.08uSec * 8 >> 625 uSec

There are 2 cables of 3 meters long each. The light speed is 10**8 m/Sec. The one way delay caused by the cable should be 3*2/(3*10**8) Sec  =  0.02 uSec. This number is neiglectable because the variation of the Two Hops Ping time is 2.8uSec which is much larger than 0.02uSec.

So the time used to copy data from device driver to kernel space is:

( 625 - 11.75*4 ) / 8 = 72.25 uSec

The above number is a little bit larger than the real one because the above calculation is under the assumption that the system resource is used ONLY for the ping test. Actually, we have one telnet session on Madrid, one telnet session on Dublin(router)

 

So the one way delay by the wire and router should be an approximate of  72.25 * 2 = 145 uSec