Upload
t-s-pradeep-kumar
View
5.147
Download
2
Embed Size (px)
Citation preview
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
Wired Trace formatC1 C2 C3 C4
type identifier time source node dest. nodeC5 C6 C7 C8
pkt name pkt size flags flow idC9 C10 C11 C12
Source Addr. Dest. Addre Seq Num Pkt unique ID
Wired Trace Format• Type identifier (+, -, r, d, c)
• + - enqueue
• - dequeue
• r - receive
• d - drop
• c - packet collision
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
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
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
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
AWK• Syntax for AWK inside a file is
• BEGIN {
• }
• {
• }
• END {
• }
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
Link throughput
• Ratio of
• No of bits from Node A to Node B
• to
• Observation duration (total time)
Link throughput• BEGIN {
• lineCount = 0;totalBits = 0;
• }
• {
• if ($3=="0" &&$4=="2") {
• totalBits += 8*$6;
• if ( lineCount==0 ) {
• timeBegin = $2; lineCount++;
• } else {
• timeEnd = $2;
• };
• };
• }
• END {
• duration = timeEnd-timeBegin;
• print "Number of records is " NR;
• print "Transmission: 0 to 1";
• print " - Total transmitted bits = " totalBits " bits";
• print " - duration = " duration " s";
• print " - Thoughput = " totalBits/duration/1e3 " kbps.";
• };
End to End throughput
• Ratio of
• no of bits from Node A to node B whose source is S and destination is D
• to
• Observation Destination
End to End throughput• BEGIN {
• src1 = 0.0; dst1 = 3.1;
• src2 = 3.0; dst2 = 1.0;
• lineCount1 = 0;totalBits1 = 0;
• lineCount2 = 0;totalBits2 = 0;
• }
• {
• if ($1=="r" && $3=="2" &&$4== "3" && $9==src1 && $10==dst1) {
• totalBits1 += 8*$6;
• if ( lineCount1==0 ) {
• timeBegin1 = $2; lineCount1++;
• } else {
• timeEnd1 = $2;
• };
• };
• if ($1=="r" && $3=="3" &&$4== "2" && $9==src2 && $10==dst2) {
• totalBits2 += 8*$6;
• if ( lineCount2==0 ) {
• timeBegin2 = $2; lineCount2++;
• } else {
• timeEnd2 = $2;
• };
• };
• }
End to End Throughput• END{
• duration = timeEnd1-timeBegin1;
• print "Transmission: source " src1 "->Destination" dst1;
• print " - Total transmitted bits = " totalBits1 " bits";
• print " - duration = " duration " s";
• print " - Thoughput = " totalBits1/duration/1e3 " kbps.";
• print " ";
• duration = timeEnd2-timeBegin2;
• print "Transmission: source " src2 "->Destination" dst2;
• print " - Total transmitted bits = " totalBits2 " bits";
• print " - duration = " duration " s";
• print " - Thoughput = " totalBits2/duration/1e3 " kbps.";
• };
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)
Delay calculation
• Average delay is ratio of
• Sum of all delay samples
• to
• number of samples