PacketDrillHost

Package: inet.node.packetdrill

PacketDrillHost

compound module

IPv4 host with SCTP, TCP, UDP layers and a packetdrill application. The application has a direct connection to the TunInterface.

NodeStatus IEnergyStorage IEnergyManagement IEnergyGenerator IMobility PcapRecorder InterfaceTable ILoopbackInterface IWirelessInterface IPppInterface IEthernetInterface ITunnelInterface IVlanInterface INetworkLayer INetworkLayer INetworkLayer MessageDispatcher IUdp ITcp ISctp MessageDispatcher IApp MessageDispatcher PacketDrillApp

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.

Extends

Name Type Description
StandardHost compound module

IPv4 host with SCTP, TCP, UDP layers and applications. IP forwarding is disabled by default (see forwarding).

Parameters

Name Type Default value Description
hasStatus bool false
osgModel string ""

3D model for OSG visualization, no 3D model by default

osgModelColor string ""

tint color, no colorization by default

canvasImage string ""

image for canvas visualization, no image by default

canvasImageColor string ""

tint color, no colorization by default

numPcapRecorders int 0
numLoInterfaces int 1
numWlanInterfaces int 0
numEthInterfaces int 0

minimum number of ethernet interfaces

numPppInterfaces int 0

minimum number of PPP interfaces

numTunInterfaces int 0
numVlanInterfaces int 0
hasIpv4 bool true
hasIpv6 bool false
hasGn bool false
forwarding bool false
multicastForwarding bool false
hasUdp bool true || numUdpTunApps>0
hasTcp bool true || numTcpTunApps>0
hasSctp bool false || numSctpTunApps>0
numApps int 0
numTcpTunApps int 0

no of TCP packetdrill apps.

numUdpTunApps int 0

no of UDP packetdrill apps.

numSctpTunApps int 0

no of SCTP packetdrill apps.

Properties

Name Value Description
networkNode
labels node
display i=device/pc2;bgl=4

Gates

Name Direction Size Description
radioIn [ ] input numWlanInterfaces
pppg [ ] inout numPppInterfaces
ethg [ ] inout numEthInterfaces

Unassigned submodule parameters

Name Type Default value Description
status.initialStatus string "UP"

TODO @signal, @statistic

pcapRecorder.verbose bool false

whether to log packets on the module output

pcapRecorder.pcapFile string ""

the PCAP file to be written

pcapRecorder.pcapLinkType int -1

the network type header field in the PCAP file, see http://www.tcpdump.org/linktypes.html (1=ethernet, 204=ppp, 105=IEEE 802.11, ...) (-1 means autodetect based on first recordable packet)

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[*]"

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.dumpProtocols string "ethernetmac ppp ieee80211mac"

space-separated list of protocol names as defined in the Protocol class

pcapRecorder.packetFilter string "*"

which packets are considered, matches all packets by default

pcapRecorder.packetDataFilter string "*"

which packets are considered based on the data they contain, matches all packets by default

pcapRecorder.helpers string ""

usable PcapRecorder::IHelper helpers for accept packettype and store/convert packet as specified linktype currently available: "inet::AckingMacToEthernetPcapRecorderHelper"

pcapRecorder.alwaysFlush bool false

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

pcapRecorder.displayStringTextFormat string "rec: %n pks"
interfaceTable.displayAddresses bool false

whether to display IP addresses on links

tunApp.scriptFile string
tunApp.startTime double 0s
tunApp.localPort int

port number of the initiator

tunApp.remotePort int
tunApp.localAddress string
tunApp.remoteAddress string
tunApp.interfaceTableModule string
tunApp.inboundStreams int 20
tunApp.outboundStreams int 20
tunApp.streamReset int 0
tunApp.crcMode string "declared"
tunApp.latency double 0s

Source code

//
// IPv4 host with SCTP, TCP, UDP layers and a packetdrill application.
// The application has a direct connection to the ~TunInterface.
//
module PacketDrillHost extends StandardHost
{
    parameters:
        @display("i=device/pc2;bgl=4");
        int numTcpTunApps = default(0);    // no of TCP packetdrill apps.
        int numUdpTunApps = default(0);    // no of UDP packetdrill apps.
        int numSctpTunApps = default(0);   // no of SCTP packetdrill apps.
        hasTcp = default(true || numTcpTunApps>0);
        hasUdp = default(true || numUdpTunApps>0);
        hasSctp = default(false || numSctpTunApps>0);
    submodules:
        tunApp[numTunInterfaces]: PacketDrillApp {
            parameters:
                interface = "tun"+string(index);
                @display("p=825,76,row,150");
        }

    connections allowunconnected:
        for i=0..numTunInterfaces-1 {
            tunApp[i].socketOut --> at.in++;
            tunApp[i].socketIn <-- at.out++;
        }
}

File: src/inet/node/packetdrill/PacketDrillHost.ned