Search code examples
tclns2

tcl script error on ns2 (no such variable)


I tried to run the example code available here: http://simula.stanford.edu/~alizade/Site/DCTCP_files/dctcp-ns2-rev1.0.tar.gz

As per the readme file, the patch was successfully applied but on executing the example code, the following error was obtained:

ns: myTrace file3: can't read "dctcp_alpha_": no such variable
    while executing
"subst $[subst $var]"
    (procedure "_o154" line 5)
    (Object next line 5)
    invoked from within
"_o154 next dctcp_alpha_"
    ("eval" body line 1)
    invoked from within
"eval $self next $args"
    (procedure "_o154" line 18)
    (Agent set line 18)
    invoked from within
"$tcp($i) set dctcp_alpha_"
    (procedure "myTrace" line 8)
    invoked from within
"myTrace file3"

How could this be solved?


Solution

  • Build example : tar xvf ns-allinone-2.35_gcc482.tar.gz

    https://drive.google.com/file/d/0B7S255p3kFXNSGJCZ2YzUGJDVk0/view?usp=sharing

    cd ns-allinone-2.35/ns-2.35/

    patch -p1 --ignore-whitespace -i dctcp.patch

    cd ../

    ./install

    cd ns-2.35/

    sudo make install

    cp ns ns235-dctcp

    sudo cp ns235-dctcp /usr/local/bin/

    • Run the simulation : ns235-dctcp simpleDumbbell.tcl

    .. The files mytracefile.tr 2.1MB, thrfile.tr 10.2kB are created. ( And queue.tr : 0B ).

    Your errors : You are probably using a wrong executabe 'ns'.

    The safe way is a copy of the DCTCP patched 'ns', with a new name.

    And with a location in a system PATH, like /usr/local/bin/ns235-dctcp

      -