PriorityBufferTutorialStep

Package: inet.tutorials.queueing

PriorityBufferTutorialStep

network

(no description)

buffer : PriorityBuffer

This buffer drops packets among the connected packet queues based on their module ID.

Source:
buffer: PriorityBuffer {
    @display("p=125,350");
} producer1 : ActivePacketSource

An active packet source which pushes packets into the connected module.

Source:
producer1: ActivePacketSource {
    @display("p=125,100");
} producer2 : ActivePacketSource

An active packet source which pushes packets into the connected module.

Source:
producer2: ActivePacketSource {
    @display("p=125,225");
} queue1 : PacketQueue

Implements a configurable packet queue, which is suitable for use in MAC protocols, traffic...

Source:
queue1: PacketQueue {
    @display("p=325,100");
    bufferModule = "^.buffer";
} queue2 : PacketQueue

Implements a configurable packet queue, which is suitable for use in MAC protocols, traffic...

Source:
queue2: PacketQueue {
    @display("p=325,225");
    bufferModule = "^.buffer";
} collector1 : ActivePacketSink

An active packet sink which pulls packets from the connected module.

Source:
collector1: ActivePacketSink {
    @display("p=525,100");
} collector2 : ActivePacketSink

An active packet sink which pulls packets from the connected module.

Source:
collector2: ActivePacketSink {
    @display("p=525,225");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Properties

Name Value Description
isNetwork

Unassigned submodule parameters

Name Type Default value Description
buffer.displayStringTextFormat string "contains %p pk (%l)\nadded %a removed %r dropped %d"

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

buffer.packetCapacity int 100

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

buffer.dataCapacity int -1b

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

buffer.dropperClass string "inet::queueing::PacketWithHighestOwnerModuleIdDropper"

Determines which packets are dropped when the buffer 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

producer1.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

producer1.packetNameFormat string "%a-%c"

See directives in module documentation

producer1.packetRepresentation string "byteCount"

Determines the chunk of the packet data

producer1.packetProtocol string "unknown"
producer1.packetLength int
producer1.packetData int -1
producer1.attachCreationTimeTag bool true
producer1.attachIdentityTag bool true
producer1.attachDirectionTag bool true
producer1.clockModule string ""

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

producer1.initialProductionOffset double -1s

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

producer1.productionInterval double

Elapsed time between subsequent packets pushed to the connected packet consumer

producer1.scheduleForAbsoluteTime bool true

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

producer2.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

producer2.packetNameFormat string "%a-%c"

See directives in module documentation

producer2.packetRepresentation string "byteCount"

Determines the chunk of the packet data

producer2.packetProtocol string "unknown"
producer2.packetLength int
producer2.packetData int -1
producer2.attachCreationTimeTag bool true
producer2.attachIdentityTag bool true
producer2.attachDirectionTag bool true
producer2.clockModule string ""

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

producer2.initialProductionOffset double -1s

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

producer2.productionInterval double

Elapsed time between subsequent packets pushed to the connected packet consumer

producer2.scheduleForAbsoluteTime bool true

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

queue1.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

queue1.packetCapacity int -1

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

queue1.dataCapacity int -1b

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

queue1.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

queue1.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

queue2.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

queue2.packetCapacity int -1

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

queue2.dataCapacity int -1b

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

queue2.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

queue2.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

collector1.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

collector1.clockModule string ""

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

collector1.initialCollectionOffset double -1s

Initial duration before which packets are not collected, negative value means: try the first collection in initialize()

collector1.collectionInterval double

Elapsed time between subsequent packets pulled from the connected packet provider

collector1.scheduleForAbsoluteTime bool true

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

collector2.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

collector2.clockModule string ""

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

collector2.initialCollectionOffset double -1s

Initial duration before which packets are not collected, negative value means: try the first collection in initialize()

collector2.collectionInterval double

Elapsed time between subsequent packets pulled from the connected packet provider

collector2.scheduleForAbsoluteTime bool true

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

Source code

network PriorityBufferTutorialStep
{
    submodules:
        buffer: PriorityBuffer {
            @display("p=125,350");
        }
        producer1: ActivePacketSource {
            @display("p=125,100");
        }
        producer2: ActivePacketSource {
            @display("p=125,225");
        }
        queue1: PacketQueue {
            @display("p=325,100");
            bufferModule = "^.buffer";
        }
        queue2: PacketQueue {
            @display("p=325,225");
            bufferModule = "^.buffer";
        }
        collector1: ActivePacketSink {
            @display("p=525,100");
        }
        collector2: ActivePacketSink {
            @display("p=525,225");
        }
    connections:
        producer1.out --> queue1.in;
        queue1.out --> collector1.in;
        producer2.out --> queue2.in;
        queue2.out --> collector2.in;
}

//-------------------------------------------------


File: tutorials/queueing/QueueingTutorial.ned