0
votes

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?

2
Well, subst $[subst $var] is awful code, and set $var would (probably) be better (or the code is even more awful than I thought). But that probably wouldn't fix the problem. Did you write $tcp($i) set dctcp_alpha_ and what do you expect it to do? - Donal Fellows
Thanks a lot @DonalFellows for your kind reply. I am very new to tcl and this is the first tcl code I have seen in my life which is obviously not written by me, so unfortunately I cannot answer what I expect $tcp($i) set dctcp_alpha_ to do. The code is here: goo.gl/5HeO9y - user3048851

2 Answers

0
votes

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

    -
0
votes

I used to have exactly the same problem as you mentioned:

  ns: myTrace file3: can't read "dctcp_alpha_": no such variable 
           while executing
  st $[subst $var]"
       (procedure "_o154" line 5)
       (Object next line 5)
       invoked from within
    ...

1.The problem is you needs to compile after running the patch.

as Knud Larsen mentioned in his answer, after running following patch:

cd ns-allinone-2.35/ns-2.35/

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

You need to go to the /ns-allinone-2.35/ folder, and do the compiling:

cd ../

./install

cd ns-2.35/

sudo make install
  1. Different from Knud Larsen, I did not rename another ns. I run the simulation directly with ns command:

    ns simpleDumbbell.tcl

And it works for me.

Hope this helps : )