standalone

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package standalone provides infrastructures to write network simulations without simulating compute cores and memory systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	*akita.TickingComponent

	ToOut akita.Port

	Buffer []*TrafficMsg
}

Agent is a component that connects the network. It can send and receive msguests to/ from the network.

func NewAgent

func NewAgent(name string, engine akita.Engine) *Agent

NewAgent creates a new agent.

func (*Agent) Handle

func (a *Agent) Handle(e akita.Event) error

Handle defines how an agent handles events.

func (*Agent) NotifyRecv

func (a *Agent) NotifyRecv(now akita.VTimeInSec, port akita.Port)

NotifyRecv notifies that a port has received a message.

func (*Agent) Tick added in v1.3.0

func (a *Agent) Tick(now akita.VTimeInSec) bool

type GreedyTrafficInjector

type GreedyTrafficInjector struct {
	PacketSize int
	NumPackets int
	// contains filtered or unexported fields
}

GreedyTrafficInjector generate a large number of traffic at the beginning of the simulation.

func NewGreedyTrafficInjector

func NewGreedyTrafficInjector(engine akita.Engine) *GreedyTrafficInjector

NewGreedyTrafficInjector creates a new GreedyTrafficInjector.

func (*GreedyTrafficInjector) InjectTraffic

func (ti *GreedyTrafficInjector) InjectTraffic()

InjectTraffic injects traffic.

func (*GreedyTrafficInjector) RegisterAgent

func (ti *GreedyTrafficInjector) RegisterAgent(a *Agent)

RegisterAgent allows the GreedyTraffiCInjector to inject traffic from the agent.

type StartSendEvent

type StartSendEvent struct {
	*akita.EventBase
	Msg *TrafficMsg
}

StartSendEvent is an event that triggers an agent to send a message.

func NewStartSendEvent

func NewStartSendEvent(
	time akita.VTimeInSec,
	src, dst *Agent,
	byteSize int,
	trafficClass int,
) *StartSendEvent

NewStartSendEvent creates a new StartSendEvent.

type TrafficInjector

type TrafficInjector interface {
	RegisterAgent(a *Agent)
	InjectTraffic()
}

A TrafficInjector can inject traffic to a network.

type TrafficMsg added in v1.2.0

type TrafficMsg struct {
	akita.MsgMeta
}

TrafficMsg is a type of msguests that only used in standalone network test. It has a byte size, but we do not care about the information it carries.

func NewTrafficMsg added in v1.2.0

func NewTrafficMsg(src, dst akita.Port, byteSize int) *TrafficMsg

NewTrafficMsg creates a new traffic message

func (*TrafficMsg) Meta added in v1.2.0

func (m *TrafficMsg) Meta() *akita.MsgMeta

Meta returns the meta data of the message.

Jump to

Keyboard shortcuts

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