Compound Module NA_NodeBase

Package: nesg.netattacks.nodes
File: src/nodes/NA_NodeBase.ned

Compound module allowing hacked modules. Modificated from NodeBase module.

Allowed hacked modules:

See also: NA_NetworkLayer, NodeBase

Author: Gabriel Maciá Fernández, gmacia@ugr.es

Date: 01/22/2013

NotificationBoard IMobility NA_NetworkLayer RoutingTable InterfaceTable PcapRecorder IWirelessNic IWiredNic IWiredNic IExternalNic

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.

Known subclasses:

Name Type Description
NA_StandardHost compound module

Generic standard host. Modificated from StandarHost module. Migrated from INET for inheritance requirements of NA_AttackerAdhocHost and NA_AttackerWirelessHost

Parameters:

Name Type Default value Description
numExtInterfaces int 0
numRadios int 0

the number of radios in the router. by default no wireless

numPcapRecorders int 0

no of PcapRecorders.

mobilityType string "StationaryMobility"
routingFile string ""
IPForward bool true

Properties:

Name Value Description
display bgb=611,448
node
labels node

Gates:

Name Direction Size Description
radioIn [ ] input numRadios
pppg [ ] inout
ethg [ ] inout

Unassigned submodule parameters:

Name Type Default value Description
networkLayer.ip.procDelay double 0s
networkLayer.ip.timeToLive int 32
networkLayer.ip.multicastTimeToLive int 32
networkLayer.ip.fragmentTimeout double 60s
networkLayer.ip.forceBroadcast bool false
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.arp.globalARP bool false
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.forwardMulticast bool false

turns multicast forwarding on/off

interfaceTable.displayAddresses bool true

whether to display IP addresses on links

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

Source code:

//
// Compound module allowing hacked modules. Modificated from NodeBase module.
//
// Allowed hacked modules:
// - NA_NetworkLayer
//
// @see NA_NetworkLayer, NodeBase
//
// @author Gabriel Maciá Fernández, gmacia@ugr.es
// @date 01/22/2013
module NA_NodeBase
{
    parameters:
        @display("bgb=611,448");
        @node;
        @labels(node,ethernet-node,wireless-node);
        int numExtInterfaces = default(0);
        int numRadios = default(0);               // the number of radios in the router. by default no wireless
        int numPcapRecorders = default(0); // no of PcapRecorders.
        string mobilityType = default("StationaryMobility");
        string routingFile = default("");
        bool IPForward = default(true);
    gates:
        input radioIn[numRadios] @directIn;
        inout pppg[] @labels(PPPFrame-conn);
        inout ethg[] @labels(EtherFrame-conn);
    submodules:
        notificationBoard: NotificationBoard {
            parameters:
                @display("p=53,194");
        }

        // optional mobility module. Required only if wireless cards are present
        mobility: <mobilityType> like IMobility if mobilityType != "" && numRadios > 0 {
            parameters:
                @display("p=53,121");
        }

        //# Hacked module replacing the normal NetworkLayer INET module for attack purposes.
        networkLayer: NA_NetworkLayer {
            parameters:
                @display("p=329,287;q=queue");
        }

        routingTable: RoutingTable {
            parameters:
                @display("p=53,287");
                IPForward = IPForward;
                routingFile = routingFile;
        }

        // linklayer
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=53,386");
        }

        pcapRecorder[numPcapRecorders]: PcapRecorder {
            @display("p=159,259");
        }

        wlan[numRadios]: <default("Ieee80211Nic")> like IWirelessNic {
            parameters:
                @display("p=159,386;q=queue");
        }
        eth[sizeof(ethg)]: <default("EthernetInterface")> like IWiredNic {
            parameters:
                @display("p=282,386,row,90;q=txQueue");
        }
        ppp[sizeof(pppg)]: <default("PPPInterface")> like IWiredNic {
            parameters:
                @display("p=407,386,row,90;q=txQueue");
        }
        ext[numExtInterfaces]: <default("ExtInterface")> like IExternalNic {
            parameters:
                @display("p=547,386,row,90;q=txQueue;i=block/ifcard");
        }

    connections allowunconnected:
        // connections to network outside
        for i=0..sizeof(radioIn)-1 {
            radioIn[i] --> wlan[i].radioIn;
            wlan[i].upperLayerOut --> networkLayer.ifIn++;
            wlan[i].upperLayerIn <-- networkLayer.ifOut++;
        }

        for i=0..sizeof(ethg)-1 {
            ethg[i] <--> eth[i].phys;
            eth[i].upperLayerOut --> networkLayer.ifIn++;
            eth[i].upperLayerIn <-- networkLayer.ifOut++;
        }

        for i=0..sizeof(pppg)-1 {
            pppg[i] <--> ppp[i].phys;
            ppp[i].upperLayerOut --> networkLayer.ifIn++;
            ppp[i].upperLayerIn <-- networkLayer.ifOut++;
        }

        for i=0..numExtInterfaces-1 {
            ext[i].upperLayerOut --> networkLayer.ifIn++;
            ext[i].upperLayerIn <-- networkLayer.ifOut++;
        }
}