---
title: NEPacketTunnelFlow
framework: networkextension
role: symbol
role_heading: Class
path: networkextension/nepackettunnelflow
---

# NEPacketTunnelFlow

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

## Declaration

```swift
class NEPacketTunnelFlow
```

## Overview

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

- [readPacketObjects(completionHandler:)](networkextension/nepackettunnelflow/readpacketobjects(completionhandler:).md)
- [writePacketObjects(_:)](networkextension/nepackettunnelflow/writepacketobjects(_:).md)
- [readPackets(completionHandler:)](networkextension/nepackettunnelflow/readpackets(completionhandler:).md)
- [writePackets(_:withProtocols:)](networkextension/nepackettunnelflow/writepackets(_:withprotocols:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Packet handling

- [NEPacket](networkextension/nepacket.md)
- [In-Provider Networking](networkextension/in-provider-networking.md)
