12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}name,th->size(),flags,iph->flowid() /* was p->class_ */,iph->src() >> 8, iph->src() & 0xff,iph->dst() >> 8, iph->dst() & 0xff,seqno,th->uid(), /* was p->uid_ */tcph->ackno(),tcph->flags(),tcph->hlen());// XXX// XXXThis function is somewh<strong>at</strong> unelegant, primarily due to the desire to maintain backward comp<strong>at</strong>ibility. It form<strong>at</strong>s the source,destin<strong>at</strong>ion, <strong>and</strong> type fields defined in the trace object (not in the packet headers), the current time, along with various packetheader fields including, type of packet (as a name), size, flags (symbolically), flow identifier, source <strong>and</strong> destin<strong>at</strong>ion packetheader fields, sequence number (if present), <strong>and</strong> unique identifier. <strong>The</strong> show_tcphdr_ variable indic<strong>at</strong>es whether thetrace output should append tcp header inform<strong>at</strong>ion (ack number, flags, header length) <strong>at</strong> the end of each output line. Thisis especially useful for simul<strong>at</strong>io<strong>ns</strong> using FullTCP agents (Section 34.3). An example of a trace file (without the tcp headerfields) might appear as follows:+ 1.84375 0 2 cbr 210 ------- 0 0.0 3.1 225 610- 1.84375 0 2 cbr 210 ------- 0 0.0 3.1 225 610r 1.84471 2 1 cbr 210 ------- 1 3.0 1.0 195 600r 1.84566 2 0 ack 40 ------- 2 3.2 0.1 82 602+ 1.84566 0 2 tcp 1000 ------- 2 0.1 3.2 102 611- 1.84566 0 2 tcp 1000 ------- 2 0.1 3.2 102 611r 1.84609 0 2 cbr 210 ------- 0 0.0 3.1 225 610+ 1.84609 2 3 cbr 210 ------- 0 0.0 3.1 225 610d 1.84609 2 3 cbr 210 ------- 0 0.0 3.1 225 610- 1.8461 2 3 cbr 210 ------- 0 0.0 3.1 192 511r 1.84612 3 2 cbr 210 ------- 1 3.0 1.0 196 603+ 1.84612 2 1 cbr 210 ------- 1 3.0 1.0 196 603- 1.84612 2 1 cbr 210 ------- 1 3.0 1.0 196 603+ 1.84625 3 2 cbr 210 ------- 1 3.0 1.0 199 612Here we see 14 trace entries, five enque oper<strong>at</strong>io<strong>ns</strong> (indic<strong>at</strong>ed by “+” in the first column), four deque oper<strong>at</strong>io<strong>ns</strong> (indic<strong>at</strong>ed by“-”), four receive events (indic<strong>at</strong>ed by “r”), <strong>and</strong> one drop event. (this had better be a trace fragment, or some packets wouldhave just vanished!). <strong>The</strong> simul<strong>at</strong>ed time (in seconds) <strong>at</strong> which each event occurred is listed in the second column. <strong>The</strong> nexttwo fields indic<strong>at</strong>e between which two nodes tracing is happening. <strong>The</strong> next field is a descriptive name for the the type ofpacket seen (Section 26.5). <strong>The</strong> next field is the packet’s size, as encoded in its IP header.<strong>The</strong> next field contai<strong>ns</strong> the flags, which not used in this example. <strong>The</strong> flags are defined in the flags[] array in trace.cc. Fourof the flags are used for ECN: “E” for Congestion Experienced (CE) <strong>and</strong> “N” for ECN-Capable-Tra<strong>ns</strong>port (ECT) indic<strong>at</strong>io<strong>ns</strong>in the IP header, <strong>and</strong> “C” for ECN-Echo <strong>and</strong> “A” for Congestion Window Reduced (CWR) in the TCP header. For the otherflags, “P” is for priority, <strong>and</strong> “F” is for TCP Fast Start.<strong>The</strong> next field gives the IP flow identifier field as defined for IP version 6. 1 . <strong>The</strong> subsequent two fields indic<strong>at</strong>e the packet’ssource <strong>and</strong> destin<strong>at</strong>ion node addresses, respectively. <strong>The</strong> following field indic<strong>at</strong>es the sequence number. 2 <strong>The</strong> last field is a1 In <strong>ns</strong> v1, each packet included a class field, which was used by CBQ to classify packets. It then found additional use to differenti<strong>at</strong>e between “flows”<strong>at</strong> one trace point. In <strong>ns</strong> v2, the flow ID field is available for this purpose, but any additional inform<strong>at</strong>ion (which was commonly overloaded into the classfield in <strong>ns</strong> v1) should be placed in its own separ<strong>at</strong>e field, possibly in some other header2 In <strong>ns</strong> v1, all packets contained a sequence number, whereas in <strong>ns</strong> v2 only those Agents interested in providing sequencing will gener<strong>at</strong>e sequencenumbers. Thus, this field may not be useful in <strong>ns</strong> v2 for packets gener<strong>at</strong>ed by agents th<strong>at</strong> have not filled in a sequence number. It is used here to remainbackward comp<strong>at</strong>ible with <strong>ns</strong> v1.236

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!