Changes between Initial Version and Version 1 of Old/OtherApps/ScriptsITGRepository


Ignore:
Timestamp:
Oct 8, 2005, 6:49:28 PM (19 years ago)
Author:
Surya Satyavolu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/OtherApps/ScriptsITGRepository

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:Documentation/OtherApps Other Applications] > ITG Scripts
     2
     3= Application Definition Schema =
     4The application definition schema for the ITG application is as follows
     5{{{
     6<?xml version="1.0" encoding="UTF-8"?>
     7<orbit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="H:\Orbit\Oml\docs\definitions\application\app_def.xsd">
     8        <application id="orbit_winlab_itg">
     9                <name>ITG</name>
     10                <id>ITG</id>
     11                <version major="0" minor="1" revision="0"/>
     12                <organization>
     13                        <name>WINLAB, Rutgers University</name>
     14                        <url>http://www.winlab.rutgers.edu/</url>
     15                </organization>
     16                <shortDescription>Receive network traffic</shortDescription>
     17                <description>
     18Receive network traffic on the specified interface
     19       </description>
     20                <url>http://apps.orbit-lab.org/itg</url>
     21                <properties>
     22                        <property>
     23                                <name>network_interface</name>
     24                                <mnemonic>i</mnemonic>
     25                                <type>xsd:string</type>
     26                                <dynamic>no</dynamic>
     27                                <description>Device name for sending network traffic</description>
     28                        </property>
     29                        <property>
     30                                <name>pipe name</name>
     31                                <mnemonic>p</mnemonic>
     32                                <type>xsd:string</type>
     33                                <dynamic>no</dynamic>
     34                                <description>iinterface for changing generator properties</description>
     35                        </property>
     36                </properties>
     37                <measurement-points>
     38                        <measurement-point id="decoderport">
     39                                <metric id="flow_no" type="int">
     40                                        <description>id of the stream</description>
     41                                </metric>
     42                                <metric id="src_port" type="int">
     43                                        <description>source port</description>
     44                                </metric>
     45                                <metric id="dst_port" type="int">
     46                                        <description>Destination port</description>
     47                                </metric>
     48                                <metric id="throughput" type="float">
     49                                        <description>Flow Throughput</description>
     50                                </metric>
     51                                <metric id="jitter" type ="float">
     52                                     <description>Flow jitter</description>
     53                                </metric>
     54                                <metric id="delay" type="float">
     55                                        <description>flow delay</description>
     56                                </metric>
     57                                <metric id="pkt_loss" type="float">
     58                                        <description>Pkt loss for flow</description>
     59                                </metric>   
     60                        </measurement-point>
     61                </measurement-points>
     62                <issueTrackingUrl>
     63          http://apps.orbit-lab.org/issues/winlab/renny
     64       </issueTrackingUrl>
     65                <repository>
     66                        <development>scm:cvs:pserver:anoncvs@cvs.orbit-lab.org:/trafficgenerator/renny</development>
     67                        <binary>apt:repository.orbit-lab.org/orbit/binary:???</binary>
     68                </repository>
     69                <mailingLists/>
     70                <developers>
     71                        <developer>
     72                                <name>John Doe</name>
     73                                <id>jdoe</id>
     74                                <email>jdoe@winlab.rutgers.edu</email>
     75                                <organization>
     76                                        <name>WINLAB, Rutgers University</name>
     77                                </organization>
     78                        </developer>
     79                </developers>
     80                <dependencies>
     81                        <dependency>
     82                                <id>libmac</id>
     83                                <version>&gt;= 0.4</version>
     84                                <url>apt:repository.orbit-lab.org/debian/binary:libmac</url>
     85                        </dependency>
     86                </dependencies>
     87        </application>
     88</orbit>
     89
     90
     91}}}
     92
     93= Application definition script for Iperf sender and Receiver =
     94
     95== ITG Sender ==
     96{{{
     97
     98#
     99# Create an application representation from scratch
     100#
     101require 'appDefinition'
     102
     103a = AppDefinition.create('test:app:itgs')
     104a.name = "itgs"
     105a.version(0, 0, 1)
     106a.shortDescription = "D-ITG Sender"
     107a.description = <<TEXT
     108ITGSend is a traffic generator for TCP and UDP traffic. It contains generators producing various forms of packet streams and port for sending these packets via various transports, such as TCP and UDP.
     109TEXT
     110
     111# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
     112
     113#Flow options
     114a.addProperty('m', 'Measurement type: either onewaydelay or RTT', ?m, String, false)
     115a.addProperty('a', 'Destination address', ?a, String, false)
     116a.addProperty('r', 'Remote port', ?r, Integer, false)
     117a.addProperty('T', 'Protocol type TCP or UDP', ?T, Integer, false)
     118a.addProperty('f', 'TTL',?f, Integer, false)
     119a.addProperty('d', 'Gen_Delay',?d, Integer, false)
     120a.addProperty('t', "Duration of traffic generation(millisecs)", ?t, Integer, false)
     121
     122#Interdeparture time options
     123a.addProperty('C', 'Constant interdeparture time b/w packets (pkts_per_s)', ?C, Integer, false)
     124a.addProperty('E', '(Exponential) Average packets per sec', ?E, Integer, false)
     125a.addProperty('O', '(Poisson) Average pkts per sec', ?O, Integer, false)
     126
     127#Note that Pareto, Cauchy, UNiform, Normal and Gamma distributions will # be added
     128
     129#Log file options
     130a.addProperty('l', 'Log file', ?l, String, false)
     131
     132#Packet size options
     133a.addProperty('c', 'Constant payload size', ?c, Integer, false)
     134a.addProperty('e', "Average pkt size (exponential)", ?e, Integer, false)
     135a.addProperty('o', "Poisson distributed avg. pkt size", ?o, Integer, false)
     136
     137#Note that Pareto, Cauchy, UNiform, Normal and Gamma distributions will # be added
     138
     139# Applications (note that no other interdeparture or packet size can be #chosen if an application is chosen
     140a.addProperty('App', 'VoIP traffic', ?Z, Integer, false)
     141a.addProperty('codec', 'VoIP codec: G.711.1, G.711.2, G.723.1, G.729.2, G.729.3', ?i, Integer, false)
     142a.addProperty('voip_control', 'protocol_type RTP or CRTP',?h, String, false)
     143
     144a.addProperty('Telnet', 'Telnet traffic', nil, Integer, false)
     145a.addProperty('DNS', 'DNS traffic', nil, Integer, false)
     146
     147a.path = "/usr/local/bin/ITGSend"
     148
     149if $0 == __FILE__
     150  require 'stringio'
     151  require 'rexml/document'
     152  include REXML
     153   
     154  sio = StringIO.new()
     155  a.to_xml.write(sio, 2)
     156  sio.rewind
     157  puts sio.read
     158 
     159  sio.rewind
     160  doc = Document.new(sio)
     161  t = AppDefinition.from_xml(doc.root)
     162 
     163  puts
     164  puts "-------------------------"
     165  puts
     166  t.to_xml.write($stdout, 2)
     167 
     168end
     169
     170
     171}}}
     172== ITG Receiver ==
     173{{{
     174#
     175# Create an application representation from scratch
     176#
     177require 'appDefinition'
     178
     179a = AppDefinition.create('test:app:itgr')
     180a.name = "itgr"
     181a.version(0, 0, 1)
     182a.shortDescription = "D-ITG Receiver"
     183a.description = <<TEXT
     184D-ITG is a traffic generator for TCP and UDP traffic. It contains generators
     185producing various forms of packet streams and port for sending
     186these packets via various transports, such as TCP and UDP.
     187TEXT
     188
     189# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
     190#Flow options
     191a.addProperty('l', 'Log file', ?l, String, false)
     192
     193a.path = "/usr/local/bin/ITGRecv"
     194
     195if $0 == __FILE__
     196  require 'stringio'
     197  require 'rexml/document'
     198  include REXML
     199   
     200  sio = StringIO.new()
     201  a.to_xml.write(sio, 2)
     202  sio.rewind
     203  puts sio.read
     204 
     205  sio.rewind
     206  doc = Document.new(sio)
     207  t = AppDefinition.from_xml(doc.root)
     208 
     209  puts
     210  puts "-------------------------"
     211  puts
     212  t.to_xml.write($stdout, 2)
     213 
     214end
     215
     216}}}
     217
     218== ITG Decoder ==
     219{{{
     220#
     221# Create an application representation from scratch
     222#
     223require 'appDefinition'
     224
     225a = AppDefinition.create('test:app:itgdec')
     226a.name = "itgdec"
     227a.version(0, 0, 1)
     228a.shortDescription = "D-ITG Decoder"
     229a.description = <<TEXT
     230This program decodes the output of the experiment
     231TEXT
     232
     233# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
     234a.addProperty('logfile', 'Log file', ?x , String, false)
     235a.addProperty('d', 'Delay interval size (msec)', ?d, Integer, false)
     236a.addProperty('j', 'Jitter Interval size (msec)', ?j, Integer, false)
     237a.addProperty('b', 'Bitrate interval size (msec)', ?b, Integer, false)
     238a.addProperty('p', 'Packet loss interval size(msec)', ?p, Integer, false)
     239
     240a.addMeasurement("decoderport", nil, [
     241    ['flow_no', 'int'],
     242    ['src_port', 'int'],
     243    ['dst_port', 'int'],
     244    ['throughput', Float],
     245    ['jitter', Float],
     246    ['delay', Float],
     247    ['pkt_loss', Float]
     248 ])
     249
     250a.path = "/usr/local/bin/ITGDec"
     251
     252if $0 == __FILE__
     253  require 'stringio'
     254  require 'rexml/document'
     255  include REXML
     256   
     257  sio = StringIO.new()
     258  a.to_xml.write(sio, 2)
     259  sio.rewind
     260  puts sio.read
     261 
     262  sio.rewind
     263  doc = Document.new(sio)
     264  t = AppDefinition.from_xml(doc.root)
     265 
     266  puts
     267  puts "-------------------------"
     268  puts
     269  t.to_xml.write($stdout, 2)
     270 
     271end
     272}}}
     273= Sample prototype definitions script for ITG UDP CBR(sender and Receiver) =
     274
     275== ITG CBR UDP Sender ==
     276{{{
     277#
     278# Define a prototype
     279#
     280require 'prototype'
     281require 'filter'
     282require 'appDefinition'
     283
     284p = Prototype.create("test:proto:itgcbrsender")
     285p.name = "ITG Sender"
     286p.description = "Nodes which send a stream of packets"
     287p.defProperty('meter', 'one way delay or RTT', 'owdm')
     288p.defProperty('protocol', 'Protocol to use', 'udp')
     289p.defProperty('destinationHost', 'Host to send packets to')
     290p.defProperty('constsize', 'Size of packets', 1000)
     291p.defProperty('constrate', 'Number of bits per second', 1000)
     292p.defProperty('duration', 'Time for sending (millisec)', 1000)
     293p.defProperty('gen_delay', 'Generation delay (millisec)', 10000)
     294p.defProperty('recv_port', 'Receiver_port', 8000)
     295
     296itgs = p.addApplication(:itgs, "test:app:itgs")
     297itgs.bindProperty('m','meter')
     298itgs.bindProperty('T','protocol')
     299itgs.bindProperty('a', 'destinationHost')
     300itgs.bindProperty('c', 'constsize')
     301itgs.bindProperty('C', 'constrate')
     302itgs.bindProperty('t', 'duration')
     303itgs.bindProperty('d', 'gen_delay')
     304itgs.bindProperty('r', 'recv_port')
     305
     306if $0 == __FILE__
     307  p.to_xml.write($stdout, 2)
     308  puts
     309end
     310
     311
     312}}}
     313== ITG CBR UDP Receiver ==
     314{{{
     315#
     316# Define a prototype
     317#
     318
     319require 'prototype'
     320require 'filter'
     321require 'appDefinition'
     322
     323p = Prototype.create("test:proto:itgreceiver")
     324p.name = "ITG Receiver"
     325p.description = "Nodes which receive packets"
     326p.defProperty('logfile', 'Logfile')
     327
     328itgr = p.addApplication('itgr', "test:app:itgr")
     329itgr.bindProperty('l','logfile')
     330
     331if $0 == __FILE__
     332  p.to_xml.write($stdout, 2)
     333  puts
     334end
     335
     336
     337
     338}}}
     339== ITG CBR UDP Decoder ==
     340{{{
     341#
     342# Define a prototype
     343#
     344
     345require 'prototype'
     346require 'filter'
     347require 'appDefinition'
     348
     349p = Prototype.create("test:proto:itgdecoder")
     350p.name = "ITG Decoder"
     351p.description = "Decodes output and prints results"
     352p.defProperty('logfile', 'Logfile')
     353p.defProperty('tput_report_interval', 'Report interval for throughput')
     354p.defProperty('delay_report_interval', 'Report interval for Delay')
     355p.defProperty('jitter_report_interval', 'Report interval for Jitter')
     356p.defProperty('loss_report_interval', 'Report interval for Packet loss')
     357
     358itgd = p.addApplication('itgdec', "test:app:itgdec")
     359itgd.bindProperty('logfile')
     360itgd.bindProperty('d', 'delay_report_interval')
     361itgd.bindProperty('j', 'jitter_report_interval')
     362itgd.bindProperty('b', 'tput_report_interval')
     363itgd.bindProperty('p', 'loss_report_interval')
     364
     365itgd.addMeasurement('decoderport',  Filter::SAMPLE,
     366  {Filter::SAMPLE_SIZE => 1},
     367  [
     368    ['flow_no'],
     369    ['src_port'],
     370    ['dst_port'],
     371    ['throughput'],
     372    ['jitter'],
     373    ['delay'],
     374    ['pkt_loss']
     375  ]
     376)
     377
     378if $0 == __FILE__
     379  p.to_xml.write($stdout, 2)
     380  puts
     381end
     382}}}
     383
     384
     385= Experiment script for Iperf =
     386
     387== UDP CBR Experiment ==
     388{{{
     389############# Tutorial1 ##################################
     390# This script defines the experiment
     391# that has two senders and one receiver using Iperf
     392# 802.11b
     393# UDP flow of 500 packet/sec of 1024 byte payload
     394# Decoder reports throughput, delay, packet loss and jitter ############################################################
     395
     396Experiment.name = "tutorial-itg"
     397Experiment.project = "orbit:tutorial"
     398
     399###########################################
     400# Receiver definition and configuration
     401##########################################
     402
     403defNodes('receiver',[3,1]) {|node|
     404  node.image = nil  # assume the right image to be on disk
     405  node.prototype("test:proto:itgreceiver", {
     406    'logfile' => "/tmp/results.txt"
     407    }
     408)
     409  node.net.w0.ip = "%192.168.%x.%y"
     410  node.net.w0.mode = "master"
     411  node.net.w0.type = 'b'
     412  node.net.w0.essid = "helloworld"     
     413}
     414###########################################
     415# Decoder definition and configuration
     416##########################################
     417
     418defNodes('decoder',[3,1]) {|node|
     419  node.image = nil  # assume the right image to be on disk
     420  node.prototype("test:proto:itgdecoder", {
     421    'logfile' => "/tmp/results.txt",
     422    'tput_report_interval' => 1000,
     423    'delay_report_interval' => 1000,
     424    'loss_report_interval' => 1000,
     425    'jitter_report_interval' => 1000
     426    }
     427)
     428}
     429###########################################
     430# Sender definition and configuration
     431###########################################
     432defNodes('sender',[1,2]) {|node|
     433  node.image = nil  # assume the right image to be on disk
     434  node.prototype("test:proto:itgcbrsender", {
     435    'destinationHost' => '192.168.3.1',
     436    'meter' => 'owdm',          #One way delay
     437    'protocol' => 'udp',        #UDP client
     438    'constsize' => 1024,        #Const payload size (bytes)
     439    'constrate' => 500,         #packets per second
     440    'duration' => 60000,        #Expt duration (msec)
     441    'recv_port' => 8000         #Receiver port
     442  })
     443  node.net.w0.ip = "%192.168.%x.%y"
     444  node.net.w0.mode = "managed"
     445  node.net.w0.type = 'b'
     446  node.net.w0.essid = "helloworld"
     447}
     448###########################################
     449# Sender definition and configuration
     450###########################################
     451defNodes('sender',[2,2]) {|node|
     452  node.image = nil  # assume the right image to be on disk
     453  # use prototype "sender"
     454  # and set it's property "destinationHost" to
     455  # the receiver node
     456  # and bind the remaining properties to the
     457  # experiment property space
     458  node.prototype("test:proto:itgcbrsender", {
     459    'destinationHost' => '192.168.3.1',
     460    'meter' => 'owdm',          #One way delay
     461    'protocol' => 'udp',        #UDP client
     462    'constsize' => 1024,        #Const payload size (bytes)
     463    'constrate' => 500,         #packets per second
     464    'duration' => 60000,        #Expt duration (msec)
     465    'recv_port' => 8001         #Receiver port
     466  })
     467  node.net.w0.ip = "%192.168.%x.%y"
     468  node.net.w0.mode = "managed"
     469  node.net.w0.type = 'b'
     470  node.net.w0.essid = "helloworld"
     471}
     472
     473###########################################
     474#  When nodeAgents have reported "OK" to
     475# the nodeHandler start the application
     476###########################################
     477whenAllInstalled {|node|
     478  NodeSet['receiver'].startApplications
     479  ###Need to separate receiver and sender start
     480  wait  15
     481  ###
     482  NodeSet['sender'].startApplications
     483  NodeSet['sender1'].startApplications
     484
     485  wait 60
     486
     487###############################################
     488Launch the decoder application to report results
     489################################################
     490  NodeSet['decoder'].startApplications
     491 
     492
     493
     494###########################################
     495# Shutdown nodes
     496###########################################
     497 Experiment.done
     498
     499}
     500}}}
     501== VoIP Experiment ==
     502{{{
     503############# Tutorial2 ##################################
     504# This script defines the experiment
     505# that has one sender and one receiver and VoIP session
     506# Sender, Receiver - 802.11a channel 36
     507# Receiver reports throughput, packet loss, avg. delay and jitter
     508############################################################
     509
     510
     511Experiment.name = "tutorial-itg"
     512Experiment.project = "orbit:tutorial"
     513
     514#
     515# Define nodes used in experiment
     516###########################################
     517# Receiver definition and configuration
     518##########################################
     519
     520defNodes('receiver',[3,1]) {|node|
     521  node.image = nil  # assume the right image to be on disk
     522  node.prototype("test:proto:itgreceiver", {
     523    'logfile' => "/tmp/results.txt"
     524    }
     525)
     526  node.net.w0.ip = "%192.168.%x.%y"
     527  node.net.w0.mode = "master"
     528  node.net.w0.type = 'a'
     529  node.net.w0.essid = "helloworld"     
     530}
     531###########################################
     532# Decoder definition and configuration
     533##########################################
     534
     535defNodes('decoder',[3,1]) {|node|
     536  node.image = nil  # assume the right image to be on disk
     537  node.prototype("test:proto:itgdecoder", {
     538    'logfile' => "/tmp/results.txt",
     539    'tput_report_interval' => 1000,
     540    'delay_report_interval' => 1000,
     541    'loss_report_interval' => 1000,
     542    'jitter_report_interval' => 1000
     543    }
     544)}
     545###########################################
     546# Sender definition and configuration
     547###########################################
     548defNodes('sender',[2,2]) {|node|
     549  node.image = nil  # assume the right image to be on disk
     550  node.prototype("test:proto:itgvoipsender", {
     551    'destinationHost' => '192.168.3.1',
     552    'meter' => 'owdm',          #One way delay
     553    'duration' => 20000,        #Run for 20 seconds
     554    'recv_port' => 8000,        #Recv port
     555    'App' => 'VoIP',            #Use VoIP
     556    'codec' => 'G.711.1',       #Codec type
     557    'voip_control' => 'RTP'     #VoIP control
     558  })
     559  node.net.w0.ip = "%192.168.%x.%y"
     560  node.net.w0.mode = "managed"
     561  node.net.w0.type = 'a'
     562  node.net.w0.essid = "helloworld"
     563
     564}
     565
     566###########################################
     567#  When nodeAgents have reported "OK" to
     568# the nodeHandler start the application
     569###########################################
     570whenAllInstalled {|node|
     571  NodeSet['receiver'].startApplications
     572  ###Need to separate receiver and sender start
     573  wait 15
     574  ###
     575  NodeSet['sender'].startApplications
     576 
     577
     578
     579  wait 60
     580
     581###############################################
     582Launch the decoder application to report results
     583################################################
     584
     585  NodeSet['decoder'].startApplications
     586 
     587
     588###########################################
     589# Shutdown nodes
     590###########################################
     591 Experiment.done
     592
     593}
     594
     595
     596}}}