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 ns-3.34 in Ubuntu 20.04

This post shows how to install ns 3.34 in Ubuntu 20.04 LTS Prerequisites: Fresh installation of Ubuntu Version 20.04 LTS  ns3.34 can be downloaded from here Follow the video link for complete step by step instructions on the installation.  This version fixes the compilation issues of vanet-routing-compare.cc (bug in ns3.33)  Issue the following commands after opening a terminal  $ sudo apt update $ sudo apt install g++ python3 python3-dev python-dev pkg-config sqlite3 python3-setuptools git qt5-default 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 openmpi-bin openmpi-common openmpi-doc libopenmpi-dev tcpdump wireshark libxml2 libxml2-dev Unzip or untar the ns-allinone-3.34.tar.bz2 in the home folder (in my case its /home/pradeepkumar) $ cd ns-allinone-3.34/ $ ./build.py --enable-examples --enable-tests  Once the installation is completed, you may get an output show

Installation of ns3 in Windows 10 and Windows 11 OS using WSL (Windows Subsystem for Linux)

This post shows how to install ns-3.33 in Windows 10 through WSL (Windows Subsystem for Linux) This posts works for Windows 11 also (I have tested it on a Windows 11 ISO and it works the Same way as mentioned in the following post.) This post will work for ns-3.3x version. Prerequisites : Install Windows Subsystem for Linux with GUI: Please refer the following video  System Information: OS used: Windows 10 and WSL (Ubuntu 20.04) GUI: XServer for Windows NS3 Version: ns-3.33 See the following complete video on how to install ns3 in Windows 10 Step 0 : Open XLaunch Step 1 :  Open WSL using PowerShell and open it as Administrator Command:/  wsl $ xfce4-session The GUI of Ubuntu Opens within Windows 10 OS. Step 2 : Download ns3 from nsnam.org website through Mozilla Firefox browser Step 3: Open a Terminal  $ sudo apt update $ sudo apt install build-essential autoconf automake libxmu-dev python3-pygraphviz cvs mercurial bzr git cmake p7zip-full python3-matplotlib python-tk python3-dev qt5-q

Installing NS-3.32 in Ubuntu 20.04

This is about installing ns version 3.32 in Ubuntu 20.04 LTS. #ns3 #ns3 .32 #networksimulation The commands used in the video are given here. $] sudo apt update $] sudo apt install build-essential autoconf automake libxmu-dev python3-pygraphviz cvs mercurial bzr git cmake p7zip-full python3-matplotlib python-tk python3-dev qt5-qmake qt5-default gnuplot-x11 wireshark Download the ns-allinone-3.32.tar.bz2 package from nsnam.org and copy it to /home/ folder See the full video for detailed instructions Extract it either in GUI or using command $] tar jxvf ns-allinone-3.32.tar.bz2 $] cd ns-allinone-3.32/ $] ./build.py --enable-examples --enable-tests The above command will take some time to install all the packages  You can see the output as shown below ns3 To check whether ns3 installed successfully, use the following commands. $] cd ns-3.32/ $] ./waf --run hello-simulator You should get the output as Hello Simulator $] ./waf --run first This is the example from the ns-3.32/exa