Search This Blog

Modified DSDV for Multiple Interface Support in NS-2

Labels: , , ,

The document named "Adding multiple interface support in NS-2" prepared by Ramon Aguero Calvo and Jesus Perez Campo, University of Cantabria helps to incorporate multiple channel support to the core of the ns-2 simulator.


There are few modifications required in the routing protocols such as DSDV, AODV and DSR to use multiple interface support in ns-2. Ramon Aguero Calvo and Jesus Perez Campo have modified the AODV protocol for which code is available in the document they have provided. A patch (that contains modifications in ns-2 to support multiple interfaces and modifications in AODV code) based on that document is available on this link "Revised: Adding Multiple Interface Support in NS-2" .

Based on the guidelines provided in Chapter 5 of the document we have successfully made modifications in DSDV routing protocol. The patch for the same is available on the link given below:

Download NS-2.33-DSDV-Multiple-Interface.patch


Following are the steps to be followed to apply above given patch to ns-2.33:



3. Unzip ns-allinone-2.33.tar.gz. You will get a folder named ns-allinone-2.33.

4. Paste the downloaded patch in this folder.

5. Give the following command:

    patch -p1 < NS-2.33-DSDV-Multiple-Interface.patch

6. Then give ./install

If you have already installed copy of ns-allinone-2.33 then follow the below given steps to apply multi-interface patch.

1. Paste the downloaded patch in ns-allinone-2.33 folder.

2. Give the following command:

    patch -p1 < NS-2.33-DSDV-Multiple-Interface.patch

3. Go in ns-allinone-2.33/ns-2.33 directory.

4. Give the following commands:

    ./configure

    make clean

    make

    make install

You are done with it!

Example TCL scripts to verify the working of the patch can be found on the link given below:



Kindly Note: The tcl scripts having "mesh" word in their name are the scripts designed with multiple interfaces. Others are designed with single interfaces. To verify the working of multiple interfaces, two awk scripts are also provided in the folder.

A tcl script named im3pmanual.tcl is a tcl script wherein nodes have different number of interfaces assigned to them whereas in other tcl scripts designed with multiple interface are designed such that all the nodes in the network have equal number of interfaces.

If you encounter any problem in downloading the patch from the link given above, please follow this link:


If you encounter any problem in downloading example tcl scripts, please follow this link:


Hope it helps.

Regards,
Mohit P. Tahiliani

Acknowledgements: I would like to Thank Chirag J. Raval and Vaidehi S. Panwala for extending their support in modifying the code of DSDV. They went in complete details of DSDV source code in NS-2 and have a major role in the implementation of this patch.

Very Important!!! Please Note: 
(1) The DSDV modifications are still under review and the patch has been verified with only few TCL scripts. Please report any bugs if encountered.
(2) This patch does not contain modifications to AODV routing protocol. However it includes Multiple Interface Support in NS-2 (i.e we have excluded the AODV Modifications from the code of Ramon Sir's document and included DSDV Modifications).
(3) A combined patch that includes Multiple Interface Support + AODV Modifications + DSDV Modifications will be uploaded soon with sample TCL Scripts. Thank you for co-operation. 

Comments (19)

Sir what does the following trace indicate?

N -t 5.070582 -n 311 -e 99.996170

r 5.070884032 _134_ RTR --- 0 AODV 48 [0 ffffffff 2e 800] [energy 99.996253 ei 0.004 es 0.000 et 0.000 er 0.000] ------- [46:255 -1:255 21 0] [0x2 10 1 [0 0] [10 4]] (REQUEST)

Hello,

Follow this link to understand how to interpret trace files. The explanation is very simple and clear.

http://www.cs.binghamton.edu/~kliu/

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi...
Is the modified AODV done? Can you please send a copy to ellysoo@gmail.com? Thank you very much.

Your site is indeed benefit all of us.

Regards,
Elly

Yes it is done. You can download it from the following link:

http://mohittahiliani.blogspot.com/2010/04/revised-adding-multiple-interface.html

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi,
How do fix this error, sir.

patching file ns-2.33/common/mobilenode.cc
patching file ns-2.33/common/mobilenode.h
patching file ns-2.33/dsdv/dsdv.cc
patching file ns-2.33/dsdv/dsdv.h
patching file ns-2.33/dsdv/rtable.h
patching file ns-2.33/mac/channel.cc
patching file ns-2.33/mac/mac-802_11.cc
patching file ns-2.33/tcl/lib/ns-lib.tcl
Hunk #4 succeeded at 646 with fuzz 2 (offset 12 lines).
Hunk #6 FAILED at 865.
Hunk #7 succeeded at 2321 (offset 39 lines).
1 out of 7 hunks FAILED -- saving rejects to file ns-2.33/tcl/lib/ns-lib.tcl.rej
patching file ns-2.33/tcl/lib/ns-mobilenode.tcl


Thanks!!!

sir,
After installing DSDV patch which supports Multiple interface, on running the TCL scripts given by you i have got the following errors... How to fix the errors?


[root@ise203 Multi-Interface TCL Scripts - DSDV ]# ns im3pmesh.tcl
num_nodes is set 15
INITIALIZE THE LIST xListHead
INITIALIZE THE LIST xListHead
INITIALIZE THE LIST xListHead

(_o19 cmd line 1)
invoked from within
"_o19 cmd if-queue 0 _o22"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o19" line 2)
(SplitObject unknown line 2)
invoked from within
"$agent if-queue $i [$self set ifq_($i)]"
(procedure "_o16" line 27)
(Node/MobileNode add-target line 27)
invoked from within
"$self add-target $agent $port"
(procedure "_o16" line 15)
(Node attach line 15)
invoked from within
"$node attach $ragent [Node set rtagent_port_]"
(procedure "_o3" line 84)
(Simulator create-wireless-node line 84)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random..."
(file "im3pmesh.tcl" line 53)

Hello Sir,

I am using your multi interface script in that how to modify the script to see two simultaneous transmission from a node as they have two interfaces in two different channel I want the node to start the transmission at the same time to the two different destination nodes is that possible ? IF yes please let me know how to accomplish it.

I am doing like this

set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns_ attach-agent $node_(0) $tcp
$ns_ attach-agent $node_(4) $sink

$ns_ attach-agent $node_(0) $tcp
$ns_ attach-agent $node_(3) $sink
$ns_ connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns_ at 50.0 "$ftp start"

But I see only the last pair in the trace file.I am wondering why the transmission from 0 to 4 is not seen.

Waiting for your response

Sena

@Sena - You need to configure 2 TCP flows - tcp0 and tcp1 and attach FTP on each of them. Start both the flows at the same time. You will be able to see simultaneous transmission of packets.

Hope it helps.

Regards,
Mohit P. Tahiliani

hi Mohit
im using the ns 2.34 and installed patch, i am running the all the files belong to multi interfaces but it giving some errors one error when i tried to run im3pmesh.tcl file it shows the following error

num_nodes is set 15

(_o3 cmd line 1)
invoked from within
"_o3 cmd change-numifs 3"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"$ns_ change-numifs $val(ni)"
(file "im3pmesh.tcl" line 48)

please help me ....it is very important for my masters project

@Shiva - Make sure you have assigned the channels properly to all the nodes. There must be atleast one common channel between nodes to communicate.

Hope it helps.

Regards,
Mohit P. Tahiliani

Sir
How to create replica and enable its communication with other nodes in wireless sensor network?
How to create base station and enable its communication with other nodes in wireless sensor network

@Unknown - See the sample TCL scripts for the same given in the following directory:

ns-allinone-2.xx/ns-2.xx/tcl/ex/wpan

Hope it helps.

Regards,
Mohit P. Tahiliani

hi friends

I am going to implement one paper in that I need to add some node which act
as a blackhole packet droping node so any
kind of idea or code please help me
madani.belacel@gmail.com
thanx in advance

Hi Mohit

I am new in NS2 and I need your help please. I would like to add 4 routing protocols (FLOODING, DIRECT DIFFUSION, ANT, GOSSIPING ) in my NS2.35 folder and I want them to run with a TCL code that we have built with a some colleagues. Please tell what should I do?

when i try to run " patch -p1 < ns-2.35 DSDV Multiple Interface.patch", the following error occurs:
patch: Interface.patch: extra operand
patch: Try `patch --help' for more information.
i tried to rename the NS-2.33 to ns-2.35 since i installed ns 2.35.
Pls advice.

Dear Mr. Mohit
I have difficulty in modifying tora routing protocol. there are some errors:
--- 'debug_fname' was not declared in this scope
--- 'debug_drop' was not declared in this scope

Hello,
I am doing my master in computer science.I have a selected a project on Congestion control in AODV. CAn any one please help me how to go ahead with this modification.Do anyone have a modified AODV code for my reference will be helpful.
Thanks is advance

hello
what is the difference between dsdv and aodv script?

Hello Mr Mohit,
I made the changes proposed to DSDV.
It compiles but it gives me the following error.
ns: dsdv/dsdv.cc:525: : Assertion `change_count == 0' failed.