Unable to understand Flow of Network extension for iOS

For a past few days, I have been exploring control Filter and data filter. I am unable to understand how control moves from various functions of data filter to control Filter. One thing that I am unable to figure out is that when I pass verdict as .allow in dataFilter's handleNewFlow and mark .shouldReport as true, I get inBytes and outbytes in the flow report of handle() in controlFilter. But when I pass verdict as needRules and wait till the handle is called in controlFilter when the report.event == .flowClosed, I don't get inBytes and outBytes. I am unable to understand this complete flow of network extension from the apple documentation. Can someone provide me with some flow chart or some pictorial representation or detailed explanation of network extension for iOS? Also is there some way to imitate the ..statisticsReportFrequency for iOS as it is not available for iOS?

Also I need help in logging inbytes and outbytes at end of flow in iOS. I know that we get bytes in handle report in control filter when report.event == .flowClosed. But I only get bytes when I allow the flow in data filter and mark should report as true. Apart from that I don't get byte data when I go with .needRules and should report as true even when the handle report is called with report.event == .flowClosed. /** * @property bytesInboundCount * @discussion The number of inbound bytes received from the flow. This property is only non-zero when the report event is NEFilterReportEventFlowClosed or NEFilterReportEventFlowStatistics. Is there some issue in iOS or am I missing something?

Unable to understand Flow of Network extension for iOS
 
 
Q