Ipv4NetworkLayer

Package: inet.networklayer.ipv4

Ipv4NetworkLayer

compound module

Network layer of an IPv4 node.

configurator : like IIpv4NodeConfigurator

Ipv4NodeConfigurator: This module has one instance per network node, and it acts like a bridge between the node and the...

Source:
configurator: <default("Ipv4NodeConfigurator")> like IIpv4NodeConfigurator if typename != "" {
    parameters:
        @display("p=100,100;is=s");
} routingTable : Ipv4RoutingTable

Stores the routing table.

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

Stores the network address translation table.

Source:
natTable: Ipv4NatTable {
    parameters:
        @display("p=100,300;is=s");
} up : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
up: MessageDispatcher {
    parameters:
        @display("p=550,100;b=600,5");
} igmp : like IIgmp

Igmpv2: Imlementation of IGMPv2 protocol.

IIgmp: Module interface for IGMP modules.

Source:
igmp: <default("Igmpv2")> like IIgmp {
    parameters:
        @display("p=400,200");
} icmp : Icmp

ICMP implementation.

Source:
icmp: Icmp {
    parameters:
        @display("p=700,200");
} mp : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
mp: MessageDispatcher {
    parameters:
        @display("p=550,300;b=600,5");
} ip : like IIpv4

Ipv4: Implements the IPv4 protocol.

Source:
ip: <default("Ipv4")> like IIpv4 {
    parameters:
        @display("p=700,400;q=queue");
} arp : like IArp

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

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

This module connects multiple applications, protocols and interfaces with each other and...

Source:
lp: MessageDispatcher {
    parameters:
        @display("p=550,500;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.

Used in compound modules

Name Type Description
LdpMplsRouter compound module

An LDP-capable router.

RsvpMplsRouter compound module

An RSVP-TE capable router.

Parameters

Name Type Default value Description
forwarding bool false
multicastForwarding bool false
interfaceTableModule string
displayStringTextFormat string "%i"

Properties

Name Value Description
class ::inet::Ipv4NetworkLayer
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
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

natTable.networkProtocolModule string "^.ip"
natTable.config xml xml("")

XML configuration parameters for network address translation

up.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

up.forwardServiceRegistration bool true
up.forwardProtocolRegistration bool true
icmp.interfaceTableModule string

The path to the InterfaceTable module

icmp.routingTableModule string
icmp.crcMode string "declared"
icmp.quoteLength int 8B

Number of bytes from original packet to quote in ICMP reply

mp.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

mp.forwardServiceRegistration bool true
mp.forwardProtocolRegistration bool true
lp.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

lp.forwardServiceRegistration bool true
lp.forwardProtocolRegistration bool true

Source code

//
// Network layer of an IPv4 node.
//
//
module Ipv4NetworkLayer like INetworkLayer
{
    parameters:
        bool forwarding = default(false);
        bool multicastForwarding = default(false);
        string interfaceTableModule;
        string displayStringTextFormat = default("%i");
        *.forwarding = this.forwarding;
        *.multicastForwarding = this.multicastForwarding;
        *.interfaceTableModule = default(absPath(this.interfaceTableModule));
        *.routingTableModule = default(absPath(".routingTable"));
        *.arpModule = default(absPath(".arp"));
        *.icmpModule = default(absPath(".icmp"));
        @class(::inet::Ipv4NetworkLayer);
        @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: <default("Ipv4NodeConfigurator")> like IIpv4NodeConfigurator if typename != "" {
            parameters:
                @display("p=100,100;is=s");
        }
        routingTable: Ipv4RoutingTable {
            parameters:
                @display("p=100,200;is=s");
        }
        natTable: Ipv4NatTable {
            parameters:
                @display("p=100,300;is=s");
        }
        up: MessageDispatcher {
            parameters:
                @display("p=550,100;b=600,5");
        }
        igmp: <default("Igmpv2")> like IIgmp {
            parameters:
                @display("p=400,200");
        }
        icmp: Icmp {
            parameters:
                @display("p=700,200");
        }
        mp: MessageDispatcher {
            parameters:
                @display("p=550,300;b=600,5");
        }
        ip: <default("Ipv4")> like IIpv4 {
            parameters:
                @display("p=700,400;q=queue");
        }
        arp: <default("Arp")> like IArp {
            parameters:
                @display("p=400,400;q=pendingQueue");
        }
        lp: MessageDispatcher {
            parameters:
                @display("p=550,500;b=600,5");
        }

    connections allowunconnected:
        transportIn --> { @display("m=n"); } --> up.in++;
        transportOut <-- { @display("m=n"); } <-- up.out++;

        up.out++ --> igmp.routerIn;
        up.in++ <-- igmp.routerOut;

        up.out++ --> mp.in++;
        up.in++ <-- mp.out++;

        up.out++ --> icmp.transportIn;
        up.in++ <-- icmp.transportOut;

        igmp.ipOut --> mp.in++;
        igmp.ipIn <-- mp.out++;

        icmp.ipOut --> mp.in++;
        icmp.ipIn <-- mp.out++;

        mp.out++ --> ip.transportIn;
        mp.in++ <-- ip.transportOut;

        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/networklayer/ipv4/Ipv4NetworkLayer.ned