TCP_INFO documented

MAINT_6_0
Stephane Bortzmeyer 17 years ago
parent 91959176f3
commit 8e83acace2

@ -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:

@ -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 <perry@coders.net> for the tip */
/* Thanks to Perry Lorier <perry@coders.net> 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

@ -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.
<H3>More on Linux</H3>
<P>On operating systems, like Linux, who have the TCP_INFO option (see
<A HREF="http://linuxgazette.net/136/pfeiffer.html">a detailed
presentation</A>), echoping can also display interesting TCP information.
<H2>UDP and inetd</H2>
<P>With UDP servers you can have surprises: the first test is quite often

Loading…
Cancel
Save