The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
rtt.h File Reference

Calculate smoothed round trip time and round trip time variation. More...

#include <freeradius-devel/util/time.h>
+ Include dependency graph for rtt.h:

Go to the source code of this file.

Data Structures

struct  fr_rtt_t
 Smoothed round trip time, and the variation of the round trip time. More...
 

Macros

#define FR_RTT_DIFF(_rtt, _t)
 Absolute difference between the smoothed round trip time and a new sample.
 
#define FR_RTT_IALPHA   (8)
 
#define FR_RTT_IBETA   (4)
 
#define FR_RTT_RTO(_rtt, _k)    fr_time_delta_add((_rtt)->rtt, fr_time_delta_mul((_rtt)->rttvar, (_k)))
 Calculate the retransmission timeout as SRTT + (K * RTTVAR)
 
#define FR_RTT_SMOOTH(_old, _new)   fr_time_delta_wrap((fr_time_delta_unwrap(_new) + (fr_time_delta_unwrap(_old) * (FR_RTT_IALPHA - 1))) / FR_RTT_IALPHA)
 Calculate the new smoothed round trip time from the old value and a new sample.
 
#define FR_RTT_VAR(_rtt, _rttvar, _t)
 Calculate the new RTT variation from the old values and a new sample.
 

Functions

static void fr_rtt_update (fr_rtt_t *r, fr_time_delta_t t)
 Update the smoothed round trip time and the variation with a new sample.
 

Detailed Description

Calculate smoothed round trip time and round trip time variation.

Id
bba96d2ca177187efcb086c8e9f4cbe090fcdf28

Definition in file rtt.h.


Data Structure Documentation

◆ fr_rtt_t

struct fr_rtt_t

Smoothed round trip time, and the variation of the round trip time.

Definition at line 48 of file rtt.h.

+ Collaboration diagram for fr_rtt_t:
Data Fields
fr_time_delta_t rtt smoothed round trip time
fr_time_delta_t rttvar RTT variation.

Macro Definition Documentation

◆ FR_RTT_DIFF

#define FR_RTT_DIFF (   _rtt,
  _t 
)
Value:
(\
fr_time_delta_lt(_rtt, _t) ? \
fr_time_delta_sub(_t, _rtt) : \
fr_time_delta_sub(_rtt, _t)\
)
static fr_time_delta_t fr_time_delta_sub(fr_time_delta_t a, fr_time_delta_t b)
Definition time.h:261

Absolute difference between the smoothed round trip time and a new sample.

Definition at line 56 of file rtt.h.

◆ FR_RTT_IALPHA

#define FR_RTT_IALPHA   (8)

Definition at line 43 of file rtt.h.

◆ FR_RTT_IBETA

#define FR_RTT_IBETA   (4)

Definition at line 42 of file rtt.h.

◆ FR_RTT_RTO

#define FR_RTT_RTO (   _rtt,
  _k 
)     fr_time_delta_add((_rtt)->rtt, fr_time_delta_mul((_rtt)->rttvar, (_k)))

Calculate the retransmission timeout as SRTT + (K * RTTVAR)

Parameters
[in]_rttpointer to the fr_rtt_t.
[in]_kinteger multiplier for the RTT variation.
Returns
the retransmission timeout, as an fr_time_delta_t.

Definition at line 86 of file rtt.h.

◆ FR_RTT_SMOOTH

#define FR_RTT_SMOOTH (   _old,
  _new 
)    fr_time_delta_wrap((fr_time_delta_unwrap(_new) + (fr_time_delta_unwrap(_old) * (FR_RTT_IALPHA - 1))) / FR_RTT_IALPHA)

Calculate the new smoothed round trip time from the old value and a new sample.

Definition at line 78 of file rtt.h.

◆ FR_RTT_VAR

#define FR_RTT_VAR (   _rtt,
  _rttvar,
  _t 
)
Value:
FR_RTT_DIFF(_rtt, _t)\
), \
)
#define FR_RTT_DIFF(_rtt, _t)
Absolute difference between the smoothed round trip time and a new sample.
Definition rtt.h:56
#define FR_RTT_IBETA
Definition rtt.h:42
static fr_time_delta_t fr_time_delta_add(fr_time_delta_t a, fr_time_delta_t b)
Definition time.h:255
#define fr_time_delta_wrap(_time)
Definition time.h:152
static fr_time_delta_t fr_time_delta_mul(fr_time_delta_t a, int64_t b)
Definition time.h:273
static fr_time_delta_t fr_time_delta_div(fr_time_delta_t a, fr_time_delta_t b)
Definition time.h:267

Calculate the new RTT variation from the old values and a new sample.

Definition at line 66 of file rtt.h.

Function Documentation

◆ fr_rtt_update()

static void fr_rtt_update ( fr_rtt_t *  r,
fr_time_delta_t  t 
)
inlinestatic

Update the smoothed round trip time and the variation with a new sample.

The variation depends on the old RTT, so it is updated first.

Parameters
[in,out]rto update.
[in]tnew round trip time sample.

Definition at line 96 of file rtt.h.

+ Here is the caller graph for this function: