[ns] add a new queue

2007-10-17 Thread hossein fotouhi

Hi all,

is there any priority queuing implementation for ns-2 . I found files *
PriQueue.h *and* PriQueue.cc* in ns-2 . It aims to prioritize routing
traffic over ordinary  traffic. This is not what I am looking for.
I want to create 2 different queues  one for high  priority and the other
for low priority according to my packet size( ch-size() ). But when I add
these two queues to priqueue.cc, no considerable changes will happen. The
changes I think are just due to random number generation.

please send me your suggestion.
Thanks so much

-- 
Hossein Fotouhi


[ns] perl for energy model

2007-08-17 Thread hossein fotouhi

Dear friend

Does anybody has the perl file for energy trace file produced from 802.15.4?

tnx

-- 
Hossein


[ns] error in TCL code

2007-08-01 Thread hossein fotouhi

Hi,
I have added a routing to ns2 ( I dont write it by myself ;) ). After making
the  objects i try to run the TCL code. I put an IF state in the beginning
of the file as follow:
if { $argc  2 } {
   puts Usage: cbr packet size cbr data rate
  exit 0
}
but when i run this, it exits and show me the phrase in puts command.
I dont know how can i find these two arguments, and why the $argc has the
value less than 2.
I put the related files in the right directories also.

Is it possible in spite of making the objects, it has still problem to
connect the files?
tq very much


[ns] error with agent!!!

2007-08-01 Thread hossein fotouhi

Hi,
I received this error when running my file.
does anyone know where is the problem?
thank you

---

[EMAIL PROTECTED] bin]# ./ns wireless-spr.tcl 10 20
num_nodes is set 100
invalid command name Agent/SP
while executing
Agent/SP set sport_0
(file ./spr.tcl line 3)
invoked from within
source.orig ./spr.tcl
(uplevel body line 1)
invoked from within
uplevel source.orig [list $fileName]
invoked from within
if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
...
(procedure source line 8)
invoked from within
source ./spr.tcl
(file wireless-spr.tcl line 259)


[ns] delay packet in intermediate nodes

2007-07-31 Thread hossein fotouhi

Hi,
How can I delay packets in their routes from source to destination in
multi-hop network?
I want to keep the packets in each intermediate nodes as long as a special
time and after elapsing that time, let  the packet  be sent to next hope.
If anybody has a recommendation or guidance, plz send it to me.

And also I should use a timer for each packet, but I don't know how can I
implement these.
I found a source code from this website http://www.cs.binghamton.edu/~kliu/;
as follow :


 The Generic implementation of Multiple (a lot) timers   Usually, for one
protocol implementation, we need several timers. According to NS2's
implementation, for each timer calling different firing function, one more
class need to be declared and defined, which is boring and bothering.
In fact, we can use the *pointer to function* to same time and coding (How
to do in with C++ template, I am not sure.). As below:

   - Suppose you have one agent as *TestAgent*, and many firing
   functions, you can define a pointer to any firing function as

   typedef void(TestAgent::*firefunction)(void);

   - Then, you can create a general (generic) Timer class for all timers,
   as

   class TestTimer : public TimerHandler{  public:
TestTimer(TestAgent *a, firefunction f) : TimerHandler() {a_ = a;
  firing_ = f;   }  private:
virtual void expire(Event *e);   TestAgent *a_;   firefunction
firing_;  };

   - Ususally, when we create a timer, we need to define the
*expire*function to call specific firing function. Now we just need it
to call the
   *Generic* firing funtion pointer, as

   void TestTimer::expire(Event *){   (a_-*firing_)();  }

   - Finally, when we need a specific timer calling a specific firing
   funtion, other than what we ususally do as in NS2, we now just need to
   declare a new timer as an instance of the Generic Timer, and initialize it
   in TestAgent's constructor, as
  - In TestAgent's head file (.h file):

  class TestAgent : public Agent {  ...   TestTimer timerA_;
TestTimer timerB_;  ...   void
   firingA();   // these are 2 different firing functions
void firingB(); ...  };

  - Then initialization in .cc file as :

  TestAgent::TestAgent(): Agent(), ... timerA_(this,
TestAgent::firingA), timerB_(this, TestAgent::firingB), ...
{  ...  }

  - Even you have 100 timers calling 100 different firing
   functions in the same agent, you just need what I have shown you here to
   create *Only ONE* timer class, with only one definition of expire
   function.

-
Thanks a lot


[ns] how to monitor neighbour nodes traffic?

2007-07-30 Thread hossein fotouhi

Hi dear friends
Does anybody know how can I monitor the neibour node's traffic? I'm
implementing wireless sensor network, and my modifications are in network
layer.
TQ

-- 
Hossein


[ns] floating point exception

2007-06-19 Thread hossein fotouhi

Hi everybody
I cannot solve this error floating point exception. I tried with all
versions but same error happened.
Can anyone help me with this problem?
Thank you

-- 
Hossein