mpthSim

package module
v0.0.0-...-f04ed6b Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: Apache-2.0 Imports: 7 Imported by: 3

README

MPTH-Sim

This repository contains both a simulator and a library to simulate network coded multipath transmissions. The goal is to simulate earth-earth and aircraft-earth communications over GEO and LEO satellites, and HAPS (high altitude platform system).

You can read the reference here: GoDoc

Components

The components of the library are:

*Links: A link is represented by an input and output channel, a paket error rate probability, and a delay.

*Nodes

*Paths

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	In  chan []byte
	Out chan []byte

	DestGone chan struct{}

	InCount, OutCount, LostCount uint64
	// contains filtered or unexported fields
}

Link represents a communication channel with a loss probability and a delay

func NewLink(lossProb float64, delay time.Duration) *Link

NewLink creates a new link with the given loss probability and delay

func (*Link) ProcessPackets

func (l *Link) ProcessPackets()

ProcessPackets listens the Input channel of the link until it is close and sends the incoming payload to a go routine DelayAndSend

type Node

type Node struct {
	// Inputs and Outputs are the channels from which and to which the node
	// receives and sends payloads
	Inputs      chan []byte
	InputsWg    sync.WaitGroup
	InputsCount uint32
	InputLinks  []*Link
	OutputLinks []*Link
	// TTL is the time to live for a recoder
	Done      chan struct{}
	ResetChan chan struct{}

	Encoder *kodo.Encoder
	Decoder *kodo.Decoder
	Data    []byte

	NodeID    byte
	RxPackets []uint32

	Transmissions uint64
	// contains filtered or unexported fields
}

func NewDecoderNode

func NewDecoderNode(factory *kodo.DecoderFactory, rate uint64) *Node

NewDecoderNode creates a node with a kodo Encoder. It takes an encoder factory as an argument, which it uses to create the encoder

func NewEncoderNode

func NewEncoderNode(factory *kodo.EncoderFactory, rate uint64) *Node

NewEncoderNode creates a node with a kodo Encoder. It takes an encoder factory as an argument, which it uses to create the encoder

func NewRecoderNode

func NewRecoderNode(factory *kodo.DecoderFactory, rate uint64) *Node

NewRecoderNode creates a node with a kodo Encoder. It takes an encoder factory as an argument, which it uses to create the encoder

func (*Node) AddInput

func (n *Node) AddInput(l *Link)

func (*Node) AddOutput

func (n *Node) AddOutput(l *Link)

func (*Node) ReceiveCodedPackets

func (n *Node) ReceiveCodedPackets(wg *sync.WaitGroup, done ...chan<- struct{})

func (*Node) RecodeAndSend

func (n *Node) RecodeAndSend()

func (*Node) Reset

func (n *Node) Reset(factory *kodo.DecoderFactory)

func (*Node) SendEncodedPackets

func (n *Node) SendEncodedPackets()

SendEncodedPackets produces encoded packets and sends them through all the output channels

func (*Node) SetConstSymbols

func (n *Node) SetConstSymbols()

SetConstSymbols should be called after the n.Data slice have been filled with the desired data

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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