# # Create an application representation from scratch # require 'handler/appDefinition' a = AppDefinition.create('test:app:itgs') a.name = "itgs" a.version(0, 0, 1) a.shortDescription = "D-ITG Sender" a.description = <<TEXT ITGSend 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. TEXT # addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil) #Flow options a.addProperty('m', 'MSR type: either onewaydelay or RTT', ?m, String, false) a.addProperty('a', 'Destination address', ?a, String, false) a.addProperty('r', 'Remote port', ?r, Integer, false) a.addProperty('T', 'Protocol type TCP/UDP/UDP_Libmac', ?T, Integer, false) a.addProperty('f', 'TTL',?f, Integer, false) a.addProperty('d', 'Gen_Delay',?d, Integer, false) a.addProperty('t', "Duration of traffic generation(millisecs)", ?t, Integer, false) #Interdeparture time options a.addProperty('C', 'Constant interdeparture time b/w packets (pkts_per_s)', ?C, Integer, false) a.addProperty('E', '(Exponential) Average packets per sec', ?E, Integer, false) a.addProperty('O', '(Poisson) Average pkts per sec', ?O, Integer, false) #Note that Pareto, Cauchy, UNiform, Normal and Gamma distributions will be added #Log file options a.addProperty('l', 'Log file', ?l, String, false) #Packet size options a.addProperty('c', 'Constant payload size', ?c, Integer, false) a.addProperty('e', "Average pkt size (exponential)", ?e, Integer, false) a.addProperty('o', "Poisson distributed avg. pkt size", ?o, Integer, false) #Note that Pareto, Cauchy, UNiform, Normal and Gamma distributions will be added # Applications (note that no other interdeparture or packet size can be chosen # if an application is chosen a.addProperty('App', 'VoIP traffic', ?Z, Integer, false) a.addProperty('codec', 'VoIP codec: G.711.1, G.711.2, G.723.1, G.729.2, G.729.3', ?i, String, false) a.addProperty('voip_control', 'protocol_type RTP or CRTP',?h, String, false) a.addProperty('Telnet', 'Telnet traffic', nil, Integer, false) a.addProperty('DNS', 'DNS traffic', nil, Integer, false) a.path = "/usr/bin/ITGSend" if $0 == __FILE__ require 'stringio' require 'rexml/document' include REXML sio = StringIO.new() a.to_xml.write(sio, 2) sio.rewind puts sio.read sio.rewind doc = Document.new(sio) t = AppDefinition.from_xml(doc.root) puts puts "-------------------------" puts t.to_xml.write($stdout, 2) end
Last modified
18 years ago
Last modified on Sep 5, 2006, 9:50:05 PM
Note:
See TracWiki
for help on using the wiki.