<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWParameters",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network12NWParametersC"
  },
  "title" : "NWParameters"
}
-->

# NWParameters

An object that stores the protocols to use for connections, options for sending data, and network path constraints.

```
final class NWParameters
```

## Topics

### Creating Parameters

[`tls`](/documentation/Network/NWParameters/tls)

A set of default parameters for connections and listeners that use TLS and TCP.

[`tcp`](/documentation/Network/NWParameters/tcp)

A set of default parameters for connections and listeners that use TCP.

[`dtls`](/documentation/Network/NWParameters/dtls)

A set of default parameters for connections and listeners that use DTLS and UDP.

[`udp`](/documentation/Network/NWParameters/udp)

A set of default parameters for connections and listeners that use UDP.

[`quic(alpn:)`](/documentation/Network/NWParameters/quic(alpn:))

Returns a set of default parameters for connections and listeners that use QUIC, with a set of supported Application-Layer Protocol Negotiation values.

[`quicDatagram(alpn:)`](/documentation/Network/NWParameters/quicDatagram(alpn:))

Returns a set of default parameters for connections and listeners that use QUIC datagrams, with a set of supported Application-Layer Protocol Negotiation values.

[`init(tls:tcp:)`](/documentation/Network/NWParameters/init(tls:tcp:))

Initializes parameters for TLS connections and listeners with custom TLS and TCP options.

[`init(dtls:udp:)`](/documentation/Network/NWParameters/init(dtls:udp:))

Initializes parameters for DTLS connections and listeners with custom DTLS and UDP options.

[`init(quic:)`](/documentation/Network/NWParameters/init(quic:))

Initializes parameters for QUIC connections and listeners with custom QUIC options.

[`init()`](/documentation/Network/NWParameters/init())

Initializes parameters for connections, listeners, and browsers with no protocols specified.

[`init(customIPProtocolNumber:)`](/documentation/Network/NWParameters/init(customIPProtocolNumber:))

Initializes parameters for connections and listeners using a custom IP protocol.

[`copy()`](/documentation/Network/NWParameters/copy())

Performs a deep copy of a parameters object.

### Modifying Protocol Stacks

[`defaultProtocolStack`](/documentation/Network/NWParameters/defaultProtocolStack)

The protocol stack used by connections and listeners.

[`ProtocolStack`](/documentation/Network/NWParameters/ProtocolStack)

An ordered set of protocol options that define the protocols that connections and listeners use.

[`NWProtocol`](/documentation/Network/NWProtocol)

The abstract superclass used by Network framework protocols and by custom network protocols that you define.

### Selecting Paths

[`requiredInterfaceType`](/documentation/Network/NWParameters/requiredInterfaceType)

An interface type to require on connections and listeners.

[`requiredInterface`](/documentation/Network/NWParameters/requiredInterface)

A specific interface to require on connections, listeners, and browsers.

[`requiredLocalEndpoint`](/documentation/Network/NWParameters/requiredLocalEndpoint)

A specific local IP address and port to use for connections and listeners.

[`prohibitConstrainedPaths`](/documentation/Network/NWParameters/prohibitConstrainedPaths)

A Boolean that prevents connections, listeners, and browsers from using network paths marked as constrained by Low Data Mode.

[`prohibitExpensivePaths`](/documentation/Network/NWParameters/prohibitExpensivePaths)

A Boolean that prevents connections, listeners, and browsers from using network paths marked as expensive.

[`prohibitedInterfaceTypes`](/documentation/Network/NWParameters/prohibitedInterfaceTypes)

A list of interface types that connections, listeners, and browsers will not use.

[`prohibitedInterfaces`](/documentation/Network/NWParameters/prohibitedInterfaces)

A list of specific interfaces that connections and listeners will not use.

### Customizing Connection Options

[`multipathServiceType`](/documentation/Network/NWParameters/multipathServiceType-swift.property)

An option to allow connections to use multipath protocols.

[`MultipathServiceType`](/documentation/Network/NWParameters/MultipathServiceType-swift.enum)

Modes in which a connection can support multipath protocols.

[`serviceClass`](/documentation/Network/NWParameters/serviceClass-swift.property)

The traffic characteristics network connections send and receive.

[`ServiceClass`](/documentation/Network/NWParameters/ServiceClass-swift.enum)

Indicates how the system prioritizes transmitted traffic by your latency and throughput needs.

[`allowFastOpen`](/documentation/Network/NWParameters/allowFastOpen)

A Boolean that enables sending application data with protocol handshakes.

[`expiredDNSBehavior`](/documentation/Network/NWParameters/expiredDNSBehavior-swift.property)

A behavior that defines how expired DNS answers will be used.

[`ExpiredDNSBehavior`](/documentation/Network/NWParameters/ExpiredDNSBehavior-swift.enum)

Options for configuring how expired DNS answers should be used.

[`requiresDNSSECValidation`](/documentation/Network/NWParameters/requiresDNSSECValidation)

A Boolean value that determines whether a connection requires DNSSEC validation when resolving endpoints.

[`preferNoProxies`](/documentation/Network/NWParameters/preferNoProxies)

A Boolean that indicates that connections should ignore proxies when they are enabled on the system.

[`includePeerToPeer`](/documentation/Network/NWParameters/includePeerToPeer)

A Boolean that enables peer-to-peer link technologies for connections and listeners.

[`allowLocalEndpointReuse`](/documentation/Network/NWParameters/allowLocalEndpointReuse)

A Boolean that allows reusing local addresses and ports across connections.

[`acceptLocalOnly`](/documentation/Network/NWParameters/acceptLocalOnly)

A Boolean that restricts listeners to only accepting connections from the local link.

### Configuring Privacy Settings

[`setPrivacyContext(_:)`](/documentation/Network/NWParameters/setPrivacyContext(_:))

Associates a privacy context with any connections or listeners that use the parameters.

[`PrivacyContext`](/documentation/Network/NWParameters/PrivacyContext)

An object that defines the privacy requirements for a set of connections.

## Relationships

### Conforms To

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

[`NWParametersProvider`](/documentation/Network/NWParametersProvider)

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

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

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

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

---

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)