[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] units in command() (fwd)




I dunno why part of my message was cut. I am resending it. thanks
mani

Hi,
If i read a bandwidth value of 2Mb from tcl file in the following way:

tcl:
	$scheduler set_target_rate 2Mb

and read the value in in the corresponding .cc file in the following way:

int Classname::command(int argc, const char *const*  argv)
{

	if (argc == 3) {
		if(strcmp(argv[1], "set_target_rate") == 0) {
		double t_rate = (double) atof(argv[2];
		return TCL_OK;
	}

}

The variable t_rate has the value 2 instead of 2000000. Is it still right
or should i change 2Mb in tcl script to 2000000 ?

But at the same time tcl commands like
    $ns duplex-link node1 node2 5Mb 10ms DropTail
reads the rate as 5000000 and not as 5.

Could someone explain this?

thanks

-mani