sir,
  when i am using to  generate  nam file its properly  work  in ns2.35
 but when I am using to  generate   xgraph  we modify  nam file  it
gives the following error:
  "invalid command name "Agent/TCPSink/Sack1/DeAck"
    while executing
"Agent/TCPSink/Sack1/DeAck create _o108 "
    invoked from within
"catch "$className create $o $args" msg"
    invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
    (procedure "new" line 3)
    invoked from within
"new Agent/TCPSink/Sack1/DeAck"
    invoked from within
"set Sink0 [new Agent/TCPSink/Sack1/DeAck]"
    (file "blue.tcl" line 75)"




this tcl  file for nam:

------------------------------------------------------blue.tcl
------------------------for nam file it properly work------
#script illustrating the BLUE algorithm
#Senders are TCP-SACK senders, and receivers are TCP-SACK sinks

set ns [new Simulator]

# turn on ns and nam tracing
set f [open out.tr w]
$ns trace-all $f
$ns namtrace-all [open out.nam w]

#set the no of TCP flows here
set nodenum 5

set start_time 1.0
set finish_time 100

# create the nodes

#First create TCP senders and receivers

for {set i 0} {$i < $nodenum} {incr i} {

    set s($i) [$ns node]
    set r($i) [$ns node]
}

#Then create the 2 back-bone routers
set n1 [$ns node]
set n2 [$ns node]

# create the links
#betwwen the senders and n1, receivers and n2
for {set i 0} {$i < $nodenum} {incr i} {

    $ns duplex-link $s($i) $n1 10Mb 1ms DropTail
    $ns duplex-link $r($i) $n2 10Mb 1ms DropTail

}

#Bottle neck link between between n1 and n2
$ns simplex-link $n1 $n2 1Mbps 100ms Blue
$ns simplex-link $n2 $n1 1Mbps 100ms DropTail

#Configure BLUE queue parameters here
set blueq [[$ns link $n1 $n2] queue]
$blueq set decrement 0.00025
$blueq set increment 0.0025
$blueq set dhold-time 100ms
$blueq set ihold-time 100ms

#Enable ECN here
$blueq set setbit true

#set the queue-limit between n1 and n2
$ns queue-limit $n1 $n2 50

#set up queue monitor, sample every 0.5 seconds
set qfile [open "test-blue-qsize.out" w]
set qm [$ns monitor-queue $n1 $n2 $qfile 0.5]
[$ns link $n1 $n2] queue-sample-timeout

#create the random number generator
set rng [new RNG]


# create TCP agents
for {set i 0} {$i < $nodenum} {incr i} {

    set tcp($i) [new Agent/TCP/Sack1]
    $tcp($i) set fid_ [expr ($i + 1)]
    $tcp($i) set ecn_ 1
    set sink($i) [new Agent/TCPSink/Sack1/DelAck]
    $sink($i) set ecn_ 1
    $ns attach-agent $s($i) $tcp($i)
    $ns attach-agent $r($i) $sink($i)
    $ns connect $tcp($i) $sink($i)
    set ftp($i) [new Application/FTP]
    $ftp($i) attach-agent $tcp($i)
    set p($i) [new Application/Traffic/Pareto]
    $p($i) set packetSize_ 1000
    $p($i) set burst_time_ 200ms
    $p($i) set idle_time_ 200ms
    $p($i) set shape_ 1.5
    $p($i) set rate_ 10000K
    $p($i) attach-agent $tcp($i)
    set start_time [$rng uniform 0 1]
    $ns at $start_time "$ftp($i) start"
    $ns at $start_time "$p($i) start"
}


$ns at $finish_time "finish"


proc finish {} {
    global ns sink nodenum  qfile
    $ns flush-trace
    close $qfile
    puts "running nam..."
    exec nam out.nam &
    #exec xgraph out.tr -geometry 800x400 &
    exit 0
}

$ns run



-------------------------------------------blue.tcl-----------after
modify above blue.tcl for xgraph but  it gives  above
error--------------------------------------------



#script illustrating the BLUE algorithm
#Senders are TCP-SACK senders, and receivers are TCP-SACK sinks

set ns [new Simulator]

# turn on ns and nam tracing
$ns color 0 red

#set the no of TCP flows here


set f0 [open out0.tr w]
set f1 [open out1.tr w]
set f2 [open out2.nam w]
$ns namtrace-all $f2

# create the nodes

#First create TCP senders and receivers

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]



# create the links
#betwwen the senders and n1, receivers and n2
$ns  duplex-link $n0 $n2  10Mb 1ms DropTail
$ns  duplex-link $n1 $n2  10Mb 1ms DropTail

#Bottle neck link between between n1 and n2
$ns simplex-link $n2 $n3 1Mbps 100ms Blue
$ns simplex-link $n4 $n3 1Mbps 100ms DropTail
$ns simplex-link $n5 $n3 1Mbps 100ms DropTail



#Configure BLUE queue parameters here
set blueq [[$ns link $n2 $n3] queue]
$blueq set decrement 0.00025
$blueq set increment 0.0025
$blueq set dhold-time 100ms
$blueq set ihold-time 100ms

#Enable ECN here
$blueq set setbit true

#set the queue-limit between n1 and n2
$ns queue-limit $n2 $n3 50

#set up queue monitor, sample every 0.5 seconds
set qfile [open "test-blue-qsize.out" w]
set qm [$ns monitor-queue $n2 $n3 $qfile 0.5]
[$ns link $n2 $n3] queue-sample-timeout

#create the random number generator
#set rng [new RNG]


# create TCP agents
set tcp0 [new Agent/TCP/Sack1]
$tcp0 set fid_ 1
$tcp0 set ecn_ 1
$ns attach-agent $n0 $tcp0

set tcp1 [new Agent/TCP/Sack1]
$tcp1 set fid_ 2
$tcp1 set ecn_ 1
$ns attach-agent $n1 $tcp1

set Sink0 [new Agent/TCPSink/Sack1/DeAck]
$Sink0 set ecn_ 1
$ns attach-agent $n4 $Sink0

set Sink1 [new Agent/TCPSink/Sack1/DeAck]
$Sink1 set ecn_ 1
$ns attach-agent $n5 $Sink1



set ftp0 [new Application/Traffic/Pareto]
$ftp0 attach-agent $tcp0
set p0 [new Application/Traffic/Pareto]
$p0 set packetSize_ 1000
$p0 set burst_time_ 200ms
$p0 set idle_time_ 200ms
$p0 set shape_ 1.5
$p0 set rate_ 10000K
$p0 attach-agent $tcp0

set ftp1 [new Application/Traffic/Pareto]
$ftp1 attach-agent $tcp1
set p1 [new Application/Traffic/Pareto]
$p1 set packetSize_ 1000
$p1 set burst_time_ 200ms
$p1 set idle_time_ 200ms
$p1 set shape_ 1.5
$p1 set rate_ 10000K
$p1 attach-agent $tcp1


set  Sink0 [new Agent/LossMonitor]
set  Sink1 [new Agent/LossMonitor]


$ns connect $tcp0 $Sink0
$ns connect $tcp1 $Sink1


proc record {} {
   global Sink0 Sink1 f0 f1
   set ns [Simulator instance]
   set time 0.5

   set bw0 [$Sink0 set bytes_]
   set bw1 [$Sink1 set bytes_]

   set now [$ns now]

   puts $f0 "$now [expr $bw0/$time*8/1000000]"
   puts $f1 "$now [expr $bw1/$time*8/1000000]"

   $Sink0 set bytes_ 0
   $Sink1 set bytes_ 0

   $ns at [expr $now+$time]   "record"

}



$ns at 0.0 "record"

$ns at 10.0 "$ftp0 start"
$ns at 10.0 "$p0 start"
$ns at 10.0 "$ftp1 start"
$ns at 10.0 "$p1 start"

$ns at  99.0 "$ftp0 stop"
$ns at  99.0 "$p0 stop"
$ns at  99.0 "$ftp1 stop"
$ns at  99.0 "$p1 stop"


$ns at 100.0  "finish"

proc finish {} {
    global ns  f0 f1 f2

    $ns flush-trace
    close $f0
    close $f1
    close $f2
    close $qfile
    puts "running nam..."
    exec nam out2.nam &
    exec xgraph out0.tr out1.tr -geometry 800x400 &
    exit 0
}




$ns run





plz   solve this problem  and give me solution.

thank you

Reply via email to