How to add new queue type

139 views
Skip to first unread message

Antoine Nom

unread,
Jun 3, 2018, 3:21:10 AM6/3/18
to Network Simulator 2 (NS2)
Hello,

I am trying to add some new queue types in ns-2.29 but it doesn't work, so I tried some easier things like following this tutorial : http://nile.wpi.edu/NS/new_queue.html

But when I try to run the tcl file, I get this error :

invalid command name "Queue/DTRR"
    while executing
"Queue/DTRR create _o68 "
    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 Queue/$qtype"
    ("default" arm line 3)
    invoked from within
"switch -exact $qtype {
ErrorModule {
if { [llength $args] > 0 } {
set q [eval new $qtype $args]
} else {
set q [new $qtype Fid]
}
}
intserv {
set qtyp..."
    (procedure "_o3" line 14)
    (Simulator simplex-link line 14)
    invoked from within
"_o3 simplex-link _o16 _o19 2Mb 10ms DTRR"
    ("eval" body line 1)
    invoked from within
"eval $self simplex-link $n1 $n2 $bw $delay $type $args"
    (procedure "_o3" line 8)
    (Simulator duplex-link line 8)
    invoked from within
"$ns duplex-link $node_(r1) $node_(r2) 2Mb 10ms DTRR"
    (file "ex-dtrr-queue.tcl" line 48)


I added the two files "dtrr-queue.h" and "dtrr-queue.cc" to my queue folder and added the following line : "queue/dtrr-queue.o \" in the makefile before doing a "make" without errors. So I don't know what I missed?

Thank you for helping me.

knudfl

unread,
Jun 3, 2018, 6:57:51 AM6/3/18
to Network Simulator 2 (NS2)
»» invalid command name "Queue/DTRR" «« :  You are using a wrong copy of the executable 'ns'.
Please always use a new name when creating a new 'ns',  e.g.  ns229-dtrr.
And use it at simulation time :         $ ns229-dtrr ex-dtrr-queue.tcl

! However, if you read "ex-dtrr-queue.tcl" it can be discovered that a "new Agent" is also required.
Line 65, ex-dtrr-queue.tcl              set udp_s [new Agent/UDP/UDPmm]

.... which is the Chapter before  http://nile.wpi.edu/NS/new_queue.html

My test :
cd ns-allinone-2.29/
patch
-p0 > mmApp-DTRR_ns229.patch
export  CC=gcc34 CXX=g++34 && ./install
cd ns
-2.29/
cp ns ns229
-mmApp-DTRR
sudo cp ns229
-mmApp-DTRR /usr/local/bin/

-------- Simulation ---------------
ns229-mmApp-DTRR ex-dtrr-queue.tcl
ns229
-mmApp-DTRR ex-mm-app.tcl
mmApp-DTRR_ns229.patch

knudfl

unread,
Jun 3, 2018, 4:19:58 PM6/3/18
to Network Simulator 2 (NS2)
Sorry, wrong patch.
The new patch with all code is attached ...


On Sunday, June 3, 2018 at 9:21:10 AM UTC+2, Antoine Nom wrote:
mmApp-DTRR-1_ns229.patch

Antoine Nom

unread,
Jun 4, 2018, 12:50:16 AM6/4/18
to Network Simulator 2 (NS2)
Hey! 

Thank you it actually worked, the thing I was missing from the beginning is the fact that we need to create a new ns after every new change in the makefile. Now I understand better. 

Another question : I am working on wireless adhoc networks and I was wondering if you had some Round Robin queue that worked well since the DTRR made no change on my wireless simulation compare to the Droptail/PriQueue (which I believe is FIFO).

Thanks again, one more time you helped me a lot.

knudfl

unread,
Jun 4, 2018, 6:35:58 AM6/4/18
to Network Simulator 2 (NS2)
@Antoine Nom,  Hi.

DRR (Deficit Round Robin), see  queue-ns2/README, and TextFile2017-links.txt

The other item I have in my "ns Queue" folder is `size-aware´
I also have "QLBP/" → all items are in ``Queue-ns2.tar´´

eva lu

unread,
Jul 3, 2019, 6:16:12 AM7/3/19
to Network Simulator 2 (NS2)
<<Please always use a new name when creating a new 'ns',  e.g.  ns229-dtrr.<<
I met the same problem,could you tell me how to use a new name when creating a new 'ns'.
thank you very much.

在 2018年6月3日星期日 UTC+8下午6:57:51,knudfl写道:

knudfl

unread,
Jul 3, 2019, 6:41:10 AM7/3/19
to Network Simulator 2 (NS2)
@eva lu ,   Hi.

Executable´s "ns-new.name" are required when you have multiple 'ns'.
Example :
cd ns-2.35/
cp ns ns
-orig
sudo cp ns
-orig /usr/local/bin/
           
// and when you do changes, example "LTE"
cp ns ns235
-lte
sudo cp ns235
-lte /usr/local/bin/

------------- Simulation -------------
$ ns
-orig [a-default-simulation].tcl
$ ns235
-lte lte.tcl
  • My example  usr.local.bin-04May19.txt  is attached ...
  • Please read ns2-INFO  :  Also attached ...

On Wednesday, July 3, 2019 at 12:16:12 PM UTC+2, eva lu wrote:
<<Please always use a new name when creating a new 'ns',  e.g.  ns229-dtrr.<
could you tell me how to use a new name when creating a new 'ns'
usr.local.bin-04May19.txt
ns2-INFO.txt

eva lu

unread,
Jul 3, 2019, 8:53:59 AM7/3/19
to Network Simulator 2 (NS2)
Hi,thank you for helping me!
I added the two files "dtrr-queue.h" and "dtrr-queue.cc" to my queue folder and added the following line : "queue/dtrr-queue.o \" in the makefile ,and than did the following steps:
cd ns-2.35/
make clean
make
cp ns ns
-dtrr
sudo cp ns
-dtrr /usr/local/bin/
------------- Simulation -------------
$ ns
-dtrr test-dtrr.tcl

but I got this error :

    (_o68 cmd line 1)
    invoked from within
"_o68 cmd link _o72"
    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 "_o68" line 2)
    (SplitObject unknown line 2)
    invoked from within
"$q link [$link_($sid:$did) set link_]"
    (procedure "_o3" line 73)
    (Simulator simplex-link line 73)
    invoked from within
"_o3 simplex-link _o16 _o19 2Mb 10ms DTRR"
    ("eval" body line 1)
    invoked from within
"eval $self simplex-link $n1 $n2 $bw $delay $type $args"
    (procedure "_o3" line 8)
    (Simulator duplex-link line 8)
    invoked from within
"$ns duplex-link $node_(r1) $node_(r2) 2Mb 10ms DTRR"
    (file "ex.tcl" line 48)

Do you know where is wrong? Thank you very much.


在 2019年7月3日星期三 UTC+8下午6:41:10,knudfl写道:

knudfl

unread,
Jul 3, 2019, 9:54:31 AM7/3/19
to Network Simulator 2 (NS2)
@eva lu  ,   Hi.

My test ...
$ ns229-mmApp-DTRR-64 ex-dtrr-queue.tcl
... The files out.nam 3.7MB, out.tr 1.5MB are created.
And a NAM window opens.
  • The example  ex-dtrr-queue.tcl  is attached.
ex-dtrr-queue.tcl
Message has been deleted

knudfl

unread,
Jul 3, 2019, 10:34:42 AM7/3/19
to Network Simulator 2 (NS2)
@eva lu  ,   Hi.

Sorry, the above example has some "mmApp, UDPmm" included.

A "dtrr only"  example works OK with ...
ns235-dtrr-64 dtrr-queue.tcl
Files :  out.nam 3.5MB, out.tr 1.4MB
dtrr-queue.tcl

eva lu

unread,
Jul 4, 2019, 1:44:51 AM7/4/19
to Network Simulator 2 (NS2)
hello, knudfl :
   you helped me a lot,thank you. I have solved this problem.

在 2019年7月3日星期三 UTC+8下午10:34:42,knudfl写道:
Reply all
Reply to author
Forward
0 new messages