NS-2 Trace Formats
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 | Source Node | ||
int | Destination Node | ||
string | Packet Name | ||
int | Packet Size | ||
string | Flags | ||
int | Flow ID | ||
int | Source Address | ||
int | Source Port | ||
int | 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.
Value | Meaning |
---|---|
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 | |
hexadecimal | Flags | |
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
- New Wireless Trace Formats
- AODV Trace Formats
- DSDV Trace Formats
- DSR Trace Formats
- TORA Trace Formats
- Mobile node movement and energy trace formats
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 | ||
hexadecimal | Time To Send Data | ||
hexadecimal | Destination MAC Address | ||
hexadecimal | Source MAC Address | ||
hexadecimal | Type (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- |