# Network

Site [llms.txt](/llms.txt)

---

- [Network Attributes](#network-attributes)
- [Deprecated Network Attributes](#deprecated-network-attributes)

## Network Attributes

These attributes may be used for any network related operation.

**Attributes:**

| Key | Stability | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- |
| <a id="network-carrier-icc" href="#network-carrier-icc">`network.carrier.icc`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. | `DE` |
| <a id="network-carrier-mcc" href="#network-carrier-mcc">`network.carrier.mcc`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The mobile carrier country code. | `310` |
| <a id="network-carrier-mnc" href="#network-carrier-mnc">`network.carrier.mnc`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The mobile carrier network code. | `001` |
| <a id="network-carrier-name" href="#network-carrier-name">`network.carrier.name`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the mobile carrier. | `sprint` |
| <a id="network-connection-state" href="#network-connection-state">`network.connection.state`</a> | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | string | The state of network connection [1] | `close_wait` [(see more)](#network-connection-state-values) |
| <a id="network-connection-subtype" href="#network-connection-subtype">`network.connection.subtype`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a Wi-Fi connection. | `LTE` [(see more)](#network-connection-subtype-values) |
| <a id="network-connection-type" href="#network-connection-type">`network.connection.type`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The internet connection type. | `wifi` [(see more)](#network-connection-type-values) |
| <a id="network-interface-name" href="#network-interface-name">`network.interface.name`</a> | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | string | The network interface name. | `lo`; `eth0` |
| <a id="network-io-direction" href="#network-io-direction">`network.io.direction`</a> | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | string | The direction of traffic from the perspective of the observing host's physical or virtual network interface. It should not be used to represent the logical direction of a stateful connection or network flow. | `transmit` [(see more)](#network-io-direction-values) |
| <a id="network-local-address" href="#network-local-address">`network.local.address`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | Local address of the network connection - IP address or UNIX domain socket name. | `10.1.2.80`; `/tmp/my.sock` |
| <a id="network-local-as-number" href="#network-local-as-number">`network.local.as.number`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The [Autonomous System Number (ASN)](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) associated with the local IP address. [2] | `64496`; `15169` |
| <a id="network-local-as-organization" href="#network-local-as-organization">`network.local.as.organization`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the organization associated with the autonomous system of the local IP address. [3] | `Example Networks Inc.`; `Google LLC` |
| <a id="network-local-mac-address" href="#network-local-mac-address">`network.local.mac.address`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | Local Media Access Control (MAC) address of the network connection. [4] | `00-00-5E-00-53-23` |
| <a id="network-local-port" href="#network-local-port">`network.local.port`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | int | Local port number of the network connection. | `65123` |
| <a id="network-local-prefix" href="#network-local-prefix">`network.local.prefix`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The IP prefix associated with the local IP address, in CIDR notation. [5] | `192.0.2.0/24`; `2001:db8::/32` |
| <a id="network-peer-address" href="#network-peer-address">`network.peer.address`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | Peer address of the network connection - IP address or UNIX domain socket name. | `10.1.2.80`; `/tmp/my.sock` |
| <a id="network-peer-as-number" href="#network-peer-as-number">`network.peer.as.number`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The [Autonomous System Number (ASN)](https://www.iana.org/assignments/as-numbers/as-numbers.xhtml) associated with the peer IP address. [6] | `64496`; `15169` |
| <a id="network-peer-as-organization" href="#network-peer-as-organization">`network.peer.as.organization`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the organization associated with the autonomous system of the peer IP address. [7] | `Example Networks Inc.`; `Google LLC` |
| <a id="network-peer-mac-address" href="#network-peer-mac-address">`network.peer.mac.address`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | Peer Media Access Control (MAC) address of the network connection. [8] | `00-00-5E-00-53-23` |
| <a id="network-peer-port" href="#network-peer-port">`network.peer.port`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | int | Peer port number of the network connection. | `65123` |
| <a id="network-peer-prefix" href="#network-peer-prefix">`network.peer.prefix`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The IP prefix associated with the peer IP address, in CIDR notation. [9] | `192.0.2.0/24`; `2001:db8::/32` |
| <a id="network-protocol-name" href="#network-protocol-name">`network.protocol.name`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent. [10] | `amqp`; `http`; `mqtt` |
| <a id="network-protocol-version" href="#network-protocol-version">`network.protocol.version`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | The actual version of the protocol used for network communication. [11] | `1.1`; `2` |
| <a id="network-transport" href="#network-transport">`network.transport`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [12] | `tcp`; `udp` [(see more)](#network-transport-values) |
| <a id="network-type" href="#network-type">`network.type`</a> | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [13] | `ipv4`; `ipv6` [(see more)](#network-type-values) |

**[1] `network.connection.state`:** Connection states are defined as part of the [rfc9293](https://datatracker.ietf.org/doc/html/rfc9293#section-3.3.2)

**[2] `network.local.as.number`:** This attribute SHOULD only be set when the local address is an IP address and the ASN is available from routing, enrichment, or lookup data. The value SHOULD be represented as an integer without the `AS` prefix.

**[3] `network.local.as.organization`:** This attribute SHOULD only be set when `network.local.as.number` is set and the organization name is available. The value SHOULD be the organization name as provided by the lookup or enrichment source, not the AS name or short code.

**[4] `network.local.mac.address`:** MAC addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
as hyphen-separated octets in uppercase hexadecimal form from most to least significant.

> [!WARNING]
>
> This attribute may contain sensitive (PII) information.

**[5] `network.local.prefix`:**

> [!WARNING]
>
> This attribute may contain sensitive (PII) information. A `/32` IPv4 prefix
> or `/128` IPv6 prefix preserves the complete endpoint IP address.
> Using CIDR notation does not guarantee that the data is anonymous.

The value MUST be an IPv4 or IPv6 network prefix in CIDR notation, as defined in
[RFC 4632](https://www.rfc-editor.org/rfc/rfc4632.html) for IPv4 and
[RFC 4291](https://www.rfc-editor.org/rfc/rfc4291.html#section-2.3) for IPv6.
IPv4 prefixes MUST use a dotted-decimal address followed by `/` and a decimal
prefix length from 0 to 32. IPv6 prefixes MUST use the canonical address text
representation defined in [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html),
followed by `/` and a decimal prefix length from 0 to 128. All host bits in
the address MUST be set to zero. The value MUST NOT contain a domain name,
UNIX domain socket name, or IPv6 zone identifier.

Instrumentation or Collector receivers that populate this attribute MUST
convert native representations, such as an address and subnet mask or an
address and prefix length, to equivalent CIDR notation before emitting it.

This attribute MAY be set whether or not `network.local.address` is set. If
`network.local.address` is also set to an IP address, it MUST use the same IP version
and be contained in this prefix.

**[6] `network.peer.as.number`:** This attribute SHOULD only be set when the peer address is an IP address and the ASN is available from routing, enrichment, or lookup data. The value SHOULD be represented as an integer without the `AS` prefix.

**[7] `network.peer.as.organization`:** This attribute SHOULD only be set when `network.peer.as.number` is set and the organization name is available. The value SHOULD be the organization name as provided by the lookup or enrichment source, not the AS name or short code.

**[8] `network.peer.mac.address`:** MAC addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
as hyphen-separated octets in uppercase hexadecimal form from most to least significant.

> [!WARNING]
>
> This attribute may contain sensitive (PII) information.

**[9] `network.peer.prefix`:**

> [!WARNING]
>
> This attribute may contain sensitive (PII) information. A `/32` IPv4 prefix
> or `/128` IPv6 prefix preserves the complete endpoint IP address.
> Using CIDR notation does not guarantee that the data is anonymous.

The value MUST be an IPv4 or IPv6 network prefix in CIDR notation, as defined in
[RFC 4632](https://www.rfc-editor.org/rfc/rfc4632.html) for IPv4 and
[RFC 4291](https://www.rfc-editor.org/rfc/rfc4291.html#section-2.3) for IPv6.
IPv4 prefixes MUST use a dotted-decimal address followed by `/` and a decimal
prefix length from 0 to 32. IPv6 prefixes MUST use the canonical address text
representation defined in [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html),
followed by `/` and a decimal prefix length from 0 to 128. All host bits in
the address MUST be set to zero. The value MUST NOT contain a domain name,
UNIX domain socket name, or IPv6 zone identifier.

Instrumentation or Collector receivers that populate this attribute MUST
convert native representations, such as an address and subnet mask or an
address and prefix length, to equivalent CIDR notation before emitting it.

This attribute MAY be set whether or not `network.peer.address` is set. If
`network.peer.address` is also set to an IP address, it MUST use the same IP version
and be contained in this prefix.

**[10] `network.protocol.name`:** The value SHOULD be normalized to lowercase.

**[11] `network.protocol.version`:** If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute SHOULD be set to the negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be set.

**[12] `network.transport`:** The value SHOULD be normalized to lowercase.

Consider always setting the transport when setting a port number, since
a port number is ambiguous without knowing the transport. For example
different processes could be listening on TCP port 12345 and UDP port 12345.

**[13] `network.type`:** The value SHOULD be normalized to lowercase.

---

<a id="network-connection-state-values"></a>

`network.connection.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `close_wait` | close_wait | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `closed` | closed | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `closing` | closing | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `established` | established | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `fin_wait_1` | fin_wait_1 | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `fin_wait_2` | fin_wait_2 | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `last_ack` | last_ack | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `listen` | listen | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `syn_received` | syn_received | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `syn_sent` | syn_sent | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `time_wait` | time_wait | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |

---

<a id="network-connection-subtype-values"></a>

`network.connection.subtype` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `cdma` | CDMA | ![Development](https://img.shields.io/badge/-development-blue) |
| `cdma2000_1xrtt` | CDMA2000 1XRTT | ![Development](https://img.shields.io/badge/-development-blue) |
| `edge` | EDGE | ![Development](https://img.shields.io/badge/-development-blue) |
| `ehrpd` | EHRPD | ![Development](https://img.shields.io/badge/-development-blue) |
| `evdo_0` | EVDO Rel. 0 | ![Development](https://img.shields.io/badge/-development-blue) |
| `evdo_a` | EVDO Rev. A | ![Development](https://img.shields.io/badge/-development-blue) |
| `evdo_b` | EVDO Rev. B | ![Development](https://img.shields.io/badge/-development-blue) |
| `gprs` | GPRS | ![Development](https://img.shields.io/badge/-development-blue) |
| `gsm` | GSM | ![Development](https://img.shields.io/badge/-development-blue) |
| `hsdpa` | HSDPA | ![Development](https://img.shields.io/badge/-development-blue) |
| `hspa` | HSPA | ![Development](https://img.shields.io/badge/-development-blue) |
| `hspap` | HSPAP | ![Development](https://img.shields.io/badge/-development-blue) |
| `hsupa` | HSUPA | ![Development](https://img.shields.io/badge/-development-blue) |
| `iden` | IDEN | ![Development](https://img.shields.io/badge/-development-blue) |
| `iwlan` | IWLAN | ![Development](https://img.shields.io/badge/-development-blue) |
| `lte` | LTE | ![Development](https://img.shields.io/badge/-development-blue) |
| `lte_ca` | LTE CA | ![Development](https://img.shields.io/badge/-development-blue) |
| `nr` | 5G NR (New Radio) | ![Development](https://img.shields.io/badge/-development-blue) |
| `nrnsa` | 5G NRNSA (New Radio Non-Standalone) | ![Development](https://img.shields.io/badge/-development-blue) |
| `td_scdma` | TD-SCDMA | ![Development](https://img.shields.io/badge/-development-blue) |
| `umts` | UMTS | ![Development](https://img.shields.io/badge/-development-blue) |

---

<a id="network-connection-type-values"></a>

`network.connection.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `cell` | cell | ![Development](https://img.shields.io/badge/-development-blue) |
| `unavailable` | unavailable | ![Development](https://img.shields.io/badge/-development-blue) |
| `unknown` | unknown | ![Development](https://img.shields.io/badge/-development-blue) |
| `wifi` | Wi-Fi | ![Development](https://img.shields.io/badge/-development-blue) |
| `wired` | wired | ![Development](https://img.shields.io/badge/-development-blue) |

---

<a id="network-io-direction-values"></a>

`network.io.direction` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `receive` | receive | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `transmit` | transmit | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |

---

<a id="network-transport-values"></a>

`network.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `pipe` | Named or anonymous pipe. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `quic` | QUIC | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `tcp` | TCP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `udp` | UDP | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `unix` | UNIX domain socket | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

---

<a id="network-type-values"></a>

`network.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `ipv4` | IPv4 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `ipv6` | IPv6 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

## Deprecated Network Attributes

These attributes may be used for any network related operation.

**Attributes:**

| Key | Stability | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- |
| <a id="net-host-ip" href="#net-host-ip">`net.host.ip`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.local.address`. | string | Deprecated, use `network.local.address`. | `192.168.0.1` |
| <a id="net-host-name" href="#net-host-name">`net.host.name`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `server.address`. | string | Deprecated, use `server.address`. | `example.com` |
| <a id="net-host-port" href="#net-host-port">`net.host.port`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `server.port`. | int | Deprecated, use `server.port`. | `8080` |
| <a id="net-peer-ip" href="#net-peer-ip">`net.peer.ip`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.peer.address`. | string | Deprecated, use `network.peer.address`. | `127.0.0.1` |
| <a id="net-peer-name" href="#net-peer-name">`net.peer.name`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `server.address` on client spans and `client.address` on server spans. | string | Deprecated, use `server.address` on client spans and `client.address` on server spans. | `example.com` |
| <a id="net-peer-port" href="#net-peer-port">`net.peer.port`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `server.port` on client spans and `client.port` on server spans. | int | Deprecated, use `server.port` on client spans and `client.port` on server spans. | `8080` |
| <a id="net-protocol-name" href="#net-protocol-name">`net.protocol.name`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.protocol.name`. | string | Deprecated, use `network.protocol.name`. | `amqp`; `http`; `mqtt` |
| <a id="net-protocol-version" href="#net-protocol-version">`net.protocol.version`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.protocol.version`. | string | Deprecated, use `network.protocol.version`. | `3.1.1` |
| <a id="net-sock-family" href="#net-sock-family">`net.sock.family`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Split to `network.transport` and `network.type`. | string | Deprecated, use `network.transport` and `network.type`. | `inet`; `inet6`; `unix` [(see more)](#net-sock-family-values) |
| <a id="net-sock-host-addr" href="#net-sock-host-addr">`net.sock.host.addr`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.local.address`. | string | Deprecated, use `network.local.address`. | `/var/my.sock` |
| <a id="net-sock-host-port" href="#net-sock-host-port">`net.sock.host.port`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.local.port`. | int | Deprecated, use `network.local.port`. | `8080` |
| <a id="net-sock-peer-addr" href="#net-sock-peer-addr">`net.sock.peer.addr`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.peer.address`. | string | Deprecated, use `network.peer.address`. | `192.168.0.1` |
| <a id="net-sock-peer-name" href="#net-sock-peer-name">`net.sock.peer.name`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Removed. No replacement at this time. | string | Deprecated, no replacement at this time. | `/var/my.sock` |
| <a id="net-sock-peer-port" href="#net-sock-peer-port">`net.sock.peer.port`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.peer.port`. | int | Deprecated, use `network.peer.port`. | `65531` |
| <a id="net-transport" href="#net-transport">`net.transport`</a> | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `network.transport`. | string | Deprecated, use `network.transport`. | `ip_tcp`; `ip_udp`; `pipe` [(see more)](#net-transport-values) |

---

<a id="net-sock-family-values"></a>

`net.sock.family` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `inet` | IPv4 address | ![Development](https://img.shields.io/badge/-development-blue) |
| `inet6` | IPv6 address | ![Development](https://img.shields.io/badge/-development-blue) |
| `unix` | UNIX domain socket path | ![Development](https://img.shields.io/badge/-development-blue) |

---

<a id="net-transport-values"></a>

`net.transport` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `inproc` | In-process communication. [14] | ![Development](https://img.shields.io/badge/-development-blue) |
| `ip_tcp` | ip_tcp | ![Development](https://img.shields.io/badge/-development-blue) |
| `ip_udp` | ip_udp | ![Development](https://img.shields.io/badge/-development-blue) |
| `other` | Something else (non IP-based). | ![Development](https://img.shields.io/badge/-development-blue) |
| `pipe` | Named or anonymous pipe. | ![Development](https://img.shields.io/badge/-development-blue) |

**[14]:** Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network attributes can be left out in that case.
