Subject: [manet] radio propagation range in NS2

From: Hang Su <[email-masked]>
Date: Thu, 9 Oct 2003 11:21:50 +0800

Hi,
Can anyone suggest me how the radio propagation range in NS2 can
be varied/changed on a per packet basis

Thanks in advance,

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

---

From: Amit Jardosh <[email-masked]>
Date: Wed, 8 Oct 2003 23:01:21 -0700 (PDT)

hi Hang,

assuming that you are using the tworay ground model as
your propagation model, you would see that in
mobile/tworayground.cc .. there is a Pr value that is
calculated depending upon the distance between the
source and the destination node. you can play around
with that.

hth .. Amit

> be varied/changed on a per packet basis

=====

Amit Jardosh 
Graduate Student
MOMENT Lab, Dept. of Computer Science
University of California, Santa Barbara
homepage: www.cs.ucsb.edu/~amitj 

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---

From: Hang Su <[email-masked]>
Date: Thu, 9 Oct 2003 22:04:25 +0800

hi Amit,
thanks for your help.
But my problem is how I can adjust the tansmit power dynamically in the simulation.

If I set the value txPower like 
 $ns_ node-config -txPower 0.6
then the tranmit power of all nodes would not change in the duration of the simulation.

Can you tell me more about it.
thanks again.

On Wed, 8 Oct 2003 23:01:21 -0700 (PDT)

---

From: "HyunWook Cha" <[email-masked]>
Date: Fri, 10 Oct 2003 12:26:45 +0900

Hi Hang SU,

If you trace tcl files in ~/tcl/lib and your simulation scenario file,
you can find out that WirelessPhy class provides a instance method
"setTxPower" for tcl side and WirelessPhy::Pt_consume_ is set to given
value via this interface.
So, you only have to make netif_(0) of node accessible outside node and
call "setTxPower" method. 
By doing this, you can modify tx power of mobile nodes duing simulation.

Cheers,
HyunWook Cha
 
> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]] On 
> Behalf Of Hang Su
> Sent: Thursday, October 09, 2003 11:04 PM
> To: Amit Jardosh
> Cc: [email-masked]
> Subject: Re: [manet] radio propagation range in NS2
> 
> 
> 
> hi Amit,
> thanks for your help.
> mobile/tworayground.cc 
> > .. there is a Pr value that is calculated depending upon 
> the distance 
> > between the source and the destination node. you can play around
> > with that.
> > 
> > hth .. Amit
> >

---

From: Hang Su <[email-masked]>
Date: Sat, 11 Oct 2003 10:36:11 +0800

Hi HyunWook Cha,

Thanks for your helping. I really know a lot that I have not learned before.
But I encounter a new problem now.
The problem is how i can make netif_(0) accessible
I have found the code in ~tcl/lib/ns-mobilenode.tcl

Node/MobileNode instproc setPt { val } {
        $self instvar netif_
        $netif_(0) setTxPower $val
}

and I want to modify the code in  ~ns/mac/mac-802_11.cc to adjust the transmit power

void
Mac802_11::send(Packet *p, Handler *h)
{
        double rTime;
        struct hdr_mac802_11* dh = HDR_MAC802_11(p);
                                                                                
        /*
         * drop the packet if the node is in sleep mode
         XXX sleep mode can't stop node from sending packets
         */
                                                                                
//------------- adjust the transmit power--------------
        Tcl& tcl = Tcl::instance();
        tcl.eval("$netif_(0) setTxPower 0.6");
//---------------------------------------------------------

...
}

But when i run the simulation, the error occurs. The error message is listed below,

ns: $netif_(0) setTxPower 0.6: can't read "netif_(0)": no such variable
    while executing
"$netif_(0) setTxPower 0.6"

Would you please help me out of the problem.

Thanks in advance

On Fri, 10 Oct 2003 12:26:45 +0900

---

From: ruchir sinha <[email-masked]>
Date: Fri, 10 Oct 2003 22:01:47 -0700 (PDT)

Hi,
Wanted to know if for  AODV and DSR protocols in GloMoSim one can  analyze the routing trace as we get in NS-2. In NS-2, there is a .tr file which will have information about the position of a node at different time instants, the route to a destination, the intermediate nodes in a route (for the case of AODV), etc. I want to get something similar to that in GloMoSim. Basically, all i need are the following:
(1) Position of a node at any instant during the simulation
(2) The origin time of a route, endtime of a route and the actual intermediate nodes in a route
(3) The time, the application layer is sending the packet to the network layer and the time the application layer at the destination gets the packet from its network layer
(4) The link-to-link delay in a route
5  The timing with regard to link failures 
I saw the output in glomo.stat and it doesn't contain all the above information
Regards
Ruchir

Hang Su <[email-masked]> wrote:
Hi HyunWook Cha,

void

/*

...
}

Thanks in advance

"HyunWook Cha" wrote:

> > Amit Jardosh wrote:
> > > --- Hang Su wrote:

---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

---

From: ruchir sinha <[email-masked]>
Date: Fri, 10 Oct 2003 22:05:06 -0700 (PDT)

ruchir sinha <[email-masked]> wrote:Hi,

void

/*

...
}

Thanks in advance

> By doing this, you can modify tx power of mobile nodes duing simulation.
&g! t; 
>! ; > Amit Jardosh wrote:
> > 
> > > hi Hang,
> > > 
> > &! gt; > manet mailing list
> > > > [email-masked]

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

---

From: "HyunWook Cha" <[email-masked]>
Date: Sat, 11 Oct 2003 22:58:43 +0900

SGkgSGFuZywNCllvdSB3YW50IHRvIG1vZGlmeSB0eCBwb3dlciBkeW5hbWljYWxseSBpbnNpZGUgTWFjODAyXzExOjpzZW5kLg0KWW91IGNhbiBkbyB0aGlzIHRocm91Z2ggbGl0dGxlIG1vZGlmaWNpYXRpb24gb2YgdGNsIG9yIGMrKyBjb2Rlcy4NCkZpcnN0IHNvbHV0aW9uIGlzIHRvIGNhbGwgTm9kZS9Nb2JpbGVOb2RlOjpzZXRQdCBpbnNpZGUgTWFjODAyXzExOjpzZW5kKCkgYXMgeW91IG1lbnRpb25lZCBpbiB5b3VyIHJlcGx5Lg0KVG8gZG8gdGhpcywgeW91IHNob3VsZCBhY2Nlc3MgTm9kZS9Nb2JpbGVOb2RlIGluc3RhbmNlIHZhcmlhYmxlIGluIHRjbCBzcGFjZS4gDQpTaW5jZSBJIGZvdW5kIHRoYXQgdGNsIHZhcmlhYmxlIGZvciB0aGlzIG1hYyA4MDIuMTEgaGFzIG5vIHJlZmVyZW5jZSBmb3IgaXRzIG93bmVyIChub2RlKSwgDQpJIHN1Z2dlc3QgdGhhdCB5b3UgYWRkIGEgbWVtYmVyIGZpZWxkIGNhbGxlZCAibm9kZV9pZCIgdG8gbWFjIG9yIDgwMl8xMSBjbGFzcyBhbmQgYWRkIHNvb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UaGFua3MgaW4gYWR2YW5jZQ0KPiANCg0K_______________________________________________manet mailing [email-masked]://www1.ietf.org/mailman/listinfo/manet

---

From: Hang Su <[email-masked]>
Date: Sun, 12 Oct 2003 08:31:28 +0800

Hi HyunWook,
I have settled the problem.
I add the following code

tcl.evalf("Phy/WirelessPhy set Pt_ %f",tx_Power);

It does work.
Thanks for your helping very very very much.

On Sat, 11 Oct 2003 22:58:43 +0900
"HyunWook Cha" <[email-masked]> wrote:

> Hi Hang,
> You want to modify tx power dynamically inside Mac802_11::send.
> You can do this through little modificiation of tcl or c++ codes.
> First solution is to call Node/MobileNode::setPt inside Mac802_11::send() as you mentioned in your reply.
> To do this, you should access Node/MobileNode instance variable in tcl space. 
> Since I found that tcl variable for this mac 802.11 has no reference for its owner (node), 
> I suggest that you add a member field called "node_id" to mac or 802_11 class and add some routine for set this value to address of node in mac::commend. Then, you can set mac::node_id field from tcl space by calling newly defined method of mac after making an instance of mac.
> At last, you can call to adjust tx power as following. 
>      tcl.eval("[[[Simulator instance] get-node-by-addr %d] set netif_(0)] setTxPower %f", node_id, new_TxPower_value);
> 
> Second solution does not require tcl procedure.
> Since netif_::Mac(you should change" Phy *" to "WirelessPhy *")  exists in class Mac, the only thing you have to do is make an public interface for modifying targeted field in class WirelessPhy.
> And call it. That's all.
> I hope my suggestions can be helpful. If you have any other problem, let me know. 
> Again, Cheers.
> 
> HyunWook Cha
> 
> ----- Original Message ----- 
> From: "Hang Su" <[email-masked]>
> To: <[email-masked]>
> Cc: <[email-masked]>; <[email-masked]>
> Sent: Saturday, October 11, 2003 11:36 AM