Re: Time between sending and receiving of Ethernet Packet



Hi,
Thanks for your inputs,

Pascal Bourguignon wrote:
"Yash" <yash_mbm@xxxxxxxxx> 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 was doing the same thing, but it could not satisfy my seniors.



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

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

.



Relevant Pages

  • Re: Actius MM10 modem
    ... telling me that "pppd exited with return value ... call retry delay timer expires) without waiting for an outbound packet. ... Shut down the link when idle-time seconds pass without receiving or ... The environment variable PPPHOME, if present, specifies the directory in ...
    (comp.os.linux.portable)
  • Re: Determining if it is "safe" to send UDP packets
    ... for receiving Udp data. ... I'm receiving from a camera lines of data at 55 Hz. ... the next packet hits the wire. ... Another problem with TCP is its assumption that a lost packet is due to ...
    (microsoft.public.win32.programmer.kernel)
  • Re: servers address in ntp payload?
    ... >> with all the stateful firewalls now in place if the response to a packet ... >> the address and the requestor will never receive a response. ... > Which is a flaw in such a firewall and a violation of RFC 2979. ... appears to only discuss TCP and it's layered protocols which NTP isn't. ...
    (comp.protocols.time.ntp)
  • Re: OutOfMemoryException from Thread.Start
    ... I guess that what I'm saying is that you're implementing a resend protocol ... > of the fact that the receiving end uses a fixed 2KB buffer to receive ... >>> stream of bytes (packet) first and then sends it by calling the Socket ... >>> the client connects, the server accepts it and waits. ...
    (microsoft.public.windowsce.app.development)
  • Re: OutOfMemoryException from Thread.Start
    ... the receive process may receive an ACK and a DATA structure at ... >> stream of bytes (packet) first and then sends it by calling the Socket ... >> - On receiving, bytes are received asynchronously by calling the Socket ... >> the client connects, the server accepts it and waits. ...
    (microsoft.public.windowsce.app.development)