03-13-06 10:54 PM
"Yash" <yash_mbm@yahoo.com> writes:
> Hi all,
>
> I need a solution, by which i can measure time between sending and
> receiving of packet from one application to another one.
> I am working with application with uses unicast( both TCP and UDP) and
> broadcast.
> Also i am having "Ethereal" tool to see when packet leaving one
> port/NIC and reaching
> other port/NIC. But i want more precise solution, by which i can know
> delay for
> application to application.
ping(1)
> One solution which i thought off, is that i can get the system time
> before
> sending the packet, put it into packet with regular data and extract
> the time at other end.
This doesn't work because time is relative. Even with ntp
synchronized hosts, there may be a difference.
> By comparing the current time with this time, i can get time
> difference. Is it a
> correct approch. I am not sure, how precise it is. Is there any better
> method or
> tool available.
Yes, you can re-implement ping functionality in your application. It
could give you a different number of nanoseconds, given that ping uses
the icmp protocol, while your application may use udp or tcp.
You send data to the other application which sends a response
immediately when it receives it. You measure the time between sending
and receiving the response, and divide by 2.
> I will be grateful to you for suggestions and solutions.
> best regards,
> Yashpal
--
__Pascal Bourguignon__ http://www.informatimago.com/
Un chat errant
se soulage
dans le jardin d'hiver
Shiki
[ Post a follow-up to this message ]
|