PacketFilterBase

Package: inet.queueing.base

PacketFilterBase

simple module

C++ definition

Base module for various packet filter modules. Derived modules must implement a single packet matcher function which determines if a packet is to be passed through or filtered out.

<b>See also:</b> ~IPacketFilter

Inheritance diagram

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

Known subclasses

Name Type Description
BackPressureBasedFilter simple module

Implements a packet filter that drops packets when the following module (consumer) does not allow packets to be pushed. The module itself accepts all packets (i.e. canPushPacket() and canPushSomePacket() always return true). This is useful, for example, when the following module is a gate to filter out packets when the gate is closed.

ChecksumCheckerBase simple module

Base module for checksum checkers that verify the integrity of packets. This module filters packets based on their checksum value, dropping packets with invalid checksums. It supports multiple checksum algorithms such as CRC32 and the Internet checksum, and also several checksum modes: disabled, declared correct, declared incorrect, and computed. When in computed mode, it calculates the actual checksum and compares it with the received value.

ContentBasedFilter simple module

Filters packets that match the configured filter criteria. When the filter is pushed by a connected packet producer, it either pushes the packet to the connected packet consumer or drops it, depending on the configured packet filter. Similarly, when the filter is pulled by a connected packet collector, it pulls packets from the connected packet provider until it finds one that matches the configured packet filter.

EligibilityTimeFilter simple module

A packet filter that operates based on the ~EligibilityTimeTag attached to the packet that is passing through. Packets are dropped if the tag is missing. If the maxResidenceTime parameter is set, then the filter also drops the packets for which the eligibility time in the attached ~EligibilityTimeTag is greater than the current simulation time plus the maximum residence time.

EthernetAddressChecker simple module

Filters Ethernet packets based on their destination MAC address. Extracts source and destination addresses from Ethernet frames and adds them as tags for use by higher layers. Accepts packets where the destination address is the receiving interface's MAC address, the broadcast address, or a multicast address for which the interface has group membership. Drops the rest as "not addressed to us". When in promiscuous mode, accepts all packets regardless of destination address.

EthernetFragmentPhyHeaderChecker simple module (no description)
EthernetMacHeaderChecker simple module (no description)
EthernetPhyHeaderChecker simple module (no description)
EthernetTypeOrLengthChecker simple module (no description)
FragmentNumberHeaderChecker simple module (no description)
Ieee8021aeTagEpdHeaderChecker simple module

TODO this module is incomplete

Ieee8021qTagEpdHeaderChecker simple module (no description)
Ieee8021qTagTpidHeaderChecker simple module (no description)
Ieee8021rTagEpdHeaderChecker simple module (no description)
Ieee8022LlcChecker simple module (no description)
Ieee8022SnapChecker simple module (no description)
LabelFilter simple module

This packet filter module drops packets that don't match the given packet label filter criteria. The criteria can use wildcards and Boolean operators.

OrdinalBasedDropper simple module

Drops packets based on the ordinal number of the packet in the received stream of packets.

PacketFilter simple module

Filters packets that match the configured filter criteria. When the filter is pushed by a connected packet producer, it either pushes the packet to the connected packet consumer or drops it depending on the configured packet filter. Similarly, when the filter is pulled by a connected packet collector, it pulls packets from the connected packet provider until it finds one that matches the configured packet filter.

ProtocolChecker simple module (no description)
RedDropper simple module

Implements Random Early Detection (RED).

StatisticalRateLimiter simple module

Limits the datarate or the packetrate of a stream of packets based on the ~RateTag attached to the packets.

StreamFilter simple module

Implements a packet filter using solely the stream name. The stream name must match the filter criteria in order for the packet to pass through the filter.

StreamMerger simple module

Merges the packets of the same stream by removing duplicates. In addition, it also replaces the stream name on the packet based on the mapping parameter. For merging, it maintains a separate finite buffer per stream with the last seen sequence numbers.

VlanIndFilter simple module

Filters out packets based on the attached VlanInd tag.

VlanReqFilter simple module

Filters out packets based on the attached VlanReq tag.

Extends

Name Type Description
PacketProcessorBase simple module

Base module for various packet processing modules which maintains a few statistics.

Parameters

Name Type Default value Description
displayStringTextFormat string "dropped %d/%p pk (%k/%l)"

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

backpressure bool false

Properties

Name Value Description
class PacketFilterBase
display i=block/downarrow

Gates

Name Direction Size Description
in input
out output

Signals

Name Type Unit Description
packetPushedIn inet::Packet
packetPulledIn inet::Packet
packetDropped inet::Packet
packetPushedOut inet::Packet
packetPulledOut inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode Description
flowDroppedPacketLengths flow specific dropped packet lengths packetLength(demuxFlow(packetDropped)) sum, histogram, vector b none

the statistical value is the flow specific length of the dropped packet

incomingDataRate incoming data rate throughput(merge(packetPushedIn, packetPulledIn)) vector bps linear

the statistical value is the data rate of the incoming packets

droppedPacketLengths dropped packet lengths packetLength(packetDropped) sum, histogram, vector b none

the statistical value is the length of the dropped packet

incomingPacketLengths incoming packet lengths packetLength(merge(packetPushedIn, packetPulledIn)) sum, histogram, vector b none

the statistical value is the length of the incoming packet

droppedDataRate dropped data rate throughput(packetDropped) vector bps linear

the statistical value is the data rate of the dropped packets

flowOutgoingPacketLengths flow specific outgoing packet lengths packetLength(demuxFlow(merge(packetPushedOut, packetPulledOut))) sum, histogram, vector b none

the statistical value is the flow specific length of the outgoing packet

flowDroppedDataRate flow specific dropped data rate throughput(demuxFlow(packetDropped)) vector bps linear

the statistical value is the flow specific data rate of the dropped packets

droppedPackets dropped packets packetDropped count pk

the statistical value is the dropped packet

flowIncomingDataRate flow specific incoming data rate throughput(demuxFlow(merge(packetPushedIn, packetPulledIn))) vector bps linear

the statistical value is the flow specific data rate of the incoming packets

outgoingDataRate outgoing data rate throughput(merge(packetPushedOut, packetPulledOut)) vector bps linear

the statistical value is the data rate of the outgoing packets

outgoingPacketLengths outgoing packet lengths packetLength(merge(packetPushedOut, packetPulledOut)) sum, histogram, vector b none

the statistical value is the length of the outgoing packet

flowIncomingPacketLengths flow specific incoming packet lengths packetLength(demuxFlow(merge(packetPushedIn, packetPulledIn))) sum, histogram, vector b none

the statistical value is the flow specific length of the incoming packet

flowOutgoingDataRate flow specific outgoing data rate throughput(demuxFlow(merge(packetPushedOut, packetPulledOut))) vector bps linear

the statistical value is the flow specific data rate of the outgoing packets

incomingPackets incoming packets merge(packetPushedIn, packetPulledIn) count pk

the statistical value is the incoming packet

outgoingPackets outgoing packets merge(packetPushedOut, packetPulledOut) count pk

the statistical value is the outgoing packet

Source code

//
// Base module for various packet filter modules. Derived modules must
// implement a single packet matcher function which determines if a packet is to
// be passed through or filtered out.
//
// @see ~IPacketFilter
//
simple PacketFilterBase extends PacketProcessorBase
{
    parameters:
        bool backpressure = default(false);
        displayStringTextFormat = default("dropped %d/%p pk (%k/%l)"); // Determines the text that is written on top of the submodule
        @class(PacketFilterBase);
        @display("i=block/downarrow");
        @signal[packetPushedIn](type=inet::Packet);
        @signal[packetPushedOut](type=inet::Packet);
        @signal[packetPulledIn](type=inet::Packet);
        @signal[packetPulledOut](type=inet::Packet);
        @signal[packetDropped](type=inet::Packet);
        // the statistical value is the incoming packet
        @statistic[incomingPackets](title="incoming packets"; source=merge(packetPushedIn, packetPulledIn); record=count; unit=pk);
        // the statistical value is the length of the incoming packet
        @statistic[incomingPacketLengths](title="incoming packet lengths"; source=packetLength(merge(packetPushedIn, packetPulledIn)); record=sum,histogram,vector; unit=b; interpolationmode=none);
        // the statistical value is the data rate of the incoming packets
        @statistic[incomingDataRate](title="incoming data rate"; source=throughput(merge(packetPushedIn, packetPulledIn)); record=vector; unit=bps; interpolationmode=linear);
        // the statistical value is the outgoing packet
        @statistic[outgoingPackets](title="outgoing packets"; source=merge(packetPushedOut, packetPulledOut); record=count; unit=pk);
        // the statistical value is the length of the outgoing packet
        @statistic[outgoingPacketLengths](title="outgoing packet lengths"; source=packetLength(merge(packetPushedOut, packetPulledOut)); record=sum,histogram,vector; unit=b; interpolationmode=none);
        // the statistical value is the data rate of the outgoing packets
        @statistic[outgoingDataRate](title="outgoing data rate"; source=throughput(merge(packetPushedOut, packetPulledOut)); record=vector; unit=bps; interpolationmode=linear);
        // the statistical value is the dropped packet
        @statistic[droppedPackets](title="dropped packets"; source=packetDropped; record=count; unit=pk);
        // the statistical value is the length of the dropped packet
        @statistic[droppedPacketLengths](title="dropped packet lengths"; source=packetLength(packetDropped); record=sum,histogram,vector; unit=b; interpolationmode=none);
        // the statistical value is the data rate of the dropped packets
        @statistic[droppedDataRate](title="dropped data rate"; source=throughput(packetDropped); record=vector; unit=bps; interpolationmode=linear);
        // the statistical value is the flow specific length of the incoming packet
        @statistic[flowIncomingPacketLengths](title="flow specific incoming packet lengths"; source=packetLength(demuxFlow(merge(packetPushedIn, packetPulledIn))); record=sum,histogram,vector; unit=b; interpolationmode=none);
        // the statistical value is the flow specific data rate of the incoming packets
        @statistic[flowIncomingDataRate](title="flow specific incoming data rate"; source=throughput(demuxFlow(merge(packetPushedIn, packetPulledIn))); record=vector; unit=bps; interpolationmode=linear);
        // the statistical value is the flow specific length of the outgoing packet
        @statistic[flowOutgoingPacketLengths](title="flow specific outgoing packet lengths"; source=packetLength(demuxFlow(merge(packetPushedOut, packetPulledOut))); record=sum,histogram,vector; unit=b; interpolationmode=none);
        // the statistical value is the flow specific data rate of the outgoing packets
        @statistic[flowOutgoingDataRate](title="flow specific outgoing data rate"; source=throughput(demuxFlow(merge(packetPushedOut, packetPulledOut))); record=vector; unit=bps; interpolationmode=linear);
        // the statistical value is the flow specific length of the dropped packet
        @statistic[flowDroppedPacketLengths](title="flow specific dropped packet lengths"; source=packetLength(demuxFlow(packetDropped)); record=sum,histogram,vector; unit=b; interpolationmode=none);
        // the statistical value is the flow specific data rate of the dropped packets
        @statistic[flowDroppedDataRate](title="flow specific dropped data rate"; source=throughput(demuxFlow(packetDropped)); record=vector; unit=bps; interpolationmode=linear);
    gates:
        input in @labels(send,push,pull,pass,stream);
        output out @labels(send,push,pull,pass,stream);
}
File: src/inet/queueing/base/PacketFilterBase.ned