<!--
{
  "availability" : [
    "macOS: 10.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SystemConfiguration",
  "identifier" : "/documentation/SystemConfiguration/SCNetworkConnectionCopyStatistics(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "System Configuration"
    ],
    "preciseIdentifier" : "c:@F@SCNetworkConnectionCopyStatistics"
  },
  "title" : "SCNetworkConnectionCopyStatistics(_:)"
}
-->

# SCNetworkConnectionCopyStatistics(_:)

Returns the statistics of the specified connection.

```
func SCNetworkConnectionCopyStatistics(_ connection: SCNetworkConnection) -> CFDictionary?
```

## Parameters

`connection`

The network connection.

## Return Value

The statistics dictionary, or `NULL` if an error occurred (use the [`SCError()`](/documentation/SystemConfiguration/SCError()) function to retrieve the specific error).

## Discussion

A statistics dictionary contains specific dictionaries with statistics for each subcomponent of the service. For example, a statistics dictionary for PPP contains the following sub-dictionaries, keys, and values:

|Sub-dictionary|Key         |Value                                                                                                                  |
|--------------|------------|-----------------------------------------------------------------------------------------------------------------------|
|PPP           |`BytesIn`   |The number of bytes going up into the network stack for any networking protocol without the PPP headers and trailers.  |
|PPP           |`BytesOut`  |The number of bytes coming out of the network stack for any networking protocol without the PPP headers and trailers.  |
|PPP           |`PacketsIn` |The number of packets going up into the network stack for any networking protocol without the PPP headers and trailers.|
|PPP           |`PacketsOut`|The number of packets coming out of the network stack for any networking protocol without the PPP headers and trailers.|
|PPP           |`ErrorsIn`  |The number of errors going up into the network stack for any networking protocol without the PPP headers and trailers. |
|PPP           |`ErrorsOut` |The number of errors coming out of the network stack for any networking protocol without the PPP headers and trailers. |

See [Statistics Dictionary Keys](/documentation/SystemConfiguration/statistics-dictionary-keys) for the keys to use in the statistics dictionary.

---

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)