Compound Module IPv4NetworkLayer

Package: inet.networklayer.ipv4
File: src/inet/networklayer/ipv4/IPv4NetworkLayer.ned

Network layer of an IPv4 node.

Interfaces to transport layer: TCP, UDP, echo/ping, RSVP

IPv4NodeConfigurator IPv4 IARP ICMP IIGMP ErrorHandling

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
BGPRouterEx compound module

Example IP router with BGPv4 and OSPFv4 support.

BGPRouterSimple compound module

Example IPv4 router with BGPv4 support.

LDP_LSR compound module

An LDP-capable router.

RSVP_LSR compound module

An RSVP-TE capable router.

Parameters:

Name Type Default value Description
proxyARP bool true
igmpType string "IGMPv2"
arpType string "ARP"
interfaceTableModule string
routingTableModule string

Properties:

Name Value Description
display i=block/fork

Gates:

Name Direction Size Description
ifIn [ ] input
ifOut [ ] output
transportIn [ ] input
transportOut [ ] output
pingIn [ ] input
pingOut [ ] output
igmpIn input
igmpOut output

Unassigned submodule parameters:

Name Type Default value Description
configurator.interfaceTableModule string

The path to the InterfaceTable module

configurator.networkConfiguratorModule string "configurator"

TODO: eventually rename to networkConfigurator

configurator.configureRoutingTable bool true

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

ip.interfaceTableModule string

The path to the InterfaceTable module

ip.routingTableModule string
ip.arpModule string
ip.icmpModule string
ip.procDelay double 0s
ip.timeToLive int 32
ip.multicastTimeToLive int 32
ip.fragmentTimeout double 60s
ip.forceBroadcast bool false
icmp.interfaceTableModule string

The path to the InterfaceTable module

icmp.routingTableModule string

Source code:

//
// Network layer of an IPv4 node.
//
// Interfaces to transport layer: TCP, UDP, echo/ping, RSVP
//
module IPv4NetworkLayer like INetworkLayer
{
    parameters:
        bool proxyARP = default(true);
        string igmpType = default("IGMPv2");
        string arpType = default("ARP");
        string interfaceTableModule;
        string routingTableModule;
        *.interfaceTableModule = default(absPath(interfaceTableModule));
        *.routingTableModule = default(absPath(routingTableModule));
        *.arpModule = default(absPath(".arp"));
        *.icmpModule = default(absPath(".icmp"));
        arp.respondToProxyARP = proxyARP;
        @display("i=block/fork");
    gates:
        input ifIn[] @labels(INetworkDatagram);
        output ifOut[] @labels(INetworkDatagram);
        input transportIn[] @labels(IPv4ControlInfo/down);
        output transportOut[] @labels(IPv4ControlInfo/up);
        input pingIn[] @labels(PingPayload/down);
        output pingOut[] @labels(PingPayload/up);
        input igmpIn;
        output igmpOut;

    submodules:
        configurator: IPv4NodeConfigurator {
            @display("p=39,158");
        }
        ip: IPv4 {
            parameters:
                useProxyARP = true; // as routes with unspecified next-hop addr are quite common
                @display("p=85,95;q=queue");
            gates:
                queueIn[sizeof(ifIn)];
                queueOut[sizeof(ifOut)];
        }
        arp: <arpType> like IARP {
            parameters:
                @display("p=165,120;q=pendingQueue;is=s");
        }
        icmp: ICMP {
            parameters:
                @display("p=165,70");
        }
        igmp: <igmpType> like IIGMP {
            parameters:
                @display("p=39,33");
        }
        errorHandling: ErrorHandling {
            parameters:
                @display("p=239,70");
        }

    connections allowunconnected:
        for i=0..sizeof(transportIn)-1 {
            transportIn[i] --> { @display("m=n"); } --> ip.transportIn++;
        }
        for i=0..sizeof(transportOut)-1 {
            ip.transportOut++ --> { @display("m=n"); } --> transportOut[i];
        }

        ip.transportOut++ --> icmp.localIn;
        ip.transportIn++ <-- icmp.sendOut;

        ip.transportOut++ --> igmp.ipIn;
        ip.transportIn++ <-- igmp.ipOut;

        for i=0..sizeof(pingOut)-1 {
            icmp.pingOut++ --> { @display("m=n"); } --> pingOut[i];
        }
        for i=0..sizeof(pingIn)-1 {
            icmp.pingIn++ <-- { @display("m=n"); } <-- pingIn[i];
        }

        icmp.errorOut --> errorHandling.in;

        ip.arpOut --> arp.netwIn;
        ip.arpIn <-- arp.netwOut;

        igmp.routerOut --> igmpOut;
        igmp.routerIn <-- igmpIn;

        for i=0..sizeof(ifIn)-1 {
            ip.queueIn[i] <-- { @display("m=s"); } <-- ifIn[i];
        }
        for i=0..sizeof(ifOut)-1 {
            ip.queueOut[i] --> { @display("m=s"); } --> ifOut[i];
        }
}