PacketFlowBase

Package: inet.queueing.base

PacketFlowBase

simple module

C++ definition

Base module for various packet flow modules. A packet flow module passes or streams all pushed or pulled packets after processing them from its input to its output.

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

Inheritance diagram

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

Known subclasses

Name Type Description
BackPressureBarrier simple module

Prevents backpressure propagation from its output to its input and vice versa. It always allows pushing and pulling packets independently of what the connected modules would allow to do in their current state. Both pushed and pulled packets pass through unchanged, but the operations may raise a runtime error due to this module preventing backpressure propagation.

ChecksumInserterBase simple module

Base module for checksum inserters that add checksums to packets for integrity verification. This module supports multiple checksum algorithms such as CRC32 and the Internet checksum, and also several checksum modes: disabled, declared correct, declared incorrect, and computed. In computed mode, it calculates the actual checksum based on the packet content using the selected checksum algorithm. The checksumMode parameter determines which mode is used.

EthernetAddressInserter simple module

Inserts Ethernet MAC address fields into outgoing packets. Creates and adds the source and destination address header fields at the front of each packet. Uses the destination address from the packet's MacAddressReq tag. If the source address is unspecified in the tag, it uses the MAC address of the requested target network interface. Updates packet protocol tags to reflect the added header.

EthernetFragmentPhyHeaderInserter simple module (no description)
EthernetMacHeaderInserter simple module (no description)
EthernetPhyHeaderInserter simple module (no description)
EthernetSocketCommandProcessor simple module (no description)
EthernetTypeOrLengthInserter simple module (no description)
FlowMeasurementRecorder simple module

Part of the flow measurement infrastructure. It can be used to record the collected statistics and also to terminate the flow measurements.

FlowMeasurementStarter simple module

Initiates packet flow measurements by adding time tags to selected packets. Supports measuring various timing aspects including elapsed time, delaying time, queueing time, processing time, transmission time, and propagation time. Can be configured to measure specific packet regions and to filter which packets are measured.

FragmentNumberHeaderInserter simple module (no description)
Ieee8021aeTagEpdHeaderInserter simple module

TODO: this module is incomplete

Ieee8021qSocketCommandProcessor simple module

Processes IEEE 802.1Q socket commands from applications and manages socket registrations in the socket table. Handles bind, close, and destroy commands for IEEE 802.1Q sockets, enabling applications to send and receive VLAN-tagged frames. Supports filtering traffic based on protocol and VLAN ID, providing a socket-based interface to the IEEE 802.1Q layer. Works in conjunction with ~Ieee8021qSocketTable to maintain socket state and ~Ieee8021qSocketPacketProcessor to deliver packets to the appropriate applications.

Ieee8021qTagEpdHeaderInserter simple module (no description)
Ieee8021qTagTpidHeaderInserter simple module (no description)
Ieee8021rTagEpdHeaderInserter simple module (no description)
Ieee8022LlcInserter simple module (no description)
Ieee8022LlcSocketCommandProcessor simple module (no description)
Ieee8022LlcSocketPacketProcessor simple module (no description)
Ieee8022SnapInserter simple module (no description)
PacketDeserializer simple module (no description)
PacketDirectionReverser simple module

Part of the layer 2 architecture. It turns an incoming packet into an outgoing packet simply by removing all attached indication tags and turning some of them into an attached request tag on the packet.

PacketEmitter simple module (no description)
PacketFlowPcapFileRecorder simple module

Records packets passing through the module to a PCAP or PCAPNG file. The file format, and fields like network type, time precision, and direction flag can be configured. It supports truncation of long packets. It can also be configured to flush the file after each write to ensure all packets are captured even in case of a crash.

PacketGateBase simple module

Base module for various packet gate modules.

PacketMarkerBase simple module

Base module for various packet marker modules. Derived modules must implement a single markPacket() function which marks the individual packets by attaching tags.

PacketMeterBase simple module

Base module for various packet meter modules. Derived modules must implement a single meterPacket() function which meters the flow of and attaches the required tags.

PacketSerializer simple module

Serializes packets flowing from its input to its output.

PaddingInserter simple module

Adds padding to packets to ensure they meet a minimum length requirement or to round up to a specific length. This module calculates the required padding length based on the packet's current length and the configured parameters. If padding is needed, it adds either a ByteCountChunk (for byte-aligned padding) or a BitCountChunk (for bit-level padding) at the specified position (front or back of the packet). This is commonly used in protocols that require packets to have a minimum size or to align to specific boundaries.

RelayInterfaceLearner simple module

Extracts the source MAC address of the packet passing through and stores the mapping from this MAC address to the incoming network interface in the MAC address table (forwarding information database).

SequenceNumbering simple module

Adds sequence numbers to outgoing packets. Maintains an internal counter to assign unique, sequential numbers to packets, enabling downstream modules to detect duplicates and reorder packets.

StreamDecoder simple module

Decodes the stream of a packet by matching various tags on the packet against the mapping. It can check for network interface, source address, destination address, VLAN id, and PCP. If a match was found, then the stream is attached to the packet in a ~StreamInd tag.

StreamEncoder simple module

Encodes the stream name of a packet into several request tags attached to the packet. It looks up the stream in the mapping and attaches the necessary request tags to the packet based on the specified parameters.

StreamIdentifier simple module

Identifies the stream of a packet using packet filter expressions. It can check for arbitrary packet data and assign an if a match was found then the stream is attached to the packet in the ~StreamReq tag.

VlanReqMapper simple module

Updates the VlanReq tag on packets.

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 "processed %p pk (%l)"

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

Properties

Name Value Description
class PacketFlowBase
display i=block/rightarrow

Gates

Name Direction Size Description
in input
out output

Signals

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

Statistics

Name Title Source Record Unit Interpolation Mode Description
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

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

the statistical value is the data rate of the incoming 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

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

the statistical value is the length of the incoming packet

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

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 flow modules. A packet flow module
// passes or streams all pushed or pulled packets after processing them from
// its input to its output.
//
// @see ~IPacketFlow
//
simple PacketFlowBase extends PacketProcessorBase
{
    parameters:
        @class(PacketFlowBase);
        @display("i=block/rightarrow");
        @signal[packetPushedIn](type=inet::Packet);
        @signal[packetPushedOut](type=inet::Packet);
        @signal[packetPulledIn](type=inet::Packet);
        @signal[packetPulledOut](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 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);
    gates:
        input in @labels(send,push,pull,pass,stream);
        output out @labels(send,push,pull,pass,stream);
}
File: src/inet/queueing/base/PacketFlowBase.ned