Hello! First of all I want to thank all the people who help me in my first 
post. But now I have another problem with TCP connection. I have two 
questions:
1) How can I measure the throughput in a tcp connection?
2) How can I see the evolution of the congestion window when I have 2 TCP 
sources connected to the same Sink?
For the second question I made the next simple script:

set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf
set f0 [open CWND.tr w]
set f1 [open ssthresh.tr w]
$ns trace-all $f0
$ns trace-all $f1

proc finish {} {
        global ns nf f0 f1
        $ns flush-trace
        close $nf
        close $f0
        close $f1
        exec nam out.nam &
        exec xgraph CWND.tr &
        exit 0
}

proc record {} {
        global ns tcp tcp2 f0 f1
        set ns [Simulator instance]
        set time 0.05
        set cwnd0 [$tcp set cwnd_]
        set cwnd1 [$tcp2 set cwnd_]
        set now [$ns now]
        puts $f0 "$now $cwnd0"
        puts $f1 "$now $cwnd1"
        $ns at [expr $now+$time] "record"
}


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

$ns duplex-link $n1 $n3 1Mb 10ms DropTail
$ns duplex-link $n2 $n3 1Mb 10ms DropTail
$ns duplex-link $n3 $n4 1Mb 10ms DropTail

$ns duplex-link-op $n3 $n4 queuePos 0.5

set tcp1 [new Agent/TCP]
$ns attach-agent $n1 $tcp1
set sink1 [new Agent/TCPSink]
$ns attach-agent $n4 $sink1
$ns connect $tcp1 $sink1
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1

set tcp2 [$ns create-connection TCP $n2 TCPSink $n4 2]
set ftp2 [new Application/FTP]
$ftp2 attach-agent $tcp2

$ns at 0.5 "$ftp1 start"
$ns at 0.8 "$ftp2 start"
$ns at 10 "$ftp1 stop"
$ns at 11 "$ftp2 stop"
$ns at 15.0 "finish"
$ns run


But when I simulate it, appears a message about a problem with the input 
data, and I don’t know what is wrong…

_________________________________________________________________
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en 
MSN Motor. http://motor.msn.es/researchcentre/

Reply via email to