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

Re: [ns] accessing mac layer parameters through nodes



Hi,

To access the correct variables you either have to bind them so you can
set them through tcl, or you can add some stuff to the command function
(which in this case might be simpler since you really want to modify stuff
in the PHYMIB instead of in the MAC... but it could be done by binding as
well...). 

To do something like that, you might want to add (after the if statement)

else if (arc == 4) {
	if(strcmp(argv[1], "set-cw-params") == 0) {
		phymib_->CWMin = atoi(argv[2]);
		phymib_->CWMax = atoi(argv[3]);
		return TCL_OK;
	}
}

to the Mac802_11::command function.

Then you would use this like below in your tcl script

[$node_(0) set mac_(0)] set-cw-params 16 512
[$node_(1) set mac_(0)] set-cw-params 32 1024

and so on. The above example would give node 0 a minimum contention window
of 16, and a maximum contention window of 512 (and node 1 would get
CWMin=32 and CWMax=1024).


/Anders

On Fri, 31 Aug 2001, Dominique Dhoutaut wrote:

> Hi,
> 
> I use the 802.11 MAC layer, and I'm doing wireless ad-hoc simulations.
> I would like to use different parameters for the 802.11 backoff,
> depending on the node.
> (ie: have some nodes with long backoff and others with short ones).
> 
> Is it possible, and then how ?
> 
> I don't see how to access the lower layers through the nodes.
> (I see how to change globaly this parameter indeed)
> 
> Thanks in advance.
> 
> Dominique
>