Table Of Contents
Table Of Contents

Content-Based Classifier

The ContentBasedClassifier module classifies packets according to the configured packet filter and packet data filter expressions.

In this example network, packets are generated by an active packet source (ActivePacketSource). The packets are pushed into a ContentBasedClassifier, which is connected to two passive packet sinks (PassivePacketSink). The packet source generates 1-byte packets with either 0 or 1 as data randomly. The classifier’s packet data filter is configured to send packets which contain 0 to output 0, and those that contain 1 to output 1.

network ContentBasedClassifierTutorialStep
        producer: ActivePacketSource {
        classifier: ContentBasedClassifier {
        consumer1: PassivePacketSink {
        consumer2: PassivePacketSink {
    connections allowunconnected:
        producer.out -->;
        classifier.out++ -->;
        classifier.out++ -->;
[Config ContentBasedClassifier]
network = ContentBasedClassifierTutorialStep
sim-time-limit = 10s

*.producer.packetLength = 1B
*.producer.packetData = intuniform(0, 1)
*.producer.productionInterval = 1s
*.classifier.packetFilters = [expr( == 0), expr( == 1)]