Changes between Initial Version and Version 1 of Old/Documentation/OTG/ScriptsRepository/ProtoDefExpooSender


Ignore:
Timestamp:
Oct 3, 2005, 4:54:48 PM (19 years ago)
Author:
zhibinwu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/Documentation/OTG/ScriptsRepository/ProtoDefExpooSender

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:OTG OTG] > [wiki:OTG/ScriptsRepository Scripts Repository] > expoo_sender.rb
     2
     3{{{
     4#
     5# Define a prototype containing a single
     6# traffic generator (otg).
     7#
     8
     9require 'handler/prototype'
     10require 'handler/filter'
     11require 'handler/appDefinition'
     12
     13p = Prototype.create("test:proto:expoo_sender")
     14p.name = "Exponential on off Sender"
     15p.description = "A node which transmit a stream of packets with expoo geneator"
     16# List properties of prototype
     17p.defProperty('protocol', 'Protocol to use', 'udp')
     18p.defProperty('port', 'port to bind by sender', 3000)
     19p.defProperty('generator', 'Generator to use', 'expoo')
     20p.defProperty('destinationHost', 'Host to send packets to')
     21p.defProperty('packetSize', 'Size of packets', 1000)
     22p.defProperty('rate', 'Number of bits per second', 1000)
     23p.defProperty('ontime', 'burst length')
     24p.defProperty('offtime','average idle time duration')
     25p.defProperty('broadcast','broadcast or not', 'off')
     26
     27# Define applications to be installed on this type of node,
     28# bind the application properties to the prototype properties,
     29# and finally, define what measurements should be collected
     30# for each application
     31#
     32otg = p.addApplication(:otg, "test:app:otg")
     33otg.bindProperty('protocol')
     34otg.bindProperty('port')
     35otg.bindProperty('generator')
     36otg.bindProperty('dsthostname', 'destinationHost')
     37otg.bindProperty('size', 'packetSize')
     38otg.bindProperty('rate')
     39otg.bindProperty('ontime')
     40otg.bindProperty('offtime')
     41otg.bindProperty('broadcast')
     42
     43otg.addMeasurement('senderport',  Filter::TIME,
     44  {Filter::SAMPLE_SIZE => 1},
     45  [ 
     46    ['pkt_seqno'],
     47    ['pkt_size', Filter::SUM],
     48    ['gen_timestamp'],
     49    ['tx_timestamp']
     50  ]
     51)
     52
     53if $0 == __FILE__
     54  p.to_xml.write($stdout, 2)
     55  puts
     56end
     57
     58}}}