[ns] Metric troubles
I am sure that this has been answered before, but I, for the life of me, couldn't find what I think I need. I have been trying to figure this out for a day or two now. I am trying to create graphs for RTT and throughput. I have seen links mentioned to a university website ( //http://www-mash.cs.berkeley.edu/dist/archive/ns-users/0002/0030.html)// , but those pages aren't there anymore. I have found numerous Throughput calculations, but they all seem to be about overall throughput. (We are modeling random traffic, so are more interested in a more instantaneous throughput. Not EXACTLY instantaneous, but over a smaller window than the entire simulation.) For RTT, I am kind of stuck. Yes, I have traced 'cwnd_' and 'rtt_' and looked at the file. (Curiously, my RTT trace file (different from my cwnd_ trace file) only has one line in it.) Here is a clip (1st 10 lines) from the file, plus some headers that I am guessing at: TimeTypeValue 0.0 -1 -1 -1 -1 cwnd_ 1.000 1.29029 5 0 1 3 rtt_ 0.050 1.29029 5 0 1 3 cwnd_ 2.000 1.35309 5 0 1 3 rtt_ 0.070 1.35309 5 0 1 3 cwnd_ 3.000 1.35986 5 0 1 3 cwnd_ 4.000 1.40282 5 0 1 3 rtt_ 0.050 1.40282 5 0 1 3 cwnd_ 5.000 1.40959 5 0 1 3 cwnd_ 6.000 1.41635 5 0 1 3 cwnd_ 7.000 Here's the corresponding overall out.tr (1st 30 or so lines): + 0.004717 2 0 tcp 40 --- 1 2.0 1.0 0 0 - 0.004717 2 0 tcp 40 --- 1 2.0 1.0 0 0 r 0.005749 2 0 tcp 40 --- 1 2.0 1.0 0 0 + 0.005749 0 1 tcp 40 --- 1 2.0 1.0 0 0 - 0.005749 0 1 tcp 40 --- 1 2.0 1.0 0 0 r 0.026206 0 1 tcp 40 --- 1 2.0 1.0 0 0 + 0.026206 1 0 ack 40 --- 1 1.0 2.0 0 1 - 0.026206 1 0 ack 40 --- 1 1.0 2.0 0 1 r 0.046663 1 0 ack 40 --- 1 1.0 2.0 0 1 + 0.046663 0 2 ack 40 --- 1 1.0 2.0 0 1 - 0.046663 0 2 ack 40 --- 1 1.0 2.0 0 1 r 0.047695 0 2 ack 40 --- 1 1.0 2.0 0 1 + 0.047695 2 0 tcp 592 --- 1 2.0 1.0 1 2 - 0.047695 2 0 tcp 592 --- 1 2.0 1.0 1 2 + 0.047695 2 0 tcp 592 --- 1 2.0 1.0 2 3 - 0.048169 2 0 tcp 592 --- 1 2.0 1.0 2 3 r 0.049169 2 0 tcp 592 --- 1 2.0 1.0 1 2 + 0.049169 0 1 tcp 592 --- 1 2.0 1.0 1 2 - 0.049169 0 1 tcp 592 --- 1 2.0 1.0 1 2 r 0.049643 2 0 tcp 592 --- 1 2.0 1.0 2 3 + 0.049643 0 1 tcp 592 --- 1 2.0 1.0 2 3 - 0.055935 0 1 tcp 592 --- 1 2.0 1.0 2 3 r 0.075935 0 1 tcp 592 --- 1 2.0 1.0 1 2 + 0.075935 1 0 ack 40 --- 1 1.0 2.0 1 4 - 0.075935 1 0 ack 40 --- 1 1.0 2.0 1 4 r 0.0827 0 1 tcp 592 --- 1 2.0 1.0 2 3 + 0.0827 1 0 ack 40 --- 1 1.0 2.0 2 5 In the cwnd_ trace file, type = CWND isn't too hard figure out: that is the size of the window at that time. But what is RTT and how is it calculated? Is it simply for that one packet? Does it actually calculate the return ACK to the sender as part of the RTT (which is what we would like, I suppose)? And why the drastic difference in the time fields? What units is the 'cwnd_' time field in? It doesn't seem to match up too closely with the packets from the full trace file. Here's a clip from my TCL file. (This script uses FOR loops to assign multiple/variable numbers of sources.) #TCP sources for {set j 1} {$j=$NumbSrc} {incr j} { set tcp_src($j) [new Agent/TCP/Reno]; $tcp_src($j) set window_ 8000; # tracing TCP rtt variables set rtt_trace [open rtt_trace.out w];# trace file $tcp_src($j) attach $rtt_trace;# attach to TCP Agent $tcp_src($j) tracevar rtt_;# trace rtt #END Justin's RTT tracing # tracing TCP congestion window variables set cwnd_trace [open cwnd_trace.out w];# trace file $tcp_src($j) attach $cwnd_trace;# attach to TCP Agent $tcp_src($j) tracevar cwnd_;# trace rtt #END Justin's cong. window tracing } Any advice would be appreciated. -- Justin
[ns] Some oddities
Hello all again, In looking further at my cwnd_ trace file, I noticed that some of the congestion window values are not integers. They start out as integers and then somehow become non-integers. Also, there are spots in the file that have erroneous lines; there will parts of two lines together on one line, there will be lines with only 3 items in them, etc. Anyone else seen that before and know what is going on? (Yes, as you can tell, fairly new at this and shooting in the dark here somewhat.) Here is a snippet of the TCL again: #TCP sources for {set j 1} {$j=$NumbSrc} {incr j} { set tcp_src($j) [new Agent/TCP/Reno]; $tcp_src($j) set window_ 8000; #Justin's additions to try and get an RTT trace... # tracing TCP rtt variables set rtt_trace [open rtt_trace.out w];# trace file $tcp_src($j) attach $rtt_trace;# attach to TCP Agent $tcp_src($j) tracevar rtt_;# trace rtt # tracing TCP congestion window variables set cwnd_trace [open cwnd_trace.out w];# trace file $tcp_src($j) attach $cwnd_trace;# attach to TCP Agent $tcp_src($j) tracevar cwnd_;# trace cwnd (which also tracks RTT?) = And the output file I get: 1.45695 5 0 1 3 cwnd_ 9.000 1.46371 5 0 1 3 cwnd_ 10.000 1.48401 5 0 1 3 cwnd_ 5.000 1.54051 5 0 1 3 cwnd_ 5.200 1.74051 5 0 1 3 cwnd_ 1.000 1.79023 5 0 1 3 cwnd_ 2.000 1.83996 5 0 1 3 cwnd_ 2.500 1.88969 5 0 1 3 cwnd_ 2.900 1.93942 5 0 1 3 cwnd_ 3.245 1.94619 5 0 1 3 cwnd_ 3.553 1.95295 5 0 1 3 cwnd_ 3.834 == And some odd lines: 5.08033 5 0 1 3 cwnd_ 4.723 5.08710 5 0 1 3 cwnd_ 4.935 1 4.89089 3 0 1 1 cwnd_ 5.789 4.89766 3 0 1 1 cwnd_ 5.962 OR 13.13830 3 0 1 1 cwnd_ 5.463 13.14506 3 0 1 1 cwnd_ 5.646 13.15859 3 0 1 1 cwnd_ 5.8 1 0 cwnd_ 5.012 11.35215 2 0 1 0 cwnd_ 5.212 11.45363 2 0 1 0 cwnd_ 5.404 OR 16.47379 2 0 1 0 cwnd_ 7.442 16.48056 2 0 1 0 cwnd_ 7.576 16.57528 2 5.126 15.89871 3 0 1 1 rtt_ 0.110 15.89871 3 0 1 1 cwnd_ 5.321 == Thanks, J
Re: [ns] Metric troubles
Perhaps I have found an answer for some of my questions below, but most of them are still standing. Here is a snippet I found in an example trace file at: http://www.cs.odu.edu/~mweigle/research/netsim/intro/tracevar.out And here is a snip of what that says: # time srcnode srcport dstnode dstport variable value 0.0 0 0 -1 -1 cwnd_ 1.000 0.00610 0 0 2 0 cwnd_ 2.000 0.01219 0 0 2 0 cwnd_ 3.000 0.01222 0 0 2 0 cwnd_ 4.000 0.01829 0 0 2 0 cwnd_ 5.000 0.01832 0 0 2 0 cwnd_ 6.000 0.01835 0 0 2 0 cwnd_ 7.000 The headers there is one thing I was looking for. They make some sense, but can anyone verify that they are accurate? And that doesn't address the apparent scale issue I saw with the 'time' value. Thanks, Justin On 03/09/2011 11:45 AM, Justin wrote: ... I am trying to create graphs for RTT and throughput. ... For RTT, I am kind of stuck. Yes, I have traced 'cwnd_' and 'rtt_' and looked at the file. (Curiously, my RTT trace file (different from my cwnd_ trace file) only has one line in it.) Here is a clip (1st 10 lines) from the file, plus some headers that I am guessing at: TimeTypeValue 0.0 -1 -1 -1 -1 cwnd_ 1.000 1.29029 5 0 1 3 rtt_ 0.050 1.29029 5 0 1 3 cwnd_ 2.000 1.35309 5 0 1 3 rtt_ 0.070 1.35309 5 0 1 3 cwnd_ 3.000 1.35986 5 0 1 3 cwnd_ 4.000 1.40282 5 0 1 3 rtt_ 0.050 1.40282 5 0 1 3 cwnd_ 5.000 1.40959 5 0 1 3 cwnd_ 6.000 1.41635 5 0 1 3 cwnd_ 7.000 Here's the corresponding overall out.tr (1st 30 or so lines): + 0.004717 2 0 tcp 40 --- 1 2.0 1.0 0 0 - 0.004717 2 0 tcp 40 --- 1 2.0 1.0 0 0 r 0.005749 2 0 tcp 40 --- 1 2.0 1.0 0 0 + 0.005749 0 1 tcp 40 --- 1 2.0 1.0 0 0 - 0.005749 0 1 tcp 40 --- 1 2.0 1.0 0 0 r 0.026206 0 1 tcp 40 --- 1 2.0 1.0 0 0 + 0.026206 1 0 ack 40 --- 1 1.0 2.0 0 1 - 0.026206 1 0 ack 40 --- 1 1.0 2.0 0 1 r 0.046663 1 0 ack 40 --- 1 1.0 2.0 0 1 + 0.046663 0 2 ack 40 --- 1 1.0 2.0 0 1 - 0.046663 0 2 ack 40 --- 1 1.0 2.0 0 1 r 0.047695 0 2 ack 40 --- 1 1.0 2.0 0 1 + 0.047695 2 0 tcp 592 --- 1 2.0 1.0 1 2 - 0.047695 2 0 tcp 592 --- 1 2.0 1.0 1 2 + 0.047695 2 0 tcp 592 --- 1 2.0 1.0 2 3 - 0.048169 2 0 tcp 592 --- 1 2.0 1.0 2 3 r 0.049169 2 0 tcp 592 --- 1 2.0 1.0 1 2 + 0.049169 0 1 tcp 592 --- 1 2.0 1.0 1 2 - 0.049169 0 1 tcp 592 --- 1 2.0 1.0 1 2 r 0.049643 2 0 tcp 592 --- 1 2.0 1.0 2 3 + 0.049643 0 1 tcp 592 --- 1 2.0 1.0 2 3 - 0.055935 0 1 tcp 592 --- 1 2.0 1.0 2 3 r 0.075935 0 1 tcp 592 --- 1 2.0 1.0 1 2 + 0.075935 1 0 ack 40 --- 1 1.0 2.0 1 4 - 0.075935 1 0 ack 40 --- 1 1.0 2.0 1 4 r 0.0827 0 1 tcp 592 --- 1 2.0 1.0 2 3 + 0.0827 1 0 ack 40 --- 1 1.0 2.0 2 5 In the cwnd_ trace file, type = CWND isn't too hard figure out: that is the size of the window at that time. But what is RTT and how is it calculated? Is it simply for that one packet? Does it actually calculate the return ACK to the sender as part of the RTT (which is what we would like, I suppose)? And why the drastic difference in the time fields? What units is the 'cwnd_' time field in? It doesn't seem to match up too closely with the packets from the full trace file.
[ns] Other Trace variables - T_RTT
Hello all, yet again. :) I mentioned in my earlier post about one of my output files only having one line in it (for rtt_). Well, I have tried again with another variable and it also has only one line in it. What's going on? Here's the one line: 0.0 -1 -1 -1 -1 t_rtt_ 0 Here's the TCL: for {set j 1} {$j=$NumbSrc} {incr j} { set tcp_src($j) [new Agent/TCP/Reno] $tcp_src($j) set window_ 256 $tcp_src($j) set fid_ $j #Trying a new variable to trace: T_RTT_ set t_rtt_trace [open t_rtt.tr w]; $tcp_src($j) attach $t_rtt_trace; $tcp_src($j) tracevar t_rtt_;# trace t_rtt # tracing TCP congestion window variables set cwnd_trace [open cwnd_.trace w]; $tcp_src($j) attach $cwnd_trace; $tcp_src($j) tracevar cwnd_; # trace cwnd (which also tracks RTT?) } The trace on CWND_ comes out just fine, I think. (Yeah, see previous messages on that, too.) Thanks, J
Re: [ns] help with ns codes
Serene, That really looks like 'awk' code. Where did you find the code? In a TCL script? Was it in something like this: exec awk { $3 / ($5 * $1) } ? Awk is a programming language (usually just on Linux/Unix) that very easily allows you to handle data. It functions on one line of data at a time and breaks things into columns. Each column is assigned a variable name that is used to refer to that column. You don't have to declare variables; it is automatically done. You can output to a file or to the screen. You can run awk separately (i.e. it does NOT have to be contained inside a TCL script, you can run it at a command prompt). If you input line of data was: 4.510022tcp9.4532451000.0054 Then the above line of code you gave would mean: (3rd column) / (5th column * 1st column) Or 22 / (9.4532 * 4.5) I hope that helps; it is the best I can do with the limited information supplied. -- J On 03/12/2011 01:34 AM, serene wong wrote: Hi, I came across codes something like 1:($3/($5*$1))}. May I know what does that means? I didn't see any declaration anywhere in the code. Can anyone enlighten me? Thanks in advance.
[ns] NS2 TCPDump Output
Hi all, I read that at some point TCPDump output was in the works for NS, does anyone know what became of that? What I'd like to be able to do is simulate a small network and output TCPDump log files for it. Being able to seed intrusions is crucial to my work. Thanks! Justin [EMAIL PROTECTED]