Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TCP RTT



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




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org