Time between sending and receiving of Ethernet Packet
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Time between sending and receiving of Ethernet Packet




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Time between sending and receiving of Ethernet Packet  
Yash


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-13-06 12:51 PM

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.

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.
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.

I will be grateful to you for suggestions and solutions.
best regards,
Yashpal






[ Post a follow-up to this message ]



    Re: Time between sending and receiving of Ethernet Packet  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Re: Time between sending and receiving of Ethernet Packet  
Yash


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-16-06 12:51 PM

Hi,
Thanks for your inputs,

Pascal Bourguignon wrote:
> "Yash" <yash_mbm@yahoo.com> writes:
> 
>
> ping(1)
> 
>
> This doesn't work because time is relative.  Even with ntp
> synchronized hosts, there may be a difference.
> 
>
> 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 was doing the same thing, but it could not satisfy my seniors.

>
> 
>
>
> --
> __Pascal Bourguignon__                     http://www.informatimago.com/
>         Un chat errant
> se soulage
>         dans le jardin d'hiver
>                                         Shiki

NTP can be a good solution but is there any possibility of getting this
time information
without using NTP. I know that there has to be one common time
reference between systems.
In my code (of which,most of the part i got from google group only
;-)), i am using gettimeofday(). So i am sending this time with packet
and after receiving this packet, extracting this time and comparing
with current time. With loopback it seems to work fine but when i use
two linux machines it doesn't work.

Any help is welcome.

Regards
YASHPAL






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:01 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register