From 8e83acace27e7e9a2297e176326023dbf718f2d8 Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Sat, 17 Mar 2007 21:18:40 +0000 Subject: [PATCH] TCP_INFO documented --- SRC/DETAILS | 11 +++++++++-- SRC/echoping.c | 16 ++++++++++++---- Web/details.wml | 6 ++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/SRC/DETAILS b/SRC/DETAILS index 0efe3fd..1fc1ea1 100644 --- a/SRC/DETAILS +++ b/SRC/DETAILS @@ -29,11 +29,18 @@ physical line raw throughput measures (unlike bing). On the other end, the action it performs are close from a HTTP request and it is meaningful to use it (carefully) to measure Web performances. +More on Linux: + +On operating systems, like Linux, who have the TCP_INFO option (see +http://linuxgazette.net/136/pfeiffer.html for a detailed +presentation), echoping can also display interesting TCP information. + UDP and inetd: With UDP servers you can have surprises: the first test is quite often -much slower since inetd has to launch the process. After that, the -process stays a while so the next texts run faster. +much slower since inetd or xinetd typically has to launch the +process. After that, the process stays a while so the next texts run +faster. A nice example: diff --git a/SRC/echoping.c b/SRC/echoping.c index 9a86970..7443803 100644 --- a/SRC/echoping.c +++ b/SRC/echoping.c @@ -699,7 +699,7 @@ main(argc, argv) if (smtp) { sendline = "QUIT\r\n"; /* Surprises some SMTP servers which log a * frightening NOQUEUE. Anyone knows better? - * See bug #1512776 */ + * * See bug #1512776 */ } else #endif #ifdef ICP @@ -1346,13 +1346,21 @@ main(argc, argv) } /* That's all, folks */ alarm(0); #ifdef HAVE_TCP_INFO - /* Thanks to Perry Lorier for the tip */ + /* Thanks to Perry Lorier for the tip. See a + * longer paper in http://linuxgazette.net/136/pfeiffer.html */ if (tcp && verbose) { if (getsockopt (sockfd, SOL_TCP, TCP_INFO, &tcpinfo, &socket_length) != -1) { - printf("Estimated TCP RTT: %.04f seconds\n", - tcpinfo.tcpi_rtt / 1000000.0); + /* TODO: find out the meaning of the various fields + * inthe struct tcp_info (it seems documented only + * in the Linux kernel sources) and display stuff + * like reordering (see RFC 4737), window, lost + * packets, etc. */ + printf + ("Estimated TCP RTT: %.04f seconds (std. deviation %0.03f)\n", + tcpinfo.tcpi_rtt / 1000000.0, + tcpinfo.tcpi_rttvar / 1000000.0); } } #endif diff --git a/Web/details.wml b/Web/details.wml index c65ee6b..8ee4b59 100644 --- a/Web/details.wml +++ b/Web/details.wml @@ -24,6 +24,12 @@ line raw throughput measures (unlike bing). On the other end, the action it performs are close from a HTTP request and it is meaningful to use it (carefully) to measure Web performances. +

More on Linux

+ +

On operating systems, like Linux, who have the TCP_INFO option (see +a detailed +presentation), echoping can also display interesting TCP information. +

UDP and inetd

With UDP servers you can have surprises: the first test is quite often