Subject: [manet] Fwd: varying transmission power

From: Marco <[email-masked]>
Date: Mon, 17 Jan 2005 15:13:15 +0100

----------  Messaggio inoltrato  ----------

Subject: varying transmission power
Date: 17:42, venerdì 14 gennaio 2005
From: Marco <[email-masked]>
To: [email-masked]

hi ,
I wanted to implement a wireless protocol in which nodes vary their
transmission range from time to time , i wanted to know if there is a way in
which i can do that  in ns-2 , as in the main script the transmission power
 of all the nodes is assigned before the nodes are created ,
thanks , Marco

-------------------------------------------------------

_______________________________________________
manet mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/manet

---

From: "Sherif M. ElRakabawy" <[email-masked]>
Date: Wed, 19 Jan 2005 10:48:33 +0100

----------  Messaggio inoltrato  ----------

hi ,
I wanted to implement a wireless protocol in which nodes vary their
transmission range from time to time , i wanted to know if there is a way in
which i can do that  in ns-2 , as in the main script the transmission power
of all the nodes is assigned before the nodes are created , thanks , Marco

Hi,

You may adjust the transmission power using the variable Pt_ in
mac/wireless-phy.{cc,h}. The default value which corresponds to 250m 
is set in tcl/lib/ns-default.tcl

Regards

---

From: "Sherif M. ElRakabawy" <[email-masked]>
Date: Wed, 19 Jan 2005 13:28:22 +0100

Hi,

In your tcl script you can create an instance of the network interface of
each node :

for {set i 0} {$i < $numnodes } {incr i} {
	set if_($i) [$node_($i) set netif_(0)]
}	

then you can set the transmission power for each node individually :

$if_([$node]) set Pt_ [$value]

You may change the transmission range at different times as nodes move :

$ns_ at $time ...

Regards

--------------------------------------------
Sherif M. ElRakabawy
University of Dortmund
Department of Computer Science			   Tel. +49 231 755 2690
Mobile Computing Systems Group			   Fax. +49 231 755 2417
August-Schmidt-Str. 12
44227 Dortmund / Germany
http://mobicom.cs.uni-dortmund.de/~moustafa/

-----Ursprüngliche Nachricht-----
Von: Marco [mailto:[email-masked]] 
Gesendet: Wednesday, January 19, 2005 1:00 PM
An: Sherif M. ElRakabawy
Betreff: Re: [manet] Re: Fwd: varying transmission power

Thanks for your reply.
I have found the function "distance (MobileNode *m)" in mobile-node.cc; i
have implemented a new function "powercontrol" in whireless-phy.cc, which
calculates Pt_, depending on distance about tx node and rx node.

void
WirelessPhy::powercontrol(Node *tnode, Node *rnode)

{
        MobileNode* tmnode = (MobileNode*)tnode;
        MobileNode* rmnode = (MobileNode*)rnode;
        double distance = 0;

        distance = tmnode->distance(rmnode);

        if (distance<=40)
Pt_=0.001;
        else if (distance >40 && distance <=60)         Pt_=0.002;
        else if (distance >60 && distance <=80)         Pt_=0.00345;
        else if (distance >80 && distance <=90)         Pt_=0.0048;
        else if (distance >90 && distance <=100)        Pt_=0.00725;
        else if (distance >100 && distance <=110)       Pt_=0.0106;
        else if (distance >110 && distance<=120)        Pt_=0.015;
        else if (distance >120 && distance <=150)       Pt_=0.0366;
        else if (distance >150 && distance <=180)       Pt_=0.0758;
        else
Pt_=0.2818;
}

The problem is that the nodes are continuosly moving: Pt_ must be
continuosly updated, and it's different for each node (in ns-2, Pt_ is the
same for all 
the nodes). What can i do?
Thanks, Marco

---

From: "Sherif M. ElRakabawy" <[email-masked]>
Date: Fri, 28 Jan 2005 12:26:12 +0100

Hi,

You can't modify txPower_ or rxPower_ using the node's interface. These
variables are set directly using the nodes's instance $node_(x)
In your tcl script.

In tcl/lib/ns-lib.tcl you'll find in proc create-wireless-node:

If [info exists txPower_] {
	$node setPt_ $txPower
}

Thus, you may change the value of txPower_ in your tcl script :

$node_(x) setPt_ [value]

Regards

--------------------------------------------
Sherif M. ElRakabawy
University of Dortmund
Department of Computer Science			   Tel. +49 231 755 2690
Mobile Computing Systems Group			   Fax. +49 231 755 2417
August-Schmidt-Str. 12
44227 Dortmund / Germany
WWW: http://mobicom.cs.uni-dortmund.de/~moustafa/

> Gesendet: Friday, January 28, 2005 12:06 PM
> An: Sherif M. ElRakabawy
> Betreff: Re: AW: [manet] Re: Fwd: varying transmission power
> 
> 
> Hi Sherif, 
> thanks for your reply.
> I want now  modify txPower and rxPower(battery consumption) 
> for each node, 
> like Pt_.
> The problem is if I make:
> 
> $if_([$node]) set txPower_ [$value]
> 
> nothing happens.... Why?
> 
>   
> 
> Alle 13:28, mercoledì 19 gennaio 2005, Sherif M. ElRakabawy 
> ha scritto:
> > Hi,
> >
> > In your tcl script you can create an instance of the 
> network interface 
> > of each node :
> >
> > You may change the transmission range at different times as 
> nodes move 
> > :
> >
> > $ns_ at $time ...
> >
> > Regards
> >