Skip to content

Trace Analysis of ns-3 Ascii Traces using TraceMetrics Tool – An elementary Trace Analysis Solution for ns-3

TraceMetrics

 

TraceMetrics is a trace file analyzer for Network Simulator 3 (ns-3) and it is is an open-source software developed in Java. The main goal of this tool is to perform a quick analysis of the trace file produced by ns-3’s simulations and calculate useful metrics for research and performance measurement. This kind of tool is needed because a simulation may generate a trace file with thousands of lines, becoming difficult to analyze manually. Due to this, this tool can be handy in case someone needs a metric that the tool already supports.

The following Article shows the way of creating Event Traces from an ns-3 Simulaltion

Event Trace File Generation in a ns-3 Simulation

This tool can be downloaded from http://sourceforge.net/projects/tracemetrics/files/.

Step 1 : Download the zip file distribution from the sourceforge.net

 

Step 2: Extract the Zip file in a Folder  (ex: /home/TraceMetrics)

 

$mkdir /home/TextMetrics

Download and copy the file  tracemetrics-1.4.0.zip in that folder and then extract that zip file in that folder.

Now you will see a folder named lib and two files names tracemetrics.jar and README, TXT

 

The following is the content of that README.TXT file :

========================
BUILD OUTPUT DESCRIPTION
========================
When you build a Java application project that has a main class, the IDE automatically copies all of the JAR files on the project’s classpath to your projects dist/lib folder. The IDE also adds each of the JAR files to the Class-Path element in the application JAR files manifest file (MANIFEST.MF).To run the project from the command line, go to the dist folder and type the following:java -jar “tracemetrics.jar”
To distribute this project, zip up the dist folder (including the lib folder) and distribute the ZIP file.Notes:* If two JAR files on the project classpath have the same name, only the first JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder. If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the project’s classpath also has a Class-Path element specified in the manifest, the content of the Class-Path element has to be on the projects runtime path.
* To set the main class in a standard Java project, right-click the project node in the Projects window and choose Properties. Then click Run and enter the class name in the Main Class field. Alternatively, you can manually type the class name in the manifest Main-Class element.

Step 3 : Run the Java project as mentioned in that README.TXT file :

$cd /home/TextMetrics

$ java -jar “tracemetrics.jar”

It will open the user interface of TraceMetrics Tool.

 

 

Step 4: Select an Ascii trace file that was created by an ns-3 simulation.  Such as the one that is created in our previous experiment.

The trace file generated from a  simple UDP only network scenario is used in this example. That trace file  (“SimpleNS3Simulation_EventTraceOutput.tr”) was generated in our previous example :

 

Event Trace File Generation in a ns-3 Simulation

 

 

The TraceMetrics Interface will now show some of the details about the loaded trace file.

 

Step 5: Start the analysis by pressing the “Execute Button” And see the various trace analysis outputs from the given tabs

 

Tab 1: The Simulation Results

The first tab will show some of the general simulation parameters.

 

Tab 2: The Nodewise Statistics

The second tab will show some of the node-wise statistics of the two nodes involved in this simulation.

 

Tab 3: The Throughput and Goodput

The third tab will show the throughput and goodput of the two nodes involved in this simulation.

 

Tab 4: The Little’s results

The fourth tab will show Little’s results  Lambda and other related things of the two nodes involved in this simulation.

 

Tab 5: The Data Streamwise Statistics

The third tab will show data streamwise statistics of all the flows involved in the two nodes example network scenario,

 

 

So, for a simple UDP based network scenario, we can do this kind of elementary trace analysis. If the trace file is from a network simulation that used TCP traffic, then we can do a little more analysis from the outputs generated by this tool using the button Export TCP graphics button which was disabled in this UDP analysis scenario.  We may discuss that in our next post.

Summary :

In fact, TraceMetrics is an elementary trace analysis tool that can be used by a beginner to understand some of the basic aspects of trace analysis on a trace file output of the ns-3 simulation.

Of course, you can not complete your Ph.D level Research work only with this simple tool. Because you can not apply this tool to do any complex analysis on trace files. Further, it can not be used on multiple trace files that were generated by a batch of simulations commonly made for a Ph.D level research work.

Even though you can generate some simple bar charts and line graphs from the stream outputs generated by this tool, you can not prepare a typical complex analysis only by using this tool. So, a researcher who needs to do some genuine publication in a reputed journal, can not do a good paper with a colourful “results and discussion” section only by using the outputs generated from this tool. Still, a researcher needs a good skill set to prepare such quality outputs by doing some kind of custom trace analysis.

 

The following posts are related to trace Analysis :

 

Trace Analysis of TCP Flows Under ns-3 MANET/ FANET/ VANET/ WSN Scenario

Real-time Visualization of TCP cwnd, rtt, rto and ssthreshold Dynamics of a 3D FANET Scenario

 

An Elementary Research on UWSN using ns-2

 

 

WhatsApp Discuss Through WhatsApp