У меня есть проблема с нс-2 моделированием ... Когда я бег моего моделирования это дает мне эту ошибку:Ошибка: Закончено стандарт не слоты {} Обработчик по умолчанию [нс-2]
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o52: no target for slot -1
_o52 type: Classifier/Port
content dump:
classifier _o52
0 offset
0 shift
2147483647 mask
2 slots
slot 0: _o67 (CMUTrace/Recv)
slot 255: _o54 (CMUTrace/Recv)
---------- Finished standard no-slot{} default handler ----------
I пытался найти решение в Интернете, но никто не ответил на этот вопрос раньше. Кто-нибудь знает, для чего эта ошибка?
Вот мой код:
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) 4 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 250
set val(y) 250
set ns_ [new Simulator]
set tracefile [open W.tr w]
$ns_ trace-all $tracefile
set namfile [open N.nam w]
$ns_ namtrace-all-wireless $namfile $val(x) $val(y)
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
set god_ [create-god $val(nn)]
set chan_ [new $val(chan)]
$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) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON \
-channel $chan_
for {set i 0} {$i < $val(nn)} {incr i} {
set node($i) [$ns_ node]
$node($i) random-motion 0
set xx_ [expr rand()*200]
set yy_ [expr rand()*200]
#$ns_ at 0.0 "$node($i) setdest $xx_ $yy_ 0.0"
puts "xx_ $xx_"
puts "yy_ $yy_"
$node($i) set X_ $xx_
$node($i) set Y_ $yy_
$node($i) set Z_ 0.0
$ns_ initial_node_pos $node($i) 10
}
for {set i 0} {$i < [expr $val(nn)/2]} {incr i} {
set tcp($i) [new Agent/TCP]
set udp($i) [new Agent/UDP]
set cbr($i) [new Application/Traffic/CBR]
set ftp($i) [new Application/FTP]
set null($i) [new Agent/Null]
set tcpsink($i) [new Agent/TCPSink]
}
$ns_ attach-agent $node(0) $tcp(0)
$ns_ attach-agent $node(1) $tcpsink(0)
$ftp(0) attach-agent $tcp(0)
$ns_ connect $tcp(0) $tcpsink(0)
proc stop {} {
global ns_ namfile tracefile
$ns_ flush-trace
close $namfile
close $tracefile
exec nam N.nam
exit 0
}
for {set i 0} {$i < 1} {incr i} {
$ns_ at $i "$ftp([expr $i/2]) start"
$ns_ at 20.0 "$ftp([expr $i/2]) stop"
$ns_ at 25.0 "puts \"NS EXITING...\""
$ns_ at 25.0 "stop"
}
puts "Starting simulation..."
$ns_ run
ОС: ubuntu, VERSION: 14.04, NS-2: 2-35, PROTOCOL: AODV ........... ........... Это простая симуляция, чтобы начать, а затем ее редактировать ... Я редактировал сообщение. – Jenova