Please reply as a reply. If you reply in the comments, it’s easy for me to miss. See Quinn’s Top Ten DevForums Tips for this and other tips.
My previous response presumed that you were talking about this from the perspective of a networking app using networking APIs to communicate over your interface. For example, an app using BSD Sockets to send a large UDP datagram over your interface, or receive a large UDP datagram from your interface.
However, this:
Also to give some more context we are using this API
-writePackets:withProtocols:
in NEPacketTunnelFlow
to
inject packet.
is a very different story. The interface can’t transmit packets larger that the MTU. That’s kinda the definition of MTU.
Let me walk you through an example:
-
An app sends a large UDP datagram to a remote peer over your interface.
-
IP sees that the datagram is bigger than the interface MTU and fragments it.
-
The system then calls your packet tunnel provider to send each fragment. All of these smaller than the MTU.
-
The remote peer responds. Let’s assume that this is also a large datagram, so that response is fragmented. Your packet tunnel provider receives these fragments and passes them up to the system.
-
IP collects these fragments, reassembles them, and passes them up to the app.
This makes the job of a typical packet tunnel provider very simple: It just transfers packets across the tunnel, all of which are smaller than the MTU. It sounds you’re trying to create a packet tunnel provider that’s ‘smart’ in some way. If so, there’ll be a bunch of extra work for you to do.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"