Table Of Contents
Table Of Contents

Connecting Multiple Active Sources to a Passive Sink

The PacketMultiplexer module connects to multiple active packet sources on its inputs, and pushes all incoming packets onto a passive packet sink on its single output.

In this example network, packets are produced at random intervals by several active packet sources (ActivePacketSource). The packets are consumed by a single passive packet sink (PassivePacketSink) upon arrival. The single sink is connected to multiple sources using an intermediary component (PacketMultiplexer) which simply forwards packets.

network MultiplexerTutorialStep
        int numProducers;
        producer[numProducers]: ActivePacketSource {
        multiplexer: PacketMultiplexer {
        consumer: PassivePacketSink {
    connections allowunconnected:
        for i=0..numProducers-1 {
            producer[i].out -->;
        multiplexer.out -->;
[Config Multiplexer]
network = MultiplexerTutorialStep
sim-time-limit = 10s

*.numProducers = 3
*.producer[*].packetLength = 1B
*.producer[*].productionInterval = uniform(0s, 2s)