[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creat MultiSession In One Node



Hi.
I modify test-drr.tcl script for my simulation.

I want to use same topology. But want to create many sessions in one
nodes (maybe about 500 sessions).

so i decide to use for loop in tcl script and modify drr example script.

but occur these erros

---
ns: _o89 start:
    (_o89 cmd line 1)
    invoked from within
"_o89 cmd start"
    invoked from within
"catch "$self cmd $args" ret"
    (procedure "_o89" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o89 start"
---

Here Is My test script

 --- snip ---
      8 # Run this script as
      9 # ../../ns test-drr.tcl
     10 # or
     11 # ../../ns test-drr.tcl setmask
     12 # After running this script cat "out" to view the flow stats
     13
     14 #default Mask parameter
     15 set MASK 0
 --- snip ---
     24 # Create a simple four node topology:
     25 #
     26 #          n2
     27 #            \
     28 # 10Mb,0.01ms \   1Mb,0.01ms
     29 #               n0 --------- n1
     30 # 10Mb,0.01ms /
     31 #            /
     32 #          n3
     33
     34 set n0 [$ns node]
     35 set n1 [$ns node]
     36 set n2 [$ns node]
     37 set n3 [$ns node]
     38
     39 set nf [open out.nam w]
     40 set f [open out.tr w]
     41
     42 # $ns trace-all $f
     43 $ns namtrace-all $nf
     44
     45 $ns duplex-link $n0 $n1 1.0Mb 0.01ms DRR
     46 $ns duplex-link $n2 $n0 10.0Mb 0.01ms DropTail
     47 $ns duplex-link $n3 $n0 10.0Mb 0.01ms DropTail
     48
     49 # trace the bottleneck queue
    50 $ns trace-queue $n0 $n1 $f
     51
     52 Simulator instproc get-link { node1 node2 } {
     53     $self instvar link_
     54     set id1 [$node1 id]
     55     set id2 [$node2 id]
     56     return $link_($id1:$id2)
     57 }
     58
     59 #Alternate way for setting parameters for the DRR queue
     60 set l [$ns get-link $n0 $n1]
     61 set q [$l queue]
     62
     63 $q mask $MASK
     64 $q blimit 25000
     65 $q quantum 500
     66 $q buckets 7
     67
     68 # create 6 cbr sources :
     69
     70 ################################ Modification Start
     73 for {set i 0} {$i < 5} {incr i} {
     74         set udp($i) [new Agent/UDP]
     75 }
     76
     77 for {set i 0} {$i < 3} {incr i} {
     78         $ns attach-agent $n2 $udp($i)
     79 }
     80 for {set i 3} {$i < 5} {incr i} {
     81         $ns attach-agent $n3 $udp($i)
     82 }
     83
     84 for {set i 0} {$i < 5} {incr i} {
     85         set cbr($i) [new Agent/UDP]
     86 }
     87
     88 for {set i 5} {$i < 5} {incr i} {
     89         $cbr($i) attach-agent $udp($i)
     90         $cbr($i) set packet_size_ 250
     91         $cbr($i) set interval_ 8ms
     92         $cbr($i) set random_ 1
     93 }
     94
     95 set lm0 [new Agent/Null]
     96 $ns attach-agent $n1 $lm0
 97
     98 for {set i 0} {$i < 5} {incr i} {
     99         $ns connect $udp($i) $lm0
    100 }
    101 for {set i 0} {$i < 5} {incr i} {
    102         $ns at 0.0 "$cbr($i) start"
    103 }
    104 for {set i 0} {$i < 5} {incr i} {
    105         $ns at 1.0 "$cbr($i) stop"
    106 }
    107
    108 $ns at 2.0 "close $f;finish"
    109
    110 proc finish {} {
--- snip ---


Thx in advance!