PacketSourceBase

Package: inet.queueing.base

simple module PacketSourceBase

Base module for various packet source modules. Packets are created randomly with regard to packet length and packet data. The representation of packet data can also be configured.

Available packet name format directives: source, application, network node display name or full name, full path

  • %a: automatic application display name or application full name or module display name or module full name

  • %n: module display name or module full name

  • %m: application display name or application full name

  • %M: network node display name or network node full name

  • %p: module full path

  • %h: application full path

  • %H: network node full path

  • %c: packet number

  • %l: packet length

  • %d: packet data

  • %t: simulation time

  • %e: event number

See also: IPacketSource

inet.queueing.base.PacketSourceBasePacketSourceBasesimple

Inheritance diagram

Known subclasses

Name

Type

Description

ActivePacketSourceBase

simple module

Base module for various active packet source modules.

PassivePacketSourceBase

simple module

Base module for various active packet source modules.

Extends

Name

Type

Description

PacketProcessorBase

simple module

Base module for various packet processing modules which maintains a few statistics.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“created %p pk (%l)”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

packetNameFormat

string

“%a-%c”

See directives in module documentation

packetRepresentation

string

“byteCount”

Determines the chunk of the packet data

packetProtocol

string

“unknown”

packetLength

int

packetData

int

-1

attachCreationTimeTag

bool

true

attachIdentityTag

bool

true

attachDirectionTag

bool

true

Properties

Name

Value

Description

class

PacketSourceBase

display

i=block/source

Signals

Name

Type

Unit

Description

packetCreated

inet::Packet

Source code

//
// Base module for various packet source modules. Packets are created
// randomly with regard to packet length and packet data. The representation of
// packet data can also be configured.
//
// Available packet name format directives:
// source, application, network node
// display name or full name, full path
//
//  - %a: automatic application display name or application full name or module display name or module full name
//  - %n: module display name or module full name
//  - %m: application display name or application full name
//  - %M: network node display name or network node full name
//  - %p: module full path
//  - %h: application full path
//  - %H: network node full path
//  - %c: packet number
//  - %l: packet length
//  - %d: packet data
//  - %t: simulation time
//  - %e: event number
//
// @see ~IPacketSource
//
simple PacketSourceBase extends PacketProcessorBase
{
    parameters:
        string packetNameFormat = default("%a-%c"); // See directives in module documentation
        string packetRepresentation @units("bitCount","bits","byteCount","bytes","applicationPacket") = default("byteCount"); // Determines the chunk of the packet data
        string packetProtocol = default("unknown");
        volatile int packetLength @unit(b);
        volatile int packetData = default(-1);
        bool attachCreationTimeTag = default(true);
        bool attachIdentityTag = default(true);
        bool attachDirectionTag = default(true);
        displayStringTextFormat = default("created %p pk (%l)");
        @class(PacketSourceBase);
        @display("i=block/source");
        @signal[packetCreated](type=inet::Packet);
}

File: src/inet/queueing/base/PacketSourceBase.ned