TCP RTT
Patrick McManus
mcmanus at AppliedTheory.com
Mon Jun 25 15:16:49 EDT 2001
I'm not exactly sure what your question is getting at, but if you've
got an open tcp session and access to the running code *and* a 2.4
kernel, you can lift the smoothed rtt from the tcp stack using
getsockopt (s,SOL_TCP,TCP_INFO, &info, ..) where info is struct
tcp_info and you want the info.tcpi_rtt argument..
info.tcpi_rtt is returned in microseconds (i.e. 10E-6) but its only
measured to cenitsecond granularity on i386 cause of the 100HZ clock
thing.
of course this number is a wild ass conservative estimate that has
been skewed by karn's algorithm and the like.. it will not match a
mean ping time accept under very kind network conditions. its real
good for gaguing tcp timeouts, it's only ok as a raw measurement.
if you aren't running a 2.4 kernel you're going to need a kernel patch
to copy srtt from the sk ptr into userspace.. Hint: it's stored on
i386 as (srtt << 3) where srtt is measured in centiseconds (which is
your granularity anyhow). look in net/ipv4/tcp.c
-P
[Manish Raj Sharma: Mon, Jun 25, 2001 at 02:41:04PM -0400]
> Can anybody tell me how to get the value of Round Trip Time (RTT) of a TCP
> connection on Linux box assuming it is running the Apache Web server on
> it?
>
> -Manish
>
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).
More information about the Discuss
mailing list