PacketDuplicator

Package: inet.queueing.common

PacketDuplicator

simple module

C++ definition

Connects one packet producer to one packet consumer. It can be pushed with packets from the connected packet producer. When this happens, one or more copies of the packet are pushed to the output gate.

Inheritance diagram

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

Used in

Name Type Description
DuplicatorTutorialStep network (no description)

Extends

Name Type Description
PacketDuplicatorBase simple module

Base type for packet duplicator implementations. Provides common functionality for creating and forwarding multiple copies of incoming packets.

Parameters

Name Type Default value Description
displayStringTextFormat string "processed %p pk (%l)"

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

numDuplicates int 1

Number of duplicates, 0 means only the original packet is forwarded

Properties

Name Value Description
class PacketDuplicator
display i=block/star

Gates

Name Direction Size Description
in input
out output

Source code

//
// Connects one packet producer to one packet consumer. It can be
// pushed with packets from the connected packet producer. When this happens,
// one or more copies of the packet are pushed to the output gate.
//
simple PacketDuplicator extends PacketDuplicatorBase like IPassivePacketSink, IActivePacketSource
{
    parameters:
        volatile int numDuplicates = default(1); // Number of duplicates, 0 means only the original packet is forwarded
        @class(PacketDuplicator);
        @display("i=block/star");
    gates:
        input in @labels(push);
        output out @labels(push);
}
File: src/inet/queueing/common/PacketDuplicator.ned