Simple Module IPTrafGen

File: Applications/Generic/IPTrafGen.ned

C++ definition: click here

Sends IP or IPv6 datagrams to the given address at the given interval. The interval can be a constant or a random value (e.g. exponential(1)). If the destAddresses parameter contains more than one address, one of them is randomly for each packet. An address may be given in the dotted decimal notation (or, for IPv6, in the usual notation with colons), or with the module name. (The IPAddressResolver class is used to resolve the address.) To disable the model, set destAddresses to "".

The peer can be IPTrafSink or another IPTrafGen (it handles received packets exactly like IPTrafSink).

Usage diagram:

The following diagram shows usage relationships between modules, networks and channels. Unresolved module (and channel) types are missing from the diagram. Click here to see the full picture.

IPTrafGen

Parameters:

Name Type Description
startTime numeric

the time application generates first packet

packetInterval numeric

may be a random value, e.g. exponential(1)

numPackets numeric const

max number of packets to generate

protocol numeric const

value for IPDatagram protocol field

packetLength numeric

in bytes (changed 2005-11-04)

destAddresses string

list of IP addresses, separated by spaces

Gates:

Name Direction Description
from_ip input
from_ipv6 input
to_ip output
to_ipv6 output

Source code:

simple IPTrafGen
    parameters:
        startTime: numeric, // the time application generates first packet
        packetInterval : numeric, // may be a random value, e.g. exponential(1)
        numPackets: numeric const, // max number of packets to generate
        protocol: numeric const, // value for IPDatagram protocol field
        packetLength : numeric, // in bytes (changed 2005-11-04)
        destAddresses: string; // list of \IP addresses, separated by spaces
    gates:
        in: from_ip, from_ipv6;
        out: to_ip, to_ipv6;
endsimple