[ns] Problem with trace file! writting of trace file lines will be stopped in specific point!

2006-10-29 Thread amir zare

Hi All,

I have problem with what is written in trace file while simulation is
running. I have changed mac802_11.cc code in recv() method. in this method
made the packet loss by setting the header packet error flag. while
simulation was running, in specific place in trace file was stoped. the
simulation didn't stop but whenever I open it ( while the simulation was
running) , I saw that it was stoped on the same place without any advance in
writting any more in trace file!! I copy end of trace file as follows:


s 1367.609409107 _8_ RTR --- 55104 message 548 [0 0 0 0] --- [8:255
-1:255 32 0]

s 1367.621683432 _14_ RTR --- 55105 message 608 [0 0 0 0] --- [14:255
-1:255 32 0]

s 1367.696732589 _15_ RTR --- 55106 message 548 [0 0 0 0] --- [15:255
-1:255 32 0]

s 1367.710329725 _9_ RTR --- 55107 message 524 [0 0 0 0] --- [9:255
-1:255 32 0]

s 1367.714817072 _41_ RTR --- 55108 message 416 [0 0 0 0] --- [41:255
-1:255 32 0]

s 1367.720855549 _42_ RTR --- 55109 message 572 [0 0 0 0] --- [42:255
-1:255 32 0]

s 1367.751186360 _10_ RTR --- 55110 message 560 [0 0 0 0] --- [10:255
-1:255 32 0]

s 1367.765621923 _45_ RTR --- 55111 message 536 [0 0 0 0] --- [45:255
-1:255 32 0]

s 1367.773280693 _44_ RTR --- 55112 message 488 [0 0 0 0] --- [44:255
-1:255 32 0]

s 1367.794426339 _40_ RTR --- 55113 message 596 [0 0 0 0] --- [40:255
-1:255 32 0]

s 1367.796053816 _24_ AGT --- 55114 cbr 512 [0 0 0 0] --- [24:1 26

this simulation time for this simulation was: 2000s . you see that it stoped
in 1367s like this!!

any one has any idea about this why happend?!

I would appreciate any help

thanks a lot

Amir


[ns] what is the role of "handler * h" and "callback_" in the recv() and send() method of mac802_11?

2006-10-25 Thread amir zare

Hi All,

I want to know what is the role of "handler * h" and "callback_" in the
Mac802-11,specially in the recv() method of this class. I want to know what
will be happend if I dont let the outgoing packets to be sent by send(p, h)
method in a short duration in simulation. I did so as follows:


void Mac802_11::recv(Packet *p, Handler *h) {

if ( node_state_ == false ) {   hdr->error() = 1;  Packet::free(p); }

if ( node_state_ == true ) {

   if(hdr->direction() == hdr_cmn::DOWN) {  send(p, h); return; }

}

In fact by using the "node_state_" , when it is true by send() method the
packet can be sent to the destination , after chaneged to false, the recv()
method cant enters the send(p,h) , consequensely it cant send the packet to
destination as it is expected , but when it changes to true value again
after a short duration, it will not send a packet to the destination any
more. I cant understand where the problem is. I expect that when the
node_state is true it send the packet properly. but it seems something is
wrong with "handler * h" or "callback_" in the send() method , I guess so!

I would appreciate any help to solve my problem or any lesson about "handler
* h" and "callback_"

thanks a lot in advance

Amir


[ns] Problem with my added method in command method of mac-802_11.cc

2006-10-15 Thread amir zare

Hi All,

   I want to change the mac-802_11.cc by adding some code in
Mac802_11::command method. I added a procedure into ns-mobilenode.tcl as
follows:

Node/MobileNodeinstproc node-fail {}  {
 $self   instvar   mac_
 return [$mac_(0)  node-fail]
}

in mac-802_11.cc I added in command method as follows:


if (argc == 2) {

  if (strcmp(argv[1], "node-fail") == 0) {

tcl.result( "node failed" ); // I added this to
trace whether my program passes back this string to my tcl program or not?

return TCL_OK;

  }

}

in my main tcl program I use the added procedure to ns-mobilenode.tcl to
test it so:

set   x  [$node_(0)   node-fail]

puts "$x"

but when I run the program. the string "node failed" didn't printed. it
seems I cant pass this string back to tcl interpreter or anywhere that I
dont know! .

I guess there is something that avoids me to use my added code in C++. I
dont know exactly where the problem is.

after changing the code in tcl and cc files I compiled them again to make
the new objects.

I would appreciate any help

Thanks a lot in advance

Amir


[ns] Is any change required to be made when you add a procedure in ns-node.tcl?

2006-10-13 Thread amir zare

Hello All,

   I faced with a strange problem after adding a procedure in ns-node.tclfile.

   I wrote a procedure in the level of tcl without calling any method from
any C++ file just like the procedures can be found in ns-node.tcl , for
example:

Node instproc id {}  {
 return [$self set id_]
}

I added following procedure to ns-node.tcl :

Node instproc my-id {} {
  return [$self set id_]
}

I used this procedure in my tcl program to test:

set node_id   [$node_(0)   my-id]
puts "$node_id"

and an error occured that is:


ns: _o14 my_id:

(_o14 cmd line 1)

invoked from within

"_o14 cmd my-id"

invoked from within

"catch "$self cmd $args" ret"

invoked from within

"if [catch "$self cmd $args" ret] {

set cls [$self info class]

global errorInfo

set savedInfo $errorInfo

error "error when calling class $cls: $args" $..."

(procedure "_o14" line 2)

(SplitObject unknown line 2)

invoked from within

"_o14 my_id"

The interesting point for me is:  the procedure that I
added is exactly similar to the one exists in ns-node.tcl , but the ns2
can't execute it. (the only difference is in the name of procedure as you
see) I guess I have to change something in somewhere to meke this procedure
work. What do you think? I would appreciate any help

thanks in advance,
Amir


[ns] how to add a procedure in a .tcl file and make the required changes in related .cc files?

2006-10-12 Thread amir zare

-- Forwarded message --
From: amir zare <[EMAIL PROTECTED]>
Date: Oct 12, 2006 5:47 PM
Subject: how to add a procedure in a .tcl file and make the required changes
in related .cc files?
To: ns-users@isi.edu

Hello All,

I want to add a procedure in ns-mobilenode.tcl to implement a new
feature. For this reason, I changed mac-802_11.cc ( where I want to add my
change) by adding a method. So, in ns-mobilenode.tcl , in my added
procedure, you see:

Node/MobileNode instproc node-change {} {

   $self instvar mac_

   $mac_(0) node-change

}

 and in mac-802_11.cc you see :

Mac802_11::command(int argc, const char*const* argv) {

 if (strcmp(argv[1], "node-change") == 0) {

  node_change();  // this is
the method I added in mac802_11

  return TCL_OK;

 }

}

but when I run my program that uses new feature. I mean:

$node_(0)   node-change

I face to errors generated by ns.  I am really confused and dont know how to
solve this problem. I think I dont know the correct way to add the
procedure. I hope someone can tell me where my fault is or correct the way
I have to add this procedure to work.

I learnd this way of adding a procedure by observing the procedure node-down
in ~ns/tcl/lib/ns-mobilenode.cc and the related .cc file in:
~ns/wpan/p802_15_4mac.cc -> Mac802_15_4::command(int argc, const char*const*
argv)

I would appriciate any help.

Regards,

Amir


[ns] Tips and Statistical Data for Running Large Simulations in NS

2006-10-10 Thread amir zare

Hi dear Martina,

   You can find it in: http://www.isi.edu/nsnam/ns/

   The direct link is: http://www.isi.edu/nsnam/ns/ns-largesim.html

  regards,
   Amir


[ns] Can nix-vector routing be applied for simulating wireless ad hoc networks?

2006-10-09 Thread amir zare

Hi all,

I want to reduce simulation time and memory usage by techniques
introduced in "Tips and Statistical Data for Running Large Simulations in
NS". I want to know whether nix-vector routing can be applied for simulating
wireless ad hoc networks? If yes, Is any setting or command required in tcl
script in addition to "$ns set-nix-routing" ?
I would appricate any help
Amir


[ns] How to avoid movementTrace of mobile nodes ? ( It seems movementTrace OFF does not work)

2006-10-09 Thread amir zare

I want to simulate an ad hoc mobile network with 100 mobile nodes in 1000
seconds. But the problem is it take too much memory space and time to
preform simulation. In order to remove unnecessary info of trace files, I
tried to remove movement trace of mobile nodes with movementTrace OFF in
node-config . After this I found that the trace file has the same result
when movementTrace is either ON or OFF. I mean lines like:

* M 1.0 0 (490.18, 456.19, 0.00), (0.00, 0.00), 0.00
** M 1.0 1 (130.68, 257.04, 0.00), (0.00, 0.00), 0.00 *
* M 1.0 2 (88.83, 394.25, 0.00), (0.00, 0.00), 0.00
 M 1.0 3 (236.69, 88.64, 0.00), (0.00, 0.00), 0.00
 M 1.0 4 (264.81, 234.03, 0.00), (0.00, 0.00), 0.00
 M 1.0 0 (490.18, 456.19, 0.00), (377.91, 111.04), 2.26
 M 1.0 1 (130.68, 257.04, 0.00), (186.11, 421.37), 3.98
 M 1.0 2 (88.83, 394.25, 0.00), (244.22, 22.03), 3.33
 M 1.0 3 (236.69, 88.64, 0.00), (192.80, 465.19), 3.81
 M 1.0 4 (264.81, 234.03, 0.00), (103.61, 340.43), 0.95

*So, I changed the relating code in ~ns/common/mobilenode.cc -> proc
log_movement() . After having compiled, the new mobilenode.o obejct was
created. I run the silmulation with new created object, but I found that
above lines ( movement trace lines in trace file) didn't change at all. It
seems these lines are coming from the other place. I searched all files that
might be the reason of creation of these lines of trece file, but i did not
find any thing.


void MobileNode::log_movement() {

  if (!log_target_) return;

  Scheduler& s = Scheduler::instance();

 sprintf(log_target_->pt_->buffer(),

 "M %.5f %d (%.2f, %.2f, %.2f), (%.2f, %.2f), %.2f", s.clock(), address_,
X_, Y_, Z_, destX_, destY_, speed_);

 log_target_->pt_->dump();

}

 The question is where these lines of trace file are coming from?

  I would appreciate any help

  Amir