[ns] creating malacious nodes

2008-11-05 Thread sriram balakrishnan

-- Forwarded message --
From: sriram balakrishnan <[EMAIL PROTECTED]>
Date: Thu, Nov 6, 2008 at 8:18 AM
Subject: creating malacious nodes
To: ns-users@isi.edu


any idea how to make a specific node drop packets irrespective of routing
protocol

-- 
B Sriram
India
mob : 09733706981



-- 
B Sriram
India
mob : 09733706981


[ns] probabilistic modeling between wireless nodes

2008-11-05 Thread Fry Godwin



Hi All,

Just want to confirm something.

I have gone through the forum and documentation and it seems that in order
to model the wireless link between two nodes probabilistically ( e.g if node
A sends 100 packets to node B , node B would only receive a percentage of
the packets sent say 85% ) i have to use Ricean or Rayleigh fading instead
of the TwoRayGround Propagation Model , am i correct or am i missing
something hear ?

hope to hear from anyone 

thanks in advance 


-- 
View this message in context: 
http://www.nabble.com/probabilistic-modeling-between-wireless-nodes-tp20353400p20353400.html
Sent from the ns-users mailing list archive at Nabble.com.



Re: [ns] Get node positions in C++

2008-11-05 Thread Mubashir Rehmani

Hi Ivanovich Medeiroa

You can get the node location in your c++ by using the following code:

double x,y,z;
Node* srcnode = 0 ;
srcnode = Node::get_node_by_address(2); //put here the node id
MobileNode* tmnode = (MobileNode*)srcnode;

tmnode->getLoc(&x, &y, &z);
cout<<"Node Location : "<

>
> Hi everyone,
>
> I am developing a wireless application and I need to get the X, Y and Z
> node positions. How can I do that?
>
> Example of my OTcl code:
>
> set ns [new Simulator]
> ...
> $node(0) set X_ 10.0
> $node(0) set Y_ 20.0
> $node(0) set Z_ 0.0
> ...
>
> How can I get these values in the C++ (my application) code?
>
> Regards,
> Ivan.
>
>
>  Novos endereços, o Yahoo! que você conhece. Crie um email novo com a
> sua cara @ymail.com ou @rocketmail.com.
> http://br.new.mail.yahoo.com/addresses




-- 
Mubashir Husain Rehmani

Mobile :   00 33 (0)6 32 00 89 35


[ns] Get node positions in C++

2008-11-05 Thread Ivanovich Medeiroa

Hi everyone,

I am developing a wireless application and I need to get the X, Y and Z node 
positions. How can I do that?

Example of my OTcl code:

set ns [new Simulator]
...
$node(0) set X_ 10.0
$node(0) set Y_ 20.0
$node(0) set Z_ 0.0
...

How can I get these values in the C++ (my application) code?

Regards,
Ivan.


  Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua 
cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses

Re: [ns] assigning IP address to nodes

2008-11-05 Thread Marlos Marques

Thank you very much guys. I was considering if those structures exist in NS,
in some way they are ready for use. I wouldn't like to reinvent the wheel
:) So, any link/example/source would be *much* appreciated. Thanks again.


[]s,
Marlos.


On Wed, Nov 5, 2008 at 1:29 PM, Arturo Servin <[EMAIL PROTECTED]> wrote:

>
>
>If you are working with your code in TCL may be you can make a map
> Node_ID (from ns) to an IP address in your TCL script. If you are
> working in C++ you can do what Sidney proposes.
>
>Either way you have a way to do it, may be not trivial but
> definitely
> possible.
>
> -as
>
> On 5 Nov 2008, at 15:55, Sidney Doria wrote:
>
> >
> > The best of NS-2 is its flexibility. If you didn't find a trivial
> > solution to assign a simple IP to a node, you can add a new attribute
> > to an inherited class of node. You can simply bind this new attribute
> > in your TCL script and assign what IP you want on the node you want.
> >
> > The new atrribute can be of type nsaddr_t (IP address).
> >
> > Hope to be useful,
> >
> > Sidney Doria
> > Brazil
> >
> > 2008/11/5 Marlos Marques <[EMAIL PROTECTED]>:
> >>
> >> Hello all,
> >>
> >> Currently, I am trying to implement an application layer multicast
> >> algorithm
> >> using NS2. For this purpose I need to assign IP address to every
> >> node in
> >> NS2. I checked out the NS2 nodes may have hierarchical routing
> >> addressing
> >> which is similar to IP addressing. But, I also found the "addr"
> >> command
> >> which apparently allows you to configure the node IP, so I can run
> >> the
> >> following code:
> >>
> >> set ns [new Simulator]
> >> set n0 [$ns node]
> >> set n1 [$ns node]
> >> $n0 addr "192.168.1.1"
> >> $n1 addr "192.168.1.2"
> >>
> >> But in the trace file I keep getting sequential identifiers. For
> >> example:
> >>
> >> + 0 1 2 tcp 40 --- 2 1.0 5.0 0 0
> >>
> >> But I would like to get this one:
> >>
> >> + 0 192.168.1.1 192.168.1.2 tcp 40 --- 2 1.0 5.0 0 0
> >>
> >> What am I doing wrong?
> >>
> >>
> >> Thanks in advance,
> >> Marlos
> >>
> >
> >
> >
> > --
> > Sidney Doria
> > Redes ad hoc móveis
> > Mestrado em Computação
> > UFCG
> > Brasil
> >
> > "Nessa jornada, o conhecimento será o seu escudo..."
> > (Mestre dos Magos no episódio do grimoire de ouro)
> >
>
>


Re: [ns] assigning IP address to nodes

2008-11-05 Thread Arturo Servin


If you are working with your code in TCL may be you can make a map  
Node_ID (from ns) to an IP address in your TCL script. If you are  
working in C++ you can do what Sidney proposes.

Either way you have a way to do it, may be not trivial but definitely  
possible.

-as

On 5 Nov 2008, at 15:55, Sidney Doria wrote:

>
> The best of NS-2 is its flexibility. If you didn't find a trivial
> solution to assign a simple IP to a node, you can add a new attribute
> to an inherited class of node. You can simply bind this new attribute
> in your TCL script and assign what IP you want on the node you want.
>
> The new atrribute can be of type nsaddr_t (IP address).
>
> Hope to be useful,
>
> Sidney Doria
> Brazil
>
> 2008/11/5 Marlos Marques <[EMAIL PROTECTED]>:
>>
>> Hello all,
>>
>> Currently, I am trying to implement an application layer multicast  
>> algorithm
>> using NS2. For this purpose I need to assign IP address to every  
>> node in
>> NS2. I checked out the NS2 nodes may have hierarchical routing  
>> addressing
>> which is similar to IP addressing. But, I also found the "addr"  
>> command
>> which apparently allows you to configure the node IP, so I can run  
>> the
>> following code:
>>
>> set ns [new Simulator]
>> set n0 [$ns node]
>> set n1 [$ns node]
>> $n0 addr "192.168.1.1"
>> $n1 addr "192.168.1.2"
>>
>> But in the trace file I keep getting sequential identifiers. For  
>> example:
>>
>> + 0 1 2 tcp 40 --- 2 1.0 5.0 0 0
>>
>> But I would like to get this one:
>>
>> + 0 192.168.1.1 192.168.1.2 tcp 40 --- 2 1.0 5.0 0 0
>>
>> What am I doing wrong?
>>
>>
>> Thanks in advance,
>> Marlos
>>
>
>
>
> -- 
> Sidney Doria
> Redes ad hoc móveis
> Mestrado em Computação
> UFCG
> Brasil
>
> "Nessa jornada, o conhecimento será o seu escudo..."
> (Mestre dos Magos no episódio do grimoire de ouro)
>



Re: [ns] assigning IP address to nodes

2008-11-05 Thread Sidney Doria

The best of NS-2 is its flexibility. If you didn't find a trivial
solution to assign a simple IP to a node, you can add a new attribute
to an inherited class of node. You can simply bind this new attribute
in your TCL script and assign what IP you want on the node you want.

The new atrribute can be of type nsaddr_t (IP address).

Hope to be useful,

Sidney Doria
Brazil

2008/11/5 Marlos Marques <[EMAIL PROTECTED]>:
>
> Hello all,
>
> Currently, I am trying to implement an application layer multicast algorithm
> using NS2. For this purpose I need to assign IP address to every node in
> NS2. I checked out the NS2 nodes may have hierarchical routing addressing
> which is similar to IP addressing. But, I also found the "addr" command
> which apparently allows you to configure the node IP, so I can run the
> following code:
>
> set ns [new Simulator]
> set n0 [$ns node]
> set n1 [$ns node]
> $n0 addr "192.168.1.1"
> $n1 addr "192.168.1.2"
>
> But in the trace file I keep getting sequential identifiers. For example:
>
> + 0 1 2 tcp 40 --- 2 1.0 5.0 0 0
>
> But I would like to get this one:
>
> + 0 192.168.1.1 192.168.1.2 tcp 40 --- 2 1.0 5.0 0 0
>
> What am I doing wrong?
>
>
> Thanks in advance,
> Marlos
>



-- 
Sidney Doria
Redes ad hoc móveis
Mestrado em Computação
UFCG
Brasil

"Nessa jornada, o conhecimento será o seu escudo..."
(Mestre dos Magos no episódio do grimoire de ouro)



[ns] wireless corrupted packets monitoring

2008-11-05 Thread Ramy Eid

I want to simulate a wired-cum wireless scenario adding FEC, ARQ
functionality to the wireless environment. Please help me in any of these
topics :

   1. I added uniform error model to my mobile nodes configuration, I can
   not get any dropped packets. I am using *cat
mixed.tr| grep d
   * to search for dropped packets in the trace file. I can not  get any
   dropped packets
   2. I tried to attach flow monitor to tcp flow because I want to measure
   the dropped packets, but it seems that attach-fmon wants a link which is not
   available in the wireless based flows, how can I use that flow monitor for
   wireless flows??? The flow monitor section is commented to make the script
   working. The attach-fmon is not working :(
   3. I want to add sequential decoding algorithm [FEC algorithm] to the
   link layer, I want also to implement ARQ in the Link layer [MAC 802.11]. I
   am not sure what is possible to do and what is not ? Any idea how can I
   start ? and where to find resources ?

*Please reply, Your reply will help me a lot.*
My current code.

### This simulation is an example of combination of wired and wireless
### topologies.
#---
#defining a new hashtable to store values
global opt
set adhocRouting   DSDV
set stop   350
set num_wired_nodes  1
set num_bs_nodes 1
set num_wireless_nodes 2
set x300
set y300
#---

proc plotWindow { tcpSource file } {
global ns_
set time 0.1
set now [$ns_ now]
set cwnd [$tcpSource set cwnd_]
set wnd [$tcpSource set window_]
puts $file "$now $cwnd"
$ns_ at [expr $now+$time] "plotWindow $tcpSource $file"
}

proc wireless_node_config { ns topo em } {
  $ns node-config -adhocRouting DSDV \
 -llType LL \
 -macType Mac/802_11 \
 -ifqType Queue/DropTail/PriQueue \
 -ifqLen 50 \
 -antType Antenna/OmniAntenna \
 -propInstance [new Propagation/TwoRayGround] \
 -phyType Phy/WirelessPhy \
 -channel [new Channel/WirelessChannel] \
 -topoInstance $topo \
 -wiredRouting ON \
 -agentTrace ON \
 -routerTrace OFF \
 -macTrace OFF \
 -outgoingErrProc $em \
 -incomingErrProc $em

}

proc nam {ns namFile trFile namOutFile} {
$ns flush-trace
close $namFile
close $trFile
puts "running nam..."
#exec nam $namOutFile &
puts "I am in nam"
}
proc finish { } {
exit 0
}
#---
# The global simulator instance
set ns_   [new Simulator]
#---
#Hierarchical routing is needed to in mixed environments
#each of wireless and wired environment must be in seperated domains
#so at least we want 2 domains

# set up for hierarchical routing
$ns_ node-config -addressType hierarchical
AddrParams set domain_num_ 2
lappend cluster_num 1 2
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 1 1 2
AddrParams set nodes_num_ $eilastlevel
#---
#set the Topology
set topo   [new Topography]
$topo load_flatgrid x y

# god needs to know the number of all wireless interfaces
create-god [expr $num_wireless_nodes+$num_wired_nodes]
#---
#trace output file
set trFile  [open mixed.tr w]
$ns_ trace-all $trFile

# nam output files
set namFile [open mixed.nam w]
$ns_ namtrace-all $namFile
$ns_ namtrace-all-wireless $namFile x y

#xgraph output files
set x0 [open xgraph0.tr w]

#flow monitor trace
set flowFile [open flowfile w]
#extra files
set cwndFile [open cwndFile.wtc w]
#---
#Define different colors for data flows (for NAM)
$ns_ color 1 Blue
$ns_ color 2 Red
$ns_ color 3 Green
#---
#creating the error model
set m1_ubstate 27.0
set m1_bstate 12.0
set m2_ubstate 0.4
set m2_bstate 0.4
set durlist "$m1_ubstate $m1_bstate $m2_ubstate $m2_bstate"
#set em [new ErrorModel/ComplexTwoStateMarkov $durlist time]
set em [new ErrorModel]
$em unit bit
$em ranvar [new RandomVariable/Uniform]
$em set rate_ 0.1
$em drop-target [new Agent/Null]
#$em drop-target [new Agent/Null]

#the option below is for wired links, there is no links in wireless
environment

#$ns_ link-lossmodel $loss_module $BS(0) $node_(0)
#---
#Creating the nodes

# The wired nodes
set addresses {0.0.0 1.0.0 1.1.0 1.1.1}
set W(0) [$ns_ node [lindex $addresses 

Re: [ns] assigning IP address to nodes

2008-11-05 Thread Marlos Marques

Thanks Rami,

I read that link too. That is the hierarchical format in NS. It is like IP
addressing but not the same. It uses 3 levels of hierarchy because optimum
results were found with this value (The NS Manual). But I need assign real
IP addresses to the nodes because my protocol algorithm does some
calculations with them.


[]s,
Marlos.


On Wed, Nov 5, 2008 at 10:15 AM, Ramy Eid <[EMAIL PROTECTED]> wrote:

> Hi Marlos,
> I am not sure but this 
> linksays
>  that the addresses must be in the X.Y.Z format ?
>
>
> On Wed, Nov 5, 2008 at 14:03, Marlos Marques <[EMAIL PROTECTED]>wrote:
>
>>
>> Hello all,
>>
>> Currently, I am trying to implement an application layer multicast
>> algorithm
>> using NS2. For this purpose I need to assign IP address to every node in
>> NS2. I checked out the NS2 nodes may have hierarchical routing addressing
>> which is similar to IP addressing. But, I also found the "addr" command
>> which apparently allows you to configure the node IP, so I can run the
>> following code:
>>
>> set ns [new Simulator]
>> set n0 [$ns node]
>> set n1 [$ns node]
>> $n0 addr "192.168.1.1"
>> $n1 addr "192.168.1.2"
>>
>> But in the trace file I keep getting sequential identifiers. For example:
>>
>> + 0 1 2 tcp 40 --- 2 1.0 5.0 0 0
>>
>> But I would like to get this one:
>>
>> + 0 192.168.1.1 192.168.1.2 tcp 40 --- 2 1.0 5.0 0 0
>>
>> What am I doing wrong?
>>
>>
>> Thanks in advance,
>> Marlos
>>
>
>
>
> --
> Ramy Eid
>


Re: [ns] assigning IP address to nodes

2008-11-05 Thread Marlos Marques

Thanks Fernando,

That's Ok, the node ID is used in the simulator core. But, it is possible
assign real IP addresses to the nodes (not X.Y.Z hierarchical format)? I
need the IP addresses because my protocol algorithm does some calculations
with them. As a matter of fact, it is not so important IP addresses appear
on the trace file. I used trace file just to confirm I can assign them.

I have read something about Address class, ns_addr_t struct, etc. But I
didn't understand how I use that. Could you help me with it? Or give me any
link?


[]s,
Marlos.



On Wed, Nov 5, 2008 at 9:37 AM, Fernando Farias <[EMAIL PROTECTED]> wrote:

> On simulator core the address have been to use for send traffic between
> node are the variable id of structure common head (hdr_cmn->id). The trace
> files will write based value from id variable as you have seen on your file.
>
> regards
>
> 2008/11/5 Marlos Marques <[EMAIL PROTECTED]>
>
>
>> Hello all,
>>
>> Currently, I am trying to implement an application layer multicast
>> algorithm
>> using NS2. For this purpose I need to assign IP address to every node in
>> NS2. I checked out the NS2 nodes may have hierarchical routing addressing
>> which is similar to IP addressing. But, I also found the "addr" command
>> which apparently allows you to configure the node IP, so I can run the
>> following code:
>>
>> set ns [new Simulator]
>> set n0 [$ns node]
>> set n1 [$ns node]
>> $n0 addr "192.168.1.1"
>> $n1 addr "192.168.1.2"
>>
>> But in the trace file I keep getting sequential identifiers. For example:
>>
>> + 0 1 2 tcp 40 --- 2 1.0 5.0 0 0
>>
>> But I would like to get this one:
>>
>> + 0 192.168.1.1 192.168.1.2 tcp 40 --- 2 1.0 5.0 0 0
>>
>> What am I doing wrong?
>>
>>
>> Thanks in advance,
>> Marlos
>>
>
>
>
> --
> "A computer is like air conditioning: it becomes useless when you open
> windows." - Linus Torvalds
>
> Fernando N. N. Farias
> IT Analyst  CTIC/UFPA
> Computer Engineer M.Sc. Student
> GERCOM/UFPA Team Member
> Federal University of Pará
>
>


Re: [ns] assigning IP address to nodes

2008-11-05 Thread Ramy Eid

Hi Marlos,
I am not sure but this
linksays
that the addresses must be in the X.Y.Z format ?

On Wed, Nov 5, 2008 at 14:03, Marlos Marques <[EMAIL PROTECTED]>wrote:

>
> Hello all,
>
> Currently, I am trying to implement an application layer multicast
> algorithm
> using NS2. For this purpose I need to assign IP address to every node in
> NS2. I checked out the NS2 nodes may have hierarchical routing addressing
> which is similar to IP addressing. But, I also found the "addr" command
> which apparently allows you to configure the node IP, so I can run the
> following code:
>
> set ns [new Simulator]
> set n0 [$ns node]
> set n1 [$ns node]
> $n0 addr "192.168.1.1"
> $n1 addr "192.168.1.2"
>
> But in the trace file I keep getting sequential identifiers. For example:
>
> + 0 1 2 tcp 40 --- 2 1.0 5.0 0 0
>
> But I would like to get this one:
>
> + 0 192.168.1.1 192.168.1.2 tcp 40 --- 2 1.0 5.0 0 0
>
> What am I doing wrong?
>
>
> Thanks in advance,
> Marlos
>



-- 
Ramy Eid


Re: [ns] -DDEBUG option

2008-11-05 Thread Mubashir Rehmani

Hi Farhan Hyder

To debug ns do the following:

1. in the directory of tcl-debug:

a) ./configure --with-tcl=

b) make clean

c) make

2. in the directory of ns

a) make clean

b) ./configure --enable-debug --with-tcl= --with-tk=
--with-tcldebug= c)make
This TCL debugger enables to set specific breakpoints in the TCL code, via
"debug 1" instructions. When you do that, the TCL script will be halted at
this location, and you can check values of variables etc. Then you can
either resume execution, or execute step-by-step TCL instructions
(unfortunately, this is a very confusing debugging method, due to the nature
of TCL code)

For further details see this site:

http://tagus.inesc-id.pt/~pestrela/ns2/ns2_debugging.html

Feel free to contact me

Regards
Mubashir Husain Rehmani
LIP6, UPMC, Paris, France.

2008/11/3 Farhan Hyder <[EMAIL PROTECTED]>


>  Hello all,
>
> I can't figure out what does it mean to 'compile NS with -DDEBUG option'.
> Can anyone help me with it ? I mean the procedure, how exactly do we do it
> ?
>
> "Note: ns must be compiled with -DDEBUG for this option to
>  work. Also, if debug_ (the standard debug flag) is set to 1, then
>  all the bits in debugMask_ are set."
>
>
> Thanks,
> Farhan Hyder
>



-- 
Mubashir Husain Rehmani

Mobile :   00 33 (0)6 32 00 89 35


[ns] assigning IP address to nodes

2008-11-05 Thread Marlos Marques

Hello all,

Currently, I am trying to implement an application layer multicast algorithm
using NS2. For this purpose I need to assign IP address to every node in
NS2. I checked out the NS2 nodes may have hierarchical routing addressing
which is similar to IP addressing. But, I also found the "addr" command
which apparently allows you to configure the node IP, so I can run the
following code:

set ns [new Simulator]
set n0 [$ns node]
set n1 [$ns node]
$n0 addr "192.168.1.1"
$n1 addr "192.168.1.2"

But in the trace file I keep getting sequential identifiers. For example:

+ 0 1 2 tcp 40 --- 2 1.0 5.0 0 0

But I would like to get this one:

+ 0 192.168.1.1 192.168.1.2 tcp 40 --- 2 1.0 5.0 0 0

What am I doing wrong?


Thanks in advance,
Marlos