Ieee8021qProtocol

Package: inet.linklayer.ieee8021q

compound module Ieee8021qProtocol

Implements the IEEE 802.1Q protocol encapsulation/decapsulation. It also provides socket support so applications can use the protocol directly.

Ieee8021qProtocolupperLayerIn --> socketCommandProcessor.insocketCommandProcessor.out --> qTagHeaderInserter.inqTagHeaderInserter.out --> lowerLayerOutlowerLayerIn --> qTagHeaderChecker.inqTagHeaderChecker.out --> socketPacketProcessor.insocketPacketProcessor.out --> upperLayerOutsocketTable: inet.linklayer.ieee8021q.Ieee8021qSocketTable Maintains a table of IEEE 802.1Q VLAN sockets. Source: socketTable: Ieee8021qSocketTable if hasSocketSupport { @display("p=100,100"); }socketTablesocketCommandProcessor: inet.linklayer.ieee8021q.Ieee8021qSocketCommandProcessor (like IPacketFlow) Ieee8021qSocketCommandProcessor: Processes IEEE 802.1Q socket commands from applications and manages socket registrations in the s... IPacketFlow: Interface for packet flows. Source: socketCommandProcessor: <default(hasSocketSupport ? "Ieee8021qSocketCommandProcessor" : "")> like IPacketFlow { @display("p=300,100"); }socketCommandProcessorqTagHeaderInserter: inet.linklayer.ieee8021q.Ieee8021qTagEpdHeaderInserter (like IIeee8021qTagEpdHeaderInserter) Source: qTagHeaderInserter: <default("Ieee8021qTagEpdHeaderInserter")> like IIeee8021qTagEpdHeaderInserter { @display("p=300,200"); }qTagHeaderInsertersocketPacketProcessor: inet.linklayer.ieee8021q.Ieee8021qSocketPacketProcessor (like IPacketFlow) Ieee8021qSocketPacketProcessor: Processes packets related to IEEE 802.1Q VLAN sockets. IPacketFlow: Interface for packet flows. Source: socketPacketProcessor: <default(hasSocketSupport ? "Ieee8021qSocketPacketProcessor" : "")> like IPacketFlow { @display("p=600,100"); }socketPacketProcessorqTagHeaderChecker: inet.linklayer.ieee8021q.Ieee8021qTagEpdHeaderChecker (like IIeee8021qTagEpdHeaderChecker) Source: qTagHeaderChecker: <default("Ieee8021qTagEpdHeaderChecker")> like IIeee8021qTagEpdHeaderChecker { @display("p=600,200"); }qTagHeaderChecker

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

Ieee8021qLayer

compound module

Implements IEEE 802.1Q protocol functionality as a layered architecture with policy and protocol components. The policy submodule handles VLAN filtering and mapping, while the protocol submodule manages tag encapsulation/ decapsulation. Supports both C-VLAN (0x8100) and S-VLAN (0x88A8) tag types through configuration. Enables network segmentation and traffic control in Ethernet networks by processing VLAN tags according to configured policies.

Parameters

Name

Type

Default value

Description

vlanTagType

string

“c”

hasSocketSupport

bool

false

Properties

Name

Value

Description

display

i=block/layer

Gates

Name

Direction

Size

Description

upperLayerIn

input

upperLayerOut

output

lowerLayerIn

input

lowerLayerOut

output

Unassigned submodule parameters

Name

Type

Default value

Description

socketTable.displayStringTextFormat

string

“”

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

socketCommandProcessor.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

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

socketCommandProcessor.socketTableModule

string

qTagHeaderInserter.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

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

qTagHeaderInserter.vlanTagType

string

“c”

qTagHeaderInserter.nextProtocol

string

“ethernetmac”

qTagHeaderInserter.defaultVlanId

int

-1

qTagHeaderInserter.defaultPcp

int

-1

qTagHeaderInserter.defaultUserPriority

int

-1

qTagHeaderInserter.defaultDropEligible

int

-1

<0: unspecified, 0: false, >0: true

socketPacketProcessor.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

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

socketPacketProcessor.socketTableModule

string

qTagHeaderChecker.displayStringTextFormat

string

“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})”

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

qTagHeaderChecker.backpressure

bool

false

qTagHeaderChecker.vlanTagType

string

“c”

qTagHeaderChecker.vlanIdFilter

object

[]

Source code

//
// Implements the IEEE 802.1Q protocol encapsulation/decapsulation.
// It also provides socket support so applications can use the protocol directly.
//
module Ieee8021qProtocol like IIeee8021qLayer
{
    parameters:
        string vlanTagType = default("c");
        bool hasSocketSupport = default(false);
        *.vlanTagType = default(this.vlanTagType);
        *.socketTableModule = default(absPath(".socketTable"));
        @display("i=block/layer");
    gates:
        input upperLayerIn;
        output upperLayerOut;
        input lowerLayerIn;
        output lowerLayerOut;
    submodules:
        socketTable: Ieee8021qSocketTable if hasSocketSupport {
            @display("p=100,100");
        }
        socketCommandProcessor: <default(hasSocketSupport ? "Ieee8021qSocketCommandProcessor" : "")> like IPacketFlow {
            @display("p=300,100");
        }
        qTagHeaderInserter: <default("Ieee8021qTagEpdHeaderInserter")> like IIeee8021qTagEpdHeaderInserter {
            @display("p=300,200");
        }
        socketPacketProcessor: <default(hasSocketSupport ? "Ieee8021qSocketPacketProcessor" : "")> like IPacketFlow {
            @display("p=600,100");
        }
        qTagHeaderChecker: <default("Ieee8021qTagEpdHeaderChecker")> like IIeee8021qTagEpdHeaderChecker {
            @display("p=600,200");
        }
    connections:
        upperLayerIn --> { @display("m=n"); } --> socketCommandProcessor.in;
        socketCommandProcessor.out --> qTagHeaderInserter.in;
        qTagHeaderInserter.out --> { @display("m=s"); } --> lowerLayerOut;

        lowerLayerIn --> { @display("m=s"); } --> qTagHeaderChecker.in;
        qTagHeaderChecker.out --> socketPacketProcessor.in;
        socketPacketProcessor.out --> { @display("m=n"); } --> upperLayerOut;
}

File: src/inet/linklayer/ieee8021q/Ieee8021qProtocol.ned