Skip to main content

Posts

AWK and NS2 Tracefile | NS2 Tutorial 3

AWK Awk is abbreviated from the names of the developers – Aho, Weinberger, and Kernighan . Awk is a scripting language used for manipulating data and generating reports. The awk command programming language requires no compiling and allows the user to use variables, numeric functions, string functions, and logical operators. AWK is one of the most prominent text-processing utilities on GNU/Linux. It is very powerful and uses a simple programming language. Awk is a utility that enables a programmer to write tiny but effective programs in the form of statements that define text patterns that are to be searched for in each line of a document and the action that is to be taken when a match is found within a line. 1. AWK Operations: (a) Scans a file line by line (b) Splits each input line into fields (c) Compares input line/fields to pattern (d) Performs action(s) on matched lines 2. AWK Useful For: (a) Transform data files (b) Produce formatted reports Syntax: $ awk options 'selection ...

Installation of NS2 in Ubuntu 22.04 | NS2 Tutorial 2

NS-2.35 installation in Ubuntu 22.04 This post shows how to install ns-2.35 in Ubuntu 22.04 Operating System Since ns-2.35 is too old, it needs the following packages gcc-4.8 g++-4.8 gawk and some more libraries Follow the video for more instructions So, here are the steps to install this software: To download and extract the ns2 software Download the software from the following link http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download Extract it to home folder and in my case its /home/pradeepkumar (I recommend to install it under your home folder) $ tar zxvf ns-allinone-2.35.tar.gz or Right click over the file and click extract here and select the home folder. $ sudo apt update $ sudo apt install build-essential autoconf automake libxmu-dev gawk To install gcc-4.8 and g++-4.8 $ sudo gedit /etc/apt/sources.list make an entry in the above file deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe $ sudo apt update Since, it...

Introduction to Network Simulator 2 | NS2 Tutorial 1

Introduction to Network Simulator 2 NS2 stands for Network Simulator Version 2. It is an open-source event-driven simulator designed specifically for research in computer communication networks. Network Simulator (Version 2), is simply an event-driven simulation tool that has proved useful in studying the dynamic nature of communication networks. Simulation of wired as well as wireless network functions and protocols (e.g., routing algorithms, TCP, UDP) can be done using NS2. In general, NS2 provides users with a way of specifying such network protocols and simulating their corresponding behaviors. Due to its flexibility and modular nature, NS2 has gained constant popularity in the networking research community since its birth in 1989. Ever since, several revolutions and revisions have marked the growing maturity of the tool, thanks to substantial contributions from the players in the field. Among these are the University of California and Cornell University which developed the REAL ne...

P2P network Simulation using NS3 | NS3 Tutorial

In this post, we are going to see how to define and design a p2p network between two wired nodes with a decent bandwidth and delay. Here is the problem statement.  NS3 will be used to simulate the network Tools required: NS3  Tracemetrics (for measuring throughput) NetAnim (for Animation) Gnuplot (for plotting the characteristics) Complete Instructions are available in the video  Problem Statement: Design two wired nodes that can connect to each other through a point-to-point network that handles a data rate of 50mbps and a delay of 5ms. The first node acts as a server and the second node acts as a client and they exchange at least 10 packets in a total simulation time of 20 seconds. The maximum packet size is 1024 bytes and 512 bytes. Plot the throughput of each node for the above packet sizes. (Use any charting solution you are comfortable with). NS3 already had this file in the name as first.cc which is located at  ~ns-3.38/examples/tutorial/ Copy the above file...

Netsimulyzer - a 3D visualizer for Network Simulator 3

Netsimulyzer - 3D visualizer Netsimulyzer is a third-party software that can show the visuals of the ns3 output in a 3D virtual world. we can make the nodes look either like land drones, drones, smartphones, etc. We can construct buildings, towers, antennas, etc within the visualizer and the movement of the nodes can be simulated as well.  Here is the screenshot of a simulation generated using ns3 and shown in the Netsimulyzer.  This post will help you to understand and install Netsimulyzer in Ubuntu 22.04 and add a module to support ns3 in generating the Netsimulyzer JSON file. Netsimulyzer Installing Netsimulyzer in Ubuntu and NS3 Prerequisites Ubuntu 22.04 OS ns-3.38 Netsimulyzer version 1.0.7  There are older versions also available for other distributions of ubuntu., but we will focus on these versions Steps for installation: ns-3.38 along with Netsimulyzer module to be installed. Netsimulyzer software to be installed on Ubuntu 22.04 (the software can be installed ...

Installation of ns3 in Ubuntu 22.04 | NS-3.38

Installation of ns3 in Ubuntu 22.04 In this post, we are going to install ns3.38 in Ubuntu 22.04 OS After the fresh installation of Ubuntu, perform the following command to run the updates  Prerequisites: Download ns-3.38 from the following link ( https://www.nsnam.org/releases/ns-allinone-3.38.tar.bz2 ) Fresh installation of Ubuntu 22.04  For complete instructions, follow the video Step 1:  Install the basic requirements Open a terminal and just copy and paste the following two lines into a terminal and install it. It will take some time to complete the full process. $ sudo apt update $ sudo apt install g++ python3 cmake ninja-build git gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 tcpdump wireshark sqlite sqlite3 libsqlite3-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev doxygen graphviz imagemagick python3-sphinx dia imagemagick texlive dvipng latexmk texlive-extra...

SUMO Emission of Vehicles | VANETs

Emission of Gases by Vehicles using SUMO In this post, we will be discussing how floating cars can emit gases namely  Carbon Monoxide (CO) Carbon Dioxide (CO2) Hydro Carbons (HC) Particle Matter (PMx) Nitrous Oxide (NOx) SUMO generates this emission of gases based on the EU4 norms. How to capture these gases in our simulation?  The following video contains complete information Prerequisites 1. SUMO to be installed in Ubuntu  ( SUMO installation ) 2. Python3 to be installed 3. Knowledge of XML files The following is the image of the road design I have created,  there are a totally of 6 junctions ( 0 to 5) and two edges from one junction to another intersection (each edge has two lanes). All the junctions are priority junctions except 2 and 5. These junctions are traffic light junctions. Custom road design in SUMO We are going to design a custom road.  In our machine, I will store all the files in a folder called  /home/pradeepkumar/customroad Step 1: Creat...