Table Of Contents
Table Of Contents

Content-Based Filtering (Active Sink)

This step is very similar to the previous one, but packets are popped from the filter by an active packet sink (ActivePacketSink), and provided by a passive packet source (PassivePacketSource).

network Filter2TutorialStep
{
    @display("bgb=600,200");
    submodules:
        provider: PassivePacketSource {
            @display("p=100,100");
        }
        filter: ContentBasedFilter {
            @display("p=300,100");
        }
        collector: ActivePacketSink {
            @display("p=500,100");
        }
    connections allowunconnected:
        provider.out --> filter.in;
        filter.out --> collector.in;
}
[Config Filter2]
network = Filter2TutorialStep
sim-time-limit = 10s

*.provider.packetLength = intuniform(1B, 2B)
*.collector.collectionInterval = 1s
*.filter.packetFilter = "totalLength =~ \"1 B\""