H_ERTT(4)
π H_ERTT β the Enhanced Round Trip Time Khelp module (section 4 of the Kernel Interfaces Manual, bestie) π
okay so picture this: you're a TCP connection, you're trying to figure out how long a round trip actually takes, and the universe keeps lying to you. delayed acks? TSO? timestamps that are giving "I made this up"? this module is literally the friend who sees through all of it. β¨
πΈ NAME πΈ
h_ertt β Enhanced Round Trip Time Khelp module. that's the whole vibe. π
β¨ SYNOPSIS β¨
#include <netinet/khelp/h_ertt.h>
one include. that's it. slay. π«Ά
π DESCRIPTION π
so the h_ertt Khelp module lives inside the khelp(9) framework and hands TCP a per-connection, low noise estimate of the instantaneous RTT. and listen, the implementation is genuinely trying to be robust against a whole list of chaos:
- delayed acknowledgements π€
- TCP Segmentation Offload (TSO)
- receivers who manipulate TCP timestamps π
- and receivers that justβ¦ don't have the TCP timestamp option at all π
let's talk about the delayed-ack situation, because it's the messy part. TCP receivers using delayed acknowledgements have two moves: they either acknowledge every second packet (and that ack reflects the time stamp of the first packet π°οΈ), or they use a timeout to trigger the acknowledgement if no second packet ever shows up. so if the heuristic h_ertt uses determines the receiver is doing delayed acks, it measures the RTT using the second packet β the one that actually triggers the acknowledgement. and it does not measure the RTT if the acknowledgement is for the first packet, because ngl, that can't be accurately determined. periodt. π―
now for TSO: when TSO is in use, h_ertt will momentarily disable TSO whilst marking a packet to use for a new measurement. and before you panic β the process has negligible impact on the connection. it's fine. breathe. π§
here's the fun part: h_ertt associates the following struct with each connection's TCP control block:
struct ertt {
TAILQ_HEAD(txseginfo_head, txseginfo) txsegi_q; /* Private. */
long bytes_tx_in_rtt; /* Private. */
long bytes_tx_in_marked_rtt;
unsigned long marked_snd_cwnd;
int rtt;
int maxrtt;
int minrtt;
int dlyack_rx; /* Private. */
int timestamp_errors; /* Private. */
int markedpkt_rtt; /* Private. */
uint32_t flags;
};
β οΈ the fields marked as private should not be manipulated by any code outside of the h_ertt implementation. hands off. no touching. π
ββοΈ
the non-private fields give you the following data:
bytes_tx_in_marked_rttβ the number of bytes transmitted in themarkedpkt_rtt.marked_snd_cwndβ the value ofcwndfor the marked rtt measurement.rttβ the most recent RTT measurement.maxrttβ the longest RTT measurement that has been taken.minrttβ the shortest RTT measurement that has been taken.flagsβ theERTT_NEW_MEASUREMENTflag will be set by the implementation when a new measurement is available. it is the responsibility ofh_erttconsumers to unset the flag if they wish to use it as a notification method for new measurements. so like, you gotta clean up after yourself, iykyk π
π₯ SEE ALSO π₯
cc_chd(4), cc_hd(4), cc_vegas(4), mod_cc(4), hhook(9), khelp(9) β go read them, they're all part of the same friend group π«Ά
π ACKNOWLEDGEMENTS π
development and testing of this software were made possible in part by grants from the FreeBSD Foundation and Cisco University Research Program Fund at Community Foundation Silicon Valley. absolute icons, honestly. π
π¦ HISTORY π¦
the h_ertt module first appeared in FreeBSD 9.0. β
the module was first released in 2010 by David Hayes whilst working on the NewTCP research project at Swinburne University of Technology's Centre for Advanced Internet Architectures, Melbourne, Australia. main character energy fr fr. more details are available at:
http://caia.swin.edu.au/urp/newtcp/
π AUTHORS π
the h_ertt Khelp module and this manual page were written by David Hayes <david.hayes@ieee.org>. we stan. π
π BUGS π
the module maintains enhanced RTT estimates for all new TCP connections created after the time at which the module was loaded. yep, all of them, whether they asked for it or not π. and it might be beneficial to see if it is possible to have the module only affect connections which actually care about ERTT estimates. that's it, that's the note. someone go fix it bestie, I believe in you. πΈ
and that's the whole page! β¨ from the Debian crew β this one's dated January 18, 2012 β stay noisy, stay low-latency, and remember: every flag accounted for, no cap. ππ¦π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2010-2011 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms