Unable to change the RRED configuration parameters from the simulation TCL script file.

63 views
Skip to first unread message

Harkeerat

unread,
Apr 24, 2012, 2:03:58 PM4/24/12
to AQM&DoS Simulation Platform
Hello all,

I am trying to run the RRED simulation on my installation of NS2 (ver.
2.35) and I am not able to change the RRED configuration parameters
from my simulation TCL script file.

For example, following is one entry in the ns-default.tcl:
Queue/RED/Robust set hash_bins_ 23

And, I have a ns TCL script file where I have the following line:
Queue/RED/Robust set hash_bins_ 22.

However when I execute my TCL script, the variable hash_bins_ is 23,
instead of 22. (Even after I run make clean, make depend, make).
Also, if I edit the value in the ns-default.tcl file, then I can see
it getting updated. But I am not able to update this value from my TCL
script file.

I am not sure what I am missing. Can someone help me with how to
change the configuration parameters from a simulation TCL script?

Thank you.
Harkeerat

-

unread,
Apr 24, 2012, 3:04:11 PM4/24/12
to aqmdos-simula...@googlegroups.com
Hi,

Are you currently using the default tcl script "leodos.tcl" or a completely new one you have written yourself?

You problem do seems weird. If you are writing your own tcl script to simulate RRED, I would suggest you checking whether you have put the parameter configuration of RRED after initialising ns:

set ns [new Simulator]
.

So you code should like this:

set ns [new Simulator]

#usage
getPam $argc $argv
printPam

Queue/RED set bytes_ false ;
Queue/RED set queue_in_bytes_ false ;
#Queue/RED set adaptive_ 0 ;

# Added by leoking RobustRed config 0
Queue/RED/Robust set hash_bins_ 22
Queue/RED/Robust set hash_levels_ 2
Queue/RED/Robust set score_max_ 10
Queue/RED/Robust set score_min_ -1
Queue/RED/Robust set score_pass_ 0
Queue/RED/Robust set last_drop_time_ 0ms
Queue/RED/Robust set drop_related_period_ 10ms
# Added by leoking RobustRed config 1


For curiosity, I wonder how did you know the actual value of  hash_bins_ using in RRED? Did you modify the red-robust.cc to print the value?

Harkeerat

--
Message sent from the "AQM&DoS Simulation Platform" group.
To post to this group, send email to
aqmdos-simula...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/aqmdos-simulation-platform?hl=en

Harkeerat Bedi

unread,
Apr 24, 2012, 3:48:40 PM4/24/12
to aqmdos-simula...@googlegroups.com
Hello Leo King,

Yes you are right about printing the hash_bins_ value. I edited red-robust.cc by adding a print statement in:

RobustREDQueue::RobustREDQueue(const char * trace) : REDQueue(trace) {
....
printf("harkeerat: hash_bins_: %d \n", hash_bins_);
}

I am using a new tcl script file which I wrote myself. Following is the whole file:

example4.1.tcl:
###############
# A ns script file to learn how to change a AQM techique's configuration parameters.

#Create a simulator object
set ns [new Simulator]

#Create 5 nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]

#Connect the nodes
$ns duplex-link $n0 $n3 1Mb 100ms DropTail
$ns duplex-link $n1 $n3 1Mb 100ms DropTail
$ns duplex-link $n2 $n3 1Mb 100ms DropTail
#$ns duplex-link $n3 $n4 1Mb 100ms Droptail

#bottleneck link
$ns simplex-link $n4 $n3 1Mb 100ms DropTail
$ns simplex-link $n3 $n4 1Mb 100ms RED/Robust ;#change AQM here
#(e.g. Blue, SFQ, SFB, DFS, RED/Robust, etc). Original: DropTail.

#configure RED/Robust parameters
Queue/RED/Robust set hash_bins_ 22

#Run the simulation
$ns run
###############


When I run the above ns script. I get the following output:
harkeerat: hash_bins_: 23

I want it to be 22, but it prints 23. If I edit this value in ns-default.tcl it changes as expected. 

Can you guess what can be the issue? 

If you may run the above tcl file at your end and edit red-robust.cc to print the hash_bins_ value, maybe it can help in narrowing the issue?

Kindly suggest. Thank you.

Regards,
Harkeerat Bedi

-

unread,
Apr 24, 2012, 4:04:27 PM4/24/12
to aqmdos-simula...@googlegroups.com
I guess I know where is problem is now. :)

It is because you print the hash_bins_ in the construct function of the  RobustREDQueue. However, the parameter setting code in the tcl script might be executed after the construct function of RobustREDQueue.

So that, you might want to add the printf sentence in the function of hashPkt. Or you can remove the "//" before "//#define RREDDEBUG" in red-robust.h to activate the debug mode of the RRED program. In the debug mode, RRED program will output more information. Among those information, the info about hash_bins_ is included in the function of printBins which will be called if you turn the debug mode on.

Hope this will solve your problem: The hash_bins_ value is successfully changed by your tcl script, but not when you print its value in the construct function.

-

unread,
Apr 24, 2012, 4:10:59 PM4/24/12
to aqmdos-simula...@googlegroups.com
Hi, 

I would also suggest you putting the parameter configuration directly after initialising the ns: 

#Create a simulator object
set ns [new Simulator]

#configure RED/Robust parameters
Queue/RED/Robust set hash_bins_ 22

xxxxxx other code.

Harkeerat Bedi

unread,
Apr 24, 2012, 5:38:48 PM4/24/12
to aqmdos-simula...@googlegroups.com
Thank you so much for your help.

You are right, as I was configuring the parameters after the constructor (in my ns script file), I was not able to see the updated value in the print statement. 

I moved "Queue/RED/Robust set hash_bins_ 22" to right after initializing my ns "set ns [new Simulator]" as you suggested. Doing so, I was able to see the updated parameter values using the print statement in the constructor. I was also able to verify the same using the debugging macro you mentioned. 

Thank you once again :)

Regards,
Harkeerat Bedi

-

unread,
Apr 25, 2012, 7:22:32 AM4/25/12
to aqmdos-simula...@googlegroups.com
Hi Harkeerat,

I think you are on the right track to understand the AQM&DoS Simulation Platform and the ns2 system.

Could I invite you to be one of the managers of the Group (together with Mohammed N M F Alenezi )

You are more than welcome to help answer other members' questions.

Thanks.

Harkeerat Bedi

unread,
Apr 30, 2012, 11:32:25 AM4/30/12
to aqmdos-simula...@googlegroups.com
Hello Leo King,

Thank you for you consideration. I am a beginner in this area but, I will be more than happy to provide my support to this Group and its members.

Regards,
Harkeerat Bedi

-

unread,
Apr 30, 2012, 11:48:27 AM4/30/12
to aqmdos-simula...@googlegroups.com
Hi Harkeerat,

I just updated your role in the group. Thanks.for providing support.

Everyone is encouraged to help answer other members' questions in the group. :)

bayisa kune Mamade

unread,
Nov 30, 2014, 8:48:31 AM11/30/14
to aqmdos-simula...@googlegroups.com

Hello guys,

i am new to ns2 and trying to simulate RRED using my own tcl code. Can i do like this:
 set Ta 0.50 ; # Ta   parameter     
 set Tb 0.2;  # Tb parameter

thanks for responses.

Amir Heydari

unread,
Dec 7, 2014, 1:26:06 AM12/7/14
to aqmdos-simula...@googlegroups.com
hi
you can change any parameters in TCL file and then run it again and see the result.
best regard.

--
Message sent from the "AQM&DoS Simulation Platform" group.
To post to this group, send email to
aqmdos-simula...@googlegroups.com
To download the platform, visit the platform site at
http://sites.google.com/site/cwzhangres/home/posts/aqmdossimulationplatform
---
You received this message because you are subscribed to the Google Groups "AQM&DoS Simulation Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aqmdos-simulation-p...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages