VirtualTunnel

Package: inet.linklayer.virtual

VirtualTunnel

simple module

C++ definition

Creates a virtual network interface that tunnels traffic through an existing real network interface. This is the main component of ~VirtualInterface. Supports tunneling via Ethernet or IEEE 802.1Q protocols, with optional VLAN tagging for traffic separation.

It can copy properties from the real interface or generate new ones (e.g., MAC address). Handles packet forwarding between the virtual interface and the underlying real interface, adding appropriate tags for routing and identification.

Inheritance diagram

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

Used in compound modules

Name Type Description
VirtualInterface compound module

Implements a virtual network interface.

Extends

Name Type Description
SimpleModule simple module

Base module for all INET simple modules.

Parameters

Name Type Default value Description
displayStringTextFormat string ""

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

interfaceTableModule string
realInterface string
protocol string vlanId != -1 ? "ieee8021qctag" : ""
address string "copy"
vlanId int -1
steal bool vlanId != -1

Properties

Name Value Description
class VirtualTunnel
display i=block/cogwheel

Gates

Name Direction Size Description
upperLayerIn input
upperLayerOut output

Source code

//
// Creates a virtual network interface that tunnels traffic through an existing
// real network interface. This is the main component of ~VirtualInterface.
// Supports tunneling via Ethernet or IEEE 802.1Q protocols, with optional
// VLAN tagging for traffic separation.
//
// It can copy properties from the real interface or generate new ones (e.g., MAC address).
// Handles packet forwarding between the virtual interface and the underlying
// real interface, adding appropriate tags for routing and identification.
//
simple VirtualTunnel extends SimpleModule
{
    parameters:
        @class(VirtualTunnel);
        string interfaceTableModule;
        string realInterface;
        string protocol = default(vlanId != -1 ? "ieee8021qctag" : "");
        string address @enum("auto","copy") = default("copy");
        int vlanId = default(-1);
        bool steal = default(vlanId != -1);
        @display("i=block/cogwheel");
    gates:
        input upperLayerIn;
        output upperLayerOut;
}
File: src/inet/linklayer/virtual/VirtualTunnel.ned