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 


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.000001] "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.


On Thursday 08 March 2007 10:10, Javier Chicote wrote:
> 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

LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 

Reply via email to