> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/6.16/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/tposs/6.16/troubleshooting/traffic.md).

# Capturing TPOSS traffic

You can monitor and capture the incoming and outgoing TPOSS traffic with tools like [tcpdump](https://www.tcpdump.org/). However, the main TPOSS container is rootless, meaning it doesn't have permission to write data to disk. This may prevent you from capturing and storing traffic within the TPOSS container. For this case, TPOSS provides support for a [sidecar container](https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/). You can enable the `networkUtility` sidecar container in the TPOSS deployment for debugging purposes using the following configuration options:

```yaml
networkUtility:
  enabled: true
  image:
    repository: quay.io/travelping/nettools
    tag: v1.12.0
    pullPolicy: IfNotPresent
```

TPOSS provides the following interfaces and ports on which you can capture and collect traffic:

- RADIUS - The underlying protocol is `UDP`. The default ports are `1812` (RADIUS authentication), `1813` (RADIUS accounting) and `3799` ([RADIUS CoA and Disconnect](https://datatracker.ietf.org/doc/html/rfc5176)). The ports of the TPOSS RADIUS servers might be different in a live deployment. For more information, see the [RADIUS settings](https://docs.cennso.com/components/tposs/6.16/configuration/radius.md).
- Diameter - The underlying protocol is `TCP`. The default port is `3868`. The port of the TPOSS Diameter server might be different in a live deployment. For more information, see the [Diameter settings](https://docs.cennso.com/components/tposs/6.16/configuration/diameter.md).
- TPOSS HTTP API - The underlying protocol is `TCP`. The default port is `8080`. The port of the TPOSS HTTP server might be different in a live deployment. For more information, see the [API overview](https://docs.cennso.com/components/tposs/6.16/api-reference/api.md).
- SBI - The underlying protocol is `TCP`. The default port is the same as the `TPOSS HTTP API`.

Using the debug sidecar container, you can run `tcpdump` utility for the temporary traffic capturing. To do so, run this command:

```bash
( kubectl -ntesting exec tposs-tposs-0 -ctposs-debugging-sidecar -- tcpdump -p -w - -s0 udp port 1812 or 1813 or 3799 -lUni any | sudo wireshark -k -i - )
```

The output from tcpdump is redirected to locally launched [Wireshark](https://www.wireshark.org/). It allows you to observe and filter the captured traffic. To rotate files with the captured traffic, you can use the [standard tcpdump options](https://www.tcpdump.org/manpages/tcpdump.1.html) `-G` and `-w` with the suitable values:

```bash
tcpdump -s0 udp port 1812 or 1813 or 3799 -lUni any -W 10 -C 1 -G 1800 -w 'trace_%Y_%m_%d_%H_%M_%S.pcap'
```

To simplify capturing and analysing the traffic, you can collect only a certain part using the tcpdump or Wireshark filtering. Here is the list of the Wireshark filters that you can use to analyze the incoming and outgoing traffic:

- `radius` - filter the RADIUS packets only.
- `diameter` - filter the Diameter packets only.
- `radius || diameter` - filter the RADIUS and Diameter packets only.
- `diameter.cmd.code != 280` - exclude Diameter watchdog messages.
- `e212.imsi = {IMSI}` - filter requests by IMSI.
- `radius.Framed-IP-Address == {FRAMED-IP-ADDRESS} || diameter.Framed-IP-Address == "{FRAMED-IP-ADDRESS}"` - filter requests by RADIUS and Diameter packets with the given `Framed-IP-Address`.
- `diameter.Session-Id == {SESSION-ID} || e212.imsi == {IMSI}` - filter requests by the `Session-Id` and IMSI to catch the network and service sessions related to each other.
- `frame.number in {100, 102}` - filter packets with the given frame numbers. It can be useful to show the RADIUS or Diameter responses for the filtered requests.

You can find more information on filtering RADIUS and Diameter packets in the [RADIUS protocol filter reference](https://www.wireshark.org/docs/dfref/r/radius.html) and [Diameter protocol filter reference](https://www.wireshark.org/docs/dfref/d/diameter.html).
