Skip to main content

Greedy Perimeter Stateless Routing (GPSR) protocol in ns3


GPSR - Greedy Perimeter and Stateless Routing

Please watch the following video for Full details.


VANETs - Vehicular Adhoc NEtworks.

PA GPSR, MM GPSR and GPSR.

Under and post graduate - You can use the modules as it is and compare these protcols for VANETs.

If you are a PhD scholar, you can modify the protocols and design your own GPSR alternatives.

In this video, we will be seeing the installation of GPSR and some source codes.

ns-3.27 which i could not succeed, So I prefer going to ns-3.23

we can both multiple version of ns3. I am going to run ns-3.23 for GPSR and other simulations with ns-3.27 and ns-3.29

Welcome to the Installation.

If you are installing ns3 for the first time, install the following packages.

(You can copy paste)

$] sudo apt install build-essential autoconf automake libxmu-dev  python-pygraphviz cvs mercurial bzr git cmake p7zip-full python-matplotlib python-tk python-dev python-kiwi python-gnome2 python-gnome2-dev qt4-dev-tools qt4-qmake qt4-qmake qt4-default gnuplot-x11 wireshark default-jdk


We will download the ns3.23 package. Better that you may use the commands one by one as given below.

$] wget -c http://www.nsnam.org/release/ns-allinone-3.23.tar.bz2

$] tar xjvf ns-allinone-3.23.tar.bz2

$] cd ns-allinone-3.23/

The following are the commands to copy the PA GPSR folder to ns3 folders. I have shown how to copy in GUI.

$] cp -a PA-GPSR/src/. ns-3.23/src/

$] cp -a PA-GPSR/examples/. ns-3.23/scratch/

$] cp -a PA-GPSR/results/ ns-3.23/

$] cp -a PA-GPSR/figures/ ns-3.23/

$] cp -a PA-GPSR/scripts/ ns-3.23/

$] cp PA-GPSR/main.sh ns-3.23/

Installation of ns3.23 along with GPSR protocol. 

Open a Terminal

$] cd ns-allinone-3.23/ns-3.23

$] CXXFLAGS="-Wall -std=c++0x" ./waf configure --enable-examples

I got some error

$] ./waf

$] sudo ./waf install

Installation of GPSR and their alternatives is done.

To execute an example

We have already have a file in the scartch folder.

Just for installation of GPSR protocol.

Thanks for watchign my Channel

Please subscribe and share it to your friends.

https://www.nsnam.com





Subscribe to My Youtube Channel - Engineering Clinic

Comments

  1. Dear,
    I flowed all the steps.
    In the folder PAgpsr , I found one subfolder called " .git " so I don't no if I have to copy also this subfolder in nS3 along with figures, results, scripts, main.sh. So, I copied this subfolder with the 4 subfolders. And, I run.
    CXXFLAGS, ./waf, sudo ./waf install

    But I get an error (see below).
    Please help me to solve the problem


    - install /usr/local/include/ns3.23/ns3/core-module.h (from build/ns3/core-module.h)
    + install /usr/local/include/ns3.23/ns3/csma-layout-module.h (from build/ns3/csma-layout-module.h)
    - install /usr/local/include/ns3.23/ns3/csma-module.h (from build/ns3/csma-module.h)
    ../scratch/pagpsr-main.cc: In constructor ‘GpsrExample::GpsrExample()’:
    ../scratch/pagpsr-main.cc:93:15: warning: ‘GpsrExample::algorithm’ will be initialized after [-Wreorder]
    93 | std::string algorithm;
    | ^~~~~~~~~
    ../scratch/pagpsr-main.cc:92:8: warning: ‘bool GpsrExample::newfile’ [-Wreorder]
    92 | bool newfile;
    | ^~~~~~~
    ../scratch/pagpsr-main.cc:127:1: warning: when initialized here [-Wreorder]
    127 | GpsrExample::GpsrExample () :
    | ^~~~~~~~~~~
    ../scratch/pagpsr-main.cc:98:12: warning: ‘GpsrExample::nPairs’ will be initialized after [-Wreorder]
    98 | uint32_t nPairs;
    | ^~~~~~
    ../scratch/pagpsr-main.cc:77:15: warning: ‘std::string GpsrExample::phyMode’ [-Wreorder]
    77 | std::string phyMode;
    | ^~~~~~~
    ../scratch/pagpsr-main.cc:127:1: warning: when initialized here [-Wreorder]
    127 | GpsrExample::GpsrExample () :
    | ^~~~~~~~~~~
    ../scratch/pagpsr-main.cc: In member function ‘void GpsrExample::Run()’:
    ../scratch/pagpsr-main.cc:320:33: warning: variable ‘t’ set but not used [-Wunused-but-set-variable]
    320 | Ipv4FlowClassifier::FiveTuple t=classifier->FindFlow(i->first);
    | ^
    ../scratch/pagpsr-main.cc: In member function ‘void GpsrExample::InstallInternetStack()’:
    ../scratch/pagpsr-main.cc:416:15: warning: unused variable ‘dst_c’ [-Wunused-variable]
    416 | char const *dst_c = dst_s.c_str();
    | ^~~~~
    ../scratch/pagpsr-main.cc:417:15: warning: unused variable ‘source_c’ [-Wunused-variable]
    417 | char const *source_c = source_s.c_str();
    | ^~~~~~~~
    Waf: Leaving directory `/home/doctoratas16/ns-allinone-3.23/ns-3.23/build'
    Build failed
    Traceback (most recent call last):
    File "/home/doctoratas16/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Runner.py", line 162, in start
    st=tsk.runnable_status()
    File "/home/doctoratas16/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Build.py", line 453, in runnable_status
    ret=super(inst,self).runnable_status()
    File "/home/doctoratas16/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Task.py", line 289, in runnable_status
    new_sig=self.signature()
    File "/home/doctoratas16/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Task.py", line 274, in signature
    self.sig_explicit_deps()
    File "/home/doctoratas16/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Task.py", line 327, in sig_explicit_deps
    raise Errors.WafError('Missing node signature for %r (required by %r)'%(x,self))
    WafError: Missing node signature for /home/doctoratas16/ns-allinone-3.23/ns-3.23/build/src/fd-net-device/ns3.23-tap-device-creator-debug (required by
    {task 140658800166352: inst ns3.23-tap-device-creator-debug -> })


    ReplyDelete
  2. Many thanks sir for uploading this video. I am a big fan of your working.
    hats off to you sir.

    Pawan Singh
    Assistant Professor
    IGNTU Amarkantak

    ReplyDelete
  3. @NS_DOC did you rectified the issue if so do mention i too am troubled and need proper solution.

    ReplyDelete
  4. Dear Sir
    I am getting the following error while executing this command on ubuntu 20.04 version
    please help me to solve this problem.

    user1@HP:~/ns-allinone-3.23/ns-3.23$ ./waf --run scratch/pagpsr-main
    Waf: Entering directory `/home/user1/ns-allinone-3.23/ns-3.23/build'
    Waf: Leaving directory `/home/user1/ns-allinone-3.23/ns-3.23/build'
    'build' finished successfully (14.308s)
    Traceback (most recent call last):
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 155, in run_commands
    run_command('shutdown')
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 146, in run_command
    ctx.execute()
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 84, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 125, in recurse
    user_function(self)
    File "/home/user1/ns-allinone-3.23/ns-3.23/wscript", line 926, in shutdown
    out = open(build_status_file, 'w')
    IOError: [Errno 13] Permission denied: '/home/user1/ns-allinone-3.23/ns-3.23/build/build-status.py'
    .

    ReplyDelete
  5. Dear Sir
    i am getting the following error, kindly help me to solve this.
    I am working on ubuntu 20.04.

    user1@HP:~/ns-allinone-3.23/ns-3.23$ ./waf --run scratch/pagpsr-main
    Waf: Entering directory `/home/user1/ns-allinone-3.23/ns-3.23/build'
    Waf: Leaving directory `/home/user1/ns-allinone-3.23/ns-3.23/build'
    'build' finished successfully (14.308s)
    Traceback (most recent call last):
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 155, in run_commands
    run_command('shutdown')
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 146, in run_command
    ctx.execute()
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 84, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
    File "/home/user1/ns-allinone-3.23/ns-3.23/.waf-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 125, in recurse
    user_function(self)
    File "/home/user1/ns-allinone-3.23/ns-3.23/wscript", line 926, in shutdown
    out = open(build_status_file, 'w')
    IOError: [Errno 13] Permission denied: '/home/user1/ns-allinone-3.23/ns-3.23/build/build-status.py'

    ReplyDelete

Post a Comment

Popular posts from this blog

Installing ns3 in Ubuntu 22.04 | Complete Instructions

In this post, we are going to see how to install ns-3.36.1 in Ubuntu 22.04. You can follow the video for complete details Tools used in this simulation: NS3 version ns-3.36.1  OS Used: Ubuntu 22.04 LTS Installation of NS3 (ns-3.36.1) There are some changes in the ns3 installation procedure and the dependencies. So open a terminal and issue the following commands Step 1:  Prerequisites $ sudo apt update In the following packages, all the required dependencies are taken care and you can install all these packages for the complete use of ns3. $ sudo apt install g++ python3 python3-dev pkg-config sqlite3 cmake python3-setuptools git qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3 libsqlite3-dev  libxml2 libxml2-dev libc6-dev libc6-dev-i386 libc...

Installation of NS2 (ns-2.35) in Ubuntu 20.04

Installation of NS2 (ns-2.35) in Ubuntu 20.04 LTS Step 1: Install the basic libraries like      $] sudo apt install build-essential autoconf automake libxmu-dev Step 2: install gcc-4.8 and g++-4.8 open the file using sudo mode $] sudo nano /etc/apt/sources.list Include the following line deb http://in.archive.ubuntu.com/ubuntu bionic main universe $] sudo apt update $] sudo apt install gcc-4.8 g++-4.8 Step 3:  Unzip the ns2 packages to home folder $] tar zxvf ns-allinone-2.35.tar.gz $] cd ns-allinone-2.35/ns-2.35 Modify the following make files. ~ns-2.35/Makefile.in Change @CC@ to gcc-4.8 change @CXX@ to g++-4.8 ~nam-1.15/Makefile.in ~xgraph-12.2/Makefile.in ~otcl-1.14/Makefile.in Change in all places  @CC@ to gcc-4.8 @CPP@ or @CXX@ to g++-4.8 open the file: ~ns-2.35/linkstate/ls.h Change at the Line no 137  void eraseAll() { erase(baseMap::begin(), baseMap::end()); } to This void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); } All changes ...

Simulation of URDF, Gazebo and Rviz | ROS Noetic Tutorial 8

Design a User-defined robot of your choice (or you can use the URDF file) and enable the LIDAR Scanner so that any obstacle placed on the path of the light scan will cut the light rays. Visualize the robot in the Gazebo workspace, and also show the demonstration in RViz.   (NB: Gain knowledge on wiring URDF file and .launch file for enabling any user-defined robot to get launched in the gazebo platform.) SLAM : One of the most popular applications of ROS is SLAM(Simultaneous Localization and Mapping). The objective of the SLAM in mobile robotics is to construct and update the map of an unexplored environment with the help of the available sensors attached to the robot which will be used for exploring. URDF: Unified Robotics Description Format, URDF, is an XML specification used in academia and industry to model multibody systems such as robotic manipulator arms for manufacturing assembly lines and animatronic robots for amusement parks. URDF is especially popular with users of the ...