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