fetch

package
v0.0.0-...-c2e30b8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: NIST-PD-fallback Imports: 18 Imported by: 0

README

ndn-dpdk/app/fetch

This package is used in the traffic generator. It implements a consumer that follows the TCP CUBIC congestion control algorithm, simulating traffic patterns similar to bulk file transfer. It requires one thread, running the FetchThread_Run function.

Documentation

Overview

Package fetch simulates bulk file transfer traffic patterns.

Index

Constants

This section is empty.

Variables

View Source
var (
	GqlFetcherNodeType *gqlserver.NodeType
	GqlFetcherType     *graphql.Object
	GqlTemplateType    *graphql.InputObject
)

GraphQL types.

Functions

This section is empty.

Types

type Counters

type Counters struct {
	Time      time.Time     `json:"time"`
	LastRtt   time.Duration `json:"lastRtt"`
	SRtt      time.Duration `json:"sRtt"`
	Rto       time.Duration `json:"rto"`
	Cwnd      int           `json:"cwnd"`
	NInFlight uint32        `json:"nInFlight"` // number of in-flight Interests
	NTxRetx   uint64        `json:"nTxRetx"`   // number of retransmitted Interests
	NRxData   uint64        `json:"nRxData"`   // number of Data satisfying pending Interests
}

Counters contains counters of Logic.

func (Counters) ComputeGoodput

func (cnt Counters) ComputeGoodput(prev Counters) float64

ComputeGoodput returns average number of Data per second.

func (Counters) String

func (cnt Counters) String() string

type Cubic

type Cubic C.TcpCubic

Cubic implements the TCP CUBIC congestion avoidance algorithm.

func (*Cubic) Cwnd

func (ca *Cubic) Cwnd() int

Cwnd returns current congestion window.

func (*Cubic) Decrease

func (ca *Cubic) Decrease(now eal.TscTime)

Decrease deceases congestion window.

func (*Cubic) Increase

func (ca *Cubic) Increase(now eal.TscTime, sRtt time.Duration)

Increase increases congestion window.

func (*Cubic) Init

func (ca *Cubic) Init()

Init initializes congestion control state.

type Fetcher

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

Fetcher controls fetch threads and fetch procedures on a face. A fetch procedure retrieves Data under a single name prefix, and has independent congestion control. A fetch thread runs on an lcore, and can serve multiple fetch procedures.

func New

func New(face iface.Face, cfg FetcherConfig) (*Fetcher, error)

New creates a Fetcher.

func (*Fetcher) AddTemplate

func (fetcher *Fetcher) AddTemplate(tplArgs ...interface{}) (i int, e error)

AddTemplate sets name prefix and other InterestTemplate arguments. Return index of fetch procedure.

func (*Fetcher) Close

func (fetcher *Fetcher) Close() error

Close deallocates data structures.

func (*Fetcher) CountProcs

func (fetcher *Fetcher) CountProcs() int

CountProcs returns number of fetch procedures.

func (*Fetcher) CountThreads

func (fetcher *Fetcher) CountThreads() int

CountThreads returns number of threads.

func (*Fetcher) Face

func (fetcher *Fetcher) Face() iface.Face

Face returns the face.

func (*Fetcher) Launch

func (fetcher *Fetcher) Launch()

Launch launches all fetch threads.

func (*Fetcher) Logic

func (fetcher *Fetcher) Logic(i int) *Logic

Logic returns the Logic of i-th fetch procedure.

func (*Fetcher) Reset

func (fetcher *Fetcher) Reset()

Reset resets all Logics. If the fetcher is running, it is automatically stopped.

func (*Fetcher) RxQueue

func (fetcher *Fetcher) RxQueue(i int) *iface.PktQueue

RxQueue returns the RX queue of i-th fetch procedure.

func (*Fetcher) Stop

func (fetcher *Fetcher) Stop()

Stop stops all fetch threads.

func (*Fetcher) Thread

func (fetcher *Fetcher) Thread(i int) ealthread.Thread

Thread returns i-th thread.

type FetcherConfig

type FetcherConfig struct {
	NThreads       int                  `json:"nThreads,omitempty"`
	NProcs         int                  `json:"nProcs,omitempty"`
	RxQueue        iface.PktQueueConfig `json:"rxQueue,omitempty"`
	WindowCapacity int                  `json:"windowCapacity,omitempty"`
}

FetcherConfig contains Fetcher configuration.

type Logic

type Logic C.FetchLogic

Logic implements fetcher congestion control and scheduling logic.

func LogicFromPtr

func LogicFromPtr(ptr unsafe.Pointer) (fl *Logic)

LogicFromPtr converts *C.FetchLogic to *Logic. ptr must be in C memory due to TAILQ_HEAD usage.

func (*Logic) Close

func (fl *Logic) Close() error

Close deallocates data structures.

func (*Logic) Cubic

func (fl *Logic) Cubic() *Cubic

Cubic returns the congestion avoidance algorithm.

func (*Logic) Finished

func (fl *Logic) Finished() bool

Finished determines if all segments have been fetched.

func (*Logic) Init

func (fl *Logic) Init(windowCapacity int, socket eal.NumaSocket)

Init initializes the logic and allocates data structures.

func (*Logic) ReadCounters

func (fl *Logic) ReadCounters() (cnt Counters)

ReadCounters retrieves counters.

func (*Logic) Reset

func (fl *Logic) Reset()

Reset resets this to initial state.

func (*Logic) RttEst

func (fl *Logic) RttEst() *RttEst

RttEst returns the RTT estimator.

func (*Logic) RxData

func (fl *Logic) RxData(segNum uint64, hasCongMark bool)

RxData notifies about Data arrival.

func (*Logic) SetFinalSegNum

func (fl *Logic) SetFinalSegNum(segNum uint64)

SetFinalSegNum assigns (inclusive) final segment number.

func (*Logic) TriggerRtoSched

func (fl *Logic) TriggerRtoSched()

TriggerRtoSched triggers the internal RTO scheduler.

func (*Logic) TxInterest

func (fl *Logic) TxInterest() (need bool, segNum uint64)

TxInterest requests for Interest transmission.

func (*Logic) Window

func (fl *Logic) Window() *Window

Window returns the segment state window.

type RttEst

type RttEst C.RttEst

RttEst represents an RTT estimator.

func (*RttEst) Backoff

func (rtte *RttEst) Backoff()

Backoff performs RTO backoff once.

func (*RttEst) Init

func (rtte *RttEst) Init()

Init initializes RTT estimator.

func (*RttEst) LastRtt

func (rtte *RttEst) LastRtt() time.Duration

LastRtt returns last RTT.

func (*RttEst) Push

func (rtte *RttEst) Push(now eal.TscTime, rtt time.Duration)

Push adds an RTT sample.

func (*RttEst) Rto

func (rtte *RttEst) Rto() time.Duration

Rto returns RTO.

func (*RttEst) SRtt

func (rtte *RttEst) SRtt() time.Duration

SRtt returns smoothed RTT.

type Window

type Window C.FetchWindow

Window is a sliding window of segment states.

func (*Window) Append

func (win *Window) Append() *SegState

Append adds per-segment state.

func (*Window) Close

func (win *Window) Close() error

Close deallocates the FetchWindow.

func (*Window) Delete

func (win *Window) Delete(segNum uint64)

Delete removes per-segment state.

func (*Window) Get

func (win *Window) Get(segNum uint64) *SegState

Get retrieve per-segment state.

func (*Window) Init

func (win *Window) Init(capacity int, socket eal.NumaSocket)

Init allocates and initializes the FetchWindow.

func (*Window) Reset

func (win *Window) Reset()

Reset clears the state in the FetchWindow.

Jump to

Keyboard shortcuts

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