[wiki:WikiStart Orbit] > [wiki:Documentation/OtherApps Other Applications] > ITG Scripts
= Application Definition Schema = 
The application definition schema for the ITG application is as follows
{{{
	
		ITG
		ITG
		
		
			WINLAB, Rutgers University
			http://www.winlab.rutgers.edu/
		
		Receive network traffic
		
Receive network traffic on the specified interface
       
		http://apps.orbit-lab.org/itg
		
			
				network_interface
				i
				xsd:string
				no
				Device name for sending network traffic
			
			
				pipe name
				p
				xsd:string
				no
				iinterface for changing generator properties
			
		
		
			
				
					id of the stream
				
				
					source port
				
				
					Destination port
				
				
					Flow Throughput
				
                                
                                     Flow jitter 
				
                                
					flow delay
				
				
					Pkt loss for flow
				   
			
		
		
          http://apps.orbit-lab.org/issues/winlab/renny
       
		
			scm:cvs:pserver:anoncvs@cvs.orbit-lab.org:/trafficgenerator/renny
			apt:repository.orbit-lab.org/orbit/binary:???
		
		
		
			
				John Doe
				jdoe
				jdoe@winlab.rutgers.edu
				
					WINLAB, Rutgers University
				
			
		
		
			
				libmac
				>= 0.4
				apt:repository.orbit-lab.org/debian/binary:libmac
			
		
	
}}}
= Application definition script for Iperf sender and Receiver =
== ITG Sender ==
{{{
#
# Create an application representation from scratch
#
require 'appDefinition'
a = AppDefinition.create('test:app:itgs')
a.name = "itgs"
a.version(0, 0, 1)
a.shortDescription = "D-ITG Sender"
a.description = < 1},
  [
    ['flow_no'],
    ['src_port'],
    ['dst_port'],
    ['throughput'],
    ['jitter'],
    ['delay'],
    ['pkt_loss']
  ]
)
if $0 == __FILE__
  p.to_xml.write($stdout, 2)
  puts
end
}}}
= Experiment script for Iperf =
== UDP CBR Experiment ==
{{{
############# Tutorial1 ##################################
# This script defines the experiment
# that has two senders and one receiver using Iperf
# 802.11b 
# UDP flow of 500 packet/sec of 1024 byte payload
# Decoder reports throughput, delay, packet loss and jitter ############################################################
Experiment.name = "tutorial-itg"
Experiment.project = "orbit:tutorial"
###########################################
# Receiver definition and configuration
##########################################
defNodes('receiver',[3,1]) {|node|
  node.image = nil  # assume the right image to be on disk
  node.prototype("test:proto:itgreceiver", { 
    'logfile' => "/tmp/results.txt"
    }
)
  node.net.w0.ip = "%192.168.%x.%y"
  node.net.w0.mode = "master"
  node.net.w0.type = 'b'
  node.net.w0.essid = "helloworld"	
}
###########################################
# Decoder definition and configuration
##########################################
defNodes('decoder',[3,1]) {|node|
  node.image = nil  # assume the right image to be on disk
  node.prototype("test:proto:itgdecoder", { 
    'logfile' => "/tmp/results.txt",
    'tput_report_interval' => 1000,
    'delay_report_interval' => 1000,
    'loss_report_interval' => 1000,
    'jitter_report_interval' => 1000
    }
)
}
###########################################
# Sender definition and configuration
###########################################
defNodes('sender',[1,2]) {|node|
  node.image = nil  # assume the right image to be on disk
  node.prototype("test:proto:itgcbrsender", {
    'destinationHost' => '192.168.3.1',
    'meter' => 'owdm',          #One way delay
    'protocol' => 'udp',        #UDP client
    'constsize' => 1024,        #Const payload size (bytes)
    'constrate' => 500,         #packets per second
    'duration' => 60000,        #Expt duration (msec)
    'recv_port' => 8000         #Receiver port
  })
  node.net.w0.ip = "%192.168.%x.%y"
  node.net.w0.mode = "managed"
  node.net.w0.type = 'b'
  node.net.w0.essid = "helloworld"
}
###########################################
# Sender definition and configuration
###########################################
defNodes('sender',[2,2]) {|node|
  node.image = nil  # assume the right image to be on disk
  # use prototype "sender" 
  # and set it's property "destinationHost" to 
  # the receiver node
  # and bind the remaining properties to the 
  # experiment property space
  node.prototype("test:proto:itgcbrsender", {
    'destinationHost' => '192.168.3.1',
    'meter' => 'owdm',          #One way delay
    'protocol' => 'udp',        #UDP client
    'constsize' => 1024,        #Const payload size (bytes)
    'constrate' => 500,         #packets per second
    'duration' => 60000,        #Expt duration (msec)
    'recv_port' => 8001         #Receiver port
  })
  node.net.w0.ip = "%192.168.%x.%y"
  node.net.w0.mode = "managed"
  node.net.w0.type = 'b'
  node.net.w0.essid = "helloworld"
}
###########################################
#  When nodeAgents have reported "OK" to 
# the nodeHandler start the application
###########################################
whenAllInstalled {|node|
  NodeSet['receiver'].startApplications
  ###Need to separate receiver and sender start
  wait  15 
  ###
  NodeSet['sender'].startApplications
  NodeSet['sender1'].startApplications
  wait 60
###############################################
Launch the decoder application to report results
################################################
  NodeSet['decoder'].startApplications
 
###########################################
# Shutdown nodes
###########################################
 Experiment.done
}
}}}
== VoIP Experiment ==
{{{
############# Tutorial2 ##################################
# This script defines the experiment
# that has one sender and one receiver and VoIP session
# Sender, Receiver - 802.11a channel 36
# Receiver reports throughput, packet loss, avg. delay and jitter
############################################################
Experiment.name = "tutorial-itg"
Experiment.project = "orbit:tutorial"
#
# Define nodes used in experiment
###########################################
# Receiver definition and configuration
##########################################
defNodes('receiver',[3,1]) {|node|
  node.image = nil  # assume the right image to be on disk
  node.prototype("test:proto:itgreceiver", { 
    'logfile' => "/tmp/results.txt"
    }
)
  node.net.w0.ip = "%192.168.%x.%y"
  node.net.w0.mode = "master"
  node.net.w0.type = 'a'
  node.net.w0.essid = "helloworld"	
}
###########################################
# Decoder definition and configuration
##########################################
defNodes('decoder',[3,1]) {|node|
  node.image = nil  # assume the right image to be on disk
  node.prototype("test:proto:itgdecoder", { 
    'logfile' => "/tmp/results.txt",
    'tput_report_interval' => 1000,
    'delay_report_interval' => 1000,
    'loss_report_interval' => 1000,
    'jitter_report_interval' => 1000
    }
)}
###########################################
# Sender definition and configuration
###########################################
defNodes('sender',[2,2]) {|node|
  node.image = nil  # assume the right image to be on disk
  node.prototype("test:proto:itgvoipsender", {
    'destinationHost' => '192.168.3.1',
    'meter' => 'owdm',          #One way delay
    'duration' => 20000,        #Run for 20 seconds
    'recv_port' => 8000,        #Recv port
    'App' => 'VoIP',            #Use VoIP
    'codec' => 'G.711.1',       #Codec type
    'voip_control' => 'RTP'     #VoIP control
  })
  node.net.w0.ip = "%192.168.%x.%y"
  node.net.w0.mode = "managed"
  node.net.w0.type = 'a'
  node.net.w0.essid = "helloworld"
}
###########################################
#  When nodeAgents have reported "OK" to 
# the nodeHandler start the application
###########################################
whenAllInstalled {|node|
  NodeSet['receiver'].startApplications
  ###Need to separate receiver and sender start
  wait 15 
  ###
  NodeSet['sender'].startApplications
 
  wait 60
###############################################
Launch the decoder application to report results
################################################
  NodeSet['decoder'].startApplications
 
###########################################
# Shutdown nodes
###########################################
 Experiment.done
}
}}}