I don't know if this is called packets or packet flow, perhaps you could explain the difference or link to a correct explanation.
I can understand your confusion. In standard TCP parlance packets would mean separate IP datagrams whereas a flow would mean the contents of a TCP stream (that is, the user data that’s transported over the TCP connection). Some tools (like
tcpflow
) can assemble the latter from the former.
NE uses the term flow in both ways:
A packet tunnel provider reads and writes packets via NEPacketTunnelFlow
An app proxy provider reads and writes TCP flows via NEAppProxyTCPFlow, but it can also use NEAppProxyUDPFlow for UDP packets
A content filter reads flows via NEFilterFlow
If you’re aiming to create a
.pcap
file, you definitely want packets, not flows.
I don't want to redirect the traffic to a proxy or over a vpn network. Just sniff packets with the NE. Is this even possible?
No. Well, you might make some progress but the Network Extension provider architecture was definitely not designed to support this. Specifically:
Packet tunnel providers have the routing problem I described in your previous thread.
App proxy providers and content filters don’t see packets, they see flows.
No, this is just for research purpose and will not be released to the appstore. It should make it easier to get the network traffic of a device, otherwise you have to set up a proxy server in the network, which sniffs all packets like a MITM attack, which is a big overhead to do.
Have you looked at RVI? Personally I use this for most packet sniffing tasks, except where I need to see inside HTTPS, in which case I use
mitmproxy
. QA1176
Getting a Packet Trace has the details on both of these.
There is also CFNetwork diagnostic logging, which is the place I generally start when debugging networking problems. See QA1887 for the details.
Do I need to set up a MDM to use the AppProxyProvider?
The general rules are:
Normal VPN (a packet tunnel provider in destination IP routing mode (
routingMethod
is destinationIP
) can be used on any device.Per-app VPN (an app proxy provider, or a packet tunnel in source application mode) requires MDM.
A content filter provider requires a supervised device.
The last two points only apply to deployed apps; there is specific support for apps under development to bypass these restrictions. This is predicated on the
get-task-allow
entitlement, which is automatically set by development provisioning profiles. Hence my “deployed to customers” question (-:
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"