Compound Module NetworkLayer

Package: inet.nodes.inet
File: src/nodes/inet/NetworkLayer.ned

Network layer of an IP node.

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

IP ARP ICMP IGMP ErrorHandling

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Used in compound modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

BurstHost (compound module)

Definition of an IP node with a transport generator that connects to IP directly, without TCP or UDP.

ExtRouter (compound module)

External router.

LDP_LSR (compound module)

An LDP-capable router.

MFMobileHost (compound module)

Models a mobile host with a wireless (802.11b) card in ad-hoc mode. This model contains the Mobility Framework's 802.11 implementation, Nic80211, and IP, TCP and UDP protocols. The mobility model can be dynamically specified with the mobilityType parameter.

MobileHost (compound module)

Models a mobile host with a wireless (802.11b) card in ad-hoc mode. This model contains the new IEEE 802.11 implementation, Ieee80211Nic, and IP, TCP and UDP protocols. The mobility model can be dynamically specified with the mobilityType parameter.

OSPFRouter (compound module)

IP router.

Router (compound module)

IP router.

RSVP_LSR (compound module)

An RSVP-TE capable router.

RTPHost (compound module) (no description)
StandardHost (compound module)

IP host with TCP, UDP layers and applications.

TCPSpoofingHost (compound module)

IP host with TCPSpoof in the application layer.

WirelessHost (compound module)

Models a host with one wireless (802.11b) card in infrastructure mode. This module is basically a StandardHost with an Ieee80211NicSTA added. It should be used in conjunction with WirelessAP, or any other AP model which contains Ieee80211NicAP.

WirelessHostSimplified (compound module)

Models a host with one wireless (802.11b) card in infrastructure mode, but using a simplified NIC that does not support handovers. This module is basically a StandardHost with an Ieee80211NicSTASimplified added. It should be used in conjunction with WirelessAPSimplified, or any other AP model which contains Ieee80211NicAPSimplified.

Parameters:

Name Type Default value Description
proxyARP bool true

Properties:

Name Value Description
display i=block/fork

Gates:

Name Direction Size Description
ifIn [ ] input
tcpIn input
udpIn input
sctpIn input

I.R.

rsvpIn input
ospfIn input
pingIn input
ifOut [ ] output
TCPOut output
udpOut output
sctpOut output

I.R.

rsvpOut output
ospfOut output
pingOut output

Unassigned submodule parameters:

Name Type Default value Description
ip.procDelay double 0s
arp.retryTimeout double 1s

number seconds ARP waits between retries to resolve an IP address

arp.retryCount int 3

number of times ARP will attempt to resolve an IP address

arp.cacheTimeout double 120s

number seconds unused entries in the cache will time out

Source code:

//
// Network layer of an \IP node.
//
// Interfaces to transport layer: TCP, UDP, echo/ping, RSVP
//
module NetworkLayer
{
    parameters:
        bool proxyARP = default(true);
        @display("i=block/fork");
    gates:
        input ifIn[];
        input tcpIn;
        input udpIn;
        input sctpIn;   //I.R.
        input rsvpIn;
        input ospfIn;
        input pingIn;
        output ifOut[];
        output TCPOut;
        output udpOut;
        output sctpOut; //I.R.
        output rsvpOut;
        output ospfOut;
        output pingOut;

    submodules:
        ip: IP {
            parameters:
                timeToLive = 32;
                multicastTimeToLive = 32;
                fragmentTimeout = 60s;
                protocolMapping = "6:0,17:1,1:2,2:3,46:4,89:5,132:6";   //I.R.
                @display("p=85,95;q=queue");
            gates:
                transportIn[7]; //I.R.
                transportOut[7];
                queueIn[sizeof(ifIn)];
        }
        arp: ARP {
            parameters:
                proxyARP = proxyARP;
                @display("p=163,206;q=pendingQueue");
            gates:
                nicOut[sizeof(ifOut)];
        }
        icmp: ICMP {
            parameters:
                @display("p=160,63");
        }
        igmp: IGMP {
            parameters:
                @display("p=160,122");
        }
        errorHandling: ErrorHandling {
            parameters:
                @display("p=239,63");
        }
    connections allowunconnected:
        // transport Layer
        ip.transportOut[0] --> TCPOut;
        ip.transportIn[0] <-- tcpIn;

        ip.transportOut[1] --> udpOut;
        ip.transportIn[1] <-- udpIn;

        ip.transportOut[2] --> icmp.localIn;
        ip.transportIn[2] <-- icmp.sendOut;

        ip.transportOut[3] --> igmp.localIn;
        ip.transportIn[3] <-- igmp.sendOut;

        ip.transportOut[4] --> rsvpOut;
        ip.transportIn[4] <-- rsvpIn;

        ip.transportOut[5] --> ospfOut;
        ip.transportIn[5] <-- ospfIn;

        ip.transportOut[6] --> sctpOut;     //I.R.
        ip.transportIn[6] <-- sctpIn;

        icmp.pingOut --> pingOut;
        icmp.pingIn <-- pingIn;

        icmp.errorOut --> errorHandling.in;

        ip.queueOut --> arp.ipIn;

        // L2 interfaces to IP and from ARP
        for i=0..sizeof(ifOut)-1 {
            ifIn[i] --> { @display("m=s"); } --> ip.queueIn[i];
        }
}