<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEPacketTunnelFlow",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEPacketTunnelFlow"
  },
  "title" : "NEPacketTunnelFlow"
}
-->

# NEPacketTunnelFlow

An object you use to read and write packets to and from the tunnel’s virtual interface.

```
class NEPacketTunnelFlow
```

## Overview

Use the `NEPacketTunnelFlow` class to implement a custom-IP tunneling protocol for your packet tunnel. For example, use the APIs in this class to read packets from the virtual interface, so you can then encapsulate these packets and send them to a packet-tunnel server. Likewise, read packets from your packet-tunnel server and use these APIs to write the packets back to the tunnel’s virtual interface.

## Topics

### Handling IP packets

[`-  readPacketObjectsWithCompletionHandler:`](/documentation/NetworkExtension/NEPacketTunnelFlow/readPacketObjects(completionHandler:))

Read multiple IP packets from the TUN interface.

[`-  writePacketObjects:`](/documentation/NetworkExtension/NEPacketTunnelFlow/writePacketObjects(_:))

Write multiple IP packets to the TUN interface.

[`-  readPacketsWithCompletionHandler:`](/documentation/NetworkExtension/NEPacketTunnelFlow/readPackets(completionHandler:))

Reads IP packets from the TUN interface.

[`-  writePackets:withProtocols:`](/documentation/NetworkExtension/NEPacketTunnelFlow/writePackets(_:withProtocols:))

Writes IP packets to the TUN interface.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)