2. Tracing
• Identify the performance parameters of your network
• Post processing of results in ns2
• Know the format of trace files in ns2 (old and new
trace format)
• Know a scripting language for processing the
results. AWK is the apt choice
• Compute the performance parameters
3. Wired Trace format
C1 C2 C3 C4
type identifier time source node dest. node
C5 C6 C7 C8
pkt name pkt size flags flow id
C9 C10 C11 C12
Source Addr. Dest. Addre Seq Num Pkt unique ID
4. Wired Trace Format
• Type identifier (+, -, r, d, c)
• + - enqueue
• - dequeue
• r - receive
• d - drop
• c - packet collision
5. Wired Trace Format
• C2: Time at which the packet tracing happend
• C3-C4 : Source and destination ID
• C5: name of the packet
• C6: packet size
6. Wired Trace Format
• C7: Flags
• 7 digit flag string
• - disable
• E - Explicit congestion notification (ECN)
• P - priority in the IP header
• Not in use
• A- congestion action
• E - Congestion has occured
• F - The TCP fast start is used
• N - ECN is ON
7. Wired Trace Format
• C8: Flow ID
• C9-C10 - Source Address and Destination
address where the format is a.b (a is the
address and b is the port)
• C11 - Sequence Number
• C12 - Packet Unique ID
8. AWK Scripts
• Either written in one line or written as a separate
file with extension .awk (file.awk)
• The syntax to run the awk script is
• awk -f file.awk file.tr
• gawk -f file.awk file.tr
9. AWK
• Syntax for AWK inside a file is
• BEGIN {
• }
• {
• }
• END {
• }
10. AWK
• FS - Field Separator
• RS - Record Separator
• NR - number of records
• NF - Number of fields in current record
• $0 is the current column
• $1 is the first column
• $2 is the second column and so on
11. Link throughput
• Ratio of
• No of bits from Node A to Node B
• to
• Observation duration (total time)
16. Link delay
Type of Delay Begin Node End Node
Link Delay Pkt transmitter (C3) Pkt Receiver (C4)
End to End Delay Pkt Creator(C9) Pkt destructor(C10)