Difference between revisions of "NS-2 Trace Formats"

From nsnam
Jump to: navigation, search
(Normal trace formats: Describe TCP flags)
(Normal trace formats: Clarify link/network layer addresses)
Line 23: Line 23:
 
       <td colspan="2"><tt>%g %d %d %s %d %s %d %d.%d %d.%d %d %d </tt></td></tr>
 
       <td colspan="2"><tt>%g %d %d %s %d %s %d %d.%d %d.%d %d %d </tt></td></tr>
 
   <tr><td>double    </td><td>Time                                    </td></tr>
 
   <tr><td>double    </td><td>Time                                    </td></tr>
   <tr><td>int        </td><td>Source Node                             </td></tr>
+
   <tr><td>int        </td><td>(Link-layer) Source Node               </td></tr>
   <tr><td>int        </td><td>Destination Node                       </td></tr>
+
   <tr><td>int        </td><td>(Link-layer) Destination Node           </td></tr>
 
   <tr><td>string    </td><td>Packet Name                            </td></tr>
 
   <tr><td>string    </td><td>Packet Name                            </td></tr>
 
   <tr><td>int        </td><td>Packet Size                            </td></tr>
 
   <tr><td>int        </td><td>Packet Size                            </td></tr>
 
   <tr><td>string    </td><td>Flags                                  </td></tr>
 
   <tr><td>string    </td><td>Flags                                  </td></tr>
 
   <tr><td>int        </td><td>Flow ID                                </td></tr>
 
   <tr><td>int        </td><td>Flow ID                                </td></tr>
   <tr><td>int        </td><td>Source Address                         </td></tr>
+
   <tr><td>int        </td><td>(Network-layer) Source Address         </td></tr>
   <tr><td>int        </td><td>Source Port                             </td></tr>
+
   <tr><td>int        </td><td>Source Port                             </td></tr>
   <tr><td>int        </td><td>Destination Address                     </td></tr>
+
   <tr><td>int        </td><td>(Network-layer) Destination Address     </td></tr>
 
   <tr><td>int        </td><td>Destination Port                        </td></tr>
 
   <tr><td>int        </td><td>Destination Port                        </td></tr>
 
   <tr><td>int        </td><td>Sequence Number                        </td></tr>
 
   <tr><td>int        </td><td>Sequence Number                        </td></tr>

Revision as of 21:47, 1 July 2009

This document lists various trace formats used by the NS-2 Network Simulator. The information is based on NS2 version 2.1b9a. The best effort has been made to document correctly all of the trace formats, but be warned that this list is not complete, and may contain errors. If you find any errors or omissions, please edit this page to fix the problems.

The various traces begin with a single character or abbreviation that indicates the type of trace, followed by a fixed or variable trace format. The tables listing the trace formats differ between fixed and variable trace formats:

  • For fixed trace formats, the table lists the event the triggers the trace under the Event heading and the characters that start the trace under the Abbreviation heading. The format is listed across the last two columns, and the the type and value for each element of the format are listed beneath under the Type and Value headings. Some events have multiple trace formats.
  • For variable trace formats, the table lists the event the triggers the trace under the Event heading and the characters that start the trace under the Abbreviation heading. The last three columns list the possible flags, types, and values for the event under the Flag, Type, and Value headings.

Normal trace formats

This information comes from "The ns Manual" "Trace and Monitoring Support: Trace File Format" chapter. This trace is used normal wired operations. The trace starts with one of four possible characters.

The tables that list the additional wireless trace information do not have an Abbreviation column, since the information is appended to the end of the regular wireless trace format.

Event Abbreviation Type Value
Normal Event r: Receive
d: Drop
e: Error
+: Enqueue
-: Dequeue
%g %d %d %s %d %s %d %d.%d %d.%d %d %d
double Time
int (Link-layer) Source Node
int (Link-layer) Destination Node
string Packet Name
int Packet Size
string Flags
int Flow ID
int (Network-layer) Source Address
int Source Port
int (Network-layer) Destination Address
int Destination Port
int Sequence Number
int Unique Packet ID

The flags are read as follow (the "value" is displayed instead of `-` if flag is set). Each row is one of the "slots", from left to right. From from ns/trace/trace.cc.

ValueMeaning
C ECN-echo
P pri_ (supposedly unused)
-
A Congestion Action
E Congestion Experienced (CE)
F Fast Start
N ECN-capable
SCTP-only

Depending on the packet type, the trace may log additional information:

Event Type Value
TCP Trace %d 0x%x %d %d
int Ack Number
hexadecimalFlags (Used by FullTCP)
FIN=0x01, SYN=02, PUSH=08, ACK=10, ECE=40, CWR=80
int Header Length
int Socket Address Length
Satellite Trace %.2f %.2f %.2f %.2f
double Source Latitude
double Source Longitude
double Destination Latitude
double Destination Longitude

Wireless Trace Formats

This section covers the various wireless trace format:

Old Wireless Trace Formats

This information comes from "The ns Manual" "Mobile Networking in ns: Trace Support" chapter, and the "trace/cmu-trace.cc" file. Wireless traces begin with one of four characters followed by one of two different trace formats, depending on whether the trace logs the X and Y coordinates of the mobile node.

Event Abbreviation Type Value
Wireless Event s: Send
r: Receive
d: Drop
f: Forward
%.9f %d (%6.2f %6.2f) %3s %4s %d %s %d [%x %x %x %x]
%.9f _%d_ %3s %4s %d %s %d [%x %x %x %x]
double Time
int Node ID
double X Coordinate (If Logging Position)
double Y Coordinate (If Logging Position)
string Trace Name
string Reason
int Event Identifier
string Packet Type
int Packet Size
hexadecimalTime To Send Data
hexadecimalDestination MAC Address
hexadecimalSource MAC Address
hexadecimalType (ARP, IP)

Some older versions of NS2 (such as 2.1b5) have five hexidecimal values between the square braces. The first hexidecimal value is the MAC frame control information, and the remaining hexidecimal values are the same as listed above.

Depending on the packet type, the trace may log additional information:

Event Type Value
ARP Trace ------- [%s %d/%d %d/%d]
string Request or Reply
int Source MAC Address
int Source Address
int Destination MAC Address
int Destination Address
IP Trace ------- [%d:%d %d:%d %d %d]
int Source IP Address
int Source Port
int Destination IP Address
int Destination Port Address
int TTL
int Next hop node (or 0 if not valid)
DSR Trace %d [%d %d] [%d %d %d %d->%d] [%d %d %d %d-