Bug 2375 - Flowmonitor parse crashes with no reception
Flowmonitor parse crashes with no reception
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: flow-monitor
ns-3-dev
All All
: P5 trivial
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-18 10:26 UTC by Konstantinos Katsaros
Modified: 2016-04-20 18:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantinos Katsaros 2016-04-18 10:26:49 UTC
The bug was reported in the ns-3-users mailing list here 
https://groups.google.com/d/msg/ns-3-users/3mxFpajyu_o/ezZfSQ2cBAAJ

The python script will try to calculate the rxBitrate as follows:
        if rx_duration > 0:
            self.rxBitrate = long(flow_el.get('rxBytes'))*8 / rx_duration
        else:
            self.rxBitrate = None

If you do not receive any packet, it will be assigned 'None' which does not print as float and hence the error.
      
print "\tRX bitrate: %.2f kbit/s" % (flow.rxBitrate*1e-3,)

~~
The fix should be trivial to have a check before the print.
Comment 1 Tommaso Pecorella 2016-04-20 18:40:22 UTC
Thanks, fixed in changeset: 12091:5fd7f3fc2eca