12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- %description:
- Test for basic UDP application lifecycle handling.
- Sequence of operations:
- - at 0 client initializes to down
- - at 0 server initializes to down
- - at 1 client executes startup operation
- - at 2 server executes startup operation
- - simulation stops at 3
-
- %inifile: omnetpp.ini
- [General]
- network = Test
- tkenv-plugin-path = ../../../etc/plugins
- ned-path = .;../../../../src;../../lib
- cmdenv-express-mode = false
- sim-time-limit = 3s
- record-eventlog = true
- #omnetpp 5.0 - 5.1 compatibility:
- eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
- output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
- output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
- snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
- **.hasStatus = true
- **.initialStatus = "down"
- **.scenarioManager.script = xmldoc("scenario.xml")
- **.arp.retryCount = 0
- **.arp.retryTimeout = 100ms
- # udp apps
- **.numUdpApps = 1
- **.client.udpApp[0].typename = "UDPBasicApp"
- **.client.udpApp[0].startTime = 0s
- **.client.udpApp[0].destAddresses = "10.0.0.2"
- **.client.udpApp[0].destPort = 1000
- **.client.udpApp[0].messageLength = 1000B
- **.client.udpApp[0].sendInterval = 100ms
- **.server.udpApp[0].typename = "UDPSink"
- **.server.udpApp[0].localPort = 1000
- %file: test.ned
- import inet.node.ethernet.Eth10M;
- import inet.node.inet.StandardHost;
- import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
- import inet.common.lifecycle.LifecycleController;
- import inet.common.scenario.ScenarioManager;
- network Test
- {
- submodules:
- scenarioManager: ScenarioManager;
- lifecycleController: LifecycleController;
- configurator: IPv4NetworkConfigurator;
- client: StandardHost;
- server: StandardHost;
- connections:
- client.pppg++ <--> Eth10M <--> server.pppg++;
- }
- %file: scenario.xml
-
- <scenario>
- <at t="1">
- <tell module="lifecycleController" target="client" operation="NodeStartOperation"/>
- </at>
- <at t="2">
- <tell module="lifecycleController" target="server" operation="NodeStartOperation"/>
- </at>
- </scenario>
- %contains-regex: stdout
- .*
- Test.client starting up
- .*
- Test.client started
- .*
- Test.server starting up
- .*
- Test.server started
- .*
- Test.server.udpApp\[0\]: received 10 packets
- .*
- %#--------------------------------------------------------------------------------------------------------------
- %not-contains: stdout
- undisposed object:
- %not-contains: stdout
- -- check module destructor
- %#--------------------------------------------------------------------------------------------------------------
|