[ns] Defining diferent multicast groups

2007-03-22 Thread Javier Chicote

Hi ns-users,

I have two groups of nodes in my network, and I would like to define two 
multicast groups, one for each of them.

The problem is that the traffic sources send the packets to ALL the nodes, and 
not only to the nodes within its group.

For example, when source 'a' is transmitting to the group 'a' nodes, nodes of 
the group 'b' also receive the packets and reply with a 'prune' packet. After 
some time, nodes of the group 'b' do not receive packets from the source 'a', 
long time passes and they start receiving again.

Anyone could give me a explanation of this, or knows the solution to the 
problem??

Many thanks in advance,

Javier

P.D. I have defined the multicast groups:

set mproto DM
set mrthandle [$ns_ mrtproto $mproto] 
set group_a [Node allocaddr]
set group_b [Node allocaddr]


I have defined each udp agent to its corresponding group:

set udp_a [new Agent/UDP]
$udp_a set dst_addr_ $group_a
$udp_a set dst_port_ 0
$ns attach-agent $node(0) $udp_a


I have attached each node to its corresponding group:

$node($i) join-group $sink($i) $group_a





__ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com


[ns] Is it possible to add a processing delay at the NODES??

2007-03-22 Thread Javier Chicote

Hi ns-users,

I know that I can define a delay in the links of a wired network.

Additionally, I would like to add a processing delay at the nodes.

Is that possible? How can it be defined?

Many thanks in advance.

Regards,

Javier







__ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com


Re: [ns] ns/nam: respresentation problem when definingposition-fixed nodes (NEW question)

2007-03-21 Thread Javier Chicote

Hi,

Thank your very much for your reply.

It is a good idea, but in my case all the links must have the same delay, so 
that is not a possibility.

It is a pity that NAM does not support this facility.

Best regards,

Javier

- Mensaje original 
De: Pedro Vale Estrela <[EMAIL PROTECTED]>
Para: Javier Chicote <[EMAIL PROTECTED]>; ns-users@ISI.EDU
Enviado: miércoles, 21 de marzo, 2007 19:02:16
Asunto: RE: [ns] ns/nam: respresentation problem when definingposition-fixed 
nodes (NEW question)


I' tried to add XY coordinates for wired nodes, but nam doesn't support this
facility.

Instead, I achieve the same result by setting the length of the wired links
via their delay

Pedro Vale Estrela
http://tagus.inesc-id.pt/~pestrela/ns2





> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Javier Chicote
> Sent: quarta-feira, 21 de Março de 2007 17:00
> To: ns-users@ISI.EDU
> Subject: Re: [ns] ns/nam: respresentation problem when definingposition-
> fixed nodes (NEW question)
> 
> 
> Hi ns-users,
> 
> I learnt that the previous problem can be "solved" by using 'orient'
> method at the link definition. However, this solution is not enough when
> defining more complex structures. The next figure shows 4 nodes standing
> in the imaginary vertexes of a square, which are all of them connected to
> a master node like it is shown in the next picture:
> 
>  node(1,0)node(1,1)
>   (0,100) (100,100)__
>  \___\__
>  \___   \_
>  \___ master
>_/(200,50)
>  _/ _/
> /  /
> (0,0)   (0,100)
>  node(0,0)   node(100,0)
> 
> ---> What I would like to know is if it is possible (or not) to define the
> geographic position of the nodes when the coordinates of them are known in
> a wired scenario, or other ideas to solve the problem.
> 
> This is the code of the file:
> 
> # Network configuration (x,y):## node(1,0)node(1,1)#  (0,100)
> (100,100)__# \___\__ # \___
> \_# \___ master#
> _/(200,50)# _/ _/#/
> /   #(0,0)   (0,100)# node(0,0)   node(100,0)#
> # Create a simulator instanceset ns [new Simulator]
> # Open the NAM trace fileset namfile [open position-out.nam w]$ns
> namtrace-all $namfile
> set rows2   ;# number of rowsset cols2
> ;# number of nodes per row
> # Define nodesfor {set i 0} {$i < $rows} {incr i} {for {set j 0}
> {$j < $cols} { incr j } {set node($i,$j) [$ns node]
> }}set master [$ns node]
> # Provide initial (X,Y,Z) co-ordinates for nodesfor {set i 0} {$i < $rows}
> {incr i} {set xj 0.0for {set j 0} {$j < $cols} { incr j }
> {$node($i,$j) set X_ $xjif {$i == 0} then
> { $node($i,$j) set Y_ 0.0} elseif {$i == 1} then {
> $node($i,$j) set Y_ 100.0 } $node($i,$j) set Z_ 0.0
> set xj [expr $xj + 200]}}$master set X_ 200.0$master set Y_
> 50.0$master set Z_ 0.0
> # Define links between nodes$ns duplex-link $node(0,0) $master 1Mb 100ms
> DropTail$ns duplex-link $node(0,1) $master 1Mb 100ms DropTail$ns duplex-
> link $node(1,0) $master 1Mb 100ms DropTail$ns duplex-link $node(1,1)
> $master 1Mb 100ms DropTail
> # Define link orientation$ns duplex-link-op $node(0,0) $master orient
> rigth-up$ns duplex-link-op $node(0,1) $master orient rigth$ns duplex-link-
> op $node(1,0) $master orient rigth$ns duplex-link-op $node(1,1) $master
> orient rigth-down
> # Define a 'finish' procedureproc finish {} {global ns tracefile
> namfile$ns flush-traceclose $namfile exec nam
> position-out.nam &exit 0}
> # Stop the simulation$ns at [expr 5.0 - 0.01] "puts \"Stopping
> Simulation...\" "$ns at 5.0 "finish ; $ns halt"
> # Start the simulationputs "Starting Simulation..."$ns run
> 
> 
> 
> - Mensaje original 
> De: Javier Chicote <[EMAIL PROTECTED]>
> Para: ns-users@isi.edu
> Enviado: miércoles, 21 de marzo, 2007 11:36:06
> Asunto: ns/nam: respresentation problem when defining position-fixed nodes
> 
> Hi ns-users,
> 
> I would like to simulate a position-fixed wired network with 2 lines and 3
> nodes per line, like it is shown above. The distance between the nodes
> should be 100 units (for example), so the first node of the matrix will be
> in (x=0,y=0) and the last node in (x=100, y=200).
> 
>   

Re: [ns] ns/nam: respresentation problem when defining position-fixed nodes (NEW question)

2007-03-21 Thread Javier Chicote

Hi ns-users,

I learnt that the previous problem can be "solved" by using 'orient' method at 
the link definition. However, this solution is not enough when defining more 
complex structures. The next figure shows 4 nodes standing in the imaginary 
vertexes of a square, which are all of them connected to a master node like it 
is shown in the next picture:

 node(1,0)node(1,1)
  (0,100) (100,100)__
 \___\__ 
 \___   \_
 \___ master
   _/(200,50)
 _/ _/
/  /   
(0,0)   (0,100)
 node(0,0)   node(100,0)

---> What I would like to know is if it is possible (or not) to define the 
geographic position of the nodes when the coordinates of them are known in a 
wired scenario, or other ideas to solve the problem.

This is the code of the file:

# Network configuration (x,y):## node(1,0)node(1,1)#  (0,100) 
(100,100)__# \___\__ # \___   
\_# \___ master#   
_/(200,50)# _/ _/#/ 
 /   #(0,0)   (0,100)# node(0,0)   node(100,0)#
# Create a simulator instanceset ns [new Simulator]
# Open the NAM trace fileset namfile [open position-out.nam w]$ns namtrace-all 
$namfile
set rows2   ;# number of rowsset cols2  
 ;# number of nodes per row
# Define nodesfor {set i 0} {$i < $rows} {incr i} {for {set j 0} {$j < 
$cols} { incr j } {set node($i,$j) [$ns node]}}set master 
[$ns node]
# Provide initial (X,Y,Z) co-ordinates for nodesfor {set i 0} {$i < $rows} 
{incr i} {set xj 0.0for {set j 0} {$j < $cols} { incr j } { 
   $node($i,$j) set X_ $xjif {$i == 0} then { 
$node($i,$j) set Y_ 0.0} elseif {$i == 1} then { $node($i,$j) 
set Y_ 100.0 } $node($i,$j) set Z_ 0.0set xj 
[expr $xj + 200]}}$master set X_ 200.0$master set Y_ 50.0$master set Z_ 
0.0
# Define links between nodes$ns duplex-link $node(0,0) $master 1Mb 100ms 
DropTail$ns duplex-link $node(0,1) $master 1Mb 100ms DropTail$ns duplex-link 
$node(1,0) $master 1Mb 100ms DropTail$ns duplex-link $node(1,1) $master 1Mb 
100ms DropTail
# Define link orientation$ns duplex-link-op $node(0,0) $master orient 
rigth-up$ns duplex-link-op $node(0,1) $master orient rigth$ns duplex-link-op 
$node(1,0) $master orient rigth$ns duplex-link-op $node(1,1) $master orient 
rigth-down
# Define a 'finish' procedureproc finish {} {global ns tracefile 
namfile$ns flush-traceclose $namfile exec nam 
position-out.nam &exit 0}
# Stop the simulation$ns at [expr 5.0 - 0.01] "puts \"Stopping 
Simulation...\" "$ns at 5.0 "finish ; $ns halt"
# Start the simulationputs "Starting Simulation..."$ns run



- Mensaje original 
De: Javier Chicote <[EMAIL PROTECTED]>
Para: ns-users@isi.edu
Enviado: miércoles, 21 de marzo, 2007 11:36:06
Asunto: ns/nam: respresentation problem when defining position-fixed nodes

Hi ns-users,

I would like to simulate a position-fixed wired network with 2 lines and 3 
nodes per line, like it is shown above. The distance between the nodes should 
be 100 units (for example), so the first node of the matrix will be in 
(x=0,y=0) and the last node in (x=100, y=200).

 node(1,1) node(1,2)node(1,3)
  (100,0)__(100,100)(100,200)
  |||
  |||
  |||
  |||
(0,0)(0,100)__(0,200)
 node(0,1) node(0,2)node(0,3)

When I do not define the links, the nodes are shown correctly in NAM (without 
lines between them), but when I make some of the link definitions (lines 46-48 
of the above code), the structure of the network changes, and it is shown as a 
straight line.

I know that I
 could manually edit the position of the nodes by clicking on the Edit/View 
button in NAM, but I would like to build the structure of the network 
automatically for future bigger structures, where it is not affordable to edit 
them manually.

How could I solve the problem??

Many thanks in advance,

Regards,

Javi


# Network configuration (x,y):## node(1,1) node(1,2)node(1,3)#  
(100,0)__(100,100)(100,200)#  ||   
 |#  |||#  |||# 
 |||#(0,0)(0,100)__(0,200)# 
node(0,1) node(0,2)node(0,3)#
# Create a simulator instanceset ns [new Simulator]
# Open 

Re: [ns] How to test a new protocol? [nsrt-howto]

2007-03-13 Thread Javier Chicote

Hello Fran,

Thank you very much for the answer. I think I have followed the steps described 
in your tutorial, and I also turned the '-routerTrace' on when configuring the 
mobile nodes, as it is shown in the above code of my file a1.tcl.

If I define AODV as the routing protocol instead of Protoname, I can see the 
exchange of packets and it works fine.

Thank you in advance!!

P.D. When recompiling ns I had to comment the following lines of the file 
protoname.h (I obtained an error message saying that ´protoname_state´ was not 
declared as a type and the variable state was not used after that):

// protoname_state state_;
// inline protoname_state& state() { return state_; }

P.D.2. Maybe you could suggest an idea to solve the problem about wireless 
multicast:

http://mailman.isi.edu/pipermail/ns-users/2007-March/059086.html

P.D.3. My .tcl file is:

# ===
# a1.tcl
# ===

# Define options
set val(chan)   Channel/WirelessChannel ;# channel type
set val(prop)   Propagation/TwoRayGround;# radio-propagation model
set val(netif)  Phy/WirelessPhy ;# network interface type
set val(mac)Mac/802_11  ;# MAC type
set val(ifq)Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL  ;# link layer type
set val(ant)Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50  ;# max packet in ifq
set val(seed)   0.0
#set val(rp) AODV;# routing protocol
set val(rp) Protoname   ;# routing protocol
set val(nn) 3   ;# number of nodes
set val(x)  400.0   ;# X dimension of topography
set val(y)  400.0   ;# Y dimension of topography
set val(stop)   10.0;# time to stop simulation

# Create a simulator instance
set ns_ [new Simulator]

# Open the Trace file
set tracefile [open a1-out.tr w]
$ns_ trace-all $tracefile

# Open the NAM trace file
set namfile [open a1-out.nam w]
$ns_ namtrace-all-wireless $namfile $val(x) $val(y)

# Set up topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

# Create God
set god_ [create-god $val(nn)]

# Global node settings
$ns_ node-config -adhocRouting $val(rp) \
 -llType $val(ll) \
 -macType $val(mac) \
 -ifqType $val(ifq) \
 -ifqLen $val(ifqlen) \
 -antType $val(ant) \
 -propType $val(prop) \
 -phyType $val(netif) \
 -channelType $val(chan) \
 -topoInstance $topo \
 -agentTrace ON \
 -routerTrace ON \
 -macTrace OFF \
 -movementTrace OFF

# Define nodes
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0;# disable random motion
}

# Provide initial (X,Y,Z) co-ordinates for nodes
$node_(0) set X_ 50.0
$node_(0) set Y_ 100.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 200.0
$node_(1) set Y_ 200.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 350.0
$node_(2) set Y_ 100.0
$node_(2) set Z_ 0.0

# Define master nodes size in nam
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ initial_node_pos $node_($i) 50
}

# Setup traffic flow between nodes
set tcp [new Agent/TCP]
$ns_ attach-agent $node_(0) $tcp

set sink [new Agent/TCPSink]
$ns_ attach-agent $node_(2) $sink

$ns_ connect $tcp $sink

set ftp [new Application/FTP]
$ftp attach-agent $tcp

# Tell node when simulation ends
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ at $val(stop) "$node_($i) reset";
}

# Define a 'finish' procedure
proc finish {} {
global ns_ tracefile
$ns_ flush-trace
close $tracefile
exec nam a1-out.nam &
exit 0
}

# Schedule events
$ns_ at 0.3 "$ftp start" 
$ns_ at [expr $val(stop) - 0.01] "finish"
$ns_ at $val(stop) "puts \"NS EXITING...\" ; $ns_ halt"

# Start the simulation
puts "Starting Simulation..."
$ns_ run

# ===
# ===

- Mensaje original 
De: Francisco J. Ros <[EMAIL PROTECTED]>
Para: ns-users@isi.edu
CC: Javier Chicote <[EMAIL PROTECTED]>
Enviado: martes, 13 de marzo, 2007 13:29:27
Asunto: Re: [ns] How to test a new protocol? [nsrt-howto]

Hello Javier,

You can use your new agent like any other routing agent, just indicate its 
name when you configure your mobile nodes with 'node-config'. If you can't 
see anything, maybe you forgot to turn '-routerTrace' on.

Regar

[ns] Wireless multicast: is it neccesary to implement a new protocol?? - Given ideas

2007-03-09 Thread Javier Chicote

Dear ns users,



I would like to simulate a wireless network with 2 master nodes that control 2 
different groups of nodes, and where each master is supposed to send multicast 
packets to the nodes of the group it controls.


I have successfully implemented this in a wired scenario, but I am having
several problems while implementing the wireless scenario.

What should I do?


a) Define multicast routing in the wireless .tcl file ==> In the line "$ns_ 
multicast" I get the error "Classfier::no-slot{} default handler 
(tcl/lib/ns-lib.tcl)"

b) Change an existing routing protocol to allow multicast ==> Which functions 
on the source files are needed to be changed? Have been any work done about 
this idea?

c) Use an existing multicast implementation ==> Is there any?

d) Implement my own protocol ==> I need help: 
http://mailman.isi.edu/pipermail/ns-users/2007-March/059051.html


I guess I should change an existing protocol to allow multicat (option b), but 
I do not know what code/functions to change/implement.

Any idea would be really appreciated.

Best regards,

Javi









__ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com



[ns] How to test a new protocol? [nsrt-howto]

2007-03-08 Thread Javier Chicote

Dear ns-users,

I am trying to implement a new protocol for NS-2 following the howto 
"Implementing a New Manet Unicast Routing Protocol in NS2", which is available 
at http://masimum.dif.um.es/nsrt-howto/html/.

After adding some missing header files, I could recompile NS with the new 
protocol, but I am not able to see the results. I defined a very simple 
scenario with 3 wireless nodes but I am not able to see the exchange of 
packets. However, with AODV or DSDV the tcl script works fine.

I wonder if I should define a Protoname Agent (like in the example Ping of Marc 
Greis, but I get a segmentation fault, and I am not sure that it is really 
needed). If someone has any kind of tcl code or link to a scrip I would really 
appreciate the help.

Best regards,

Javi 




__ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com