<!--
{
  "documentType" : "article",
  "framework" : "Network",
  "identifier" : "/documentation/Network/ip-options",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "IP Options"
}
-->

# IP Options

Configure Internet Protocol options on connections.

## Topics

### Handling IP Packets

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

Initializes an IP packet configuration with default settings.

[`nw_protocol_metadata_is_ip`](/documentation/Network/nw_protocol_metadata_is_ip(_:))

Checks whether a metadata object represents an IP packet.

[`nw_ip_metadata_set_ecn_flag`](/documentation/Network/nw_ip_metadata_set_ecn_flag(_:_:))

Sets a specific Explicit Congestion Notification flag value to set on an IP packet.

[`nw_ip_metadata_get_ecn_flag`](/documentation/Network/nw_ip_metadata_get_ecn_flag(_:))

Checks the Explicit Congestion Notification flag value received on an IP packet.

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

Flag values for Explicit Congestion Notifications in IP packets.

[`nw_ip_metadata_set_service_class`](/documentation/Network/nw_ip_metadata_set_service_class(_:_:))

Sets a specific service class to mark on an IP packet.

[`nw_ip_metadata_get_service_class`](/documentation/Network/nw_ip_metadata_get_service_class(_:))

Accesses a specific service class to mark on an IP packet.

[`nw_ip_metadata_get_receive_time`](/documentation/Network/nw_ip_metadata_get_receive_time(_:))

Access the time at which a packet was received, in nanoseconds, based on `CLOCK_MONOTONIC_RAW`.

### Configuring IP Connections

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

Accesses the system definition of the Internet Protocol.

[`nw_ip_options_set_version`](/documentation/Network/nw_ip_options_set_version(_:_:))

Sets a required IP version to disable all other versions for a connection.

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

IP versions to require on connections and listeners.

[`nw_ip_options_set_calculate_receive_time`](/documentation/Network/nw_ip_options_set_calculate_receive_time(_:_:))

Configures a connection to deliver receive timestamps for IP packets.

[`nw_ip_options_set_hop_limit`](/documentation/Network/nw_ip_options_set_hop_limit(_:_:))

Configures the default hop limit for packets generated by a connection.

[`nw_ip_options_set_use_minimum_mtu`](/documentation/Network/nw_ip_options_set_use_minimum_mtu(_:_:))

Configures a connection to use the minimum MTU value, which is 1280 bytes for IPv6.

[`nw_ip_options_set_disable_fragmentation`](/documentation/Network/nw_ip_options_set_disable_fragmentation(_:_:))

Configures a connection to disable fragmentation on outbound packets.

[`nw_ip_options_set_local_address_preference`](/documentation/Network/nw_ip_options_set_local_address_preference(_:_:))

Configures a connection to prefer certain types of local addresses, such as temporary or stable.

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

Types of local addresses that can be selected, such as temporary or stable.



---

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)