ActivePacketSource

Package: inet.queueing.source

ActivePacketSource

simple module

C++ definition

An active packet source which pushes packets into the connected module. It pushes whole packets through the out gate at every production interval. It pushes the first packet after the initial production offset.

If backpressure is present at the end of a production interval, then it waits until the backpressure disappears, and then pushes out a packet. The production interval timer always starts after the module pushes a packet out.

Invariants:

  • Two subsequent packets are always pushed out at least productionInterval time apart
  • Backpressure prevents packets from being pushed out

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Used in compound modules

Name Type Description
BurstyPacketProducer compound module

Mixes two different packet sources to generate bursty traffic.

ClientHost1 compound module (no description)
ClientHost2 compound module (no description)
ClientHost3 compound module (no description)
ClientHost4 compound module (no description)
ClientHost5 compound module (no description)
ClientHost6 compound module (no description)
ClientHost7 compound module (no description)
ExampleCompoundPriorityQueue compound module (no description)
ExampleHost compound module (no description)
SenderHost compound module (no description)

Used in

Name Type Description
BufferTutorialStep network (no description)
ClonerTutorialStep network (no description)
ComparatorTutorialStep network (no description)
CompoundPacketQueueTutorialStep network (no description)
ContentBasedClassifierTutorialStep network (no description)
ContentBasedTaggerTutorialStep network (no description)
DelayerTutorialStep network (no description)
DropTailQueueTutorialStep network (no description)
DuplicatorTutorialStep network (no description)
Filter1TutorialStep network (no description)
Gate1TutorialStep network (no description)
GenericClassifierTutorialStep network (no description)
InputQueueSwitching network (no description)
LabelerTutorialStep network (no description)
LeakyBucketTutorialStep network (no description)
MarkovClassifierTutorialStep network (no description)
MeterTutorialStep network (no description)
MultiplexerTutorialStep network (no description)
OrdinalBasedDropperTutorialStep network (no description)
OrdinalBasedDuplicatorTutorialStep network (no description)
OutputQueueSwitching network (no description)
PacketBasedTokenGeneratorTutorialStep network (no description)
PacketQueueTutorialStep network (no description)
PeekingUnderTheHoodShowcase network (no description)
PeekingUnderTheHoodShowcase network (no description)
PriorityBufferTutorialStep network (no description)
PriorityClassifierTutorialStep network (no description)
PriorityQueueTutorialStep network (no description)
PrioritySchedulerTutorialStep network (no description)
ProducerConsumerTutorialStep network (no description)
RedDropperTutorialStep network (no description)
RequestResponseTutorialStep network (no description)
TaggerTutorialStep network (no description)
TokenBucketTutorialStep network (no description)
WrrClassifierTutorialStep network (no description)

Extends

Name Type Description
ActivePacketSourceBase simple module

Base module for various active packet source modules.

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
clockModule string ""

Relative path of a module that implements IClock(1,2); optional

initialProductionOffset double -1s

Initial duration before which packets are not produced. When negative, then produce packet in initialize()

productionInterval double

Elapsed time between subsequent packets pushed to the connected packet consumer

scheduleForAbsoluteTime bool true

When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event

Properties

Name Value Description
class ActivePacketSource
display i=block/source

Gates

Name Direction Size Description
out output

Signals

Name Type Unit Description
packetPushed inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode Description
packetLengths packet lengths packetLength(packetPushed) sum, histogram, vector b none

the statistical value is the length of the packet

dataRate data rate throughput(packetPushed) vector bps linear

the statistical value is the data rate of the packets

packets packets packetPushed count pk

the statistical value is the packet

Source code

//
// An active packet source which pushes packets into the connected
// module. It pushes whole packets through the out gate at every production
// interval. It pushes the first packet after the initial production offset.
//
// If backpressure is present at the end of a production interval, then it waits
// until the backpressure disappears, and then pushes out a packet. The production
// interval timer always starts after the module pushes a packet out.
//
// Invariants:
//  - Two subsequent packets are always pushed out at least `productionInterval` time apart
//  - Backpressure prevents packets from being pushed out
//
simple ActivePacketSource extends ActivePacketSourceBase like IActivePacketSource
{
    parameters:
        string clockModule = default(""); // Relative path of a module that implements IClock; optional
        double initialProductionOffset @mutable @unit(s) = default(-1s); // Initial duration before which packets are not produced. When negative, then produce packet in initialize()
        volatile double productionInterval @unit(s); // Elapsed time between subsequent packets pushed to the connected packet consumer
        bool scheduleForAbsoluteTime = default(true); // When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event
        @class(ActivePacketSource);
    gates:
        output out @labels(push);
}
File: src/inet/queueing/source/ActivePacketSource.ned