An XML Front-End for ns-3

advertisement

An XML Front-End for ns-3

George Riley and Josh Pelkey

Georgia Institute of Technology

Overview

• Motivation

• Approach

• Details of XML interface

• Problems with the Approach

• Alternative Approaches

• Summary

Motivation

• A primary effort from the NSF funding for ns-3 is

“educational use”.

• The ns-3 simulator requires tools for compiling, linking, and in some cases C++ programming skills.

• The majority of classroom educators at college level, either at undergraduate or graduate level are unlikely to have these compiling/linking tools readily available, and are not in fact skilled in these areas.

– Often rely on undergraduate or graduate “teaching assistants”, who may or may not have programming skills.

• In order to promote “educational use”, we must have a simple way, using tools that are readily available to nearly all users (eg. Text editor)

Approach

• Describe the ns-3 simulation scenario using the well-known

Extensible Markup Language (XML).

• Implement an XML parser that both understands the XML syntax, and the meaning of the ns-3 objects specified

• The XML parser will read the complete XML file, validate that it is correct, then create the ns-3 objects (nodes, links, protocol stacks, routing objects, and applications)

• The parser will produce meaningful and detailed error messages when erroneous specifications are detected.

• Allows command line arguments to vary independent variables, to illustrate effects of network parameters.

• A difficulty is that the XML syntax is not easily adapted to concepts such as loops, repetitions, and references to other XML elements

Details of XML Interface

• The XML root element is the ns3 element

– Attribute “ StopAt ”

– Subelements:

• cmdline

• randomgenerators

• topology

• applications

• animation

• statistics

cmdline element

• Attributes are:

– name

• Name of ns-3 attribute

– default

• Default value if not specified

– help

• Help text

randomgenerators element

• Subelements

– exponential

• Name

• Mean

• limit

– Uniform

• Name

• Min

• Max

– Normal

• Name

• Mean

• variance

– Constant

• Name

• Value

randomgenerators example

• <randomgenerators runNumber = "$runNumber" seed =

"123456" >

<exponential name = "exp1" mean = "1.0" limit

= "100.0" />

<uniform name = "uni1" min = "0.0" max =

"1.0" />

<normal name = "norm1" mean = "0.0" variance = "1.0" />

<constant name = "const1" value = "0.0" />

</randomgenerators>

Topology Element

• Attributes

– autoIPV4

– GODRouting

– NIXRouting

– autoIPV4Base

– autoIPV4mask

• Subelements

– Queue element

– P2plink element

– Node element

– Connect p2p

– Dumbbell

Applications Element

• Subelements

– Onoff

– Constantbitrate

– Bulksend

Statistics Element

• Log subelement, attributes:

– Repeat

– Name

– Stat

– At

– Frequency

• Example:

<log repeat = "10" name = "sinkRx" stat =

"$packetsinkapp$0$totalBytesRx" at = "1.0" frequency =

"1.0" />

Problems with this Approach

• Windows!

– The vast majority of teaching faculty use windows. We will have to have a windows versio

• John Abraham has already ported most of ns-3 to the win32 API

• Animation!

– Not only topology and packets, but various metrics (queue occupancy, sequence number for TCP, etc)

• Still need detailed understanding of how ns-3 pieces fit together

• Lack of “real-time” statistics (ie. Queue occupancy over time as simulation is running).

• Requires new code in ns3xml for each release (with new topology, applications, queues, etc).

Alternative Approaches

• Drag and drop GUI

– Still need some “save file format”, so perhaps the drag and drop GUI could produce ns3xml format.

• Pre-compile many “scenarios” and use command line arguments for setting independent variables.

– Presupposes we an predict in advance all possible teaching scenarios. Seems unlikely

Summary

• Ns3xml is still work in progress

• Usefulness and ease of use in the classroom is yet to be demonstrated

• Proof is in the pudding.

– We will monitor when and if other teaching faculty download and use ns3xml

Download