Re: [ns] Cloning AODV

2006-06-20 Thread Larry Zhang

Hi,
 
  I can tell another way which I think is simpler to do this clone stuff, for 
your reference only.
  You can directly change the AODV codes in the ns/aodv/ directory without 
change the name of the directory and files (of course you'd better backup the 
oringal codes first), and rebuild the codes.
  This approach would cause less problems related to the makefile and 
ns-lib.tcl kind of things, so maybe worth a shot.
 
good luck
Larry
 
 
 
 



Hello, NS-users:

I want to create a routing protocol according to AODV, so my first
task is to clone AODV. After seeing other ns-users' posts, i do my
work in following steps.


First, i copy all the files in $NS\aodv\ to a new folder called
aodv_lsa and rename all files (i.e. from filename.cc and filename.h to
myfilename.cc and myfilename.h), and then i change all the names of
C++ classes, packet headers, variables, TCL bindings, ...


Second, i make some essential changes according to
http://masimum.dif.um.es/nsrt-howto/html/


$NS\common\packet.h
enum packet_t {
PT_TCP,
PT_UDP,
PT_CBR,
..
..
PT_AODV,
PT_MYAODV,  //added by Xinhao Yu
PT_IMEP,
..
..
PT_NTYPE // This MUST be the LAST one
};
..
..
class p_info {
public:
p_info() {
name_[PT_TCP]= "tcp";
name_[PT_UDP]= "udp";
name_[PT_CBR]= "cbr";
..
..
name_[PT_AODV]= "AODV";
name_[PT_MYAODV]= "MYAODV";  //added by Xinhao Yu
name_[PT_IMEP]= "IMEP";
..
..
name_[PT_NTYPE]= "undefined";
}
..
..
};


$NS\trace\cmu-trace.h
class CMUTrace : public Trace {
..
..
voidformat_aodv(Packet *p, int offset);
voidformat_myaodv(Packet *p, int offset);  //added by Xinhao Yu
};


$NS\trace\cmu-trace.cc
#include   //added by Xinhao Yu
..
..
//added by Xinhao Yu
void
CMUTrace::format_myaodv(Packet *p, int offset)
{
struct hdr_myaodv *ah = HDR_MYAODV(p);
struct hdr_myaodv_request *rq = HDR_MYAODV_REQUEST(p);
struct hdr_myaodv_reply *rp = HDR_MYAODV_REPLY(p);


switch(ah->ah_type) {
case MYAODVTYPE_RREQ:

if (pt_->tagged()) {
sprintf(pt_->buffer() + offset,
"-myaodv:t %x -myaodv:h %d -myaodv:b %d -myaodv:d 
%d "
"-myaodv:ds %d -myaodv:s %d -myaodv:ss %d "
"-myaodv:c REQUEST ",
rq->rq_type,
rq->rq_hop_count,
rq->rq_bcast_id,
rq->rq_dst,
rq->rq_dst_seqno,
rq->rq_src,
rq->rq_src_seqno);
} else if (newtrace_) {

sprintf(pt_->buffer() + offset,
"-P myaodv -Pt 0x%x -Ph %d -Pb %d -Pd %d -Pds %d -Ps %d 
-Pss %d -Pc
REQUEST ",
rq->rq_type,
rq->rq_hop_count,
rq->rq_bcast_id,
rq->rq_dst,
rq->rq_dst_seqno,
rq->rq_src,
rq->rq_src_seqno);


} else {

sprintf(pt_->buffer() + offset,
"[0x%x %d %d [%d %d] [%d %d]] (RREQ)",
rq->rq_type,
rq->rq_hop_count,
rq->rq_bcast_id,
rq->rq_dst,
rq->rq_dst_seqno,
rq->rq_src,
rq->rq_src_seqno);
}
break;

case MYAODVTYPE_RREP:
case MYAODVTYPE_HELLO:
case MYAODVTYPE_RERR:

if (pt_->tagged()) {
sprintf(pt_->buffer() + offset,
"-myaodv:t %x -myaodv:h %d -myaodv:d %d -myadov:ds 
%d "
"-myaodv:l %f -myaodv:c %s ",
rp->rp_type,
rp->rp_hop_count,
rp->rp_dst,
rp->rp_dst_seqno,
rp->rp_lifetime,
rp->rp_type == MYAODVTYPE_RREP ? "REPLY" :
(rp->rp_type == MYAODVTYPE_RERR ? "ERROR" :
 "HELLO"));
} else if (newtrace_) {

sprintf(pt_->buffer() + offset,
"-P myaodv -Pt 0x%x -Ph %d -Pd %d -Pds %d -Pl %f 
-Pc %s ",
rp->rp_type,
rp->rp_hop_count,
rp->rp_dst,

Re: [ns] program to place nodes in regula r shapes???

2006-06-20 Thread Larry Zhang

Hi,
  
  I think this can be done properly with Tcl scripts, using some 
node&link-setup and loop controlling code lines. For the convience of reusing, 
you can also write these codes in a seperate senario file and load it in the 
main simulation tcl files.
 
Best Regards,
Larry
 
 





Hi everyone!

In working with ns fhcf implementation and I must place my wireless nodes in 
such positions (co-ordinates X and Y)so that these nodes would create regular 
shapes: squares, pentagons, hexagons etc...
Does enyone know any program which could help with this matter?

Thanks in advance!
Best regards!
Mateusz

--
INTERIA.PL dla kobiet... >>> http://link.interia.pl/f193b



Re: [ns] Fwd: (hybrid ad hoc network) behavior of base stations

2006-06-20 Thread Hai Nam

On 6/20/06, Andrea M <[EMAIL PROTECTED]> wrote:
>
> Do you have any UM-OLSR examples? I'm looking for some scripts to learn how
> OLSR works under NS, I'm very principiant.
> Thank you very much.
> Andrea.

Hi,

Take a look at this page http://masimum.dif.um.es/um-olsr/html/
There's an example.

Regards,

-- 
Hai-Nam NGUYEN
Elève 3A SLR, ENST Bretagne
2 rue de la Châtaigneraie, 35576 Cesson Sévigné
Site web: http://www.jcisio.com



Re: [ns] Fwd: (hybrid ad hoc network) behavior of base stations

2006-06-20 Thread Andrea M

Do you have any UM-OLSR examples? I'm looking for some scripts to learn how
OLSR works under NS, I'm very principiant.
Thank you very much.
Andrea.

2006/6/20, Francisco J. Ros <[EMAIL PROTECTED]>:
>
>
> Hello,
>
> That occurs because gateways haven't been selected as MPRs by any node.
> Note
> that fixed nodes aren't included within the neighborhood of the gateways.
>
> Regards,
> fran
>
> On Monday 19 June 2006 18:57, Hai Nam wrote:
> > message below, don't know why the list ask me to resend this mail, I'm
> > not new in this list :-(
> >
> > -- Forwarded message --
> > From: Hai Nam <[EMAIL PROTECTED]>
> > Date: Jun 19, 2006 6:31 PM
> > Subject: (hybrid ad hoc network) behavior of base stations
> > To: NS-List 
> >
> >
> > Hello,
> >
> > I simulate a hybrid ad hoc network in NS2 with UM-OLSR. I'm modifying
> > this implementation of OLSR so that it supports base stations. But I
> > find that the base stations don't send TC messages (but it do send
> > HELLO messages). Is there anything wrong ?
> >
> > Regards,
> >
> > --
> > Hai-Nam NGUYEN
> > Elève 3A SLR, ENST Bretagne
> > 2 rue de la Châtaigneraie, 35576 Cesson Sévigné
> > Site web: http://www.jcisio.com
>
>


Re: [ns] Mobile nodes: radius

2006-06-20 Thread Andrea M

Do you have any UM-OLSR examples? I'm looking for some scripts to learn how
OLSR works under NS, I'm very principiant.
Thank you very much.
Andrea.

2006/6/20, Daniel Mahrenholz <[EMAIL PROTECTED]>:
>
> Andrea M schrieb:
> > Hello, I found this string in NS Manual, how can I use it?
> >
> > [quote]$mobilenode radius 
> >
> > The radius  denotes the node's range. All mobilenodes that fall
> within
> > the circle of radius  with the node at its center
> > are considered as neighbours.[/quote]
> >
> > I used it like:
> > $node_(0) radius 50
> >
> > but It seems to do not work.
> >
>
> This must be a very old piece of code and does not make any sense at
> all. In practice there is nothing like a transmission radius. If a node
> receives a packet  depends on the propagation model. If you need a
> specific transmission radius (which btw is not really realistic) you can
> calculate the corresponding propagation parameters using the
> propagation.cc helper tool. Better setup the propagation parameters to
> reflect the conditions in the simulated environment and see what happens.
>
> Daniel.
>
>
>


Re: [ns] Mobile nodes: radius

2006-06-20 Thread Daniel Mahrenholz

Andrea M schrieb:
> Hello, I found this string in NS Manual, how can I use it?
>
> [quote]$mobilenode radius 
>
> The radius  denotes the node's range. All mobilenodes that fall within
> the circle of radius  with the node at its center
> are considered as neighbours.[/quote]
>
> I used it like:
> $node_(0) radius 50
>
> but It seems to do not work.
>   

This must be a very old piece of code and does not make any sense at 
all. In practice there is nothing like a transmission radius. If a node 
receives a packet  depends on the propagation model. If you need a 
specific transmission radius (which btw is not really realistic) you can 
calculate the corresponding propagation parameters using the 
propagation.cc helper tool. Better setup the propagation parameters to 
reflect the conditions in the simulated environment and see what happens.

Daniel.

 



Re: [ns] Warning everyone is ignoring (please use -channel)]

2006-06-20 Thread Q.R.Iqbal

 Original Message 
Subject: Re: [ns] Warning everyone is ignoring (please use -channel)
From:"Q.R.Iqbal" <[EMAIL PROTECTED]>
Date:Tue, June 20, 2006 3:18 pm
To:  "Amer Filipovic" <[EMAIL PROTECTED]>
--

Have a look at that file and see how the channel is declared
if you follow that procedure, you will not get that warning
the file is located as ns2.29/tcl/ex/

I hope this will help



> Hey all,
>
> Can anyone tell me how to get rid of that warning at the beginning of
> the wireless simulations
>
> warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
>
> It is getting on my nerves :P
>
> Regards,
>
> Amer
> University of Western Australia
>
>


Kind regards

Qasim Raza Iqbal
PhD Candidate,
ACNRG Lab N504,  Office N505
Adaptive Communications Networks Research Group,
School of Engineering And Applied Science
Aston University
Birmingham  B4 7ET
United Kingdom
http://www.ee.aston.ac.uk/research/acrg/index.html





Re: [ns] Getting data from wireless base station to cross to wiredstation

2006-06-20 Thread Pedro Vale Estrela


Congratulations Paul! 

I believe that after fixing your first "major" bug, your next NS2 hacking
experiences will be done a lot faster.

One very important helper for beating the NS2 learning curve is to study the
other NS2 success stories, to try to grasp all the details and lessons
learnt. These could be right the thing that one will need either tomorrow...
or in a year's time.

Now that you have the protocol working, you might want to combine and
parametize the test script so that it is able to run both protocols in the
exact same scenarios.



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Paul Vincent Craven
>
> A while back I asked about getting data to move from my wireless base
> station node to my wired node. I finally figured out the issue. Key to
> getting this to work was:
> 
> 1.) Telling my "node that is wired to the base station" that such a
> route exists:
> $W(0) add-route $BS(0) $W(0)

This is very strange. The fixed routing protocol should have done it for
you, on the fixed part of the network.

Try other fixed routing protocols without your fix, to check what's
happening: 

# http://www.isi.edu/nsnam/ns/doc/node304.html
# types of protocols: Algorithmic / Direct / Dummy / DV / LS / Manual
# Session / Static

In this process you may find that the bug was your's, which is strange
because your hierarchal addresses are OK, eg:

  0.0.0   (W(0))
wired link 
  1.0.0   (BS)
wireless link
  1.0.1   (MH)

your you might find a bug on the NS2 (step 7 of
http://tagus.inesc-id.pt/~pestrela/ns2/ns2_debugging3.html)
 

> 2.) And in my forward_data() member of my custom routing protocol, I
> needed to pick the right target:
> Scheduler::instance().schedule(p->handler_, p, 0.0);
> 
> Key in this was not to use target_ with just went back to my handler I
> was already in, but instead reset back to use the packet's original
> handler.

I've compared your code to DSDV's and NOAH's, and I can't understand why you
couldn't use the same method:

NOAH_Agent::forwardPacket (Packet * p)
...
target_->recv(p, (Handler *)0); //line 985
...


DSDV_Agent::forwardPacket (Packet * p)
...
target_->recv(p, (Handler *)0); //line 168
...

 
> Particular thanks to Pedro Vale Estrela, who's help was invaluable.
> 
> Paul Vincent Craven




Re: [ns] Fwd: (hybrid ad hoc network) behavior of base stations

2006-06-20 Thread Francisco J. Ros

Hello,

That occurs because gateways haven't been selected as MPRs by any node. Note 
that fixed nodes aren't included within the neighborhood of the gateways.

Regards,
fran

On Monday 19 June 2006 18:57, Hai Nam wrote:
> message below, don't know why the list ask me to resend this mail, I'm
> not new in this list :-(
>
> -- Forwarded message --
> From: Hai Nam <[EMAIL PROTECTED]>
> Date: Jun 19, 2006 6:31 PM
> Subject: (hybrid ad hoc network) behavior of base stations
> To: NS-List 
>
>
> Hello,
>
> I simulate a hybrid ad hoc network in NS2 with UM-OLSR. I'm modifying
> this implementation of OLSR so that it supports base stations. But I
> find that the base stations don't send TC messages (but it do send
> HELLO messages). Is there anything wrong ?
>
> Regards,
>
> --
> Hai-Nam NGUYEN
> Elève 3A SLR, ENST Bretagne
> 2 rue de la Châtaigneraie, 35576 Cesson Sévigné
> Site web: http://www.jcisio.com



Re: [ns] Mobile nodes: radius

2006-06-20 Thread Q.R.Iqbal

Hi there

I also tried that a few months ago, but it does not seem to do what it says
i personally think it is useless, unless someone has other opinion



>
> Hello, I found this string in NS Manual, how can I use it?
>
> [quote]$mobilenode radius 
>
> The radius  denotes the node's range. All mobilenodes that fall within
> the circle of radius  with the node at its center
> are considered as neighbours.[/quote]
>
> I used it like:
> $node_(0) radius 50
>
> but It seems to do not work.
>
> Sorry for my poor english.
> thank you
> Andrea.
>


Kind regards

Qasim Raza Iqbal
PhD Candidate,
ACNRG Lab N504,  Office N505
Adaptive Communications Networks Research Group,
School of Engineering And Applied Science
Aston University
Birmingham  B4 7ET
United Kingdom
http://www.ee.aston.ac.uk/research/acrg/index.html




[ns] error when compiling a new MANET protocol

2006-06-20 Thread Alexandra Cioroianu

Hello ns users!
 I am trying to develop a new MANET routing protocol, following the steps 
described in the tutorial "Implementing a new MANET unicast routing protocol in 
NS2" . I have created the requested files and i have written the code, with 
small changes, but i haven't added any new variables or functions. My protocol 
is named myproto. Here are the errors i get:
 myproto/myproto.h:37: error: 'myproto_state' does not name a type
 myproto/myproto.h:38: error: 'myproto_rtable' does not name a type
 myproto/myproto.h:48: error: ISO C++ forbids declaration of 'myproto_state' 
with no type
 myproto/myproto.h:48: error: 'myproto_state' declared as an 'inline' field
 myproto/myproto.h:48: error: expected ';' before '&' token
 myproto/myproto.h:49: error: expected `;' before 'inline'
 myproto/myproto.h: In member function 'int& Myproto::accessible_var()':
 myproto/myproto.h:49: error: 'accessible_var_' was not declared in this scope
 myproto/myproto.cc: In constructor 'Myproto::Myproto(nsaddr_t)':
 myproto/myproto.cc:38: error: 'accessible_var_' was not declared in this scope
 myproto/myproto.cc: In member function 'virtual int Myproto::command(int, 
const char* const*)':
 myproto/myproto.cc:52: error: 'rtable_' was not declared in this scope
 myproto/myproto.cc:56: error: 'da_addr' was not declared in this scope
 myproto/myproto.cc: In member function 'void 
Myproto::recv_myproto_pkt(Packet*)':
 myproto/myproto.cc:108: warning: unused variable 'ih'
 myproto/myproto.cc:109: warning: unused variable 'ph'
 myproto/myproto.cc: In member function 'void Myproto::forward_data(Packet*)':
 myproto/myproto.cc:170: error: 'nsdaddr_t' was not declared in this scope
 myproto/myproto.cc:170: error: expected `;' before 'next_hop'
 myproto/myproto.cc:171: error: 'next_hop' was not declared in this scope
 make: *** [myproto/myproto.o] Error 1
  Please tell me what could be wrong. I really got stuck, don't know what to do 
in this point. Thank you in advance!
 Regards, Alexandra 
 

-
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2¢/min or less.


[ns] tcp on mipv6 problem?

2006-06-20 Thread erwin budi

hello,
i am working with ns-2.1b6 and mobiwan to simulate
mipv6 to get tcp throughput.but when i simulate it,i
can't get the throughput from it.do anyone have same
work wit me?
regards,
erwin

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



[ns] LinkCache vs MobiCache

2006-06-20 Thread Amer Filipovic

Ok,

This is actually a pretty a big issue. Pretty much any ns distribution I 
have tried so far makes use of MobiCache and NOT LinkCache. The code 
appears to be there, but I cannot get it to work.

Does anyone know how to enable linkcache.cc? Any ns distribution will 
do, I've been trying with 2.1b9a and 2.29.2 and 2.29.3.

Regards,

Amer Filipovic
University of Western Australia



[ns] Mobile nodes: radius

2006-06-20 Thread Andrea M

Hello, I found this string in NS Manual, how can I use it?

[quote]$mobilenode radius 

The radius  denotes the node's range. All mobilenodes that fall within
the circle of radius  with the node at its center
are considered as neighbours.[/quote]

I used it like:
$node_(0) radius 50

but It seems to do not work.

Sorry for my poor english.
thank you
Andrea.


Re: [ns] Warning everyone is ignoring (please use -channel)

2006-06-20 Thread Daniel Mahrenholz

Amer Filipovic schrieb:
> Can anyone tell me how to get rid of that warning at the beginning of 
> the wireless simulations
>
> warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
>
> It is getting on my nerves :P
>   
As you can read - modify each test script to use the wireless channel as 
shown in the example file (explanation is in the file; a three-liner a 
suppose).

I agree that this warning is anoying - so if you can offer some time for 
the modification, please provide a patch and I will spend some time to 
integrate it into the CVS version  (if the other developers don't have 
any objections).

Daniel.



[ns] Warning everyone is ignoring (please use -channel)

2006-06-20 Thread Amer Filipovic

Hey all,

Can anyone tell me how to get rid of that warning at the beginning of 
the wireless simulations

warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl

It is getting on my nerves :P

Regards,

Amer
University of Western Australia