| 1 | {{{ |
| 2 | # |
| 3 | # Define a prototype |
| 4 | # |
| 5 | require 'handler/prototype' |
| 6 | require 'handler/filter' |
| 7 | require 'handler/appDefinition' |
| 8 | |
| 9 | p = Prototype.create("test:proto:iperftcpreceiver") |
| 10 | p.name = "Iperf TCP Receiver" |
| 11 | p.description = "Nodes which receive packets" |
| 12 | p.defProperty('server', 'Client/Server') |
| 13 | #p.defProperty('port', 'Port to listen on') |
| 14 | p.defProperty('time', 'Duration of experiment (seconds)', 10) |
| 15 | p.defProperty('window', 'Receiver Window Size', 64000) |
| 16 | p.defProperty('report_interval', 'Interval beween reports', 1) |
| 17 | |
| 18 | |
| 19 | iperfr = p.addApplication('iperfr', "test:app:iperfr") |
| 20 | iperfr.bindProperty('server') |
| 21 | #iperfr.bindProperty('port','port') |
| 22 | iperfr.bindProperty('time') |
| 23 | iperfr.bindProperty('window') |
| 24 | iperfr.bindProperty('interval', 'report_interval') |
| 25 | |
| 26 | iperfr.addMeasurement('receiverport', Filter::SAMPLE, |
| 27 | {Filter::SAMPLE_SIZE => 1}, |
| 28 | [ |
| 29 | ['flow_no'], |
| 30 | ['throughput'], |
| 31 | ['jitter'], |
| 32 | ['packet_loss'] |
| 33 | ] |
| 34 | ) |
| 35 | |
| 36 | |
| 37 | if $0 == __FILE__ |
| 38 | p.to_xml.write($stdout, 2) |
| 39 | puts |
| 40 | end |
| 41 | }}} |