nada

package
v0.0.0-...-d44d60c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PRIO               float64 = 1.0
	RMIN               uint64  = 150000  // bps
	RMAX               uint64  = 1500000 // bps
	XREF               uint64  = 10      // ms
	KAPPA              float64 = 0.5
	ETA                float64 = 2.0
	TAU                uint64  = 500 // ms
	DELTA              uint64  = 100 // ms
	LOGWIN             uint64  = 500 // ms
	QEPS               uint64  = 10  // ms
	DFILT              uint64  = 120 // ms
	GAMMA_MAX          float64 = 0.1
	QBOUND             uint64  = 50 // ms
	MULTILOSS          float64 = 7.0
	QTH                uint64  = 50 // ms
	LAMBDA             float64 = 0.5
	PLRREF             float64 = 0.01
	PMRREF             float64 = 0.01
	DLOSS              uint64  = 10 // ms
	DMARK              uint64  = 2  // ms
	ALPHA              float64 = 0.1
	GRAD_UPDATE_FACTOR float64 = 0.02
)

Variables

This section is empty.

Functions

func SmoothDelaySamples

func SmoothDelaySamples(conf Config, newDelay, oldDelay uint64) uint64

Types

type Acknowledgment

type Acknowledgment struct {
	SeqNr     uint64
	Departure time.Time
	Arrival   time.Time
	SizeBit   uint64
	Marked    bool
	Arrived   bool
}

Acknowledgment contains arrival information about one packet. Sender-only NADA requires these Acknowledgments.

type Config

type Config struct {
	Priority               float64 // Weight of priority of the flow
	MinRate                uint64  // minimum rate supported by encoder in bps
	MaxRate                uint64  // maximum rate supported by encoder in bps
	StartRate              uint64  // at which rate NADA should start (default: MinRate)
	RefCongLevel           uint64  // Reference congestion level
	Kappa                  float64 // Scaling parameter for gradual rate update calculation
	Eta                    float64 // Scaling parameter for gradual rate update calculation
	Tau                    uint64  // Upper bound of RTT in gradual rate update calculation
	FeedbackDelta          uint64  // Target feedback interval
	LogWin                 uint64  // Observation window in time for calculating packet summary statistics at receiver
	QEPS                   uint64  // Threshold for determining queuing delay buildup at receiver
	DFILT                  uint64  // Bound on filtering delay for RampUp Mode
	MaxRampUpFactor        float64 // GAMMA_MAX: Upper bound on rate increase ratio for accelerated ramp up
	MaxGradualUpdateFactor float64 // Upper/Lower bound on rate increase/decrease ratio for gradual updates
	QBOUND                 uint64  // Upper bound on self-inflicted queuing delay during ramp up
	MULTILOSS              float64 // Multiplier for self-scaling the expiration threshold of the last observed loss (loss_exp) based on measured average loss interval (loss_int)
	QTH                    uint64  // Delay threshold for invoking non-linear warping
	LAMBDA                 float64 // Scaling parameter in the exponent of non-linear warping
	PLRREF                 float64 // Reference packet loss ratio
	PMRREF                 float64 // Reference packet marking ratio
	DLOSS                  uint64  // Reference delay penalty for loss when packet loss ratio is at PLRREF
	DMARK                  uint64  // Reference delay penalty for ECN marking when packet marking is at PM
	ALPHA                  float64 // Smoothing factor in exponential smoothing of packet loss and marking ratios

	DeactivateQDelayWrapping bool // do not apply wrapping of qdely
	SmoothDelaySamples       bool // Smooth delay samples with exponential moving average
	UseDefaultGradualUpdates bool // Use default gradual update mode that depends on MaxRate
}

type Feedback

type Feedback struct {
	RecvRate     uint64
	Delay        uint64
	QueueBuildup bool
}

func (Feedback) String

func (f Feedback) String() string

type Receiver

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

Receiver: all timestamps are in microseconds

func NewReceiver

func NewReceiver(config Config) Receiver

func (*Receiver) GenerateFeedback

func (r *Receiver) GenerateFeedback() (feedback Feedback)

GenerateFeedback for loss detection at sender. On time to send a new feedback report (t_curr - t_last > DELTA).

func (*Receiver) PacketArrived

func (r *Receiver) PacketArrived(
	packetNumber uint64,
	departure time.Time,
	arrival time.Time,
	packetSizeBit uint64,
	marked bool,
)

PacketArrived registers a new arrived packet. sentTs and recvTs are timestamps in microseconds. packetSize is the size of the packet in bits. marked: packet got ECN

type Sender

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

func NewSender

func NewSender(config Config) Sender

func (*Sender) FeedbackReport

func (s *Sender) FeedbackReport(feedback Feedback, rtt time.Duration) (newRate uint64)

FeedbackReport calculates the new rate with the feedback from the receiver. recvRate, delay, queueBuildup are from the receiver feedback. rtt is the current rtt.

func (*Sender) LostPacket

func (r *Sender) LostPacket(pn, tsReceived uint64)

LostPacket registers a lost packet

func (*Sender) PacketDelivered

func (s *Sender) PacketDelivered(
	packetNumber uint64,
	ackTs uint64,
	packetSize uint64,
	marked bool,
)

PacketDelivered register a delivered packet. QueueBuildUp is calculated at receiver. Use arrival ts of Ack for the LogWindow.

type SenderOnly

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

func NewSenderOnly

func NewSenderOnly(config Config) SenderOnly

func (*SenderOnly) OnAck

func (s *SenderOnly) OnAck(seqNr uint64, departure, arrival time.Time, sizeBit uint64, marked bool)

func (*SenderOnly) OnAcks

func (s *SenderOnly) OnAcks(rtt time.Duration, acks []Acknowledgment) (newRate uint64)

func (*SenderOnly) OnLoss

func (s *SenderOnly) OnLoss(seqNr uint64, departure time.Time)

func (*SenderOnly) UpdateRTT

func (s *SenderOnly) UpdateRTT(rtt time.Duration)

func (*SenderOnly) UpdateTargetRate

func (s *SenderOnly) UpdateTargetRate() uint64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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