Professional

Advertisements

158 thoughts on “Professional

  1. hii..

    I am trying to install ns-allinone-2.33 in my linux operating system (SUSE 10.0).
    i have done the same steps exactly what u have said.(i cahnged the ns version number nd directory).After i editing the file”.bashrc” by adding ur code to the end.That was successfully done.After this step i opened another console nd wrote ns.
    i got the error msg like “bash: ns command not found”

    could you plz help in this..how can i solve this problem??

    1. First of all you can run your program in any directory in your suse.
      I didnt use suse. maye its configuration is differet from the ubunut. or u can change your ns version. I tried to install new version of ns but I couldnt handle it.
      try ns2.32
      as you know that sometimes new versions couldnt be proper…
      at the same time you shpuld check your .bashrc again…

      for more question pls contact with me
      hkaratoy@hotmail.com

    2. hi,
      this meas that u have not updated bashrc file. u must ur whole path for this. and after this u must run this command source /etc/bashrc , if it is successful u can run ns command now.
      u can check by using this command ” which ns ” .

      1. Hello,
        i am facing similar problems whiling installing ns2.34 in opensuse 11.
        i have installed ns successfuly.But i am not sure been able to update the bashrc file properly.tried few commands to open bashrc but it shows:
        nikumani@linux-ttof:~/ns-allinone-2.34/ns-2.34> sudo gedit ~/.bashrc
        root’s password:

        (gedit:6239): Gtk-WARNING **: cannot open display:

        Also after installation how should i start the application.Please help me in this regard.

        With Regards,
        Nikumani Choudhury

  2. i want to know about the various tools to analyze trace (.tr) files which can give me throughput, efficiency , average delay etc as output

    1. I modified the trace file format and I worte some scripts to analyse the trace file…
      If you know at least one tool share it pls

  3. Dear,

    I installed NS2 on the ubuntu. At the step, I typed
    $ gedit ~/.bashrc

    Add the following lines to the end of it. Remember replace “/your/path” by something like “/home/wexins”

    # LD_LIBRARY_PATH
    OTCL_LIB=/your/path/ns-allinone-2.32/otcl-1.13
    NS2_LIB=/your/path/ns-allinone-2.32/lib
    X11_LIB=/usr/X11R6/lib
    USR_LOCAL_LIB=/usr/local/lib
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
    # TCL_LIBRARY
    TCL_LIB=/your/path/ns-allinone-2.32/tcl8.4.15/library
    USR_LIB=/usr/lib
    export TCL_LIBRARY=$TCL_LIB:$USR_LIB
    # PATH
    XGRAPH=/your/path/ns-allinone-2.32/bin:/your/path/ns-allinone-2.32/tcl8.4.15/unix:/your/path/ns-allinone-2.32/tk8.4.14/unix
    NS=/your/path/ns-allinone-2.32/ns-2.32/
    NAM=/your/path/ns-allinone-2.32/nam-1.13/
    PATH=$PATH:$XGRAPH:$NS:$NAM

    Then I cannot save the .bashrc file. Help me.
    please send to my email: mthuvtb42@gmail.com

  4. hi,
    i am using Ubuntu 9.04 64bit, i have done all but when running ./install i am getting the error:

    make: *** [install-binaries] Hata 1
    tcl8.4.15 installation failed.
    Tcl is not part of the ns project. Please see http://www.Scriptics.com
    to see if they have a fix for your platform.

    could you help me?

  5. hi!
    I m using ubuntu 8.10.and i installed ns-2.31.
    when i try to run nam after % ——> [% nam]
    i get error as invalid command name……..
    i don’t know how to solve this….
    plz help me out.

  6. Dear Sir,
    i’m a final yr student doing project in ns-2. i dont ‘ve any problem in installing but while simulating a tcl file named gpsr i’m getting the error as command file “Agent/gpsr” not find. can u help me.

    1. If you want me that I help you you should send your code to me
      otherwise i couldnt help you and at the same time this is your starting point if you want help in each problem you cant improve yourself read froums carefully because this problem is not so compicated…
      check your syntax and try your syntax for the basic examples if you can not find the problem pls send it to me

      1. Thanks a lot for replying me sir. i got my coding executed successfully under linux platform with ns2.32 version. sorry for the delay to reply. once again thank u sir.

    2. invalid command name “Agent/GPSR”

      Hi,
      We face similar problem while executing GPSR .tcl script. Please let us know how to solve this….

      Your help us…
      After modifying the files in common directory, etc.,
      I executed this script file but it does not run due to some agent issues…

      $ns wireless-gpsr.tcl
      invalid command name “Agent/GPSR”
      while executing
      “Agent/GPSR set planar_type_ 1 ”
      (file “wireless-gpsr.tcl” line 113)

      Similar with gpsr.tcl

      $ns gpsr.tcl
      invalid command name “Agent/GPSR”
      while executing
      “Agent/GPSR set sport_ 0”
      (file “gpsr.tcl” line 33)

      Pls do let us know a workaroud.
      Regards,
      Sravan

      1. hi, i’m also working under gpsr protocole…
        so, about your bug : you must fix varibles : “planar_type_” (for planar graph) and “hello_period_” in the filt ns-default.tcl to take effect :
        Agent/GPSR set planar_type_ 1.0
        Agent/GPSR set hello_period 0
        hope that fix your bug…

        im also in trouble with tcl scenario for gpsr so if you can mail it (the file wireless-gpsr.tcl) to me airmax_pro@hotmail.fr “thanks in advance and sorry for my bad english”

      2. Dear sir
        please send to me your correct code and instructions ; its urgent
        thank you
        Regards

      3. Please sir send your correct code and instructions if possible ; I need to use GPSR cod but I couldn’t at all .

        I will be very grateful thank you very much

      4. I dont have problem 🙂 and the code I wrote is correct… You can apply any kind of protocol to the template i created.

    3. Dear sir
      I’m working with GPSR protocol too

      I need some help please if you can send the correct code with instructions for mee .

      please its urgent becuse I tried many times and I faild .

      thank you
      regards

    4. Please help me to run the GPSR code successfully too

      I need this so much and I’couldn’t at all

      please help me and send for me your successful code with instructions.

      thank you

  7. hi!
    I m using ubuntu 9.04.and i installed ns-2.32
    When I try to type ns after successful isntall and path change , I faced below that :
    I don’t know how to solve this….
    Please help me out.
    owner@ubuntu:~$ ns
    Usage: host [-v] [-a] [-t querytype] [options] name [server]
    Listing: host [-v] [-a] [-t querytype] [options] -l zone [server]
    Hostcount: host [-v] [options] -H [-D] [-E] [-G] zone
    Check soa: host [-v] [options] -C zone
    Addrcheck: host [-v] [options] -A host
    Listing options: [-L level] [-S] [-A] [-p] [-P prefserver] [-N skipzone]
    Common options: [-d] [-f|-F file] [-I chars] [-i|-n] [-q] [-Q] [-T] [-Z]
    Other options: [-c class] [-e] [-m] [-o] [-r] [-R] [-s secs] [-u] [-w]
    Special options: [-O srcaddr] [-j minport] [-J maxport]
    Extended usage: [-x [name …]] [-X server [name …]]

  8. Hi,
    I have a Dell Laptop with Vista Home Premium… I partitioned my HD and installed Ubuntu 9.04… I tried to install ns 2.32-allinone package. But some packages like xgraph were not installed.. Den i switched over to RHEL 5 and then Fedora… But in both of these i lost my Vista MBR and had to recover them.. Den i installed Sun VirtualBox and installed Red hat linux.. It had worked for my project mate… But for me, all packages except xgraph and tk8.4.15.. Can u give me a solution??

  9. I have a Dell laptop with Windows Vista… I partitioned 10 GB for Dual OS and installed Ubuntu 9.04.. But ns-2.32 allinone package was not installed properly.. So i installed RHEL 5.. But my Vista MBR was lost.. Then i recovered it… Then i tried Fedora.. Same problem as RHEL.. Had to recover my Vista MBR… Den i installed Sun Virtual Box and installed Red Hat 9.0… This time it was a different problem… All the packages of ns-2.32 allinone were installed except xgraph and tk-8.14.5.. I get parse error for xgraph… I have gcc as other packages were installed without a problem… Pls help me out…

  10. Dear Hilal,

    Need your help.

    When nam runs its shown :

    ns: stop couldn’t execute “nam” : no such file or directory
    while executing nam
    “exec nam max.nam &”

    I installed ns in fedora 9, 64bit Dell computer.

    NS works well except for the script containing nam.

    please help.

    Thank you so much.

    With regards,
    Jims

    1. if it was the first execution of you nam file, that mean that your path variable dosn’t contain the path to nam execution file ; so, in this case, you must put this in you path environnement variable (or in bashcr file) :
      XGRAPH=/yourDirectory/ns-allinone-2.32/ns-allinone-2.32/bin:/youDirectory/ns-allinone-2.32/ns-allinone-2.32/tcl8.4.15/unix:/youDirectory/ns-allinone-2.32/ns-allinone-2.32/tk8.4.15/unix NS=/yourDirectory/ns-allinone-2.32/ns-allinone-2.32/ns-2.32/ NAM=/yourDirectory/ns-allinone-2.32/ns-allinone-2.32/nam-1.13/ PATH=$PATH:$XGRAPH:$NS:$NAM
      (becarefull to the version of NS; i’m using ns-2.32 and tcl8.4.15)

  11. hi
    i using redhat 5 i installed ns 2.32 but when comlpied tcl file its not creating nam file pls help me out ia am in urgent hav to submit in college

    1. if u have some problem about nam file this means you didnt install your ns-2 well. just do make clean and do it again…if I found my files I will write them my blog. ALso foloow the installing instruction (carefully please)

  12. i also used my friend command its working he has new.tcl ,new.nam and new.tr file if i run this in my system its working but if i create a working tcl file also its not creating nam and tr file p[ls help me pls

    1. send ur code to me… or review… most probably u misspelled or your ns cimmand is different setted… ckech it did u run ns as ns or ns2 also you should write it same in your source code,.. this is just an example what i faced… can be similar

    2. it means you didnt create nam file… without source code i cant help u…beside this try the simple example if u can run then u installed correctly then we can look it again

  13. if complie atcl file its displays
    warning : using backward compactibility mode
    error when calling class Oldsim : new.tcl

  14. Dear sir,
    I installed ns-2.2 based on ubuntu 8.04 completely.
    I have a problem when modified the protocol.
    After make clean and make again for compile source code.
    I type ns command again at terminal but the network animator is not display and the terminal is shown below :
    The program ‘ns’ is currently not installed. You can install it by typing:
    sudo apt-get install host
    bash: ns: command not found
    ****
    please help.
    thank .
    pat

  15. i’m using gpsr protocol to simulate trafic in vehicle network,

    and when i use the proc : “gpsr-create-mobile-node $i” it dosn’t work, so i’m in puzzle!

    i need help !!!

    regards.

    khaled

  16. Hi , I have found a patch of MTENS (Multi-Protocol Label Switching – Traffic Engineering Network Simulator) on http://netserv.iet.unipi.it/software/ and I don’t known how to add on my NS2.32, Someone can help me? It is very urgent! before the end of this month!

    Thanks!

    Bless regards

    Delmar!

  17. Hi,i’m using NS-2.34 and xgraph for wired potocol but when i’m trace file .tr i got this

    Error in file `coba.tr’ at line 56321:
    Unknown line type
    Problems found with input data.

    how do i fix this???

  18. I have the same problem as pat in the last step of installing ns-2. I did all the steps correctly and all are checked again too. here is the last response:

    pooya@PH:~/ns-allinone-2.27$ ns
    The program ‘ns’ is currently not installed. You can install it by typing:
    sudo apt-get install host
    bash: ns: command not found

  19. sir i have installed ns2-2.31 in ubuntu 9.04 and after exeuting nam i get nam window but when i try to execute any code i get the following error=warning: using backward compatibility mode
    error when calling class OldSim: simple.tcl

    1. hi ashish
      when you open terminal try to execute ns filename.tcl directly.
      Dont go to home folder by typing sudo su and then opening ns where you see % symbol.Just open the terminal and execute ns Filename.tcl.
      Thats it

  20. Hello,
    regarding your work on collected data analysis, you will be very helpful
    I want to collect some information regarding transmit power and received power from nodes as an input to an algorithm and then sent the output like new transmit power to the nodes
    I don’t know how to start
    I am using ns2.34

  21. How to install NS-2.33 in fedora 12….??
    it gives me error like that…
    (1) Tcl file not found
    (2) Otcl file not found…

    plz….tell me how to install….Ns-2.33.

  22. I am doing my project in VANET. Inorder to create a vehicular scenario I tried SUMO, TRANS. But not yet sucessfully completed. Can you please tell me how to create a vehicular environment in ns2..to create lane of vehicles or multiple lane of vehicles

  23. I am doing my project in VANET. Inorder to create a vehicular scenario I tried SUMO, TRANS. But not yet sucessfully completed. Can you please tell me how to create a vehicular environment in ns2..to create lane of vehicles or multiple lane of vehicles

      1. Read my thesis… I will upload it soon ( but you can also find it on the internet. Data collection and anlaysis on VANET is name of my master thesis

  24. hye…im ct..can u help me??i need an installer of ns2.32…i can’t download using my internet in campus because it’s too slow…i really need d installer(zip/compressed file) of ns-allinone-2.32….i hope u can emel to me…thank u for ur kindness..

  25. hi i am working on ns2 for my project work, i am using GPSR routing protocol but its not supporting and getting error in 2.34. you have any idea about GPSR location based routing protocol.

    pls help me make good result
    Thank you

  26. hello sir .
    i m trying to locate the position of mobile node with the help of reference fixed nodes.
    please help me. its very urgent to complete my project.

  27. Hey Guys,
    I’m working on GPSR code which i got it from “GPSR_KeLiu_SUNY_Binghamton”. While executing wireless-gpsr code i’m not getting any error but the Animator doesn’t appears. I get the following message while executing wireless-gpsr code:

    num_nodes is set 100
    GPSR configuration file
    INITIALIZE THE LIST xListHead
    Loading connection pattern…
    Loading scenario file…
    Load complete…
    Starting Simulation…
    channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
    highestAntennaZ_ = 1.5, distCST_ = 129.2
    SORTING LISTS …DONE!
    NS EXITING…

    Can anybody please help me with this. I also tried executing out.nam file but i get “segmentation fault” while executing it.
    Please need serious help regarding this.

  28. Help me
    When I try to execute my file in ns2 like:

    %ns ns-mobile.tcl
    A error message displayed as:

    warning: using backward compatibility mode
    error when calling class OldSim: ns-mobile.tcl

    Please tell me how i can resolve this issuee

  29. hi, when i am saving bashrc file, the prompt is coming that i cant save this file….i become the admin of system, it still giving same prompt…..now what can i do?

  30. invalid command name “Agent/GPSR”
    Hi,
    We face similar problem while executing GPSR .tcl script. Please let us know how to solve this….
    Your help us…
    After modifying the files in common directory, etc.,
    I executed this script file but it does not run due to some agent issues…
    $ns wireless-gpsr.tcl
    invalid command name “Agent/GPSR”
    while executing
    “Agent/GPSR set planar_type_ 1 ”
    (file “wireless-gpsr.tcl” line 113)
    Similar with gpsr.tcl
    $ns gpsr.tcl
    invalid command name “Agent/GPSR”
    while executing
    “Agent/GPSR set sport_ 0″
    (file “gpsr.tcl” line 33)
    ..
    plz help me sir, its very argent.
    send me any correctly working gpsr code.
    Thanku sir,
    dhananjay

  31. sir,

    im using linux fedora.can u pls send me the steps to install ns-2?im doing my research in mobile computing.i tried a lot.but i couldnt install ns-2.

    Plz help me.

    With regards,
    sasee

  32. [Acer@localhost dia]$ ns Final.tcl
    num_nodes is set 31
    INITIALIZE THE LIST xListHead

    Traffic: ftp
    Acknowledgement for data: on

    Starting Simulation…
    channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
    highestAntennaZ_ = 1.5, distCST_ = 35.9
    SORTING LISTS …DONE!
    ns: stop: couldn’t execute “xgraph”: no such file or directory
    while executing
    “exec xgraph out.xgr &”
    (procedure “stop” line 15)
    invoked from within
    “stop”

    Please Help me How to run Xgraph

  33. # ======================================================================
    # Define options
    # ======================================================================
    set val(chan) Channel/WirelessChannel ;# Channel Type
    set val(prop) Propagation/TwoRayGround ;# radio-propagation model
    set val(netif) Phy/WirelessPhy/802_15_4
    set val(mac) Mac/802_15_4
    set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
    set val(ll) LL ;# link layer type
    set val(ant) Antenna/OmniAntenna ;# antenna model
    set val(ifqlen) 50 ;# max packet in ifq
    set val(nn) 21 ;# number of mobilenodes
    set val(rp) AODV ;# AODV Routing
    set val(x) 50
    set val(y) 50

    set val(nam) wpan_demo4.nam
    set val(traffic) mix ;# mix/cbr/poisson/ftp

    #read command line arguments
    proc getCmdArgu {argc argv} {
    global val
    for {set i 0} {$i < $argc} {incr i} {
    set arg [lindex $argv $i]
    if {[string range $arg 0 0] != "-"} continue
    set name [string range $arg 1 end]
    set val($name) [lindex $argv [expr $i+1]]
    }
    }
    getCmdArgu $argc $argv

    set appTime1 10.3 ;# in seconds
    set appTime2 10.6 ;# in seconds
    set stopTime 100 ;# in seconds

    # Initialize Global Variables
    set ns_ [new Simulator]
    set tracefd [open ./wpan_demo4.tr w]
    $ns_ trace-all $tracefd
    if { "$val(nam)" == "wpan_demo4.nam" } {
    set namtrace [open ./$val(nam) w]
    $ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
    }

    $ns_ puts-nam-traceall {# nam4wpan #} ;# inform nam that this is a trace file for wpan (special handling needed)

    Mac/802_15_4 wpanCmd verbose on
    Mac/802_15_4 wpanNam namStatus on ;# default = off (should be turned on before other 'wpanNam' commands can work)
    #Mac/802_15_4 wpanNam ColFlashClr gold ;# default = gold
    #Mac/802_15_4 wpanNam NodeFailClr grey ;# default = grey

    # For model 'TwoRayGround'
    set dist(5m) 7.69113e-06
    set dist(9m) 2.37381e-06
    set dist(10m) 1.92278e-06
    set dist(11m) 1.58908e-06
    set dist(12m) 1.33527e-06
    set dist(13m) 1.13774e-06
    set dist(14m) 9.81011e-07
    set dist(15m) 8.54570e-07
    set dist(16m) 7.51087e-07
    set dist(20m) 4.80696e-07
    set dist(25m) 3.07645e-07
    set dist(30m) 2.13643e-07
    set dist(35m) 1.56962e-07
    set dist(40m) 1.20174e-07
    Phy/WirelessPhy set CSThresh_ $dist(12m)
    Phy/WirelessPhy set RXThresh_ $dist(12m)

    # set up topography object
    set topo [new Topography]
    $topo load_flatgrid $val(x) $val(y)

    # Create God
    set god_ [create-god $val(nn)]

    set chan_1_ [new $val(chan)]

    # configure node

    $ns_ node-config -adhocRouting $val(rp) \
    -llType $val(ll) \
    -macType $val(mac) \
    -ifqType $val(ifq) \
    -ifqLen $val(ifqlen) \
    -antType $val(ant) \
    -propType $val(prop) \
    -phyType $val(netif) \
    -topoInstance $topo \
    -agentTrace OFF \
    -routerTrace OFF \
    -macTrace ON \
    -movementTrace OFF \
    #-energyModel "EnergyModel" \
    #-initialEnergy 1 \
    #-rxPower 0.3 \
    #-txPower 0.3 \
    -channel $chan_1_

    for {set i 0} {$i < $val(nn) } {incr i} {
    set node_($i) [$ns_ node]
    $node_($i) random-motion 0 ;# disable random motion
    }

    #set Cm 4
    #set Lm 3
    #Agent/ZBR Cm $Cm
    #Agent/ZBR Lm $Lm
    #Agent/ZBR BSize calc
    #set BlockSize [Agent/ZBR BSize]
    #set cskip0 [Agent/ZBR CSkip 0]
    #set cskip1 [Agent/ZBR CSkip 1]
    #set cskip2 [Agent/ZBR CSkip 2]
    #puts [format "Cm: %s" $Cm]
    #puts [format "Lm: %s" $Lm]
    #puts [format "BlockSize: %s" $BlockSize]
    #$ns_ at 0.0 "$ns_ trace-annotate \"Cm = $Cm, Lm = $Lm, BlockSize = $BlockSize, CSkip0 = $cskip0, CSkip1 = $cskip1, CSkip2 = $cskip2\""

    # default is RN+, so only set RN-
    #$node_(3) RNType 0
    #$node_(4) RNType 0
    #$node_(7) RNType 0
    #$node_(8) RNType 0
    #$node_(9) RNType 0
    #$node_(10) RNType 0
    #$node_(13) RNType 0
    #$node_(15) RNType 0
    #$node_(18) RNType 0
    #$node_(20) RNType 0

    source ./wpan_demo4.scn

    $ns_ at 0.0 "$node_(0) NodeLabel \"PAN Coor\""
    #for {set i 1} {$i < $val(nn)} {incr i} {
    # set RNType [eval \$node_($i) RNType]
    # if {$RNType == "0"} {
    # $ns_ at 0.0 "$node_($i) NodeLabel -"
    # } else {
    # $ns_ at 0.0 "$node_($i) NodeLabel +"
    # }
    #}

    $ns_ at 0.0 "$node_(0) sscs startCTPANCoord 1" ;# startCTPANCoord
    $ns_ at 0.3 “$node_(1) sscs startCTDevice 1 1” ;# startCTDevice
    $ns_ at 1.3 “$node_(9) sscs startCTDevice 1 1”
    $ns_ at 1.7 “$node_(13) sscs startCTDevice 1 1”
    $ns_ at 2.3 “$node_(19) sscs startCTDevice 1 1”

    $ns_ at 3.3 “$node_(2) sscs startCTDevice 1 1 1”
    $ns_ at 3.5 “$node_(7) sscs startCTDevice 1 1 1”
    $ns_ at 3.6 “$node_(11) sscs startCTDevice 1 1 1”
    $ns_ at 3.8 “$node_(16) sscs startCTDevice 1 1 1”

    $ns_ at 4.3 “$node_(3) sscs startCTDevice 0 0”
    $ns_ at 4.5 “$node_(6) sscs startCTDevice 1 1”
    $ns_ at 4.8 “$node_(12) sscs startCTDevice 1 0”
    $ns_ at 5.1 “$node_(17) sscs startCTDevice 1 0”

    $ns_ at 5.6 “$node_(20) sscs startCTDevice 1 1”
    $ns_ at 5.8 “$node_(5) sscs startCTDevice 1 1”
    $ns_ at 6.0 “$node_(10) sscs startCTDevice 1 1”
    $ns_ at 6.3 “$node_(14) sscs startCTDevice 1 1”

    $ns_ at 6.8 “$node_(18) sscs startCTDevice 1 0”
    $ns_ at 7.0 “$node_(4) sscs startCTDevice 0 0”
    $ns_ at 7.3 “$node_(8) sscs startCTDevice 0 0”
    $ns_ at 7.7 “$node_(15) sscs startCTDevice 0 0”

    $ns_ at $appTime1 “$node_(0) sscs stopBeacon”
    $ns_ at $appTime1 “$node_(2) sscs startBeacon 4 4”
    $ns_ at $appTime1 “$node_(7) sscs startBeacon 4 4”
    #$ns_ at $appTime1 “$node_(11) sscs stopBeacon”
    #$ns_ at $appTime1 “$node_(16) sscs stopBeacon”

    Mac/802_15_4 wpanNam PlaybackRate 4ms
    $ns_ at $appTime1 “Mac/802_15_4 wpanNam PlaybackRate 1.0ms”
    $ns_ at [expr $appTime1 + 0.5] “Mac/802_15_4 wpanNam PlaybackRate 2.0ms”

    $ns_ at $appTime1 “puts \”\nTransmitting data …\n\””

    # Setup traffic flow between nodes

    proc cbrtraffic { src dst interval starttime } {
    global ns_ node_
    set udp_($src) [new Agent/UDP]
    eval $ns_ attach-agent \$node_($src) \$udp_($src)
    set null_($dst) [new Agent/Null]
    eval $ns_ attach-agent \$node_($dst) \$null_($dst)
    set cbr_($src) [new Application/Traffic/CBR]
    eval \$cbr_($src) set packetSize_ 80
    eval \$cbr_($src) set interval_ $interval
    eval \$cbr_($src) set random_ 0
    #eval \$cbr_($src) set maxpkts_ 10000
    eval \$cbr_($src) attach-agent \$udp_($src)
    eval $ns_ connect \$udp_($src) \$null_($dst)
    $ns_ at $starttime “$cbr_($src) start”
    }

    proc poissontraffic { src dst interval starttime } {
    global ns_ node_
    set udp($src) [new Agent/UDP]
    eval $ns_ attach-agent \$node_($src) \$udp($src)
    set null($dst) [new Agent/Null]
    eval $ns_ attach-agent \$node_($dst) \$null($dst)
    set expl($src) [new Application/Traffic/Exponential]
    eval \$expl($src) set packetSize_ 70
    eval \$expl($src) set burst_time_ 0
    eval \$expl($src) set idle_time_ [expr $interval*1000.0-70.0/100]ms ;# idle_time + pkt_tx_time = interval
    eval \$expl($src) set rate_ 100k
    eval \$expl($src) attach-agent \$udp($src)
    eval $ns_ connect \$udp($src) \$null($dst)
    $ns_ at $starttime “$expl($src) start”
    }

    if {$val(rp) == “ZBR”} {
    Mac/802_15_4 wpanCmd callBack 2 ;# 0=none; 1=failure only (default); 2=both failure and success
    }

    if { (“$val(traffic)” == “mix”) || (“$val(traffic)” == “cbr”) || (“$val(traffic)” == “poisson”) } {
    if { “$val(traffic)” == “mix” } {
    set trafficName “cbr + poisson”
    set traffic1 cbr
    set traffic2 poisson
    } else {
    set trafficName $val(traffic)
    set traffic1 $val(traffic)
    set traffic2 $val(traffic)
    }
    puts “\nTraffic: $trafficName”
    #Mac/802_15_4 wpanCmd ack4data on
    puts [format “Acknowledgement for data: %s” [Mac/802_15_4 wpanCmd ack4data]]
    ${traffic1}traffic 3 18 0.2 $appTime1
    ${traffic2}traffic 9 17 0.2 $appTime2
    Mac/802_15_4 wpanNam FlowClr -p AODV -c tomato
    Mac/802_15_4 wpanNam FlowClr -p ARP -c green
    Mac/802_15_4 wpanNam FlowClr -p MAC -c navy
    $ns_ at $appTime1 “$node_(3) add-mark m1 blue circle”
    $ns_ at $appTime1 “$node_(18) add-mark m2 blue circle”
    $ns_ at $appTime1 “$ns_ trace-annotate \”(at $appTime1) $traffic1 traffic from node 3 to node 18\””
    $ns_ at $appTime2 “$node_(9) add-mark m3 green4 circle”
    $ns_ at $appTime2 “$node_(17) add-mark m4 green4 circle”
    $ns_ at $appTime2 “$ns_ trace-annotate \”(at $appTime2) $traffic2 traffic from node 9 to node 17\””
    $ns_ at [expr $appTime1 + 2.0] “Mac/802_15_4 wpanCmd link-down 0 19”
    set tmpTime [format “%.1f” [expr $appTime1 + 2.0]]
    $ns_ at [expr $appTime1 + 2.0] “$ns_ trace-annotate \”(at $tmpTime) link down: 0 -> 19\””
    $ns_ at [expr $appTime2 + 3.0] “$node_(2) node-down”
    set tmpTime [format “%.1f” [expr $appTime2 + 3.0]]
    $ns_ at [expr $appTime2 + 3.0] “$ns_ trace-annotate \”(at $tmpTime) node down: 2\””
    $ns_ at [expr $appTime1 + 8.0] “Mac/802_15_4 wpanCmd link-up 0 19”
    set tmpTime [format “%.1f” [expr $appTime1 + 8.0]]
    $ns_ at [expr $appTime1 + 8.0] “$ns_ trace-annotate \”(at $tmpTime) link up: 0 -> 19\””
    $ns_ at [expr $appTime2 + 10.0] “$node_(2) node-up”
    set tmpTime [format “%.1f” [expr $appTime2 + 10.0]]
    $ns_ at [expr $appTime2 + 10.0] “$ns_ trace-annotate \”(at $tmpTime) node up: 2\””
    if { “$val(traffic)” == “cbr” } {
    set pktType cbr
    set pktType2 cbr
    } elseif { “$val(traffic)” == “poission” } {
    set pktType exp
    set pktType2 exp
    } else {
    set pktType cbr
    set pktType2 exp
    }
    Mac/802_15_4 wpanNam FlowClr -p $pktType -s 3 -d 18 -c blue
    Mac/802_15_4 wpanNam FlowClr -p $pktType2 -s 9 -d 17 -c green4
    }

    proc ftptraffic { src dst starttime } {
    global ns_ node_
    set tcp($src) [new Agent/TCP]
    eval \$tcp($src) set packetSize_ 60
    set sink($dst) [new Agent/TCPSink]
    eval $ns_ attach-agent \$node_($src) \$tcp($src)
    eval $ns_ attach-agent \$node_($dst) \$sink($dst)
    eval $ns_ connect \$tcp($src) \$sink($dst)
    set ftp($src) [new Application/FTP]
    eval \$ftp($src) attach-agent \$tcp($src)
    $ns_ at $starttime “$ftp($src) start”
    }

    if { “$val(traffic)” == “ftp” } {
    puts “\nTraffic: ftp”
    #Mac/802_15_4 wpanCmd ack4data off
    puts [format “Acknowledgement for data: %s” [Mac/802_15_4 wpanCmd ack4data]]
    ftptraffic 16 3 $appTime1
    ftptraffic 8 11 $appTime2
    Mac/802_15_4 wpanNam FlowClr -p AODV -c tomato
    Mac/802_15_4 wpanNam FlowClr -p ARP -c green
    Mac/802_15_4 wpanNam FlowClr -p MAC -c navy
    $ns_ at $appTime1 “$node_(16) add-mark m1 blue circle”
    $ns_ at $appTime1 “$node_(3) add-mark m2 blue circle”
    $ns_ at $appTime1 “$ns_ trace-annotate \”(at $appTime1) ftp traffic from node 16 to node 3\””
    Mac/802_15_4 wpanNam FlowClr -p tcp -s 16 -d 3 -c blue
    Mac/802_15_4 wpanNam FlowClr -p ack -s 3 -d 16 -c blue
    $ns_ at $appTime2 “$node_(8) add-mark m3 green4 circle”
    $ns_ at $appTime2 “$node_(11) add-mark m4 green4 circle”
    $ns_ at $appTime2 “$ns_ trace-annotate \”(at $appTime2) ftp traffic from node 8 to node 11\””
    Mac/802_15_4 wpanNam FlowClr -p tcp -s 8 -d 11 -c green4
    Mac/802_15_4 wpanNam FlowClr -p ack -s 11 -d 8 -c green4
    }

    # defines the node size in nam
    for {set i 0} {$i < $val(nn)} {incr i} {
    $ns_ initial_node_pos $node_($i) 2
    }

    # Tell nodes when the simulation ends
    for {set i 0} {$i AODV
    exec xgraph AODV &
    set hasDISPLAY 0
    foreach index [array names env] {
    #puts “$index: $env($index)”
    if { (“$index” == “DISPLAY”) && (“$env($index)” != “”) } {
    set hasDISPLAY 1
    }
    }
    if { (“$val(nam)” == “wpan_demo4.nam”) && (“$hasDISPLAY” == “1”) } {
    exec nam wpan_demo4.nam &
    }
    }

    puts “\nStarting Simulation…”
    $ns_ run

    PLEASE GIVE ME ITS LINE BY LINE EXPLANATION

  34. i have installed ns-2.32 in fedora 10 . but nam is not working .
    and another problem thing i noticed during installation
    common/packet.h:358: warning: deprecated conversion from string constant to ‘char*’

    how to get rid of this problem.
    i searched lot for solving this but at the end failure.

  35. i completed installing the whole process of ns-2.34 on ubuntu.
    at last when i tried to give ns command there is an error coming as ns command not found

    anybody can help me plz..
    i tried many times….

  36. Hey Sir,I executed this wireless-gpsr.tcl in the NS2.34 with Ubuntu 9.10 but it does not run due to some agent issues…

    ———————————–

    $ns wireless-gpsr.tcl
    invalid command name “Agent/GPSR”
    while executing
    “Agent/GPSR set planar_type_ 1 ”
    (file “wireless-gpsr.tcl” line 113)

    ————————————-

    i try to marked this code,but it valid.

    how can i solve it,or do you have any suggestion

    Thanks Eric

  37. hi my dear friend
    i have many question in ns.

    1) how i can simulate a webserver (how code or command or class & objects?)

    2) how i can install gnuplot?
    – how i can show the output analyze file, in gnuplot? (how code or command?)

    3) if i use SCTP Protocol&Agent,how should i do? (how code or command?)

    very thanks…
    send reply to my mail please…
    helot_of_god@yahoo.com

  38. Dear sir,

    Recently I have installed ns-2.34 by using ns-allinone-2.34 packet in my system ubuntu. I need to do a test by installing the protocol GPSR.
    So I follow the steps written in the Readme of GPSR_KeLiu_SUNY_Binghamton packet(like changing packet.h…and Makefile etc.). The step “sudo make” suceeded. but when I try to do “ns gpsr.tcl”, it shows a problem as below:

    invalid command name “Agent/GPSR”
    while executing
    “Agent/GPSR set sport_ 0”
    (file “gpsr.tcl” line 1)

    Can you help me figure out how to solve this? Thank you very much.

  39. when i installed it and go through all required you mention above, they are working well but after “./install” it shows
    make: *** [libotcl.so] Error 1
    otcl-1.13 make failed! Exiting
    meanwhile OTCL is very important to run ns2 but it gets error on that…
    i’m using ubuntu 10.04 and running on virtual box.

    please help me out how to fix that…thank you

  40. i have installed ns 2.32 sucessfully on my opensuse. But when i write ./nam it gives an error . But ./ns is workng.
    Can u fix it.

  41. when iam trying to install ns2.34 on ubuntu 11.04 iam getting the errors
    gcc-4.3: command not found
    make: *** [libotcl.so] Error 1
    otcl-1.13 make failed! Exiting …
    next i tried like this iam getting the following errors
    sudo apt-get install build-essential gcc-4.3
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package gcc-4.3
    E: Couldn’t find any package by regex ‘gcc-4.3’

  42. invalid command name “Queue/DropTail/EDCAQueue”
    while executing
    “Queue/DropTail/EDCAQueue set queueSize_ 500 ”
    (file “aggregation.tcl” line 126)
    ———————————————————-
    im korean. I dont english well. ………….. How does this solve???ㅜㅜ

  43. I tried to install ns-3.32 on OpenSuse 11.1 machine. at the install, got the following error:

    make: *** No rule to make target ‘VERSION’, needed by ‘gen/version.c’. Stop. Ns make failed!

    Tried the following command before installation:
    $ sudo apt-get install build-essential autoconf automake libxmu-dev
    but the output it gives is: bash: cd: home: No such file or directory…

    please help step by step how to overcome this problem. I do need ns-3.32 on OpenSuse 11.1…. before was running ns-3.34 and it was working fine…only gong back version for some work which could not be easily accomplished in 3.34.

  44. Hey, the problem was solved when i just renamed: /nsallinone-3.32/ns-3.32/version as /nsallinone-3.32/ns-3.32/VERSION……. only rename the version file at this location with CAPITALS.

  45. [root@localhost GPSR_KeLiu_SUNY_Binghamton]# ns wireless-gpsr.tcl
    couldn’t read file “../tcl/lib/ns-bsnode.tcl”: no such file or directory
    while executing
    “source.orig ../tcl/lib/ns-bsnode.tcl”
    (“uplevel” body line 1)
    invoked from within
    “uplevel source.orig [list $fileName]”
    invoked from within
    “if [$instance_ is_http_url $fileName] {
    set buffer [$instance_ read_url $fileName]
    uplevel eval $buffer
    } else {
    uplevel source.orig [list $fileName]
    …”
    (procedure “source” line 8)
    invoked from within
    “source ../tcl/lib/ns-bsnode.tcl”
    (file “wireless-gpsr.tcl” line 198)

  46. hi,
    i have installed ns2.32…nd when i typed ns in the terminal % is coming..but nam nd xgraph is not working..

    Pls help me to solve this..

  47. Hi hilalkaratoy ,
    I am doing my project in MANET.I have design a protocol using Multipath routing strategy ,there are some protocol to support multipath routing like AODV-PSP , FZR, MSR ,etc.If u have Available code for this protocol or support multipath routing protocol pls give me…..

  48. I’m trying to piggyback or appending or mering two packets and then send in the multicast networks. is it possible to do in ns2?
    i’m trying to search but couldn’t found anything. Can you please help me on this?

  49. I am getting the following error while executing the drop1.tcl program. Plz help me to rectify this error.
    ns:finish: couldn’t execute “nam”: permission denied
    while executing
    “exec nam drop1.nam &”
    (procedure “finish” line 11)
    invoked from within
    “finish”

    This is the Code:
    #——-Event scheduler object creation——–#

    set ns [new Simulator]

    #——–creating nam—-#

    set nf [open drop1.nam w]
    $ns namtrace-all $nf

    set nt [open drop1.tr w]
    $ns trace-all $nt

    set proto rlm
    $ns color 1 red
    $ns color 2 cgyan

    # ——— CREATING SENDER – RECEIVER – ROUTER NODES———–#

    set Client1 [$ns node]
    set Client2 [$ns node]
    set Router1 [$ns node]
    set Router2 [$ns node]
    set Endserver1 [$ns node]

    # ————–CREATING DUPLEX LINK ———————–#

    $ns duplex-link $Client1 $Router1 5Mb 50ms DropTail
    $ns duplex-link $Client2 $Router1 5Mb 50ms DropTail
    $ns duplex-link $Router1 $Router2 150Kb 50ms DropTail
    $ns duplex-link $Router2 $Endserver1 300Kb 50ms DropTail

    #———–CREATING ORIENTATION ————————-#

    $ns duplex-link-op $Client1 $Router1 orient down-right
    $ns duplex-link-op $Client2 $Router1 orient right
    $ns duplex-link-op $Router1 $Router2 orient right
    $ns duplex-link-op $Router2 $Endserver1 orient up

    # ————–LABELLING —————————–#
    $ns at 0.0 “$Client1 label Client1”
    $ns at 0.0 “$Client2 label Client2”
    $ns at 0.0 “$Router1 label Router1”
    $ns at 0.0 “$Router2 label Router2”
    $ns at 0.0 “$Endserver1 label Endserver1”

    # ————— CONFIGURING NODES —————–#

    $Endserver1 shape hexagon
    $Router1 shape square
    $Router2 shape square

    # —————-QUEUES POSITIONING AND ESTABLISHMENT ————-#

    $ns duplex-link-op $Client1 $Router1 queuePos 0.1
    $ns duplex-link-op $Client2 $Router1 queuePos 0.1
    $ns duplex-link-op $Router1 $Router2 queuePos 0.5
    $ns duplex-link-op $Router2 $Endserver1 queuePos 0.5

    # —————-ESTABLISHING COMMUNICATION ————-#

    #————–TCP CONNECTION BETWEEN NODES—————#

    set tcp0 [new Agent/TCP]
    $tcp0 set maxcwnd_ 16
    $tcp0 set fid_ 1
    $ns attach-agent $Client1 $tcp0

    set sink0 [new Agent/TCPSink]
    $ns attach-agent $Endserver1 $sink0

    $ns connect $tcp0 $sink0

    set ftp0 [new Application/FTP]
    $ftp0 attach-agent $tcp0

    $ns add-agent-trace $tcp0 tcp
    $tcp0 tracevar cwnd_

    $ns at 0.5 “$ftp0 start”
    $ns at 5.5 “$ftp0 stop”
    #—————————————#

    set tcp1 [new Agent/TCP]
    $tcp1 set maxcwnd_ 16
    $tcp1 set fid_ 2
    $ns attach-agent $Client2 $tcp1

    set sink1 [new Agent/TCPSink]
    $ns attach-agent $Endserver1 $sink1

    $ns connect $tcp1 $sink1

    set ftp1 [new Application/FTP]
    $ftp1 attach-agent $tcp1

    $ns add-agent-trace $tcp1 tcp
    $tcp1 tracevar cwnd_

    $ns at 0.5 “$ftp1 start”
    $ns at 6.5 “$ftp1 stop”

    #———————-drop nodes—————————#

    $ns rtmodel-at 2.88 down $Router1 $Router2
    $ns rtmodel-at 3.52 up $Router2 $Endserver1

    # —————- FINISH PROCEDURE ————-#

    proc finish {} {

    global ns nf nt
    $ns flush-trace
    close $nf
    puts “running nam…”
    exec nam drop1.nam &
    exit 0
    }

    #Calling finish procedure
    $ns at 7.0 “finish”
    $ns run

  50. hai!!! can any one help me in plotting graph using xgraph command..

    it is showing error when i used xgraph command like this..
    “exec xgraph temp4.tr”
    im working in NS-2.35 in fedora 13..

    thanq in advance..

  51. I am doing project on congestion control in TCP and try to develop new protocol inherited from TCP (more like tcp westwood). My problem statement is “Receiver assistance congestion control in high speed and wireless network”. since i am new to ns2, i need a guidance about how should i get started?
    I started reading ns-doc and run some tcl script on TCP but want to start actual programming so how should i proceed?
    Thank you.

    1. Why arent u trying first and sent ur code to me and givin the bugs as well … And i posted aource code as well!!!!

  52. Hi..
    I am working with leach protocol through ns2.34 in fedora16
    Installation was completed successfully and while running the code, it got executed but the console is not getting displayed.
    Please help me.

  53. I am using Ubuntu 11.10. I have install NS2 version 2.35 for the Ubuntu Software center. but it is not working properly and also the bash.bashrc does accept any changes for to introduce the path. Please anyone help me in the setting of NS2. Thanks.

  54. Hello, I am running simple .tcl program which linked to c++. I am getting following error:
    $ ns proj.tcl
    num_nodes is set 5
    INITIALIZE THE LIST xListHead
    invalid command name “Agent/projWsn”
    while executing
    “Agent/projWsn create _o104 ”
    invoked from within
    “catch “$className create $o $args” msg”
    invoked from within
    “if [catch “$className create $o $args” msg] {
    if [string match “__FAILED_SHADOW_OBJECT_” $msg] {
    delete $o
    return “”
    }
    global errorInfo
    error “class $…”
    (procedure “new” line 3)
    invoked from within
    “new Agent/projWsn”
    (“for” body line 2)
    invoked from within
    “for {set i 0} {$i < 3} {incr i} {
    set myagent [new Agent/projWsn]
    $myagent neighbr
    $myagent set k $i
    }"
    (file "proj.tcl" line 61)

  55. hi sir is ns 2.32 stable than the other versions..? if so tel me its features which made this version stable..? and also tel me the drawbacks of this ns2.32 version..

    1. I explained it, what was the feature of my system. I installed it on ubuntu and macintosh. and study on ns2.32 , for the upgraded version did not owrk and I re-installed the ns-2 again. it was paintful but at the moment also i did lots of googling…

  56. can u pls explain me briefly about the Xgraph tool and how to fetch the data from the trace file and use in the xgraph.. could you pls send me any materials on this…?

  57. The error is

    num_nodes is set 100

    (_o14 cmd line 1)
    invoked from within
    “_o14 cmd addr”
    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 “_o14″ line 2)
    (SplitObject unknown line 2)
    invoked from within
    “_o14 addr”
    (“eval” body line 1)
    invoked from within
    “eval $node addr $args”
    (“default” arm line 2)
    invoked from within
    “switch -exact $routingAgent_ {
    DSDV {
    set ragent [$self create-dsdv-agent $node]
    }
    DSR {
    $self at 0.0 “$node start-dsr”
    }
    AODV {
    set ragent [$self cre…”
    (procedure “_o3” line 14)
    (Simulator create-wireless-node line 14)
    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 mnode_($i) [$ns node]
    }"
    (file "wfrp_802_15_4.tcl" line 74)

  58. Hello,

    I stumbled upon your blog, when i was looking for tutorials on NS2.
    I am a PhD student and I work on data collection in wireless network.
    I saw you did a thesis on the collection and analysis of data in networks VANET, I wanted to know if it was possible to have a copy of your PhD report, or paper published.

    Thank you

    1. Hi,

      First of all I would like to emphasize that the study what I had foor the master thesis not for the PhD.
      I will send my thesis (.pdf) to you and if you also want I would liket o share my sourcodes as well.
      However, I want to be sure that the work what you are looking for is included in my thesis.

      Regards
      Hilal Karatoy

  59. Hello everyone!!!!!!!! I just want to know,after modification in AODV in ns2.34,is there need to be install ns2.34 again? I am using opensuse 12.1 for running my project in MANET?

    Thanks in advance……:)

  60. warm greetings mam,
    i am doing my proj in ns2, in same situation as u bcoz there is no one around me to help me out. my project is receiver driven layered multicast for scalable video. when i run the multicast program with 2 senders n 3 receivers, nam window opens n simulation runs perfectly. Though I have included the open trace.tr w command i donot get any window which opens up and shows me the result values of simulation. I need to know how to view the trace file and plot the values on gnuplot(which i have installed). i am using ubuntu 12.04 LTS ns2-2.35

    1. Dear Arun, that is good u post ur question. The trace file u can read, i am sure it is created. I dont remember that ns232 has the feature about ploting. But for the plots or even videos u can use matlab… The project what u described is not what i can help, but i hope someone who reads will help u… Good luck

  61. Greeting everyone,
    I have an assignment to simulate traffic engineering using ns-2,
    I did found MNS_v2.0 and RSVP-Te/ns as the patch for traffic engineering module.
    I know they’re kinda old, and the last patch is only for ns-2.26 as I’m using ns-2.32 for now.
    Is there anyone who know how to patch both of them in ns-2.32 ? what modification that I have to do to make them work together in ns-2.
    I’m using ubuntu 8.04, ns-2.32, gcc-4.1 and the file that I’ve found for the patch is :
    MNS_v2.0 for ns-2.26 and RSVP-TE/ns for ns-2.26>
    Thank you.
    Sincerely, patrick.

    1. I just want to share the struggles what i had during my study, and the pages whre i get benefit. There are lots of people r doin this , i am mot the only person….
      If u mean it thank u, i suggest u to share ur solutions, maybe someone who really wants to solve their prof. problems by reading ur posts

  62. Dear Fellows,

    NS-2 has implementation for default 802.11 mac and PHY. NS-2 also has another(Extension) 802.11 implementation that is called mac-802_11Ext and wireless-phyExt. I want to know if anyone has performed simulation in the extended version of the implementation for 802.11a/b/g and compared the results with those of the default implementation.
    Detailed description about the extended implementation has been given by the authors in the paper titled “Overhaul of IEEE 802.11 Modeling and Simulation in NS-2”.
    Any feedback would be highly appreciated.

    cheers
    -Bilal

  63. Deal All,
    I have problem regarding TCP Westwood in ns-2.34.
    compilation of ns-2.34 was ok after copying the files tcp-westwood.h and tcp-westwood.cc in proper location but on running any tcl script i am getting following errors:
    ns:

    : invalid command name “Agent/TCP/Westwood”
    while executing
    “Agent/TCP/Westwood set current_bew_ 1”

    anyone having solution,,, please reply me at :dineshdobhal@rediffmail.com

    1. Hi,
      You can see which protocol i r using, when u create a communication channel. Just give a try to one of examples written under ns folder and look inside the trace file. In order to create trace file u use nam script within the code, and after u run code open the create file again with the nam script

  64. On running my code I am getting this output…..pls help me to remove segmentation fault
    num_nodes is set 30
    warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
    INITIALIZE THE LIST xListHead
    Loading connection pattern…
    Loading scenario file…
    Starting Simulation…
    channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
    highestAntennaZ_ = 1.5, distCST_ = 550.0
    SORTING LISTS …DONE!
    Segmentation fault

    1. U know why u getsegmentation fault…. Memory confliction … Afaik it is the eaisiest way is the check ur method names or so… Dont give ant method name which can be generic… This is what comes first.

      1. Also the reason could be that i had! You try to write a file while file is not opened yet!!! How it could be happen–> if u write a file within the loop… These are just i share an know… Memory problem basically…

  65. Hi,
    I need your help on how to editing c++ files in order to do cross layer solution. I propose a cross layer solution for wireless (ieee 802.11b) congestion control where requires to passing channel quality estimation and error packet marking to Transport layer. Can you help me

    Haniza, Malaysia

    1. I dont know which file u r gonna change but the way way how u r gonna chnage u need to know what u wanna change then u can just look for oo implementation for that. I did change for c++ but u need to know firts whatbu need to do. Transfer data, analayse the data receive pr sent or whatever …

  66. Hi Hilal,

    I am a newbiew here. I am using NS2 for my WSN project. Could you please tell me how to schedule multi-frequecy transmission in NS2? Could you please provide a sample ?

  67. hi.

    I have made a simulation in NS-2 and want to plot a graph by xgraph. But it always gives me the error given below:

    Error in file `voipudp.tr’ at line 378:
    Unknown line type
    Error in file `voipudp.tr’ at line 379:
    Unknown line type
    Error in file `voipudp.tr’ at line 380:
    Unknown line type
    Problems found with input data.

    I have searched on the web including ns-2 forum but no satisfactory answer is available.

    my .tr file formate is like below

    + 0.1 0 1 cbr 128 ——- 1 0.0 1.0 0 0
    – 0.1 0 1 cbr 128 ——- 1 0.0 1.0 0 0
    + 0.1 1 0 cbr 128 ——- 2 1.1 0.1 0 1
    – 0.1 1 0 cbr 128 ——- 2 1.1 0.1 0 1
    + 0.12 0 1 cbr 128 ——- 1 0.0 1.0 1 2
    – 0.12 0 1 cbr 128 ——- 1 0.0 1.0 1 2
    + 0.12 1 0 cbr 128 ——- 2 1.1 0.1 1 3
    – 0.12 1 0 cbr 128 ——- 2 1.1 0.1 1 3
    + 0.14 0 1 cbr 128 ——- 1 0.0 1.0 2 4
    – 0.14 0 1 cbr 128 ——- 1 0.0 1.0 2 4
    + 0.14 1 0 cbr 128 ——- 2 1.1 0.1 2 5
    – 0.14 1 0 cbr 128 ——- 2 1.1 0.1 2 5
    r 0.154 0 1 cbr 128 ——- 1 0.0 1.0 0 0
    r 0.154 1 0 cbr 128 ——- 2 1.1 0.1 0 1
    + 0.16 0 1 cbr 128 ——- 1 0.0 1.0 3 6
    – 0.16 0 1 cbr 128 ——- 1 0.0 1.0 3 6
    + 0.16 1 0 cbr 128 ——- 2 1.1 0.1 3 7
    – 0.16 1 0 cbr 128 ——- 2 1.1 0.1 3 7
    r 0.174 0 1 cbr 128 ——- 1 0.0 1.0 1 2
    r 0.174 1 0 cbr 128 ——- 2 1.1 0.1 1 3

    I am stuck up, Can you please help me to solve this problem its urgent and important.

    Thanks
    pradeep.vanparia@gmail.com

  68. hello mam,
    i am working on LAR and DREAM routing protocol. i need to simulate them on ns2 and find their performance.
    Please help me how i can do it.
    I have downloaded patch of LAR and DREAM from toilers. This patch work on ns-2.32. I have included the patch in ns2.32. But script is not working. i think code is not patched correctly in ns2.
    Please tell me the steps to add the pacth of LAR and DREAM in ns2.32.

  69. Hi,
    i m trying simulate leach protocol with Gauss-Markov mobility model, but when i run the tcl script im getting this error. i’ll be grateful if you can guide how to resolve this issue.
    regards,
    najma

    5 is setting code to 0
    4 is setting code to 0
    45 is setting code to 0
    3 is setting code to 0
    ns: _o917 setdest 151.71516968780583 250.0 1.9939683248219735:
    (_o917 cmd line 1)
    invoked from within
    “_o917 cmd setdest 151.71516968780583 250.0 1.9939683248219735”
    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 “_o917” line 2)
    (SplitObject unknown line 2)
    invoked from within
    “_o917 setdest 151.71516968780583 250.0 1.9939683248219735”

  70. hello mam, plz help me when m run my tcl script that type of error occure how can i resolve it plz suggest…………that error are
    [root@localhost Templates]# ns 100dsr.tcl
    *** glibc detected *** ns: realloc(): invalid next size: 0x0904a3b0 ***
    ======= Backtrace: =========
    /lib/libc.so.6[0x489ff882]
    /lib/libc.so.6[0x48a0272c]
    /lib/libc.so.6(realloc+0xcf)[0x48a0428f]
    ns(TclpRealloc+0x23)[0x8452673]
    ns(Tcl_Realloc+0x2a)[0x83dbd5a]
    ns(Tcl_SetObjLength+0x71)[0x8432c11]
    ns(TclpNativeJoinPath+0xad)[0x8407c3d]
    ns(Tcl_FSJoinPath+0x324)[0x841a5a4]
    ns(Tcl_JoinPath+0x6c)[0x840802c]
    ns(TclpInitLibraryPath+0x534)[0x8446474]
    ns[0x83fb0aa]
    ns(Tcl_FindExecutable+0xff)[0x83fb3af]
    ns(Tcl_Main+0x2f)[0x8420a2f]
    ns(nslibmain+0x20)[0x83c97c0]
    ns(main+0x1b)[0x83c991b]
    /lib/libc.so.6(__libc_start_main+0xf5)[0x489a4635]
    ns[0x81c88d1]
    ======= Memory map: ========
    08048000-08597000 r-xp 00000000 08:05 793841 /home/smriti/ns-allinone-2.34/ns-2.34/ns
    08597000-08633000 rw-p 0054e000 08:05 793841 /home/smriti/ns-allinone-2.34/ns-2.34/ns
    08633000-0863b000 rw-p 00000000 00:00 0
    09046000-09067000 rw-p 00000000 00:00 0 [heap]
    48968000-48987000 r-xp 00000000 08:05 132766 /usr/lib/ld-2.15.so
    48987000-48988000 r–p 0001e000 08:05 132766 /usr/lib/ld-2.15.so
    48988000-48989000 rw-p 0001f000 08:05 132766 /usr/lib/ld-2.15.so
    4898b000-48b36000 r-xp 00000000 08:05 132767 /usr/lib/libc-2.15.so
    48b36000-48b37000 —p 001ab000 08:05 132767 /usr/lib/libc-2.15.so
    48b37000-48b39000 r–p 001ab000 08:05 132767 /usr/lib/libc-2.15.so
    48b39000-48b3a000 rw-p 001ad000 08:05 132767 /usr/lib/libc-2.15.so
    48b3a000-48b3d000 rw-p 00000000 00:00 0
    48b5b000-48b5e000 r-xp 00000000 08:05 134217 /usr/lib/libdl-2.15.so
    48b5e000-48b5f000 r–p 00002000 08:05 134217 /usr/lib/libdl-2.15.so
    48b5f000-48b60000 rw-p 00003000 08:05 134217 /usr/lib/libdl-2.15.so
    48b6d000-48b96000 r-xp 00000000 08:05 144226 /usr/lib/libm-2.15.so
    48b96000-48b97000 r–p 00029000 08:05 144226 /usr/lib/libm-2.15.so
    48b97000-48b98000 rw-p 0002a000 08:05 144226 /usr/lib/libm-2.15.so
    48edb000-48ef7000 r-xp 00000000 08:05 134500 /usr/lib/libgcc_s-4.7.2-20120921.so.1
    48ef7000-48ef8000 rw-p 0001b000 08:05 134500 /usr/lib/libgcc_s-4.7.2-20120921.so.1
    48efa000-48efc000 r-xp 00000000 08:05 144679 /usr/lib/libXau.so.6.0.0
    48efc000-48efd000 r–p 00001000 08:05 144679 /usr/lib/libXau.so.6.0.0
    48efd000-48efe000 rw-p 00002000 08:05 144679 /usr/lib/libXau.so.6.0.0
    48f00000-48f20000 r-xp 00000000 08:05 144680 /usr/lib/libxcb.so.1.1.0
    48f20000-48f21000 r–p 0001f000 08:05 144680 /usr/lib/libxcb.so.1.1.0
    48f21000-48f22000 rw-p 00020000 08:05 144680 /usr/lib/libxcb.so.1.1.0
    48f24000-49058000 r-xp 00000000 08:05 144681 /usr/lib/libX11.so.6.3.0
    49058000-49059000 r–p 00134000 08:05 144681 /usr/lib/libX11.so.6.3.0
    49059000-4905c000 rw-p 00135000 08:05 144681 /usr/lib/libX11.so.6.3.0
    4905e000-4906e000 r-xp 00000000 08:05 144695 /usr/lib/libXext.so.6.4.0
    4906e000-4906f000 r–p 0000f000 08:05 144695 /usr/lib/libXext.so.6.4.0
    4906f000-49070000 rw-p 00010000 08:05 144695 /usr/lib/libXext.so.6.4.0
    49399000-49479000 r-xp 00000000 08:05 146073 /usr/lib/libstdc++.so.6.0.17
    49479000-4947d000 r–p 000e0000 08:05 146073 /usr/lib/libstdc++.so.6.0.17
    4947d000-4947e000 rw-p 000e4000 08:05 146073 /usr/lib/libstdc++.so.6.0.17
    4947e000-49485000 rw-p 00000000 00:00 0
    4a645000-4a65c000 r-xp 00000000 08:05 145952 /usr/lib/libnsl-2.15.so
    4a65c000-4a65d000 r–p 00016000 08:05 145952 /usr/lib/libnsl-2.15.so
    4a65d000-4a65e000 rw-p 00017000 08:05 145952 /usr/lib/libnsl-2.15.so
    4a65e000-4a660000 rw-p 00000000 00:00 0
    b77d2000-b77d6000 rw-p 00000000 00:00 0
    b77e8000-b77ea000 rw-p 00000000 00:00 0
    b77ea000-b77eb000 r-xp 00000000 00:00 0 [vdso]
    bfbf4000-bfc15000 rw-p 00000000 00:00 0 [stack]
    Aborted (core dumped)

  71. Hi,
    i m simulating leach protocol under ns-2.29 with mannasim on ubuntu 10.04. i have made few changes in energy model of sensor node and run make, and it compiled correctly then i undo the changes and run make command, now i m getting this error, although i haven’t even access those files or update anything but still getting this error. please guide how to resolve this issue.
    regards,
    najma

    root@ubuntu:/home/najmaismat/ns-allinone-2.29/ns-2.29# make
    make: *** No rule to make target `adc/ump.o’, needed by `ns’. Stop.

    1. I am suffer the same problem but yet no solve.So can give me how to make it.
      ns-allinone-2.34/ns-2.34# make
      make: *** No rule to make target `adc/ump.o’, needed by `ns’. Stop.

  72. hiii…i want to implement watchdog…can u plz tell how to put a node in promiscous mode..like if node 2 wants to overhear packets from node 3 ,den wat code i sholud write??

  73. Dear mam,

    plz provide the information to linkage in between OTCL and C language. so that i will create an object file.
    Thanks(p.netcom11@yahoo.com

  74. Hi… I am install Ns2.35 when I am run .tcl file I didn’t create nam file can u please help me for this installation is complete withouterror..

  75. set ns [new Simulator]

    set namfile [open pro1.nam w]
    $ns namtrace-all $namfile

    set tracefile [open pro1.tr w]
    $ns trace-all $tracefile

    set n0 [$ns node]
    set R1 [$ns node]
    set R2 [$ns node]
    set n1 [$ns node]
    set n2 [$ns node]
    set n3 [$ns node]

    $ns duplex-link $n0 $R1 10Mb 1ms DropTail
    $ns duplex-link $R1 $R2 1Mb 3ms DropTail
    $ns duplex-link $R2 $n1 10Mb 1ms DropTail
    $ns duplex-link $n2 $R1 10Mb 1ms DropTail
    $ns duplex-link $R2 $n3 10Mb 1ms DropTail

    set tcp [new Agent/TCP]
    $ns attach-agent $n0 $tcp

    set sink [new Agent/TCPSink]
    $ns attach-agent $n1 $sink

    set tfile[new Tracefile]
    #$tfile filename starwars.nsformat

    $n0 color “blue”
    $n1 color “green”

    $ns connect $tcp $sink

    set ftp [new Application/FTP]
    $ftp attach-agent $tcp

    set udp [new Agent/UDP]
    $ns attach-agent $n2 $udp

    set tfile [new Tracefile]
    $tfile filename starwars.nsformat

    set null [new Agent/UDP]
    $ns attach-agent $n3 $null

    set trace0 [new Application/Traffic/Trace]

    $trace0 attach-tracefile $tfile
    $trace0 attach-agent $udp

    $ns at 0.0 “$ftp start”
    $ns at 200.0 “$ftp stop”
    $ns at 0.0 “$trace0 start”
    $ns at 200.0 “$trace0 stop”

    #$ns at 0.0 “record”

    proc finish { } {
    global ns namfile tracefile
    $ns flush-trace
    close $namfile
    close $tracefile
    exec cat pro1.tr | awk -f pro1.awk
    exec cat pro1.tr | awk -f thruput.awk
    exec xgraph -bb -tk -x Count -y Tme pro1.data -bg white &
    exec xgraph -bb -tk -x Count -y Tme thruput.data -bg white &

    exec nam pro1.nam &
    }

    $ns at 10.0 “finish”
    $ns run

  76. set ns [new Simulator]

    set namfile [open pro1.nam w]
    $ns namtrace-all $namfile

    set tracefile [open pro1.tr w]
    $ns trace-all $tracefile

    set n0 [$ns node]
    set R1 [$ns node]
    set R2 [$ns node]
    set n1 [$ns node]
    set n2 [$ns node]
    set n3 [$ns node]

    $ns duplex-link $n0 $R1 10Mb 1ms DropTail
    $ns duplex-link $R1 $R2 1Mb 3ms DropTail
    $ns duplex-link $R2 $n1 10Mb 1ms DropTail
    $ns duplex-link $n2 $R1 10Mb 1ms DropTail
    $ns duplex-link $R2 $n3 10Mb 1ms DropTail

    set tcp [new Agent/TCP]
    $ns attach-agent $n0 $tcp

    set sink [new Agent/TCPSink]
    $ns attach-agent $n1 $sink

    set tfile[new Tracefile]
    #$tfile filename starwars.nsformat

    $n0 color “blue”
    $n1 color “green”

    $ns connect $tcp $sink

    set ftp [new Application/FTP]
    $ftp attach-agent $tcp

    set udp [new Agent/UDP]
    $ns attach-agent $n2 $udp

    set tfile [new Tracefile]
    $tfile filename starwars.nsformat

    set null [new Agent/UDP]
    $ns attach-agent $n3 $null

    set trace0 [new Application/Traffic/Trace]

    $trace0 attach-tracefile $tfile
    $trace0 attach-agent $udp

    $ns at 0.0 “$ftp start”
    $ns at 200.0 “$ftp stop”
    $ns at 0.0 “$trace0 start”
    $ns at 200.0 “$trace0 stop”

    #$ns at 0.0 “record”

    proc finish { } {
    global ns namfile tracefile
    $ns flush-trace
    close $namfile
    close $tracefile
    exec cat pro1.tr | awk -f pro1.awk
    exec cat pro1.tr | awk -f thruput.awk
    exec xgraph -bb -tk -x Count -y Tme pro1.data -bg white &
    exec xgraph -bb -tk -x Count -y Tme thruput.data -bg white &

    exec nam pro1.nam &
    }

    $ns at 10.0 “finish”
    $ns run

    I dont know, I am getting problem in Tracefile. Some one please help me in this proble:-)

  77. Hello sir,
    I am a final year student and I am doing a project on QoS Aware geographic opportunistic routing in wireless sensor networks. I need code for this so could you please send sir…?

  78. dear sir,
    i am final year student of ece dept .we are doing project on qos aware geographic opportunistic routing in wireless sensor network. i need a ns2 code for this project and our deadline is 25 march to submit our full project with documentation.could you pls send me the code for our project sir…..

  79. dear sir,
    i am final year student of ece dept .we are doing project on qos aware geographic opportunistic routing in wireless sensor network. i need a ns2 code eqgor and our deadline is 25 march to submit our full project with documentation.could you pls send me the ns2 code for our project sir…..

  80. hi sir,im trying to implement adaptive multitopology traffic engineering using ns2.i have a refrence paper named “TRAFFIC ENGINEERING SYSTEM BASED ON ADAPTIVE MULTI-PATH ROUTING”.this paper implements it by creating a WSN i have done a part of the code using routing protocol aomdv but im not able to set a link in the network down. and adaptive rerouting of it. if you could pls guide me with it
    thanks

  81. Hello Mam,
    I am M.tech student working on TORA protocol of MANET. My goal is to enhance the throughput of TORA. While executing the tora.tcl filre, the error I get is:
    warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
    INITIALIZE THE LIST xListHead

    Please provide me with the solution of this error as due to this error, my dissertation work is paused.
    Thanks in advance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s