Skip to main content

Posts

Showing posts from December, 2011

MANET Routing Protocols using ns3

#AODV #OLSR #MANETs #DSDV #DSR

Download the Code here: 
https://drive.google.com/open?id=1OkVOsifjN9UfQjPGvfR7OuS-x_GBRgCV

Check the Video for Detailed instruction and how to use the plots, graphs and source code.


Comparison of MANET routing Protocols 1. AODV
2. DSDV
3. DSR
4. OLSR
using NS3 (Network Simulator 3)
B.Tech, M.Tech, PhD...
1. Reactive Vs Proactive routing
2. PErformance comparison of MANET protocols
3. AODV Vs DSDV Comparison

https://www.nsnam.com and also at my channel.

What Version: ns-3.29
My Ubunut OS is: Ubuntu 18.04

This file we are going to use for our simulation:
/home/networks/ns-allinone-3.29/ns-3.29/examples/routing/manet-routing-compare.cc

Once you under stand the code, now lets run this example

Step 1: Copy the above file in to ~ns-3.29/scratch/ folder

Step 2: Understand this code.
Step 3: Run this code
Open the terminal, Go to ns-3.29 and run the following command

$] ./waf --run scratch/manet-routing-compare

enable the following header file

#include "ns3/flo…

Finding the Node Position, speed and Velocity of a Node while using AODV

Finding the Node Position, speed and Velocity of a Node while using AODVSteps
1. ~ns-2.34/aodv/aodv.h
include the following header line in aodv.h
1: #include<mobilenode.h> 2.In protected scope declare the variables you would be using to store the node parameters.


1:double xpos; 2:double ypos; 3:double zpos; 4:double iEnergy; 5:int node_speed; 6: MobileNode *iNode; 7: FILE *fp;
3.In aodv.cc initialize the declared variables.

1: xpos = 0.0; 2: ypos = 0.0; 3: zpos = 0.0; 4: node_speed = 0; 5: iEnergy=0.0;

Promiscuous Mode in AODV (ns 2.34)

In a network, promiscuous mode allows a network device to intercept and read each network packet that arrives in its entirety. This mode of operation is sometimes given to a network snoop server that captures and saves all packets for analysis (for example, for monitoring network usage). Its often used to
monitor network activityFiles to be changed
1. ~ns-2.34/aodv/aodv.h
2. ~ns-2.34/aodv/aodv.cc
3. ~ns-2.34/lib/tcl/ns-mobilenode.tcl1. Make AODV agent a child class of Tap (you should have a member function tap), and define the Mac variable 1:#include <mac.h> 2:class AODV: public Tap, public Agent { 3:public: 4:void tap(const Packet *p); 5: ...... 6:protected: 7: Mac *mac_; 8: ...... 9: }
2. Modify aodv/aodv.cc
Define TCL command "install-tap" and implement AODV::tap()


1:int AODV::command(int argc, constchar*const* argv) { 2: 3: ...... 4: 5:elseif(argc == 3) {

Network Simulators for Education and Research

There are various real hardware tools and emulators are available in the market for measuring the performance of a network, wireless network. But one cannot invest much in terms of money and time. Hence there should be some tools that helps the researchers to do their research to measure the performance and find the results. Here are some of the tools that are free and easily avaialble to everyone at the cost of Time (you need to invest time thats what a researcher is supposed to do)
1. Network Simulator 2 (NS2)
Link : http://www.isi.edu/nsnam/ns/
Ns is a discrete event simulator targeting for networking research. This simulator provides support for simulation of Wired networks like TCP, routing, and multicast protocols over wired and wireless  networks. In short it is called as NS2.
Languages Used: Tcl, OTcl, C++, Simple AWK Script to analyze the results (freely available in the web)
Pros:
It is free and Open Source Simulate almost any type of networks which are in great demand by …

Creating a New Agent in Network Simulator 2

How to create a new agent in NS2. You can use any version of the Simulator. The following codes will make you to understand the writing of a sample agent.Requirements:NS2 SimulatorA tcl file to test the compiled agentIf any two values are supplied from the TCL file, the agent computes the Surface area of the Cylinder which is nothing but (2* PI * r * h).  The supplied values from TCL file are r and h.How to do that.1. Copy the newagent.cc (given below ) file in ~ns-allinone-2.34/ns-2.34/newfolder
2. Make an entry in the ~ns-2.34/Makefile.in
    Make an entry in the OBJ_CC =
            newfolder/newagent.o \
3. in the shell prompt, go to ~ns-2.34 and give the command
./configure
make
4. run the file agent_new.tcl (given below)
you can see the outputHere is the C++ code to be written and compiled//Name of the file is newagent.cc and put it in a folder inside ~ns-2.34/newfolder/
#include <stdio.h>
#include <string.h>
#include "agent.h"
class TSPAgent : public Agent {
public:
  …