# Network
- [Network Attributes](#network-attributes)
- [Deprecated Network Attributes](#deprecated-network-attributes)
## Network Attributes
These attributes may be used for any network related operation.
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `network.carrier.icc` | string | The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. | `DE` |  |
| `network.carrier.mcc` | string | The mobile carrier country code. | `310` |  |
| `network.carrier.mnc` | string | The mobile carrier network code. | `001` |  |
| `network.carrier.name` | string | The name of the mobile carrier. | `sprint` |  |
| `network.connection.state` | string | The state of network connection [1] | `close_wait` |  |
| `network.connection.subtype` | 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 wifi connection. | `LTE` |  |
| `network.connection.type` | string | The internet connection type. | `wifi` |  |
| `network.interface.name` | string | The network interface name. | `lo`; `eth0` |  |
| `network.io.direction` | string | The network IO operation direction. | `transmit` |  |
| `network.local.address` | string | Local address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` |  |
| `network.local.port` | int | Local port number of the network connection. | `65123` |  |
| `network.peer.address` | string | Peer address of the network connection - IP address or Unix domain socket name. | `10.1.2.80`; `/tmp/my.sock` |  |
| `network.peer.port` | int | Peer port number of the network connection. | `65123` |  |
| `network.protocol.name` | string | [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent. [2] | `amqp`; `http`; `mqtt` |  |
| `network.protocol.version` | string | The actual version of the protocol used for network communication. [3] | `1.1`; `2` |  |
| `network.transport` | string | [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). [4] | `tcp`; `udp` |  |
| `network.type` | string | [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. [5] | `ipv4`; `ipv6` |  |
**[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.protocol.name`:** The value SHOULD be normalized to lowercase.
**[3] `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.
**[4] `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.
**[5] `network.type`:** The value SHOULD be normalized to lowercase.
---
`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 |  |
| `closed` | closed |  |
| `closing` | closing |  |
| `established` | established |  |
| `fin_wait_1` | fin_wait_1 |  |
| `fin_wait_2` | fin_wait_2 |  |
| `last_ack` | last_ack |  |
| `listen` | listen |  |
| `syn_received` | syn_received |  |
| `syn_sent` | syn_sent |  |
| `time_wait` | time_wait |  |
---
`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 |  |
| `cdma2000_1xrtt` | CDMA2000 1XRTT |  |
| `edge` | EDGE |  |
| `ehrpd` | EHRPD |  |
| `evdo_0` | EVDO Rel. 0 |  |
| `evdo_a` | EVDO Rev. A |  |
| `evdo_b` | EVDO Rev. B |  |
| `gprs` | GPRS |  |
| `gsm` | GSM |  |
| `hsdpa` | HSDPA |  |
| `hspa` | HSPA |  |
| `hspap` | HSPAP |  |
| `hsupa` | HSUPA |  |
| `iden` | IDEN |  |
| `iwlan` | IWLAN |  |
| `lte` | LTE |  |
| `lte_ca` | LTE CA |  |
| `nr` | 5G NR (New Radio) |  |
| `nrnsa` | 5G NRNSA (New Radio Non-Standalone) |  |
| `td_scdma` | TD-SCDMA |  |
| `umts` | UMTS |  |
---
`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 |  |
| `unavailable` | unavailable |  |
| `unknown` | unknown |  |
| `wifi` | wifi |  |
| `wired` | wired |  |
---
`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 |  |
| `transmit` | transmit |  |
---
`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. |  |
| `quic` | QUIC |  |
| `tcp` | TCP |  |
| `udp` | UDP |  |
| `unix` | Unix domain socket |  |
---
`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 |  |
| `ipv6` | IPv6 |  |
## Deprecated Network Attributes
These attributes may be used for any network related operation.
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `net.host.ip` | string | Deprecated, use `network.local.address`. | `192.168.0.1` | 
Replaced by `network.local.address`. |
| `net.host.name` | string | Deprecated, use `server.address`. | `example.com` | 
Replaced by `server.address`. |
| `net.host.port` | int | Deprecated, use `server.port`. | `8080` | 
Replaced by `server.port`. |
| `net.peer.ip` | string | Deprecated, use `network.peer.address`. | `127.0.0.1` | 
Replaced by `network.peer.address`. |
| `net.peer.name` | string | Deprecated, use `server.address` on client spans and `client.address` on server spans. | `example.com` | 
Replaced by `server.address` on client spans and `client.address` on server spans. |
| `net.peer.port` | int | Deprecated, use `server.port` on client spans and `client.port` on server spans. | `8080` | 
Replaced by `server.port` on client spans and `client.port` on server spans. |
| `net.protocol.name` | string | Deprecated, use `network.protocol.name`. | `amqp`; `http`; `mqtt` | 
Replaced by `network.protocol.name`. |
| `net.protocol.version` | string | Deprecated, use `network.protocol.version`. | `3.1.1` | 
Replaced by `network.protocol.version`. |
| `net.sock.family` | string | Deprecated, use `network.transport` and `network.type`. | `inet`; `inet6`; `unix` | 
Split to `network.transport` and `network.type`. |
| `net.sock.host.addr` | string | Deprecated, use `network.local.address`. | `/var/my.sock` | 
Replaced by `network.local.address`. |
| `net.sock.host.port` | int | Deprecated, use `network.local.port`. | `8080` | 
Replaced by `network.local.port`. |
| `net.sock.peer.addr` | string | Deprecated, use `network.peer.address`. | `192.168.0.1` | 
Replaced by `network.peer.address`. |
| `net.sock.peer.name` | string | Deprecated, no replacement at this time. | `/var/my.sock` | 
Removed. |
| `net.sock.peer.port` | int | Deprecated, use `network.peer.port`. | `65531` | 
Replaced by `network.peer.port`. |
| `net.transport` | string | Deprecated, use `network.transport`. | `ip_tcp`; `ip_udp`; `pipe` | 
Replaced by `network.transport`. |
---
`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 |  |
| `inet6` | IPv6 address |  |
| `unix` | Unix domain socket path |  |
---
`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. [6] |  |
| `ip_tcp` | ip_tcp |  |
| `ip_udp` | ip_udp |  |
| `other` | Something else (non IP-based). |  |
| `pipe` | Named or anonymous pipe. |  |
**[6]:** 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.