ActivePacketSink¶
Package: inet.queueing.sink
simple module ActivePacketSink
An active packet sink which pulls packets from the connected module. It pulls whole packets through the in gate at every collection interval. It pulls the first packet after the initial collection offset.
If backpressure is present at the end of a collection interval, then it waits until the backpressure disappears, and then pulls in a packet. The collection interval timer always starts after the module pulls a packet in.
All pulled packets are counted and deleted.
Invariants:
two subsequent packets are always pulled in at least
collectionIntervaltime apartbackpressure prevents packets from being pulled in
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for various active packet sink modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“received %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
clockModule |
string |
“” |
Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional |
initialCollectionOffset |
double |
-1s |
Initial duration before which packets are not collected, negative value means: try the first collection in initialize() |
collectionInterval |
double |
Elapsed time between subsequent packets pulled from the connected packet provider |
|
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 |
ActivePacketSink |
|
display |
i=block/sink |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
in |
input |
Signals¶
Name |
Type |
Unit |
Description |
|---|---|---|---|
packetDropped |
|||
packetPulled |
Statistics¶
Name |
Title |
Source |
Record |
Unit |
Interpolation Mode |
Description |
|---|---|---|---|---|---|---|
bitLifeTime |
bit life time |
weightTimes(lengthWeightedValuePerRegion(lifeTimePerRegion(packetPulled))) |
histogram? |
s |
none |
the statistical value is the time difference of the current simulation time and the creation time of the bit |
dataRate |
data rate |
throughput(packetPulled) |
vector |
bps |
linear |
the statistical value is the data rate of the packets |
droppedDataRate |
dropped data rate |
throughput(packetDropped) |
vector |
bps |
linear |
the statistical value is the data rate of the dropped packets |
droppedPacketLengths |
dropped packet lengths |
packetLength(packetDropped) |
sum,histogram,vector |
b |
none |
the statistical value is the length of the dropped packet |
droppedPackets |
dropped packets |
packetDropped |
count |
pk |
the statistical value is the dropped packet |
|
meanBitLifeTimePerPacket |
mean bit life time per packet |
weightedMeanPerGroup(groupRegionsPerPacket(lifeTimePerRegion(packetPulled))) |
vector,histogram |
s |
none |
the statistical value is the time difference of the current simulation time and the creation time of any bit in the region |
packetDelayDifferenceToMean |
packet delay difference to mean |
differenceToMean(weightedMeanPerGroup(groupRegionsPerPacket(lifeTimePerRegion(packetPulled)))) |
vector,histogram |
s |
none |
the statistical value is the difference of the current and the mean bit elapsed time per packet |
packetDelayVariation |
packet delay variation |
stddev(weightedMeanPerGroup(groupRegionsPerPacket(lifeTimePerRegion(packetPulled)))) |
vector,histogram |
s |
the statistical value is the variation of the mean bit elapsed time per packet |
|
packetJitter |
packet jitter |
jitter(weightedMeanPerGroup(groupRegionsPerPacket(lifeTimePerRegion(packetPulled)))) |
vector,histogram |
s |
none |
the statistical value is the difference of subsequent values of the mean bit elapsed time per packet |
packetLengths |
packet lengths |
packetLength(packetPulled) |
sum,histogram,vector |
b |
none |
the statistical value is the length of the packet |
packetLifeTime |
packet life time |
packetLifeTime(packetPulled) |
vector,histogram |
s |
none |
the statistical value is the time difference of the current simulation time and the creation time of the whole packet data, nan if not all bits have the same value |
packets |
packets |
packetPulled |
count |
pk |
the statistical value is the packet |
Source code¶
//
// An active packet sink which pulls packets from the connected
// module. It pulls whole packets through the in gate at every collection interval.
// It pulls the first packet after the initial collection offset.
//
// If backpressure is present at the end of a collection interval, then it waits
// until the backpressure disappears, and then pulls in a packet. The collection
// interval timer always starts after the module pulls a packet in.
//
// All pulled packets are counted and deleted.
//
// Invariants:
// - two subsequent packets are always pulled in at least `collectionInterval` time apart
// - backpressure prevents packets from being pulled in
//
simple ActivePacketSink extends ActivePacketSinkBase like IActivePacketSink
{
parameters:
string clockModule = default(""); // Relative path of a module that implements IClock; optional
double initialCollectionOffset @unit(s) = default(-1s); // Initial duration before which packets are not collected, negative value means: try the first collection in initialize()
volatile double collectionInterval @unit(s); // Elapsed time between subsequent packets pulled from the connected packet provider
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(ActivePacketSink);
gates:
input in @labels(pull);
}