Bug 2375

Summary: Flowmonitor parse crashes with no reception
Product: ns-3 Reporter: Konstantinos Katsaros <dinos.katsaros>
Component: flow-monitorAssignee: Tommaso Pecorella <tommaso.pecorella>
Status: RESOLVED FIXED    
Severity: trivial CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

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