Wednesday, May 8, 2013

NS2 simulator : common fixes Part 1

As I am trying to learn NS2 using the online tutorials, most examples given online are using older versions of NS. I am using NS 2.35 in which many syntax and/or file locations have changed. So I am finding my way out to figure how to fix those common errors popping up when trying those demos.

Will keep updating the page as I keep learning ... :)


Prob 1On running the multicasting example ex-mcast.tcl on nile.wpi.edu/NS/ it first gave a warning saying:


" Warning dst_ is no longer being supported in NS. dst_ 0xffffffff 
Use dst_addr_ and dst_port_ instead "

Fix: 

step 1: Replace "set mrthandle [$ns mrtproto DM {}] #DM = dense mode" with
             set mproto DM
             set mrthandle [$ns mrtproto $mproto {}]

step 2: Create groups for multicasting by adding the following after the above 2 lines:
            set group1 [Node allocaddr]
            set group2 [Node allocaddr]

step 3: Replace dest_ with dest_addr_ and replace the hexadecimal addresses with the group names you want the node to belong to. eg.
            $udp0 set dst_addr_ $group1
            $udp2 set dst_addr_ $group2

Prob 2: invalid command name "Mac/Csma/Cd" or "Mac/Csma/Ca"

Fix: Replace Mac/Csma/Cd or Mac/Csma/Ca with Mac/802_3

Prob 3: Segmentation fault when trying to use "namtrace-all-wireless"

Fix: In your script you have to change ifq value Queue/DropTail/PriQueue by CMUPriQueue