Hello everybody,
...got the following Problem:
I would like to create a scenario with wired and wireless nodes, the wired
nodes communicating and the wireless between each other. At the moment there
is no need to connect the wired and the wireless part, later there should be
a base station between them.
The routing protocol I'd like to use doesn't support hierarchical adressing.
Is there any possibility to do it without?
I tried a little example, attached at the end of this mail, but I've
problems to start nam

[Failed to start animator:
class Animator: constructor failed: class NetworkModel/Auto: constructor
failed: error when calling class NetworkModel/Auto: link 3 2 1.0 10.0 0 1.0
node 3 or 2 is not defined
usw...]

...also the tracefile looks curious (begins with ~75packets dropped in the
Queue)

Somone there who has any Idea? Thanks a lot!!!
Ira

# ======================================================================
# 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(nn)             2                          ;# number of mobilenodes
set val(rp)             DSDV                       ;# routing protocol

# ======================================================================
# Main Program
# ======================================================================


#
# Initialize Global Variables
#
set ns_         [new Simulator]
set tracefd     [open simpleww.tr w]
$ns_ trace-all $tracefd
#Open the nam trace file
set nf [open simpleww.nam w]
$ns_ namtrace-all $nf

# set up topography object
set topo       [new Topography]

$topo load_flatgrid 500 500

#
# Create God
#
create-god [expr $val(nn)+2]

#
#  Create the specified number of mobilenodes [$val(nn)] and "attach" them
#  to the channel.
#  Here two nodes are created : node(0) and node(1)

# configure node

        $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

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

#wired nodes
#Create two nodes
set n0 [$ns_ node]
set n1 [$ns_ node]
#Create a duplex link between the nodes
$ns_ duplex-link $n0 $n1 1Mb 10ms DropTail


  #configure for mobilenodes
  $ns_ node-config -wiredRouting OFF
#
# Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes
#
$node_(2) set X_ 5.0
$node_(2) set Y_ 2.0
$node_(2) set Z_ 0.0

$node_(3) set X_ 390.0
$node_(3) set Y_ 385.0
$node_(3) set Z_ 0.0

#
# Now produce some simple node movements
# Node_(1) starts to move towards node_(0)
#
#$ns_ at 50.0 "$node_(1) setdest 25.0 20.0 15.0"
#$ns_ at 10.0 "$node_(0) setdest 20.0 18.0 1.0"

# Node_(1) then starts to move away from node_(0)
#$ns_ at 100.0 "$node_(1) setdest 490.0 480.0 15.0"

# Setup traffic flow between nodes
# TCP connections between node_(0) and node_(1)

set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns_ attach-agent $node_(2) $tcp
$ns_ attach-agent $node_(3) $sink
$ns_ connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns_ at 10.0 "$ftp start"

#und jetzt für wired...
#Create a UDP agent and attach it to node n0
set udp0 [new Agent/UDP]
$ns_ attach-agent $n0 $udp0
# Create a CBR traffic source and attach it to udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0
#Create a Null agent (a traffic sink) and attach it to node n1
set null0 [new Agent/Null]
$ns_ attach-agent $n1 $null0
#Connect the traffic source with the traffic sink
$ns_ connect $udp0 $null0
#Schedule events for the CBR agent
$ns_ at 0.5 "$cbr0 start"
$ns_ at 4.5 "$cbr0 stop"
#
# Tell nodes when the simulation ends
#
for {set i 2} {$i < [expr $val(nn)+2] } {incr i} {
    $ns_ at 150.0 "$node_($i) reset";
}
$ns_ at 150.0 "stop"
$ns_ at 150.01 "puts \"NS EXITING...\" ; $ns_ halt"
proc stop {} {
    global ns_ tracefd
    $ns_ flush-trace
    close $tracefd
}
puts "Starting Simulation..."
$ns_ run

_________________________________________________________________
Die neue MSN Suche Toolbar mit Windows-Desktopsuche. Suchen Sie gleichzeitig 
im Web, Ihren E-Mails und auf Ihrem PC! Jetzt neu! http://desktop.msn.de/ 
Jetzt gratis downloaden!

Reply via email to