Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
23 views8 pages

Paper I

The document discusses the development of a Trace Analyzer for NS3, an open-source network simulator used for research and education. It highlights the challenges of analyzing NS3 trace files and presents a Java-based tool that simplifies the extraction of network performance metrics such as throughput and packet delivery ratio. The paper outlines the architecture of the analyzer, its graphical user interface, and its potential for future enhancements to improve user experience.

Uploaded by

aranyaamzon17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

Paper I

The document discusses the development of a Trace Analyzer for NS3, an open-source network simulator used for research and education. It highlights the challenges of analyzing NS3 trace files and presents a Java-based tool that simplifies the extraction of network performance metrics such as throughput and packet delivery ratio. The paper outlines the architecture of the analyzer, its graphical user interface, and its potential for future enhancements to improve user experience.

Uploaded by

aranyaamzon17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/342436725

Trace Analyzer for NS3

Article · June 2020

CITATIONS READS

5 3,567

4 authors, including:

Uma R Pujeri
Dr. Vishwanath Karad MIT World Peace University
6 PUBLICATIONS 19 CITATIONS

SEE PROFILE

All content following this page was uploaded by Uma R Pujeri on 20 November 2020.

The user has requested enhancement of the downloaded file.


Trace Analyzer for NS3
Uma R Pujeri, V Palaniswamy

Trace Analyzer for NS3


Mrs Uma R Pujeri, 2Dr V Palaniswamy
1

Anna University Chennai, [email protected]


1, First Author
*2,Corresponding Author
Anna University Chennai, [email protected]

Abstract
NS3 is an open source Network Simulator used in research and educational feild.NS3 is an open
source free software freely and publicly available for research and development. It is licensed under
GNU GPLv2 license. The main aim of this NS3 project is to give network researchers the open
simulation environment to test their network protocols so that these protocols gives same performance
in the real time screnario.Ns3 is developed by Tom Henderson, George, Sally Floyd and Sumit Roy.
The team received funding from US National Science Foundation(NSF) for the development of NS3.
NS3 is written from the scratch in c++ programming language. Waf build systems and framework for
generating Python bindings are contributed by Gustavo Carneiro.
Today NS3 is used by many researchers to perform their research in networking filed. Journals like
IEEE, ACM, IJCA etc accepts the result simulated using NS3 simulator. New protocol can be written
and tested in NS3 by using c++ language with an extension of .cc, after compiling these .cc files NS3
generates .pcap file and .tr files. These .tr files generated by the NS3 can be analyzed to get the
throughput, delay, jitter, packet delivery ratio for new protocol developed. Trace file format of NS3 is
totally different from that of trace format of NS2. In this paper a new trace file analyzer is developed
using Java so that researcher can spend much of his time and efforts in developing a new protocol than
analyzing a trace file. This paper also discussed the trace file format of NS3.Similar project called
tracemetric is developed but it is not installed correctly on every machine and is not able to read the .tr
file takes too long.

Keywords: NS3, NS2,throughput, pdf, delay, packets sent, packet received, packets dropped

1. Introduction
Computer Network plays a prominent role in our lives. Can you imagine a world without e-mails,
blogs, educational tutorials, online railways reservation, online shoppings, online examination and the
lists goes on. Sender sends the data which received by the receiver should require less delay and give
high throughput. There are many application on the networks, few application require voice over IP,
few application video on demand, few application requires video streaming providing the real time data
depending requirement of the application makes IPQos(Quality of service ) paramount. Important
parameters that would influence a network’s IP-QoS are throughput, delay, jitter and packet loss.
Many researchers have written their own protocol and tested them on different network simulator to
test the performance of the new network protocol against the existing protocol.
Opnet,OmNet++,JSIM,Glomosim,NS2,NS3 are the network simulators used to simulate and test
the new protocol.NS2 and NS3 on simulation generates the .tr file which is called as trace file. Now the
data has to be extracted from this .tr file to find the network performance parameter metrics. The trace
file format of NS2 and NS3 are totally different. Extracting data from NS3 trace file is more difficult
than NS2 trace file. Awk script or perl script are written to extract the exact data from the column of .tr
file to calculate the performance. Graph can be plotted by this extracted through .awk or perl script in
gnuplot.
In this paper we have developed NS3 trace analyzer which read the .tr file and automatically
calculates network performance parameters like throughput,packet delivery ratio, packet drop, packet
sent,packet received. It makes post-processing of .tr file very easy. This NS3[1][11][12] was developed
with the intension that the researchers can solely focus in design and development of new protocol than
wasting much of his/her time in analyzing the .tr file.
In our paper Section -2 gives a brief introduction about using of NS-3 simulator, Section-3
describes the trace file format of NS3 in detail, Section-4 describes the development of NS-3 Trace

Advances in Information Sciences and Service Sciences(AISS) 61


Volume7, Number5, October 2015
Trace Analyzer for NS3
Uma R Pujeri, V Palaniswamy

analyzer, network performance parameters and finally Section concludes the paper and also discusses
about future improvement which can make NS3 more user friendly.

2. Using NS3
NS3 is a powerful network simulator which is being used by researchers to perform the research
today.NS3 has a set of network simulation models implemented in C++ and wrapped in Python. User
program written in C++ or Python uses library which instantiates a set of simulation models to set up
the simulation scenario, enters the simulation main loop, and exits when the simulation is completed.
User writes a new protocol using C++ in NS3. After compiling this file NS3 stores the results
in .pcap files or .tr files. NS3 tracing of a file can be done in two ways
[1] Ascii tracing[13][14]: AsciiTraceHelper that is associated to a NetDevice object is used to
create .tr file like that was created in NS2. Note that the trace file format of NS2 and NS3 are
completely different.
[2] Pcap tracing[13][14]: This generates .pacap files which can be analysed in wireshark or tcpdump.
Wireshark is a GUI application but tcpdump shell command are used to analyze a file.
As discussed above .pcap file are analyzed in wireshark but .tr files generated by AsciiTraceHelper
are very big and .awk scripts or perls scripts are used to extracts the required data from these files to
get the performance metrics of the protocol like throughput,delay, pdf etc. Trace file format of NS3 is
totally different from that of NS2.Extracting the data from the NS3 trace file needed some additional
operations to be performed on the trace file. We developed simple NS3 trace file analyzer in lava that
reads the NS3 .tr file and gives throughput,delay, pdf etc.

3. NS3 Trace File


The trace data in NS3 trace file is in ASCII code and is organized in 12 fields which are discussed
below. The figure 3-A shows the format of the ns3 packet trace.
Where

Event: Every NS3 trace file starts file an event descriptor which can either +, -, d or r where
+ indicates a packet was enqueued.
- indicates a packet was dequeued.
d indicates a packet was dropped.
r indicates a packet was received.

Time: Next field in the NS3 file is time which indicates the time at which event occurred.
From: Starting node for the link on which event has occurred.
To: Ending node for the link on which event has occurred.
Type: Type indicates type of packets
Size: Size indicates size of packets in bytes.
Flags: ignore
Class: The class of the packet, which can be used to identify particular tcp connection.
Source: Source address
Destination: Destination address.
Seq: Sequence Number of the packet
Id: Identifier of the packet.
Sample of NS3 trace file is showed in figure 3-B

4. Development of NS3 Trace Analyzer.


The NS3 trace analyzer is developed on Ubuntu platform in Java. This trace analyzer analyzes the
NS3 trace file. Trace file format of NS3 is totally different from that of NS2. NS3 trace file is composed
of both text and number suppose we want to read the packet id alone from the trace file from a
particular column it gives ns3::TcpOptionTS(9994;9979) similarly for packet size etc hence some
operations are performed on the .tr file to extract the required value from the NS3 trace file.

62
Trace Analyzer for NS3
Uma R Pujeri, V Palaniswamy

4.1 Archiecture of NS3 Trace Analyzer


Architecture of NS3 trace analyzer can be divided into three parts. Read layer, Process layer and
then Presentation layer. Read layer reads the NS3 file, compile .cc file generate .tr file. Process layer
does the text Processing of the .tr files. Awk scripts or perl scripts are used to extract the data from .tr
file column by column. Required data is filtered column wise to calculate throughput, delay, packet
delivery ratio, jitter etc. NS3 Trace analyzer automatically does the processing like data extraction
from .tr file calculation of performance parameters so that it is viewed in the presentation layer.
Presentation layers displays the results and generates graphs.
Architecture of NS3 Trace Analyzer is shown in figure 4.1-A

4.2 Performance Parameters

Network Performance refers to measures of quality of service like bandwidth, throughput, delay,
jitter, error etc. NS3 Trace Analyzer has considered following performance parameters they are
 Packet Sent
 Packet Received
 Packet Dropped
 Packet delivery ratio
 Throughput
Packet Sent : Number of Packets sent by the source node
Packet Sent is calculated by following formula
Ps – Let Ps be number of packet sent
initially Ps=0;
event – Gets the first column of the tr file
here + refers packets enqueued (trace file format of NS3)
if(event == ' +')
Ps=Ps+1

Packet Received : Number of Packets received by the destination node


Packet Received is calculated by following formula
Pr-Let Pr be number of packet received
initially Pr=0;
event – Gets the first column of the tr file
here r refers packets received (trace file format of NS3)
if(event == ' r')
Pr=Pr+1
Packet Dropped : Number of Packets dropped
Packet dropped is calculated by following formula
Ds – Let Ds be number of packet received
initially Ds=0;
event – Gets the first column of the tr file
here d refers packets dropped (trace file format of NS3)
if(event == 'd ')
Ds=Ds+1
Packet Delivery Ratio: Packet Delivery Ratio (PDF) is ratio of number of packets delivered to the number of
packets received
Pdf is calculated by formula
Let pdf be the packet delivery ratio
pdf=(Pr/Ps)*100
Throughput: Throughput is number of packets sent per unit time. Throughput is measured in bits per second.
Throughput is calculated as
Let Tr be throughput
Tr=(Pr*100)/time

63
Trace Analyzer for NS3
Uma R Pujeri, V Palaniswamy

4.3 Graphical User Interface of NS3 Trace Analyzer

NS3 trace analyzer is designed in Java. NS3 trace analyzer has three tab. First tab is used to open
and save your .tr file. The second tab is used to generate graphs. The third tab will display the result
that is the network performance parameter like throughput, pdf,packet received, packet dropped. At the
command prompt user can also see .tr file being read.
GUI screen shot are shown in figure 4.3-A, 4.3-B, 4.3-C.

5. Conclusion and Future Work


NS3 trace analyzer was developed with the goal to reduce the analyzing time required for .tr file of
NS3. Trace file format of NS3 is totally different from that of NS2. Extracting the required data from
the .tr file is difficult since the string should separated with space to get only values required for
calculating performance metrics. Since it is developed in Java it can run on both windows as Linux
platform team required lot of time to understand this .tr file of ns3 and then to extract the exact values
from the file for the calculation of network performance metrics. With the aim that researcher can
solely contribute in development and testing of a new protocol this tool is being developed. This tool
can be further developed by adding more network parameters making it more user friendly.

6. Figures and Screen Shots

Phython application
C++ Application

Phython

Wrapper MODELS

CORE

STL

Figure 2-A. Program binding of NS3

64
Trace Analyzer for NS3
Uma R Pujeri, V Palaniswamy

Wireshark
tool

NS3
Program .cc .pcap file
file
Awk or
perl scripts

.tr file Gnuplot


for graph

NS3 Simulation Process

Figure 2-B. NS3 Simulation Process

Event Time From To Type Size Flags Class Source Dest Seq Id

Figure 3-A. NS3 Trace File Format

Figure 3-B. NS3 Sample Trace File Screen Shot

65
Trace Analyzer for NS3
Uma R Pujeri, V Palaniswamy

Display Result Graphs Presentation


Layer
Process Trace File Process Layer

Read Trace File Read Layer

NS3 Trace Analyzer

IV-A-1 NS3 TRACE ANALYZER LAYERS

IV-C-1 GUI SCREEN SHOT 1

IV-C-2 GUI SCREEN SHOT 2

66
Trace Analyzer for NS3
Uma R Pujeri, V Palaniswamy

IV-C-3 GUI SCREEN SHOT 2

6. References
[1] NS3 MANUAL https://www.nsnam.org/docs/manual/ns-3-manual.pdf
[2] Java Tutorial http://www.tutorialspoint.com/java/
[3] Trace Analyzer for NS2 by Aliff Umair Salleh, Zulkifli Ishak , Norashidah Md. Din, Md Zaini Jamaludin in
4 th Student Conference on Research and Development (SCOReD 2006), Shah Alam, Selangor, MALAYSIA,
27-28 June, 2006[4]
[4] Mohit P. Tahiliani http://mohittahiliani.blogspot.in/
[5] NS2 by example http://nile.wpi.edu/NS
[6] Trace metrics a trace analyzer for NS3 http://www.tracemetrics.net/
[7] The Awk tutorial http://www.grymoire.com/Unix/Awk.html
[8] NS2 simulator course for beginners http://www-sop.inria.fr/members/Eitan.Altman/ns.htm
[9] The Awk manual http://www.staff.science.uu.nl/~oostr102/docs/nawk/nawkA4.pdf

[10] Ns2 by example http://nile.wpi.edu/NS/


[11] https://www.nsnam.org/
[12] https://www.nsnam.org/docs/tutorial/html/introduction.html#about-ns3
[13] https://www.nsnam.org/docs/manual/html/tracing.html
[14] https://www.nsnam.org/docs/release/3.9/tutorial/tutorial_23.html
[15] https://www.nsnam.org/docs/manual/html/tracing.html#id1
[16] Survey of End-to-End TCP Congestion Control Protocols Volume III, Issue IV, April 2014 IJLTEMAS
ISSN 2278 – 2540 Mrs Uma R Pujeri, Dr V Palaniswamy
[17] Survey of Various Open Source Network Simulators International Journal of Science and Research (IJSR)
ISSN (Online): 2319-7064 Impact Factor (2012): 3.358 Mrs Uma R Pujeri, Dr V Palaniswamy

67

View publication stats

You might also like