H_ERTT(4)

πŸ’– H_ERTT πŸ’– β€” the Enhanced Round Trip Time Khelp module, bestie edition

okay so this is the manual page for h_ertt(4), from the Kernel Interfaces Manual, and honestly? she's serving low noise, per-connection RTT estimates and we're gonna talk about her. sit down, grab a strawberry πŸ“, let's go.


✨ NAME ✨

h_ertt β€” the Enhanced Round Trip Time Khelp module πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <netinet/khelp/h_ertt.h>

that's it. that's the include. iconic. no cap. ✨


πŸ‘‘ DESCRIPTION πŸ‘‘

so the h_ertt Khelp module lives inside the khelp(9) framework, and its whole job is giving TCP a per-connection, low noise estimate of the instantaneous RTT. like, an RTT reading that isn't screaming and crying all the time. πŸ’…

and the way she does it is robust, fr fr. she stays unbothered by:

  • delayed acknowledgements
  • TCP Segmentation Offload (TSO)
  • receivers out here manipulating TCP timestamps πŸ™ˆ
  • the TCP timestamp option just... not being there at all πŸ’€

delayed acks, the whole situation

okay so TCP receivers using delayed acknowledgements do one of two things:

  1. they acknowledge every second packet β€” and that ack reflects the time stamp of the first packet
  2. or they use a timeout to trigger the acknowledgement if no second packet ever shows up

so if the heuristic inside h_ertt figures out the receiver is doing delayed acks, she measures the RTT using the second packet β€” the one that actually triggers the acknowledgement. ✨

but if the acknowledgement is for the first packet, she does not measure the RTT. not because she's lazy, but because it literally cannot be accurately determined. respect the boundary bestie.

TSO girlies, this one's for you

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 a quick little moment, in and out, no drama. πŸ¦‹

the struct, and she IS the moment

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, bestie. those are hers. πŸ™…β€β™€οΈ

the non-private fields are giving the following data, and they are all very main character:

  • bytes_tx_in_marked_rtt β€” the number of bytes transmitted in the markedpkt_rtt. πŸ“
  • marked_snd_cwnd β€” the value of cwnd for the marked rtt measurement.
  • rtt β€” the most recent RTT measurement. ✨ fresh off the press.
  • maxrtt β€” the longest RTT measurement that has been taken. the overachiever of the group.
  • minrtt β€” the shortest RTT measurement that has been taken. tiny. precious. πŸŽ€
  • flags β€” the ERTT_NEW_MEASUREMENT flag will be set by the implementation when a new measurement is available. and listen β€” it is the responsibility of h_ertt consumers to unset the flag if they wish to use it as a notification method for new measurements. so like, if you want that notification lifestyle, you clear it yourself. that's the deal. πŸ’…

🌈 SEE ALSO 🌈

the whole friend group, fr fr 🫢


πŸŽ€ ACKNOWLEDGEMENTS πŸŽ€

development and testing of this software were made possible in part by grants from the FreeBSD Foundation and the Cisco University Research Program Fund at Community Foundation Silicon Valley. funding besties, we love to see it. πŸ’–


⭐ HISTORY ⭐

the h_ertt module first appeared in FreeBSD 9.0. πŸŽ‰

and 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. πŸ‡¦πŸ‡Ίβœ¨

more details are available at:

http://caia.swin.edu.au/urp/newtcp/

(that's a real URL from the original, keep it exactly as-is, no touchy 🫢)


🧚 AUTHORS 🧚

the h_ertt Khelp module and this manual page were written by David Hayes <david.hayes@ieee.org>. king behavior honestly. πŸ‘‘


πŸ’€ BUGS πŸ’€

okay so, the tea: the module maintains enhanced RTT estimates for all new TCP connections created after the time at which the module was loaded.

so yeah, even the connections that literally do not care about ERTT estimates are getting them. it might be beneficial to see if it is possible to have the module only affect connections which actually care about ERTT estimates. like girl, read the room. 😭


and that's the whole page bestie!! this was H_ERTT(4) from the Debian build of the manual, dated January 18, 2012 β€” yeah she's a 2012 girlie but she still eats πŸ’…βœ¨ stay low noise, stay instantaneous, mwah πŸŽ€πŸ’–

πŸ“¦ where this page comes from