title: How to reliably measure the network bandwidth used by a process
body: <p>I have developed an application and I want to measure how much network bandwidth it consumes in some typical test cases. </p>
  
  <p>I found a few applications like nethog etc. however I am not sure how accurate its reports are! </p>
  
  <p>I would like some way to very accurately measure the same as the results need to go into a report for a conference. </p>
  
  <p>I'm willing to write customized solutions for the same if someone guides me how to! </p>
  
  <p>I want something where I can run the monitoring program and my target application to get network usage statistics - cumulative bytes sent/rcvd. .. maximum usage and average usage 
  etc</p>