Well, I created a message header for my agent, and I would like to know if
NS2 actually consider its size automatically when computing the energy a
node will consume to send a message.
For example.:
struct hdr_myagent {
int a1,
a2,
a3;
float a4;
...
};
is the packet header for m
I am simulating a protocol which I developed, and I wanted the simulation
to end only when all my nodes are dead. Well, that is not really that fast
to happen, and before I reach that point my memory ends and I get a
bac_alloc error message.
And here is the thing: I do alloc lots of packets with
Well, I am using energy model, but I don't want it to keep changing my
node colors to green or yellow depending on their energy. Is there any way
to avoid it? I want to use it, but I do not want it changing my node
colors !
Thanks,
--
Fernando Henrique Gielow - UFPR - NR2
Computer Science underg
I would like to know if anyone has implemented or knows where I can find
an implemented version of the HEED protocol for ns-2.30.
Thanks in advance,
--
Fernando Henrique Gielow - UFPR - NR2
Computer Science graduation student.
Ok. Inside my Agent I do have lots of functions: command, recv, and others
that I implemented.
And inside my agent I also have lots of variables. Well, I am still not
that comfortable with C++, so I have a silly question:
If I do change a variable from my agent inside recv, for example,
shouldn'
Well, to define a timer I used instructions:
http://www.cubinlab.ee.unimelb.edu.au/~jrid/Docs/Manuel-NS2/node105.html
like this:
class MyTimer : public TimerHandler {
public:
MyTimer(MyAgentClass *a) : TimerHandler() { a_ = a; }
virtual double expire(Event *e);
Well, I am running a simulation in which I wanted to obtain a real
environment, thus I tried to calculate how many joules I have in a
Duracell AA MN1500 battery. In the end I got 30779.754 (doubled the result
as I use two batteries). So:
40 $ns node-config \
41 -energyModel EnergyModel \
Well, I have instantiated a MobileNode object, and I really need to access
its energy_model() functions, however, energy_model() points to NULL.
Here is a piece of MyAgent::command() in my C++ code:
119 if (strcasecmp(argv[1], "energy_ammount")==0) {
120 node = (MobileNode*) MobileNode:
Well.. It is just as it says, how do I declare and initialize a MobileNode
object? I tried doing it just the same way as I saw in other codes, but it
simply does not work. Not even the node->X() function does return the
right X position of my node.
Here is how I am initializing it:
C++ Code:
162
Is there a simple way to get the value of available energy of a node in my
C++ code?
Thanks,
--
Fernando Henrique Gielow - UFPR - NR2
Computer Science graduation student.
Well, I want to change my transmission power very constantly, but I am not
managing to do so. Aparently, after some changes its value just stop being
updated. Here is what I am doing to change it:
In my tcl code:
61set phy_($i) [$node_($i) set netif_(0)]
In my C++ code:
52 tcl.evalf("$phy
I would like to know if the Phy/WirelessPhy parameters can be changed only
in the initialization on my tcl script.
The reason for that question is because I am trying to change the values
of Pt_ and Pt_consume_ from inside my C++ code, but the changes do not
take effect in the simulation.
To cha
I need to send lots of messages in a row, but I want to have a delay
between them. I was told to use a timer-handler, but I do not know exactly
how to do so. How can I, for example, use a timer-handler to wait 0.3s?
Thanks,
--
Fernando Henrique Gielow - UFPR - NR2
Computer Science graduation s
What is the unit of distance of this command? Is it meter? I want to know
because the distance between the nodes is extremely relevant in what I am
developing.
Thanks,
--
Fernando Henrique Gielow - UFPR - NR2
Computer Science graduation student.
In the protocol that I am currently implementing on NS2 the transmission
powers does vary a lot. Its initial implemention was done in tinyOS, and
that is why I need to simulate its available transmission powers. There is
a range of 255 possible ones in tinyOS, and I would like to change the NS
var
I am trying to change the color and shape of some nodes in order to make
it easier to understand what happens when seeing the nam simulation.
The ran commands are currently these:
78 $node_(0) color green
79 $node_(0) shape hexagon
It seems to be correct, but nothing does change at all in nam
There is a need of waiting a certain time in my C++ code, before continue
the execution of an operation. I would like to know how can I "wait" this
time. I tried the usleep command, but it did not work at all. I have been
said that a time handler could be employed, but I am not sure on how to do
s
Well, it is just as the title says: I would like to know how to change the
value of my tcl script variables from inside my C++ code. I learned how to
change C++ variables from inside the tcl code, but not the tcl variables
from inside the C++ code. Is there any easy way?
Thanks in advance,
--
F
It is like the following:
There are two kinds of nodes: The sink and the rest. The sink, in a
initial phase, will send many broadcast messages, gradually increasing its
transmission power, so that every node will be able to determine its
necessary TP in order to reach the sink.
Thus, I intended
Hmm.. But the case is that I am developing a protocol and the trasmission
power will vary according to what it wants, so there is no way I could set
the TP individually for each node on my TCL script, since its value will
depend on some events that can not actually be foreseseen.
Can I set the TP
I would like to know how to change a node's transmission power when
sending a message. Is there a easy way to do so?
Thanks in advance,
--
Fernando Henrique Gielow - UFPR
Computer Science graduate student.
I am developing a routing protocol for WSN in tinyOS, and I want to test
it through NS2.30. Therefore, there are some things I would like to know.
1 - How to I set the transmission power when sending a packet?
2 - Can I somehow adjust the energy that is consumed when sending a packet?
I want
Well, I was studying some of them for a while, and now I will try to
implement one. But I have some doubts, they are not exactly tinyOS nor NS
doubts, but I hope someone can help me.
It's like the following :
I am going to implement a cluster-based routing protocol for WSN, thus,
before the eff
As it says.. I'm trying to develop a protocol, but I guess I am having
some trouble regarding C++ programming. This is what happens:
I have an agent class, with several variables inside it, and when I
receive a specific kind of packet I need to change some of these
variables' values (inside the r
Well.. The title is self-explanatory haha
I want to access a variable that is inside my C++ code, inside my agent,
actually. So, what I have done is the following..
This is the constructor for my Agent:
ProtexAgent::ProtexAgent() : Agent(PT_PROTEX)
{
bind("packetSize_", &size_);
bind("protexD
I was implementing a protocol, just for test purposes, and it wasn't
really working. Then, after observing some other codes, I saw that some of
them had this "cmh->addr_type()= NS_AF_INET;" somewhere, so I tried to
make the same in my code. And it worked ! I didn't understand why, can
someone expl
Well, I have already learned how to create the packet and fill it with the
data I need. Although, I end up not being able to send it.
In some codes, in the function "command", the argumente is compared with
"send", and then the code responsible for sending the packet comes down
there. I tried to
Can it be done like:
cmh->next_hop() = IP_BROADCAST; ?
Whats the difference between cmh and ih headers?
I've seen this on some codes that I've found.
Fernando.
> Hello Fernando
>
> You should use IP_BROADCAST in the ip header
>
> ih->daddr() = IP_BROADCAST;
>
>
> Hope it helps
>
> --
> Mubashir
Well.. I'm trying to learn how to implement protocols to NS2,30. And I did
not understand how to broadcast a message in wireless networks.
Here is what I've got:
Packet* pkt = allocpkt(); // new packet
hdr_protex* hdr = (hdr_protex*) pkt->access(off_protex_);
hdr->type = 0; // sending initial
UDP or TCP connections and also both of them, but
apparently none of my nodes transmitted a single piece of information.
My script is hosted here:
http://www.inf.ufpr.br/fhg07/EX-random-movement-traffic.tcl
If someone could execute it and give feedback on how to make the nodes
communicate one with
Well, I have recently started to study NS2 (Using version 2.30), and I got
some exercises to do. The purpose of one of them is to make two mobile
nodes move towards the same location (seems to be very basic, I know). I
actually did the script .tcl, but when I try to see the animation using
nam, a
31 matches
Mail list logo