Skip to content

Greedy Perimeter Stateless Routing (GPSR) Extension for ns-3

Greedy Perimeter Stateless Routing (GPSR).

In [2], the authors present Greedy Perimeter Stateless Routing.

“It is a novel routing protocol for wireless datagram networks that uses the positions of routers and a packet’s destination to make packet forwarding decisions. GPSR makes greedy forwarding decisions using only information about a router’s immediate neighbors in the network topology. When a packet reaches a region where greedy forwarding is impossible, the algorithm recovers by routing around the perimeter of the region. By keeping state only about the local topology, GPSR scales better in per-router state than shortest-path and ad-hoc routing protocols as the number of network destinations increases. Under mobility’s frequent topology changes, GPSR can use local topology information to find correct new routes quickly. We describe the GPSR protocol, and use extensive simulation of mobile wireless networks to compare its performance with that of Dynamic Source Routing. Our simulations demonstrate GPSR’s scalability on densely deployed wireless networks.”[2]

An old version of GPSR implementation which is integrated with  ns-3 version 3.29 is readily available for download from[1]. This implementation is based on the code by António Fonseca[3]. For further details about this implementation, one may refer[2].

In this article, we try to compile this particular version of ns-3 under chroot jail.

One may understand the installation of chroot jail and even the installation of ns-3 under chroot jail by reading the following article[4] :

 

Installing ns3.35 in Debian 10 chroot Jail Under Debian 11 Host OS or any Version of Linux Host

 

Step 1: Download ns-2.29 which is having the gpsr module in it.

$ cd /home/your_home
$ git clone https://github.com/dwosion/ns3.29-with-gpsr.git

The above command will clone the repository under folder “ns3.29-with-gpsr”. Inside that folder, you will see  ns2.29 and the NetAnim visualization tool.

Step 2: Configuring ns-3

$ cd /home/your_home/ns3.29-with-gpsr/ns-3.29
$ ./waf configure

This command will configure the waf build system.

Step 3: Compiling ns-3

$ cd /home/your_home/ns3.29-with-gpsr/ns-3.29
$ ./waf 

This command will compile the ns3.29 which already contains gpsr module in it.

At the end of the successful compile process, we will see the built modules list.  You can see the gpst module that is in this list.

 

Step 4: Testing the working of GPSR module with an Example code

$ cd /home/your_home/ns3.29-with-gpsr/ns-3.29
$ ./waf –run gpsr-test1

 

 

$ cd /home/your_home/ns3.29-with-gpsr/ns-3.29
$ ./waf –run gpsr-test7

This will generate a topology  like the following :

 

The following gif animation shows the GPSR protocol in action:

 

 

Final Note

Of course, this particular version of GPSR may work well in 2D network topologies; because, that paper[2] only illustrates the algoritym with 2D graphs. So we may only try this on our normal 2D VANET  projects.  But, I am having doubts about using this on 3D network topologies; so using this module under 3D FANET/UAV. In such a case, it may need little changes to make it good under 3D topologies.

References

 

  1. https://github.com/dwosion/ns3.29-with-gpsr
  2. https://dl.acm.org/doi/10.1145/345910.345953
  3. https://codereview.appspot.com/5401042
  4. https://www.projectguideline.com/installing-ns3-35-in-debian-10-chroot-jail-under-debian-11-host-os-or-any-version-of-linux-host/

 

 

WhatsApp Discuss Through WhatsApp