xref: /freebsd/share/man/man4/h_ertt.4 (revision 891b8ed4672a213bbe6f3f10522eeadb34d01b76)
129f269dcSLawrence Stewart.\"
229f269dcSLawrence Stewart.\" Copyright (c) 2010-2011 The FreeBSD Foundation
329f269dcSLawrence Stewart.\" All rights reserved.
429f269dcSLawrence Stewart.\"
529f269dcSLawrence Stewart.\" This documentation was written at the Centre for Advanced Internet
6*891b8ed4SLawrence Stewart.\" Architectures, Swinburne University of Technology, Melbourne, Australia by
7*891b8ed4SLawrence Stewart.\" David Hayes under sponsorship from the FreeBSD Foundation.
829f269dcSLawrence Stewart.\"
929f269dcSLawrence Stewart.\" Redistribution and use in source and binary forms, with or without
1029f269dcSLawrence Stewart.\" modification, are permitted provided that the following conditions
1129f269dcSLawrence Stewart.\" are met:
1229f269dcSLawrence Stewart.\" 1. Redistributions of source code must retain the above copyright
1329f269dcSLawrence Stewart.\"    notice, this list of conditions and the following disclaimer.
1429f269dcSLawrence Stewart.\" 2. Redistributions in binary form must reproduce the above copyright
1529f269dcSLawrence Stewart.\"    notice, this list of conditions and the following disclaimer in the
1629f269dcSLawrence Stewart.\"    documentation and/or other materials provided with the distribution.
1729f269dcSLawrence Stewart.\"
1829f269dcSLawrence Stewart.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1929f269dcSLawrence Stewart.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2029f269dcSLawrence Stewart.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2129f269dcSLawrence Stewart.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
2229f269dcSLawrence Stewart.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2329f269dcSLawrence Stewart.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2429f269dcSLawrence Stewart.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2529f269dcSLawrence Stewart.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2629f269dcSLawrence Stewart.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2729f269dcSLawrence Stewart.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2829f269dcSLawrence Stewart.\" SUCH DAMAGE.
2929f269dcSLawrence Stewart.\"
3029f269dcSLawrence Stewart.\" $FreeBSD$
3129f269dcSLawrence Stewart.\"
3229f269dcSLawrence Stewart.Dd February 15, 2011
3329f269dcSLawrence Stewart.Dt h_ertt 9
3429f269dcSLawrence Stewart.Os
3529f269dcSLawrence Stewart.Sh NAME
3629f269dcSLawrence Stewart.Nm h_ertt
3729f269dcSLawrence Stewart.Nd Enhanced Round Trip Time Khelp module
3829f269dcSLawrence Stewart.Sh SYNOPSIS
3929f269dcSLawrence Stewart.In netinet/khelp/h_ertt.h
4029f269dcSLawrence Stewart.Sh DESCRIPTION
4129f269dcSLawrence StewartThe
4229f269dcSLawrence Stewart.Nm
4329f269dcSLawrence StewartKhelp module works within the
4429f269dcSLawrence Stewart.Xr khelp 9
4529f269dcSLawrence Stewartframework to provide TCP with a per-connection, low noise estimate of the
4629f269dcSLawrence Stewartinstantaneous RTT.
4729f269dcSLawrence StewartThe implementation attempts to be robust in the face of delayed
4829f269dcSLawrence Stewartacknowledgements, TCP Segmentation Offload (TSO), receivers who manipulate TCP
4929f269dcSLawrence Stewarttimestamps and lack of the TCP timestamp option altogether.
5029f269dcSLawrence Stewart.Pp
5129f269dcSLawrence StewartTCP receivers using delayed acknowledgements either acknowledge every second packet
5229f269dcSLawrence Stewart(reflecting the time stamp of the first) or use a timeout to trigger the
5329f269dcSLawrence Stewartacknowledgement if no second packet arrives.
5429f269dcSLawrence StewartIf the heuristic used by
5529f269dcSLawrence Stewart.Nm
5629f269dcSLawrence Stewartdetermines that the receiver is using delayed acknowledgements, it measures the
5729f269dcSLawrence StewartRTT using the second packet (the one that triggers the acknowledgement).
5829f269dcSLawrence StewartIt does not measure the RTT if the acknowledgement is for the
5929f269dcSLawrence Stewartfirst packet, since it cannot be accurately determined.
6029f269dcSLawrence Stewart.Pp
6129f269dcSLawrence StewartWhen TSO is in use,
6229f269dcSLawrence Stewart.Nm
6329f269dcSLawrence Stewartwill momentarily disable TSO whilst marking a packet to use for a new
6429f269dcSLawrence Stewartmeasurement.
6529f269dcSLawrence StewartThe process has negligible impact on the connection.
6629f269dcSLawrence Stewart.Pp
6729f269dcSLawrence Stewart.Nm
6829f269dcSLawrence Stewartassociates the following struct with each connection's TCP control block:
6929f269dcSLawrence Stewart.Bd -literal
7029f269dcSLawrence Stewartstruct ertt {
7129f269dcSLawrence Stewart	TAILQ_HEAD(txseginfo_head, txseginfo) txsegi_q;	/* Private. */
7229f269dcSLawrence Stewart	long		bytes_tx_in_rtt;		/* Private. */
7329f269dcSLawrence Stewart	long		bytes_tx_in_marked_rtt;
7429f269dcSLawrence Stewart	unsigned long	marked_snd_cwnd;
7529f269dcSLawrence Stewart	int		rtt;
7629f269dcSLawrence Stewart	int		maxrtt;
7729f269dcSLawrence Stewart	int		minrtt;
7829f269dcSLawrence Stewart	int		dlyack_rx;			/* Private. */
7929f269dcSLawrence Stewart	int		timestamp_errors;		/* Private. */
8029f269dcSLawrence Stewart	int		markedpkt_rtt;			/* Private. */
8129f269dcSLawrence Stewart	uint32_t	flags;
8229f269dcSLawrence Stewart};
8329f269dcSLawrence Stewart.Ed
8429f269dcSLawrence Stewart.Pp
8529f269dcSLawrence StewartThe fields marked as private should not be manipulated by any code outside of
8629f269dcSLawrence Stewartthe
8729f269dcSLawrence Stewart.Nm
8829f269dcSLawrence Stewartimplementation.
8929f269dcSLawrence StewartThe non-private fields provide the following data:
9029f269dcSLawrence Stewart.Bl -tag -width ".Va bytes_tx_in_marked_rtt"  -offset indent
9129f269dcSLawrence Stewart.It Va bytes_tx_in_marked_rtt
9229f269dcSLawrence StewartThe number of bytes transmitted in the
9329f269dcSLawrence Stewart.Va markedpkt_rtt .
9429f269dcSLawrence Stewart.It Va marked_snd_cwnd
9529f269dcSLawrence StewartThe value of cwnd for the marked rtt measurement.
9629f269dcSLawrence Stewart.It Va rtt
9729f269dcSLawrence StewartThe most recent RTT measurement.
9829f269dcSLawrence Stewart.It Va maxrtt
9929f269dcSLawrence StewartThe longest RTT measurement that has been taken.
10029f269dcSLawrence Stewart.It Va minrtt
10129f269dcSLawrence StewartThe shortest RTT measurement that has been taken.
10229f269dcSLawrence Stewart.It Va flags
10329f269dcSLawrence StewartThe ERTT_NEW_MEASUREMENT flag will be set by the implementation when a new
10429f269dcSLawrence Stewartmeasurement is available.
10529f269dcSLawrence StewartIt is the responsibility of
10629f269dcSLawrence Stewart.Nm
10729f269dcSLawrence Stewartconsumers to unset the flag if they wish to use it as a notification method for
10829f269dcSLawrence Stewartnew measurements.
10929f269dcSLawrence Stewart.El
11029f269dcSLawrence Stewart.Sh SEE ALSO
11129f269dcSLawrence Stewart.Xr cc 4 ,
11229f269dcSLawrence Stewart.Xr cc_chd 4 ,
11329f269dcSLawrence Stewart.Xr cc_hd 4 ,
11429f269dcSLawrence Stewart.Xr cc_vegas 4 ,
11529f269dcSLawrence Stewart.Xr hhook 9 ,
11629f269dcSLawrence Stewart.Xr khelp 9
11729f269dcSLawrence Stewart.Sh ACKNOWLEDGEMENTS
11829f269dcSLawrence StewartDevelopment and testing of this software were made possible in part by grants
11929f269dcSLawrence Stewartfrom the FreeBSD Foundation and Cisco University Research Program Fund at
12029f269dcSLawrence StewartCommunity Foundation Silicon Valley.
12129f269dcSLawrence Stewart.Sh HISTORY
12229f269dcSLawrence StewartThe
12329f269dcSLawrence Stewart.Nm
12429f269dcSLawrence Stewartmodule first appeared in
12529f269dcSLawrence Stewart.Fx 9.0 .
12629f269dcSLawrence Stewart.Pp
12729f269dcSLawrence StewartThe module was first released in 2010 by David Hayes whilst working on the
128*891b8ed4SLawrence StewartNewTCP research project at Swinburne University of Technology's Centre for
129*891b8ed4SLawrence StewartAdvanced Internet Architectures, Melbourne, Australia.
13029f269dcSLawrence StewartMore details are available at:
13129f269dcSLawrence Stewart.Pp
13229f269dcSLawrence Stewarthttp://caia.swin.edu.au/urp/newtcp/
13329f269dcSLawrence Stewart.Sh AUTHORS
13429f269dcSLawrence Stewart.An -nosplit
13529f269dcSLawrence StewartThe
13629f269dcSLawrence Stewart.Nm
13729f269dcSLawrence StewartKhelp module and this manual page were written by
13829f269dcSLawrence Stewart.An David Hayes Aq david.hayes@ieee.org .
13929f269dcSLawrence Stewart.Sh BUGS
14029f269dcSLawrence StewartThe module maintains enhanced RTT estimates for all new TCP connections created
14129f269dcSLawrence Stewartafter the time at which the module was loaded.
14229f269dcSLawrence StewartIt might be beneficial to see if it is possible to have the module only affect
14329f269dcSLawrence Stewartconnections which actually care about ERTT estimates.
144