Hello everyone,
I thank those who helped me ...
Now I'm trying to make a simple application: one web&cache server and
multiple clients, clients being attached to a ring, connected through a node
(router) with the web server. I think that my script is done ok, but I get an
error message. Can anyone tell me why (this is the script,the most important
parts, and the message):
set ns [new Simulator]
set n(1) [$ns node]
set n(2) [$ns node]
set n(3) [$ns node]
set n(4) [$ns node]
set n(5) [$ns node]
set n(6) [$ns node]
set N [$ns node] ;#router
set W [$ns node] ;#server web
set C [$ns node] ;#server cache
$ns duplex-link $n(1) $n(2) 155Mb 10ms DropTail
$ns duplex-link $n(2) $n(3) 155Mb 10ms DropTail
$ns duplex-link $n(3) $n(4) 155Mb 10ms DropTail
$ns duplex-link $n(4) $n(5) 155Mb 10ms DropTail
$ns duplex-link $n(5) $n(6) 155Mb 10ms DropTail
$ns duplex-link $n(6) $N 155Mb 10ms DropTail
$ns duplex-link $n(1) $N 155Mb 10ms DropTail
set NodeNb 6
set LanNb 1
for {set i 1} {$i <= 6} {incr i} {
for {set j [expr ($i-1)*$LanNb+1]} {$j <= $i*$LanNb} {incr j} {
set S($j) [$ns node]
$ns duplex-link $S($j) $n($i) 100Mb 1ms DropTail
$ns queue-limit $S($j) $n($i) 1000
}
}
set server [new Http/Server $ns $W]
set cache [new Http/Cache $ns $C]
for {set i 1} {$i <= $NodeNb} {incr i} {
global client server cache
set pgp [new PagePool/Math]
set rv1 [new RandomVariable/Pareto]
$rv1 set avg_ 8000
$pgp ranvar-size $rv1
set rv2 [new RandomVariable/Exponential]
$rv2 set avg_ 5
$pgp ranvar-age $rv2
$server set-page-generator $pgp
set rv3 [new RandomVariable/Exponential]
$rv3 set avg_ 1
set client($i) [new Http/Client $ns $S($i)]
$client($i) set-interval-generator $rv3
$client($i) set-page-generator $pgp
}
proc start-connection {} {
global ns server cache client NodeNb
for {set i 1} {$i<=$NodeNb} { incr i } {
$client($i) connect $cache
$cache connect $server
$client($i) start-session $cache $server
}
}
proc finish {} {
global ns tf nf
$ns flush-trace
close $tf
close $nf
exec nam web.nam &
exit 0
}
set startTime 0.5
set finishTime 20
$ns at $startTime "start-connection"
$ns at $finishTime "finish"
$ns run
The error message is:
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o225: no target for slot -1
_o225 type: Classifier/Hash/Dest
content dump:
classifier _o225
0 offset
0 shift
2147483647 mask
1 slots
slot 11: _o377 (Classifier/Port)
-1 default
---------- Finished standard no-slot{} default handler ----------
I really don't know what this means....
Thanks for your help all the way!!!
---------------------------------
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.