Simulations

INDEX

1. NS2 Install
1.1 Instructions
1.2 Download files
2. Patch ZRP
2.1 ZRP Code for NS2
2.2 Instructions
2.3 Downlaod Files
3. ZRP CODE (My Implementation)
3.1 ZRP Code (My Implementaion)
3.2 Instructions
3.3 Downlaod Files

Top

1. NS2 Install

1.1 Instructions

Follow the steps below to install NS2.
  1. Download NS-2(ns-allinone-2.33.tar.gz) [Download here]
  2. Put this file in the directory where you want to install NS-2.
  3. Unzip all the files using command: [tar -xvf ns-allinone-2.33.tar.gz]
  4. Go into "ns-allinone-2.33" directory: [cd ns-allinone-2.33]
  5. To install NS-2 type following command: [./install]
  6. (Optional) To validate NS-2 installation: [./validate]
  7. Set the Environment Variables in .bashrc file.

1.2 Downlaod files

Above procedure is automated and coded in the follwing shell script. Please read the instructions mentioned(comments) in the shell script:

Files: Readme | NS2install.sh

Top

2. Patch ZRP

2.1 ZRP Code for NS2

The original ZRP code for NS2 is available in cornell website - Available Here.
I have made following modifications to it -
  1. Segmentation Fault: The simulation using cornell code breaks by segmentation fault. Because of the broadcasted packets are deleted multiple times by all receiver nodes. So, same memory is freed multiple times and accessed multiple times.
    Fix: The temporary fix is to not free any packet. It may lead to memory overflow. But it didn't happen with me till now. Still I am searching for another solution - May be garbage collection would be a good idea.[:)]
  2. IERP_REQUEST_TIMEOUT:
  3. The cornell code doesn't delete an IERP_REQUEST entry on receiving an IERP_REPLY message. Instead it checks expiration of IERP_REQUEST entries on every IERP_REQUEST_TIMEOUT periods.
    Fix: I have modified the code such that on receiving IERP_REPLY message, the corresponding IERP_REQUEST entry is deleted. (In addition, the expiration is also checked periodically.)
  4. Route Maintainance in IERP:
  5. The cornell code doesn't check for route stability until the route is expired for certain constant timeout period. Then it initiates another IERP_REQUEST query to find new route. Two problems can be identified here. 1) If the route is broken, the sender keeps on sending packets which are dropped along the route. AND 2) If the route is stable, still after a timeout, the route is discovered again which induces unnecessary overhead.
    Fix: I have solved for (1) - I have detected the message failure on MAC layer and I send IERP_ROUTE_ERROR message(with broken link info) to source to inform it about the link-failure. For (2), still I haven't code anything.

2.2 Instructions

Follow the steps below to patch ZRP Agent in NS2.
  1. First put following files into NS-2 home's parent directory.
  2. Run patchZRP.sh from shell.

2.3 Downlaod files

Files: Readme | ns-allinone-2.33_zrp.tar.gz | zrp4NS2_33.patch | patchZRP.sh

Top

3. ZRP CODE (My Implementation)

3.1 ZRP CODE (My Implementation)

* Details will be updated soon...

3.2 Instructions

Follow the steps below to patch ZRP Agent in NS2.
  1. First put following files into NS-2 home's parent directory.
  2. Run patchZRP.sh from shell.

3.3 Downlaod files

Files: Readme | ns-allinone-2.33_ZRP.tar.gz | PatchZRP.patch | patchmyZRP.sh
Code (In Html Format): constants.h | zrp.h | zrp.cc

Please refer the manual below for understanding the code better.

ZRP Manual (PDF)


[ N=100 nodes | R=4 hop | QueryRate=0.33 q/s | Radius=1..4 | T_lsu=1..20 | Area=1300x1300 ]

[ N=100 nodes | R=4 hop | QueryRate=0.005 q/s | Radius=1..4 | T_lsu=1..20 | Area=1300x1300 ]
Last Edited on 12 Feb, 2009