rtt.h File Reference

This file contains a data type and functions to help estimate good round trip times for UDP resend timeout values. More...

Data Structures

struct  rtt_info
 RTT information. More...
 

Functions

void rtt_init (struct rtt_info *rtt)
 Initialize RTT estimators. More...
 
int rtt_timeout (const struct rtt_info *rtt)
 Get timeout to use for sending a UDP packet. More...
 
int rtt_unclamped (const struct rtt_info *rtt)
 Get unclamped timeout to use for server selection. More...
 
int rtt_notimeout (const struct rtt_info *rtt)
 RTT for valid responses. More...
 
void rtt_update (struct rtt_info *rtt, int ms)
 Update the statistics with a new roundtrip estimate observation. More...
 
void rtt_lost (struct rtt_info *rtt, int orig)
 Update the statistics with a new timeout expired observation. More...
 

Variables

int RTT_MIN_TIMEOUT
 min retransmit timeout value, in milliseconds
 
int RTT_MAX_TIMEOUT
 max retransmit timeout value, in milliseconds
 

Detailed Description

This file contains a data type and functions to help estimate good round trip times for UDP resend timeout values.

Function Documentation

◆ rtt_init()

void rtt_init ( struct rtt_info rtt)

Initialize RTT estimators.

Parameters
rttThe structure. Caller is responsible for allocation of it.

References calc_rto(), rtt_info::rto, rtt_info::rttvar, rtt_info::srtt, and UNKNOWN_SERVER_NICENESS.

Referenced by data_entry_init(), infra_del_host(), and infra_rtt_update().

◆ rtt_timeout()

int rtt_timeout ( const struct rtt_info rtt)

Get timeout to use for sending a UDP packet.

Parameters
rttround trip statistics structure.
Returns
: timeout to use in milliseconds. Relative time value.

References rtt_info::rto.

Referenced by infra_host().

◆ rtt_unclamped()

int rtt_unclamped ( const struct rtt_info rtt)

Get unclamped timeout to use for server selection.

Recent timeouts are reflected in the returned value.

Parameters
rttround trip statistics structure.
Returns
: value to use in milliseconds.

References calc_rto(), rtt_info::rto, rtt_info::rttvar, and rtt_info::srtt.

Referenced by infra_get_lame_rtt(), and infra_rtt_update().

◆ rtt_notimeout()

int rtt_notimeout ( const struct rtt_info rtt)

RTT for valid responses.

Without timeouts.

Parameters
rttround trip statistics structure.
Returns
: value in msec.

References calc_rto().

Referenced by dump_infra_host(), infra_get_lame_rtt(), infra_host(), and print_dp_details().

◆ rtt_update()

void rtt_update ( struct rtt_info rtt,
int  ms 
)

Update the statistics with a new roundtrip estimate observation.

Parameters
rttround trip statistics structure.
msestimate of roundtrip time in milliseconds.

References calc_rto(), rtt_info::rto, rtt_info::rttvar, and rtt_info::srtt.

Referenced by infra_rtt_update().

◆ rtt_lost()

void rtt_lost ( struct rtt_info rtt,
int  orig 
)

Update the statistics with a new timeout expired observation.

Parameters
rttround trip statistics structure.
origoriginal rtt time given for the query that timed out. Used to calculate the maximum responsible backed off time that can reasonably be applied.

References rtt_info::rto, and RTT_MAX_TIMEOUT.

Referenced by infra_rtt_update().