rttest

package
v0.0.0-...-6c4fd92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: NIST-PD-fallback Imports: 3 Imported by: 0

Documentation

Overview

Package rttest implements an RTT estimator.

Index

Constants

View Source
const (
	K             = 4
	AlphaDividend = 1
	AlphaDivisor  = 8
	BetaDividend  = 1
	BetaDivisor   = 4
	InitRto       = 1000
	MinRto        = 200
	MaxRto        = 60000

	Alpha          = 1.0 * AlphaDividend / AlphaDivisor
	Beta           = 1.0 * BetaDividend / BetaDivisor
	InitRtoSeconds = InitRto / 1000.0
	MinRtoSeconds  = MinRto / 1000.0
	MaxRtoSeconds  = MaxRto / 1000.0
)

RTT algorithm constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type RttEstimator

type RttEstimator struct {
	// contains filtered or unexported fields
}

RttEstimator is an RTT estimator.

func New

func New() *RttEstimator

New creates an RTT estimator.

func (*RttEstimator) Assign

func (rtte *RttEstimator) Assign(sRtt, rttVar time.Duration)

Assign sets SRTT and RTTVAR values.

func (*RttEstimator) Backoff

func (rtte *RttEstimator) Backoff()

Backoff performs exponential backoff.

func (*RttEstimator) Push

func (rtte *RttEstimator) Push(rtt time.Duration, nPendings int)

Push adds a measurement.

func (RttEstimator) RTO

func (rtte RttEstimator) RTO() time.Duration

RTO returns retransmission timer.

func (RttEstimator) RTTVAR

func (rtte RttEstimator) RTTVAR() time.Duration

RTTVAR returns round-trip time variance.

func (RttEstimator) SRTT

func (rtte RttEstimator) SRTT() time.Duration

SRTT returns smoothed round-trip time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL