Network Extension for iOS and MacOS. Is there any difference?

Hello!

Need to develop Network Etension Packet Tunnel Provider for MacOS. Previously been developing NE for iOS. There are some limits and mobile application special things. Got some questions because of it:

  1. What kind of limits for NE in MacOS? Is it the same like for iOS? (Memory, traffic, etc).
  2. How it interacting with main application?
  3. Is there something very specific for MacOS implementaion of NE?
  4. Is there examples or manuals of NE especially designated for MacOS?
Answered by DTS Engineer in 753286022

While they share a lot of common architecture, which means you’ll be able to share a lot of code, there are significant differences between NE packet tunnel providers on macOS and iOS.

Foremost is that macOS allows a packet tunnel provider to be packaged as either an app extension or a system extension, whereas iOS only supports appex packaging. Packaging as a sysex allows your product to be distributed outside of the Mac App Store. See TN3134 Network Extension provider deployment for all the details.

If you stick with appex packaging then things are very similar to iOS. If you switch to sysex packaging there are significantly more changes:

  • You need to activate your sysex with the System Extensions framework.

  • Your provider then runs inside your sysex.

  • Which runs as root, although still sandboxed.

  • And that presents some exciting challenges for app-to-provider IPC.

Oh, and with regards the iOS memory limits, those do not apply on macOS.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

While they share a lot of common architecture, which means you’ll be able to share a lot of code, there are significant differences between NE packet tunnel providers on macOS and iOS.

Foremost is that macOS allows a packet tunnel provider to be packaged as either an app extension or a system extension, whereas iOS only supports appex packaging. Packaging as a sysex allows your product to be distributed outside of the Mac App Store. See TN3134 Network Extension provider deployment for all the details.

If you stick with appex packaging then things are very similar to iOS. If you switch to sysex packaging there are significantly more changes:

  • You need to activate your sysex with the System Extensions framework.

  • Your provider then runs inside your sysex.

  • Which runs as root, although still sandboxed.

  • And that presents some exciting challenges for app-to-provider IPC.

Oh, and with regards the iOS memory limits, those do not apply on macOS.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

What if my Application written with C++ and CMake is there any examples of how to add subtarget of NE to main CMakeLists.txt?

What if my Application written with C++

If you want to use C++ in an NE provider that’s fine. The NE provider subclass itself must be an Objective-C class, so standard practice is to implement that in Objective-C++ and then call out to your C++ code from there.

is there any examples of how to add subtarget of NE to main CMakeLists.txt?

Haven’t we had that conversation before?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hello!

Haven’t we had that conversation before?

Thx for reply. Haven't seen your last message within explanation of how to. This is what been seeking. Thx a lot.

Could you send me the link on "3d part tools" thread? Can't find it on forum.

Could you send me the link on "3d part tools" thread?

I don’t know what you mean by that. Please clarify.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Network Extension for iOS and MacOS. Is there any difference?
 
 
Q