ActivePacketSource¶
Package: inet.queueing.source
simple module ActivePacketSource
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
productionIntervaltime apartBackpressure prevents packets from being pushed out
Usage diagram¶
Inheritance diagram¶
Used in compound modules¶
Name |
Type |
Description |
|---|---|---|
compound module |
Implements a generic source application. |
|
compound module |
Generates traffic as an Ethernet application. The traffic source and traffic sink modules can be built from queueing model elements. |
|
compound module |
Generates traffic as an IEEE 802.2 LLC application. The traffic source and traffic sink modules can be built from queueing model elements. |
|
compound module |
Generates traffic for a IP application. The traffic source and traffic sink modules can be built from queueing model elements. |
|
compound module |
A generic, very modular TCP client application, similar to TcpServerApp. The traffic source and traffic sink modules can be built from queueing model elements. |
|
compound module |
This is a pre-assembled module type to be used in TcpServerApp. One instance of this module type is launched by TcpServerListener for each incoming connection. It is composed of a traffic source, a traffic sink, a socket I/O and other modules, and most of the module types are parametric. The traffic source and traffic sink modules can be built from queueing model elements. |
|
compound module |
This client application contains a configurable pre-composed telnet traffic source and traffic sink. |
|
compound module |
Generates traffic for a UDP application. The traffic source and traffic sink modules can be built from queueing model elements. |
|
compound module |
Mixes two different packet sources to generate bursty traffic. |
Extends¶
Name |
Type |
Description |
|---|---|---|
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,:ref:2 <neddoc-msg-inet-iclock>); 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 |
|---|---|---|---|
packetCreated |
|||
packetPushed |
Statistics¶
Name |
Title |
Source |
Record |
Unit |
Interpolation Mode |
Description |
|---|---|---|---|---|---|---|
dataRate |
data rate |
throughput(packetPushed) |
vector |
bps |
linear |
the statistical value is the data rate of the packets |
packetLengths |
packet lengths |
packetLength(packetPushed) |
sum,histogram,vector |
b |
none |
the statistical value is the length of the packet |
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);
}