ExtUpperIpv4NetworkLayer

Package: inet.emulation.networklayer.ipv4

ExtUpperIpv4NetworkLayer

compound module

Provides a network layer that connects the simulation to a real network on the host computer using a TUN device. Allows simulated applications to send and receive packets through the host's networking stack at the IP layer. Contains standard components like routing table and ARP, and uses ~ExtUpperIpv4 with a TUN device for external connectivity.

Using this network layer in a host or router implies that layers above IPv4 are provided by the host operating system, while layers below IPv4 are simulated.

configurator : Ipv4NodeConfigurator

Configures the containing network node using information provided by the network's global...

Source:
configurator: Ipv4NodeConfigurator {
    parameters:
        @display("p=100,100;is=s");
} routingTable : Ipv4RoutingTable

Stores the routing table.

Source:
routingTable: Ipv4RoutingTable {
    parameters:
        @display("p=100,200;is=s");
} ip : like IIpv4

ExtUpperIpv4: Provides IPv4 layer functionality for network emulation that connects simulated applications to a...

IIpv4: Module interface for IPv4 protocol implementations.

Source:
ip: <default("ExtUpperIpv4")> like IIpv4 {
    parameters:
        @display("p=500,100");
} arp : like IArp

Arp: Implements the Address Resolution Protocol for IPv4 and IEEE 802 6-byte MAC addresses.

IArp: Interface for Address Resolution Protocol (ARP) implementations.

Source:
arp: <default("Arp")> like IArp {
    parameters:
        @display("p=200,100;q=pendingQueue");
} lp : MessageDispatcher

Facilitates the interconnection of applications, protocols, and network interfaces, dispatching...

Source:
lp: MessageDispatcher {
    parameters:
        @display("p=350,200;b=600,5");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

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

Parameters

Name Type Default value Description
interfaceTableModule string

Properties

Name Value Description
display i=block/fork

Gates

Name Direction Size Description
ifIn input
ifOut output
transportIn input
transportOut output

Unassigned submodule parameters

Name Type Default value Description
configurator.displayStringTextFormat string ""

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

configurator.interfaceTableModule string

The path to the InterfaceTable module

configurator.routingTableModule string
configurator.networkConfiguratorModule string "configurator"

TODO eventually rename to networkConfigurator

configurator.configureRoutingTable bool true

Add routing entries to the routing table (uses the configurator module)

routingTable.displayStringTextFormat string ""

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

routingTable.interfaceTableModule string

The path to the InterfaceTable module

routingTable.routerId string "auto"

For routers, the router id using IPv4 address dotted notation; specify "auto" to select the highest interface address; should be left empty ("") for hosts

routingTable.netmaskRoutes string "*"

Maintain netmask routes for interfaces

routingTable.forwarding bool true

Turns IP forwarding on/off

routingTable.multicastForwarding bool false

Turns multicast forwarding on/off

routingTable.useAdminDist bool false

Use Cisco-like administrative distances

routingTable.routingFile string ""

Routing table file name

lp.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

lp.interfaceTableModule string

Module path to the ~InterfaceTable module

lp.forwardServiceRegistration bool true
lp.forwardProtocolRegistration bool true
lp.interfaceMapping object {}

Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

lp.serviceMapping object {}

Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

lp.protocolMapping object {}

Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

Source code

//
// Provides a network layer that connects the simulation to a real network on the
// host computer using a TUN device. Allows simulated applications to send and
// receive packets through the host's networking stack at the IP layer. Contains
// standard components like routing table and ARP, and uses ~ExtUpperIpv4 with a
// TUN device for external connectivity.
//
// Using this network layer in a host or router implies that layers above IPv4 are
// provided by the host operating system, while layers below IPv4 are simulated.
//
module ExtUpperIpv4NetworkLayer like INetworkLayer
{
    parameters:
        string interfaceTableModule;
        *.interfaceTableModule = default(absPath(this.interfaceTableModule));
        *.routingTableModule = default(absPath(".routingTable"));
        @display("i=block/fork");

    gates:
        input ifIn @labels(INetworkHeader);
        output ifOut @labels(INetworkHeader);
        input transportIn @labels(Ipv4ControlInfo/down);
        output transportOut @labels(Ipv4ControlInfo/up);

    submodules:
        configurator: Ipv4NodeConfigurator {
            parameters:
                @display("p=100,100;is=s");
        }
        routingTable: Ipv4RoutingTable {
            parameters:
                @display("p=100,200;is=s");
        }
        ip: <default("ExtUpperIpv4")> like IIpv4 {
            parameters:
                @display("p=500,100");
        }
        arp: <default("Arp")> like IArp {
            parameters:
                @display("p=200,100;q=pendingQueue");
        }
        lp: MessageDispatcher {
            parameters:
                @display("p=350,200;b=600,5");
        }

    connections allowunconnected:
        arp.ifOut --> lp.in++;
        arp.ifIn <-- lp.out++;

        ip.queueOut --> lp.in++;
        ip.queueIn <-- lp.out++;

        lp.out++ --> { @display("m=s"); } --> ifOut;
        lp.in++ <-- { @display("m=s"); } <-- ifIn;
}

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