Hi
i  used Telnet application with tcp in NS2.35 . And i found generated trace
file is empty.
howz it possible??
even in Nam window no data flows.
i tried a lot but could not find the solution.
i tried simple script.
Please have a look once and help me if u can.
Thanks

##############################

set ns [new Simulator]

set mynam [open telnet.nam w]
$ns namtrace-all $mynam

set mytrace [open telnet.tr w]
$ns trace-all $mytrace

set winfile [open telnet.xg w]

proc finish {} {
 global ns mynam mytrace
 $ns flush-trace
 close $mynam
 close $mytrace
 #exec nam d1.nam &
 exit 0
}

set n0 [$ns node]
set n1 [$ns node]

$ns duplex-link $n0 $n1 1Mb 10ms DropTail
                                        $ns queue-limit $n0 $n1 4


set tcp0 [new Agent/TCP]

# $tcp0 set ssthresh_ 50



$ns attach-agent $n0 $tcp0

set telnet0 [new Application/Telnet]
$telnet0 attach-agent $tcp0
$telnet0 set interval_ 20


set sink0 [new Agent/TCPSink]


$ns attach-agent $n1 $sink0

$ns connect $tcp0 $sink0

$ns at 0.5 "$telnet0 start"
$ns at 4.5 "$telnet0 stop"

proc plotWindow {tcpSource file} {
global ns
set time 0.01
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
set wnd [$tcpSource set window_]
set ssthresh [$tcpSource set ssthresh_]
puts $file "$now $cwnd \t \t \t \t \t \t $wnd \t \t \t \t \t $ssthresh"
$ns at [expr $now+$time] "plotWindow $tcpSource $file"

}

$ns at 0.5 "plotWindow $tcp0 $winfile"

$ns at 5.0 finish


$ns run

Reply via email to