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 the action it performs are close from a HTTP request and it is
meaningful to use it (carefully) to measure Web performances. 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: UDP and inetd:
With UDP servers you can have surprises: the first test is quite often 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 much slower since inetd or xinetd typically has to launch the
process stays a while so the next texts run faster. process. After that, the process stays a while so the next texts run
faster.
A nice example: A nice example:

@ -699,7 +699,7 @@ main(argc, argv)
if (smtp) { if (smtp) {
sendline = "QUIT\r\n"; /* Surprises some SMTP servers which log a sendline = "QUIT\r\n"; /* Surprises some SMTP servers which log a
* frightening NOQUEUE. Anyone knows better? * frightening NOQUEUE. Anyone knows better?
* See bug #1512776 */ * * See bug #1512776 */
} else } else
#endif #endif
#ifdef ICP #ifdef ICP
@ -1346,13 +1346,21 @@ main(argc, argv)
} /* That's all, folks */ } /* That's all, folks */
alarm(0); alarm(0);
#ifdef HAVE_TCP_INFO #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 (tcp && verbose) {
if (getsockopt if (getsockopt
(sockfd, SOL_TCP, TCP_INFO, &tcpinfo, &socket_length) (sockfd, SOL_TCP, TCP_INFO, &tcpinfo, &socket_length)
!= -1) { != -1) {
printf("Estimated TCP RTT: %.04f seconds\n", /* TODO: find out the meaning of the various fields
tcpinfo.tcpi_rtt / 1000000.0); * 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 #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 performs are close from a HTTP request and it is meaningful to use it
(carefully) to measure Web performances. (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> <H2>UDP and inetd</H2>
<P>With UDP servers you can have surprises: the first test is quite often <P>With UDP servers you can have surprises: the first test is quite often

Loading…
Cancel
Save