Compound Module InternetCloud

Package: inet.node.internetcloud
File: src/inet/node/internetcloud/InternetCloud.ned

This module is an IPv4 router that can delay or drop packets (while retaining their order) based on which interface card the packet arrived on and on which interface it is leaving the cloud. The delayer module is replacable.

By default the delayer module is MatrixCloudDelayer which lets you configure the delay, drop and datarate parameters in an XML file. Packet flows, as defined by incoming and outgoing interface pairs, are independent of each other.

The InternetCloud module can be used only to model the delay between two hops, but it is possible to build more complex networks using several InternetCloud modules.

See also: MatrixCloudDelayer

InterfaceTable IPv4RoutingTable PcapRecorder InternetCloudNetworkLayer IWiredNic

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.

Networks:

Name Type Description
CloudAndHosts network (no description)
CloudAndRouters network (no description)
EarthCloud network (no description)
Voip network

A generated network with star topology.

Parameters:

Name Type Default value Description
numPcapRecorders int 0

no of PcapRecorders.

Properties:

Name Value Description
networkNode
labels node
display i=misc/cloud

Gates:

Name Direction Size Description
pppg [ ] inout

Unassigned submodule parameters:

Name Type Default value Description
interfaceTable.displayAddresses bool false

whether to display IP addresses on links

routingTable.interfaceTableModule string

The path to the InterfaceTable module

routingTable.netmaskRoutes string "*"

maintain netmask routes for interfaces

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

pcapRecorder.verbose bool false

whether to log packets on the module output

pcapRecorder.pcapFile string ""

the PCAP file to be written

pcapRecorder.snaplen int 65535

maximum number of bytes to record per packet

pcapRecorder.dumpBadFrames bool true

enable dump of frames with hasBitError

pcapRecorder.moduleNamePatterns string "wlan[*] eth[*] ppp[*] ext[*]"

space-separated list of sibling module names to listen on

pcapRecorder.sendingSignalNames string "packetSentToLower"

space-separated list of outbound packet signals to subscribe to

pcapRecorder.receivingSignalNames string "packetReceivedFromLower"

space-separated list of inbound packet signals to subscribe to

pcapRecorder.alwaysFlush bool false

flush the pcapFile after each write to ensure that all packets are captured in case of a crash

networkLayer.configurator.interfaceTableModule string

The path to the InterfaceTable module

networkLayer.configurator.networkConfiguratorModule string "configurator"

TODO: eventually rename to networkConfigurator

networkLayer.configurator.configureRoutingTable bool true

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

networkLayer.ip.interfaceTableModule string

The path to the InterfaceTable module

networkLayer.ip.arpModule string
networkLayer.ip.icmpModule string
networkLayer.ip.procDelay double 0s
networkLayer.ip.forceBroadcast bool false
networkLayer.arp.interfaceTableModule string

The path to the InterfaceTable module

networkLayer.arp.retryTimeout double 1s

number seconds ARP waits between retries to resolve an IPv4 address

networkLayer.arp.retryCount int 3

number of times ARP will attempt to resolve an IPv4 address

networkLayer.arp.cacheTimeout double 120s

number seconds unused entries in the cache will time out

networkLayer.icmp.interfaceTableModule string

The path to the InterfaceTable module

networkLayer.icmp.routingTableModule string

Source code:

//
// This module is an IPv4 router that can delay or drop packets (while retaining their order)
// based on which interface card the packet arrived on and on which interface
// it is leaving the cloud. The delayer module is replacable.
//
// By default the delayer module is ~MatrixCloudDelayer which lets you configure
// the delay, drop and datarate parameters in an XML file. Packet flows, as defined
// by incoming and outgoing interface pairs, are independent of each other.
//
// The ~InternetCloud module can be used only to model the delay between two hops, but
// it is possible to build more complex networks using several ~InternetCloud modules.
//
// @see MatrixCloudDelayer
//
module InternetCloud
{
    parameters:
        @networkNode();
        @labels(node,ethernet-node);
        @display("i=misc/cloud");
        int numPcapRecorders = default(0); // no of PcapRecorders.
        *.interfaceTableModule = default(absPath(".interfaceTable"));
        *.routingTableModule = default(absPath(".routingTable"));
    gates:
        inout pppg[] @labels(PPPFrame-conn);
    types:
        module InternetCloudNetworkLayer
        {
            parameters:
                @display("i=block/fork");
                bool proxyARP = default(true);
                string interfaceTableModule;
                string routingTableModule;
                *.interfaceTableModule = default(absPath(interfaceTableModule));
                *.routingTableModule = default(absPath(routingTableModule));
                *.arpModule = default(absPath(".arp"));
                *.icmpModule = default(absPath(".icmp"));
            gates:
                input ifIn[] @labels(IPDatagram);
                output ifOut[];
            submodules:
                configurator: IPv4NodeConfigurator;
                ip: IPv4 {
                    parameters:
                        timeToLive = 32;
                        multicastTimeToLive = 32;
                        fragmentTimeout = 60s;
                        useProxyARP = true;
                        routingTableModule = "^.^.routingTable";
                        @display("p=85,95;q=queue");
                    gates:
                        transportIn[1];
                        transportOut[1];
                        queueIn[sizeof(ifIn)];
                        queueOut[sizeof(ifOut)];
                }

                delayer: <default("MatrixCloudDelayer")> like ICloudDelayer {
                    @display("p=160,123");
                }
                arp: ARP {
                    parameters:
                        respondToProxyARP = proxyARP;
                        routingTableModule = "^.^.routingTable";
                        @display("p=163,206;q=pendingQueue");
                }
                icmp: ICMP {
                    parameters:
                        @display("p=160,33");
                }
                errorHandling: ErrorHandling {
                    parameters:
                        @display("p=239,33");
                }
            connections allowunconnected:
                // transport Layer
                ip.transportOut[0] --> icmp.localIn;
                ip.transportIn[0] <-- icmp.sendOut;

                icmp.errorOut --> errorHandling.in;

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

                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];
                }
        }
    submodules:
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=60,131");
        }
        routingTable: IPv4RoutingTable {
            parameters:
                forwarding = true;
                routerId = "auto";
                @display("p=60,196");
        }
        pcapRecorder[numPcapRecorders]: PcapRecorder {
            @display("p=291,60");
        }
        networkLayer: InternetCloudNetworkLayer {
            parameters:
                @display("p=267,157;q=queue");
            gates:
                ifIn[sizeof(pppg)+sizeof(ethg)];
                ifOut[sizeof(pppg)+sizeof(ethg)];
        }
        ppp[sizeof(pppg)]: <default("PPPInterface")> like IWiredNic {
            parameters:
                @display("p=125,257,row,110;q=l2queue");
        }
    connections allowunconnected:
        // connections to network outside
        for i=0..sizeof(pppg)-1 {
            pppg[i] <--> ppp[i].phys;
            ppp[i].upperLayerOut --> networkLayer.ifIn[i];
            ppp[i].upperLayerIn <-- networkLayer.ifOut[i];
        }
}