tg

package
v0.0.0-...-1e60831 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: NIST-PD-fallback Imports: 20 Imported by: 0

README

ndn-dpdk/app/tg

This package implements an NDN traffic generator.

Unlike named-data.net's ndnping and ndn-traffic-generator programs, this implementation does not require a local forwarder, but can directly sends and receives packets on a network interface.

This traffic generator has up to five threads for each face:

  • The input thread ("RX" role) runs an iface.RxLoop that dispatches Data/Nacks to the consumer and dispatches Interests to the producer.
  • The output thread ("TX" role) runs an iface.TxLoop that transmits Interests, Data, and Nacks created by the client-RX and server threads.
  • Either:
  • The producer thread ("PRODUCER" role) runs either:

Documentation

Overview

Package tg controls traffic generator elements.

Index

Constants

View Source
const (
	RoleInput    = iface.RoleRx
	RoleOutput   = iface.RoleTx
	RoleConsumer = tgdef.RoleConsumer
	RoleProducer = tgdef.RoleProducer
)

Thread roles.

Variables

View Source
var (
	GqlTrafficGenType *gqlserver.NodeType[*TrafficGen]
	GqlCountersType   *graphql.Object
)

GraphQL types.

View Source
var (
	// GqlCreateEnabled allows creating traffic generator instances via GraphQL.
	GqlCreateEnabled = false
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Face       iface.LocatorWrapper `json:"face"`
	Producer   *tgproducer.Config   `json:"producer,omitempty"`
	FileServer *fileserver.Config   `json:"fileServer,omitempty"`
	Consumer   *tgconsumer.Config   `json:"consumer,omitempty"`
	Fetcher    *fetch.Config        `json:"fetcher,omitempty"`
}

Config describes traffic generator configuration.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate applies defaults and validates the configuration.

type Counters

type Counters struct {
	Producer   *tgproducer.Counters `json:"producer,omitempty"`
	FileServer *fileserver.Counters `json:"fileServer,omitempty"`
	Consumer   *tgconsumer.Counters `json:"consumer,omitempty"`
}

Counters contains traffic generator counters.

type TrafficGen

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

TrafficGen represents the traffic generator on a face.

func Get

func Get(id iface.ID) *TrafficGen

Get retrieves traffic generator instance by face.

func New

func New(cfg Config) (gen *TrafficGen, e error)

New creates a traffic generator.

func (*TrafficGen) Close

func (gen *TrafficGen) Close() error

Close releases resources. It cannot be launched again.

func (TrafficGen) Consumer

func (gen TrafficGen) Consumer() *tgconsumer.Consumer

Consumer returns the fixed rate consumer module.

func (*TrafficGen) Counters

func (gen *TrafficGen) Counters() (cnt Counters)

Counters retrieves counters.

func (TrafficGen) Face

func (gen TrafficGen) Face() iface.Face

Face returns the face on which this traffic generator operates.

func (TrafficGen) Fetcher

func (gen TrafficGen) Fetcher() *fetch.Fetcher

Fetcher returns the congestion aware fetcher module.

func (TrafficGen) FileServer

func (gen TrafficGen) FileServer() *fileserver.Server

FileServer returns the file server module.

func (*TrafficGen) Launch

func (gen *TrafficGen) Launch() error

Launch launches the traffic generator.

func (TrafficGen) Producer

func (gen TrafficGen) Producer() *tgproducer.Producer

Producer returns the producer module.

func (*TrafficGen) Stop

func (gen *TrafficGen) Stop() error

Stop stops the traffic generator. It can be launched again.

func (TrafficGen) Workers

func (gen TrafficGen) Workers() []ealthread.ThreadWithRole

Workers implements tggql.withCommonFields interface.

Directories

Path Synopsis
Package tgdef contains common definitions and helpers for traffic generator.
Package tgdef contains common definitions and helpers for traffic generator.
Package tggql contains shared functions among traffic generator elements.
Package tggql contains shared functions among traffic generator elements.
Package tgtestenv provides facility to test the traffic generator.
Package tgtestenv provides facility to test the traffic generator.

Jump to

Keyboard shortcuts

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