ExtIpv4TunDevice

Package: inet.emulation.networklayer.ipv4

ExtIpv4TunDevice

simple module

This module provides a bidirectional connection to a real TUN device of the host computer which is running the simulation. It writes the packets arrived on 'lowerLayerIn' gate to the specified real TUN device, and sends out packets arrived from real TAP device on 'lowerLayerOut' gate.

Used in compound modules

Name Type Description
ExtUpperIpv4 compound module (no description)

Parameters

Name Type Default value Description
device string
namespace string ""
packetNameFormat string "Ext"

Properties

Name Value Description

Gates

Name Direction Size Description
lowerLayerIn input
lowerLayerOut output

Signals

Name Type Unit
packetReceived Packet
packetSent Packet
packetReceivedFromLower Packet
packetSentToLower Packet

Statistics

Name Title Source Record Unit Interpolation Mode
packetReceived packets received packetReceived count, sum(packetBytes), vector(packetBytes) none
packetSent packets sent packetSent count, sum(packetBytes), vector(packetBytes) none
packetReceivedFromLower packets received from higher layer packetReceivedFromLower count, sum(packetBytes), vector(packetBytes) none
packetSentFromLower packets sent to higher layer packetSentToLower count, sum(packetBytes), vector(packetBytes) none

Source code

//
// This module provides a bidirectional connection to a real TUN device of the
// host computer which is running the simulation. It writes the packets arrived
// on 'lowerLayerIn' gate to the specified real TUN device, and sends out packets
// arrived from real TAP device on 'lowerLayerOut' gate.
//
simple ExtIpv4TunDevice
{
    parameters:
        string device;
        string namespace = default("");
        string packetNameFormat = default("Ext");
        @signal[packetSentToLower](type=Packet);
        @signal[packetReceivedFromLower](type=Packet);
        @signal[packetSent](type=Packet);
        @signal[packetReceived](type=Packet);
        @statistic[packetSentFromLower](title="packets sent to higher layer"; source=packetSentToLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[packetReceivedFromLower](title="packets received from higher layer"; source=packetReceivedFromLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[packetSent](title="packets sent"; source=packetSent; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[packetReceived](title="packets received"; source=packetReceived; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        input lowerLayerIn @labels(EtherFrame);
        output lowerLayerOut @labels(EtherFrame);
}

File: src/inet/emulation/networklayer/ipv4/ExtIpv4TunDevice.ned