[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Study of TCP
On Tue, 7 Mar 2000, Ana Delgado wrote:
> I'm working with TCP at the moment and I have problems to get some
> parameters in the simulation, do you know how can I get:
> 1. The bytes of the congestion window vs time.
> 2. The sequence number vs time.
More tracefile howto documentation is needed; I keep having to walk
people through the idea that they can write a procedure to record what
interests them, and then a lightbulb goes on...
proc record {} {
global ns tcp0 trace_wnd trace_ack trace_seq trace_srtt
set time 0.01
#Get the variables of interest
set curr_dupack [$tcp0 set dupacks_]
set curr_cwnd [$tcp0 set cwnd_]
set curr_maxseq [expr fmod([$tcp0 set maxseq_], 100)]
set curr_srtt [$tcp0 set srtt_]
#Get the current time
set now [$ns now]
#Write the variables of interest vs. time
puts $trace_ack "$now $curr_dupack"
puts $trace_wnd "$now $curr_cwnd"
puts $trace_seq "$now $curr_maxseq"
puts $trace_srtt "$now $curr_srtt"
#Re-schedule the procedure
$ns at [expr $now+$time] "record"
}
[..]
set trace_wnd [open ngsonewreno.wnd w]
set trace_ack [open ngsonewreno.dup w]
set trace_seq [open ngsonewreno.seq w]
set trace_srtt [open ngsonewreno.srtt w]
[..]
$ns at 4.0 "record"
[..]
$ns at 100.0 "end"
proc end {} {
global ns trace_ack trace_wnd trace_seq trace_srtt
close $trace_wnd
close $trace_ack
close $trace_seq
close $trace_srtt
}
multiply curr_cwnd by the segment size to get it in bytes; in ns TCP
the latter is unchanging.
> 3. The losses segments vs time.
look for 'd' events in the trace-all tracefile.
> 4. The RTT used by every packet number.
Analyse trace-all tracefile to get packet/ack rtts.
> 5. The relative bandwidht vs time.
Analyse trace-all tracefile.
L.
<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>