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


Ignore:
Timestamp:
Sep 30, 2005, 3:22:38 AM (19 years ago)
Author:
zhibinwu
Comment:

Legend:

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

    v1 v1  
     1describe OTG/ScriptsRepository/ProtoDefColocateSender here
     2
     3{{{
     4
     5#
     6# Define a prototype containing a single
     7# traffic generator (otg).
     8#
     9
     10require 'handler/prototype'
     11require 'handler/filter'
     12require 'handler/appDefinition'
     13
     14p = Prototype.create("test:proto:colocate_sender")
     15p.name = "Colocate Sender"
     16p.description = "A node which transmit several streams of packets"
     17# List properties of prototype
     18p.defProperty('protocol', 'Protocol to use', 'udp')
     19p.defProperty('port1', 'port to bind by sender', 3001)
     20p.defProperty('port2', 'port to bind by sender', 3002)
     21p.defProperty('port3', 'port to bind by sender', 3003)
     22p.defProperty('generator', 'Generator to use', 'cbr')
     23p.defProperty('destinationHost', 'Host to send packets to')
     24p.defProperty('packetSize', 'Size of packets', 1000)
     25p.defProperty('rate', 'Number of bits per second', 1000)
     26p.defProperty('broadcast','broadcast or not', 'off')
     27
     28# Define applications to be installed on this type of node,
     29# bind the application properties to the prototype properties,
     30# and finally, define what measurements should be collected
     31# for each application.
     32#
     33otg1 = p.addApplication(:otg, "test:app:otg")
     34otg1.bindProperty('protocol')
     35otg1.bindProperty('port')
     36otg1.bindProperty('generator')
     37otg1.bindProperty('dsthostname', 'destinationHost')
     38otg1.bindProperty('size', 'packetSize')
     39otg1.bindProperty('rate')
     40otg1.bindProperty('broadcast')
     41
     42otg1.addMeasurement('senderport',  Filter::TIME,
     43  {Filter::SAMPLE_SIZE => 1},
     44  [ 
     45    ['pkt_seqno'],
     46    ['pkt_size', Filter::SUM],
     47    ['gen_timestamp'],
     48    ['tx_timestamp']
     49  ]
     50)
     51
     52otg3 = p.addApplication(:otg, "test:app:otg")
     53otg3.bindProperty('protocol')
     54otg3.bindProperty('port')
     55otg3.bindProperty('generator')
     56otg3.bindProperty('dsthostname', 'destinationHost')
     57otg3.bindProperty('size', 'packetSize')
     58otg3.bindProperty('rate')
     59otg3.bindProperty('broadcast')
     60
     61otg3.addMeasurement('senderport',  Filter::TIME,
     62  {Filter::SAMPLE_SIZE => 1},
     63  [ 
     64    ['pkt_seqno'],
     65    ['pkt_size', Filter::SUM],
     66    ['gen_timestamp'],
     67    ['tx_timestamp']
     68  ]
     69)
     70
     71
     72if $0 == __FILE__
     73  p.
     74
     75
     76
     77if $0 == __FILE__
     78  p.to_xml.write($stdout, 2)
     79  puts
     80end
     81
     82
     83
     84}}}