[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Window Trace Re: hi,
+AD4-Hi xianghong,
+AD4-
+AD4- Unfortunately, I did not receive any hint on how to monitor the
+AD4-window size. I still do not know how to this through ns.
+AD4- You can use the tcpdump function (see test-suite demos). But this
+AD4-will completely slow down your simulation. Otherwise, you can infer
+AD4-approximatively the window size from the trace files. This can be done
+AD4-only if you use the agent FullTCP.
+AD4- An other solution would be to modify the tcp agent to dump the
+AD4-data you want.
+AD4- I hope that this will help you.
+AD4- Saad.
+AD4-
You'll nedd to do a little tcl programming.
1. Attach a trace file to your TCP agent (any TCP agent can trace the window
size since it's in TcpAgent::plot())
2. Make sure you have a call to plot() function (usually in receive())
3. In +ACo-.tcl script extract +ACI-win+ACI- data from the trace file and you can view
them using xgraph.
Here are parts 1. and 3. from my script file.
1.
proc openTraces +AHs- stopTime testName filename node1 node2 mod +AH0- +AHs-
global s1 r1 k1 tcp1
+ACM-tcp1 is my any TCP agent
.....
exec rm -f tr.tr
set trFile +AFs-open tr.tr w+AF0-
ns at +ACQ-stopTime +AFw-
+ACI-close +ACQ-trFile+ACI-
set TR +AFs-ns trace+AF0-
+ACQ-TR attach +ACQ-trFile
+ACQ-tcp1 trace +ACQ-TR
+AH0-
3.
proc finish +AHs- file mod +AH0- +AHs-
global win+AF8-print
+ACM-I set win+AF8-print to 1 in the test fuction if I want to trace the window
if +AHs- +ACQ-win+AF8-print +ACEAPQ- 0 +AH0- +AHs-
set fw +AFs-open temp.win w+AF0-
puts +ACQ-fw +ACI-TitleText: Win+AF8AJA-file+ACI-
puts +ACQ-fw +ACI-Device: Postscript+ACI-
exec rm -f temp.w
exec touch temp.w
exec awk +AHs-
+AHs-
if ((+ACQ-4 +AD0APQ- +ACI-win+ACI- ))+AFw-
print +ACQ-2, +ACQ-5
+AH0-
+AH0- tr.tr +AD4- temp.w
puts +ACQ-fw +AFwAIg-window
flush +ACQ-fw
exec cat temp.w +AD4AQA- +ACQ-fw
exec rm -f temp.w
flush +ACQ-fw
close +ACQ-fw
exec xgraph -zg red -fg black -bb -nl -m -x time -y window temp.win +ACY-
+AH0-
....
+AH0-