Lab 5: Analyze Bandwidth Share of TCP and UDP Traffic
It is equivalently important to understand the ns-2 output trace
format and have some knowledge on how to extract relevant information
for your research. This exercise is dedicated to familiarize you with
ns-2's output format, in particular by namtrace-all, and techniques to
do trace post-processing.
5.a. Trace Format
As a result of previous exercise, we obtain an output file, out.nam.
It contains information of all packets enqueued (+), dequeued (-),
transmitted over to another hop (h), and etc.
- Take a look at out.nam
- Ignore entries with -t *; these entries are to set up network topology in nam
- The rest of the entries look like:
- [event type] -t [time] -s [src node] -d [dst node] -p [pkt type] -e [pkt size] -c [color] -i [pkt id] -a [flow id] -x {[src.port] [dst.port] [seqno] ------- null}
- [event type]: +, -, h, d
- Guess what +, -, h, and d mean
5.b. Extracting Useful Information
Extract information from the out.nam file and compute the total bytes of
TCP (tcp) and UDP (cbr) traffic over link 4-3 for the duration of the
simulation. Then, compute total TCP and UDP/CBR traffic in bytes and
ratios of TCP and UDP/CBR to the total. Finally, Comment on the
bandwidth share of TCP vs. UDP/CBR.
Modify your awk command to compute the total bytes of UDP/CBR traffic
Compute the total of TCP and UDP/CBR traffic
Compute the ratios of TCP and UDP/CBR traffic
Here is a more elaborated awk script
Do you see more TCP or UDP/CBR traffic?
Collect similar statistics for the same simulations that contain only
the TCP or UDP/CBR flow
References:
Last modified: Thu Apr 26 20:01:27 MET DST 2001