Print flow identification in TCP parsing output.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 27 Apr 2010 21:13:45 +0000 (14:13 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 27 Apr 2010 21:13:45 +0000 (14:13 -0700)
Also fix a division-by-zero bug in computing bandwidth if no data is
transferred.

parsetrace/parse.py

index 4419a35..687dd79 100755 (executable)
@@ -45,11 +45,12 @@ class Connection:
             print "Network RTT:", rtt
             print "Additional response delay:", start - rtt
             print "Transfer time:", end - start
-            print "Bandwidth:", data / (end - start)
+            if end - start > 0:
+                print "Bandwidth:", data / (end - start)
             print
-            logfile.write("%d\t%d\t%d\t%f\t%f\t%f\n"
+            logfile.write("%d\t%d\t%d\t%f\t%f\t%f\t# %s\n"
                           % (self.id, self.transfer_count, data,
-                              rtt, start - rtt, end - start))
+                              rtt, start - rtt, end - start, self.endpoints))
             self.transfer_count += 1
         self.times = []
         self.state = STATE_START