2

I need to measure a one direction latency measurement between two applications that communicate thru a LAN and report the result to a data collection server.

The client application sends the data using multicast, then it passes thru two servers and the last server is the end point of this test, like so:

Agent -> multicast cloud -> server 1 -> server 2

I thought about using NTP (or PTP for LAN) to synchronize "agent" and "server 2", but I wonder what's the right algorithm to implement this and what would be its precision.

How can I perform this measurement (using C#)? and what would its precision be?

UPDATE: note that the data is being processed between agent and server 2, so the measurement is not purely network-wise.

Eran Betzalel
  • 4,105
  • 3
  • 38
  • 66
  • 1
    In general, it is not possible to determine one-way latency. The best you can do (unless you have accurate clocks at both ends) is round-trip time (and then divide by 2). – Oliver Charlesworth Mar 02 '13 at 18:08
  • I'm need to measure applicative latency - not a network latency, so division by 2 won't work for me :( – Eran Betzalel Mar 02 '13 at 18:10
  • Ok, equivalently you can use PTP to synchronise both ends (although this makes an equivalent assumption about latency = RTT/2), and then send timestamped packets from agent to server. – Oliver Charlesworth Mar 02 '13 at 18:13
  • The latency I'm testing include a processing operation on this data. The process time only takes place in one way (agent to server 2). – Eran Betzalel Mar 02 '13 at 18:15

1 Answers1

0

Underlying problem is synchronizing the clock between two or more machines.

Synchronization (of clocks) between two remote computers

Once you have this, you simply add the add a "construction time" to the packet itself, when it is created/sent. the one-way latency from start to finish is the "arrival time" minus the "construction time"

If you cannot trust the intermediate nodes, then you would have to have Agent register with Server, that it expects to send a packet at a specific time. Then the one-way latency from start to finish is the "arrival time" minus the "expected-arrival time"

Community
  • 1
  • 1
Meirion Hughes
  • 24,994
  • 12
  • 71
  • 122