[ns] Help Regarding NAM and scripting

2008-08-13 Thread fhg07
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

[ns] Help regarding wireless connections between nodes

2008-08-14 Thread fhg07
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

[ns] Help concearning broadcasting messages - protocols

2008-08-21 Thread fhg07
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

Re: [ns] Broadcasting messages in ns2

2008-08-21 Thread fhg07
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 Husain

[ns] Sending a packet - howto/where

2008-08-22 Thread fhg07
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 do

[ns] NS_AF_INET - ?

2008-08-25 Thread fhg07
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

[ns] Binding variables - Access them on the tcl script

2008-08-28 Thread fhg07
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_);

[ns] C++ code problem on implementation of protocol

2008-09-05 Thread fhg07
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

[ns] Regarding Routing Protocol Algorithms

2008-10-23 Thread fhg07
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

[ns] Several doubts regarding rssi, transmission power, energy consumption

2008-11-13 Thread fhg07
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

[ns] Transmission power

2008-11-24 Thread fhg07
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.

Re: [ns] Transmission power

2008-11-24 Thread fhg07
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

[ns] 'stack smashing detected' - Sending many messages in a row

2009-01-20 Thread fhg07
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

[ns] Setting tcl script variables from inside C++ code

2009-01-20 Thread fhg07
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, --

[ns] Delays in the C++ code

2009-01-20 Thread fhg07
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

[ns] Problem changing node color and shape

2009-01-21 Thread fhg07
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

[ns] NS transmission powers based in tinyOS

2009-01-22 Thread fhg07
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

[ns] $node set X_/Y_/Z_ parameter unit - meters?

2009-01-23 Thread fhg07
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.

[ns] Delaying before sending a message

2009-01-26 Thread fhg07
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

[ns] Phy/WirelessPhy - When can I change the parameters?

2009-01-26 Thread fhg07
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

[ns] Changing transmission power too often

2009-01-27 Thread fhg07
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

[ns] Initializing a MobileNode object

2009-02-02 Thread fhg07
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

[ns] Accessing energy_model()

2009-02-03 Thread fhg07
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*)

[ns] initialEnergy value

2009-02-04 Thread fhg07
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

[ns] Accessing my agent from inside a timer

2009-02-04 Thread fhg07
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);

[ns] Changing value of variables inside agent (not taking effect)

2009-02-06 Thread fhg07
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,

[ns] HEED protocol for NS-2.30

2009-02-21 Thread fhg07
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.

[ns] Help regarding absurd memory usage

2009-03-24 Thread fhg07
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

[ns] Help regarding agent header size and energy consumption

2009-04-20 Thread fhg07
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