diff options
author | lstewart <lstewart@FreeBSD.org> | 2011-01-24 23:08:38 +0000 |
---|---|---|
committer | lstewart <lstewart@FreeBSD.org> | 2011-01-24 23:08:38 +0000 |
commit | 7bfbf8dedbdc486f27863cb7d0cc9ea069f2af28 (patch) | |
tree | 8ecd0666e2a0cc863323b0b79a0e980cfd705e8d /sys/netinet/khelp/h_ertt.h | |
parent | aff100c87f79e4ad55a076fa1e28cf13cf25ee6a (diff) | |
download | FreeBSD-src-7bfbf8dedbdc486f27863cb7d0cc9ea069f2af28.zip FreeBSD-src-7bfbf8dedbdc486f27863cb7d0cc9ea069f2af28.tar.gz |
Import the ERTT (Enhanced Round Trip Time) Khelp module. ERTT uses the
Khelp/Hhook KPIs to hook into the TCP stack and maintain a per-connection, low
noise estimate of the instantaneous RTT. ERTT's implementation is robust even in
the face of delayed acknowledgements and/or TSO being in use for a connection.
A high quality, low noise RTT estimate is a requirement for applications such as
delay-based congestion control, for which we will be importing some algorithm
implementations shortly.
In collaboration with: David Hayes <dahayes at swin edu au> and
Grenville Armitage <garmitage at swin edu au>
Sponsored by: FreeBSD Foundation
Reviewed by: bz and others along the way
MFC after: 3 months
Diffstat (limited to 'sys/netinet/khelp/h_ertt.h')
-rw-r--r-- | sys/netinet/khelp/h_ertt.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/sys/netinet/khelp/h_ertt.h b/sys/netinet/khelp/h_ertt.h new file mode 100644 index 0000000..8051a6c --- /dev/null +++ b/sys/netinet/khelp/h_ertt.h @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2009-2010 + * Swinburne University of Technology, Melbourne, Australia + * Copyright (c) 2010 Lawrence Stewart <lstewart@freebsd.org> + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by David Hayes, made possible in part by + * a grant from the Cisco University Research Program Fund at Community + * Foundation Silicon Valley. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * The ERTT (Enhanced Round Trip Time) Khelp module calculates an estimate of + * the instantaneous TCP RTT which, for example, is used by delay-based + * congestion control schemes. When the module is loaded, ERTT data is + * calculated for each active TCP connection and encapsulated within a + * "struct ertt". + * + * This software was first released in 2010 by David Hayes and Lawrence Stewart + * whilst working on the NewTCP research project at Swinburne University's + * Centre for Advanced Internet Architectures, Melbourne, Australia, which was + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. Testing and development was + * further assisted by a grant from the FreeBSD Foundation. More details are + * available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#ifndef _NETINET_KHELP_H_ERTT_ +#define _NETINET_KHELP_H_ERTT_ + +struct txseginfo; + +/* Structure used as the ertt data block. */ +struct ertt { + /* Information about transmitted segments to aid in RTT calculation. */ + TAILQ_HEAD(txseginfo_head, txseginfo) txsegi_q; + /* Bytes TX so far in marked RTT. */ + long bytes_tx_in_rtt; + /* Final version of above. */ + long bytes_tx_in_marked_rtt; + /* cwnd for marked RTT. */ + unsigned long marked_snd_cwnd; + /* Per-packet measured RTT. */ + int rtt; + /* Maximum RTT measured. */ + int maxrtt; + /* Minimum RTT measured. */ + int minrtt; + /* Guess if the receiver is using delayed ack. */ + int dlyack_rx; + /* Keep track of inconsistencies in packet timestamps. */ + int timestamp_errors; + /* RTT for a marked packet. */ + int markedpkt_rtt; + /* Flags to signal conditions between hook function calls. */ + uint32_t flags; +}; + +/* Flags for struct ertt. */ +#define ERTT_NEW_MEASUREMENT 0x01 +#define ERTT_MEASUREMENT_IN_PROGRESS 0x02 +#define ERTT_TSO_DISABLED 0x04 + +#endif /* _NETINET_KHELP_H_ERTT_ */ |