QueueingPacketDelayer

Package: inet.queueing.common

compound module QueueingPacketDelayer

Compound module that delays packets for a specified amount of time while preserving their order. Implements the IPacketDelayer interface using a queue and server architecture. The queue stores packets while they wait, and the server processes each packet with a processing time equal to the configured delay. Note that the actual packet delay will be the sum of the queueing time and the configured delay. Unlike the simple PacketDelayer module, this implementation always maintains packet order regardless of delay distribution.

Usage diagram

Inheritance diagram

Parameters

Name

Type

Default value

Description

clockModule

string

“”

Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional

delay

double

Properties

Name

Value

Description

display

i=block/delay

Gates

Name

Direction

Size

Description

in

input

out

output

Unassigned submodule parameters

Name

Type

Default value

Description

queue.displayStringTextFormat

string

“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d”

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

queue.packetCapacity

int

-1

Maximum number of packets in the queue, no limit by default

queue.dataCapacity

int

-1b

Maximum total length of packets in the queue, no limit by default

queue.dropperClass

string

“”

Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class

queue.comparatorClass

string

“”

Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class

queue.bufferModule

string

“”

Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default

server.displayStringTextFormat

string

“served %p pk (%l)\n%s”

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

server.clockModule

string

“”

Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional

server.serveSchedulingPriority

int

-1

Specifies the FES scheduling priority for the extra event that is pulling the packet, -1 means no extra event

server.processingTime

double

parent.delay

Determines additional processing time per packet

server.processingBitrate

double

inf bps

Determines additional processing time per bit

Source code

//
// Compound module that delays packets for a specified amount of time while
// preserving their order. Implements the IPacketDelayer interface using a queue
// and server architecture. The queue stores packets while they wait, and the
// server processes each packet with a processing time equal to the configured
// delay. Note that the actual packet delay will be the sum of the queueing time
// and the configured delay. Unlike the simple PacketDelayer module, this
// implementation always maintains packet order regardless of delay distribution.
//
module QueueingPacketDelayer like IPacketDelayer
{
    parameters:
        string clockModule = default(""); // Relative path of a module that implements IClock; optional
        volatile double delay @unit(s);
        *.clockModule = default(absPath(this.clockModule));
        @display("i=block/delay");
    gates:
        input in @labels(push);
        output out @labels(push);
    submodules:
        queue: <default("PacketQueue")> like IPacketQueue {
            parameters:
                @display("p=150,100");
        }
        server: <default("PacketServer")> like IPacketServer {
            parameters:
                processingTime = default(parent.delay);
                @display("p=350,100");
        }
    connections:
        in --> { @display("m=w"); } --> queue.in;
        queue.out --> server.in;
        server.out --> { @display("m=e"); } --> out;
}

File: src/inet/queueing/common/QueueingPacketDelayer.ned