CbrSender

Package: simu5g.apps.cbr

simple module CbrSender

Simple module for generating Constant Bit Rate (CBR) traffic. This module periodically sends packets of a specified size to a designated address and port. The intervals between packets and the overall duration of the communication are configurable. The module emits statistics related to the generated throughput and the total amount of bytes sent.

simu5g.apps.cbr.CbrSenderCbrSendersimple

Inheritance diagram

Parameters

Name

Type

Default value

Description

localPort

int

-1

destPort

int

3000

destAddress

string

packetSize

int

40B

samplingTime

double

0.02s

startTime

double

0s

finishTime

double

0s

tos

int

-1

If not -1, set the Type of Service (IPv4) / Traffic Class (IPv6) field of sent packets to this value

Properties

Name

Value

Description

display

i=block/source

Gates

Name

Direction

Size

Description

socketOut

output

socketIn

input

Signals

Name

Type

Unit

Description

cbrGeneratedBytes

cbrGeneratedThroughput

cbrSentPkt

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

cbrGeneratedBytes

Bytes generated by the application

cbrGeneratedBytes

mean,last(sumPerDuration)

Bps

cbrGeneratedThroughput

Throughput generated by the application

cbrGeneratedThroughput

simu5g_rateavg,vector

Bps

cbrSentPkt

Sent packet ID

cbrSentPkt

vector

Source code

//
// Simple module for generating Constant Bit Rate (CBR) traffic. This module
// periodically sends packets of a specified size to a designated address
// and port. The intervals between packets and the overall duration of the
// communication are configurable. The module emits statistics related to
// the generated throughput and the total amount of bytes sent.
//
simple CbrSender like IApp
{
    parameters:
        int localPort = default(-1);
        int destPort = default(3000);
        string destAddress;
        int packetSize @unit(B) = default(40B);
        double samplingTime @unit("s") = default(0.02s);
        double startTime @unit("s") = default(0s);
        double finishTime @unit("s") = default(0s);
        int tos = default(-1); // If not -1, set the Type of Service (IPv4) / Traffic Class (IPv6) field of sent packets to this value

        @signal[cbrGeneratedThroughput];
        @statistic[cbrGeneratedThroughput](title="Throughput generated by the application"; unit="Bps"; source="cbrGeneratedThroughput"; record=simu5g_rateavg,vector);

        @signal[cbrGeneratedBytes];
        @statistic[cbrGeneratedBytes](title="Bytes generated by the application"; unit="Bps"; source="cbrGeneratedBytes"; record=mean,last(sumPerDuration));

        @signal[cbrSentPkt];
        @statistic[cbrSentPkt](title="Sent packet ID"; unit=""; source="cbrSentPkt"; record=vector);

        @display("i=block/source");
    gates:
        output socketOut;
        input socketIn;
}

File: src/simu5g/apps/cbr/CbrSender.ned