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.

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

An OSPFv2 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 SCTP, TCP, UDP layers and applications.

StandardHostWithDLDuplicatesGenerator compound module

IP host with SCTP, TCP, UDP layers and applications AND PPPInterfaceWithDLDuplicatesGenerator.

StandardHostWithDLThruputMeter compound module

IP host with SCTP, TCP, UDP layers and applications AND PPPInterfaceWithDLThruputMeter.

StandardHostWithULDropsGenerator compound module

IP host with SCTP, TCP, UDP layers and applications AND PPPInterfaceWithULDropsGenerator.

StandardHostWithULThruputMeter compound module

IP host with SCTP, TCP, UDP layers and applications AND PPPInterfaceWithULThruputMeter.

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[] @labels(IPDatagram);
        input tcpIn @labels(TCPSegment,IPControlInfo/down);
        input udpIn @labels(UDPPacket,IPControlInfo/down);
        input sctpIn @labels(IPControlInfo/down,SCTPPacket);   //I.R.
        input rsvpIn @labels(IPControlInfo/down);
        input ospfIn @labels(IPControlInfo/down);
        input pingIn;
        output ifOut[];
        output tcpOut @labels(TCPSegment,IPControlInfo/up);
        output udpOut @labels(UDPPacket,IPControlInfo/up);
        output sctpOut @labels(IPControlInfo/up,SCTPPacket); //I.R.
        output rsvpOut @labels(IPControlInfo/up);
        output ospfOut @labels(IPControlInfo/up);
        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];
            ifOut[i] <-- { @display("m=s"); } <-- arp.nicOut[i];
        }
}