CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2007
    Posts
    2

    RTT in nanoseconds

    Hi everyone. I'm new to socket programming so sorry if this is a noob question.

    Nway, is there a way to ping an access point, given that i know it's IP address, and get the RTT in nanoseconds, instead of miliseconds?

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: RTT in nanoseconds

    Divide?

    http://www.calculateme.com/Time/Nano...lliseconds.htm
    RTT is internal to TCP; there is no way for an application to get the value. Instead, you should do the same thing TCP does: arrange to exchange a few messages, compute your own estimate of the round trip time, then divide that by 2, and add it to the clock before sending the time.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Aug 2007
    Posts
    21

    Re: RTT in nanoseconds

    Depending on what OS you are using, you might or might not be able to get super accurate times.

    On MS, you can use QueryPerformanceFrequence as a high resolution timer.

  4. #4
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: RTT in nanoseconds

    But seriously, why do you think you need nanosecond precision in RTT? RTT is known to deviate significantly from segment to segment, and in fact the deviation is so significant that most stacks calculate the retransmission timeout based also on the deviation in RTT, not simply the RTT alone.

    Most implementations are happy with an estimate of RTT in the millisecond-range precision. You want something one million times more accurate. It would be helpful if you explained why.

    Mike

  5. #5
    Join Date
    Oct 2007
    Posts
    2

    Re: RTT in nanoseconds

    Quote Originally Posted by MikeAThon
    But seriously, why do you think you need nanosecond precision in RTT? RTT is known to deviate significantly from segment to segment, and in fact the deviation is so significant that most stacks calculate the retransmission timeout based also on the deviation in RTT, not simply the RTT alone.

    Most implementations are happy with an estimate of RTT in the millisecond-range precision. You want something one million times more accurate. It would be helpful if you explained why.

    Mike
    Ok. I might not really need nanosecond precision for this. is jst that i need to calculate de average RTT from a laptop to an access point and i can't have 0ms as a result.

    The laptop and the access point will be only a few meters away from each other. Therefore i think that millisencond estimation won't be enough.

    Thanx for the replies btw.
    Last edited by iStriker; October 25th, 2007 at 11:05 AM.

  6. #6
    Join Date
    Mar 2012
    Posts
    1

    Re: RTT in nanoseconds

    hi ,

    i'm doing project on positioning using time of arrival techniques. So i need round trip time (RTT) in nanoseconds in order to calculate time of arrival from access point to laptop..

  7. #7
    Join Date
    Aug 2013
    Posts
    1

    Re: RTT in nanoseconds

    Quote Originally Posted by iStriker View Post
    Ok. I might not really need nanosecond precision for this. is jst that i need to calculate de average RTT from a laptop to an access point and i can't have 0ms as a result.

    The laptop and the access point will be only a few meters away from each other. Therefore i think that millisencond estimation won't be enough.

    Thanx for the replies btw.

    Hi istrike;
    Did you calculate the RTT in nanoseconds... I also want to calculate RTT in micro or nanoseconds... if you have solve the issue please reply with the code..

    Thanks..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured