Ayse
Ayse

Reputation: 2764

Measure the delay between data sent by udp server and received by the client

I want to check my udp server client application. One of the features that I wanted to check is the time delay between data sent by the server and received by the client and vice versa. I figured out a way of sending a message from the server to the client and note the time. The client when receives this message sends the same message back to the server. The server gets this echoed message back and again notes the time. The difference between the time at which the message was sent and at which the echoed message is received back tells me the delay between data sent by the server and received by the client.

Is this approach correct? Because I also foresee a lot of other delays involved using this approach. What could be a possible way to calculate more accurate delays?

Waiting for help.

Upvotes: 3

Views: 2555

Answers (2)

Ishmeet
Ishmeet

Reputation: 1620

You can see on sniffer, using relative time taken between sender's udp packet and receiver's udp packet. For the need of more accurate results, you have to go deep into the window's stack where it checks for udp packet received or not. And for calculation of timer's you can use a real time clock which gives upto microsecond delay. Also you are using udp which has high priority of packet getting lost, unlike tcp which is much reliable. What stack are you using? LwIP ?

Upvotes: 1

pradipta
pradipta

Reputation: 1744

Yes this is the most traditional way of doing ,you can do this.

Upvotes: 3

Related Questions