Table Of Contents
Table Of Contents

Blocking/Unblocking Packet Flow (Active Sink)

This step is similar to the previous one, but with an active packet sink and passive packet source. Packets are collected periodically by an active packet sink (ActivePacketSink). The packets pass through a packet gate if it is open, otherwise packets are not generated. The packets are provided by a passive packet source (PassivePacketSource).

../../../_images/Gate2.png
network Gate2TutorialStep
{
    @display("bgb=600,200");
    submodules:
        provider: PassivePacketSource {
            @display("p=100,100");
        }
        gate: PacketGate {
            @display("p=300,100");
        }
        collector: ActivePacketSink {
            @display("p=500,100");
        }
    connections:
        provider.out --> gate.in;
        gate.out --> collector.in;
}
[Config Gate2]
network = Gate2TutorialStep
sim-time-limit = 10s

*.provider.packetLength = 1B
*.collector.collectionInterval = 1s
*.gate.openTime = 3s
*.gate.closeTime = 7s