> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/upg/2.2/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/upg/2.2/troubleshooting/connectivity.md).

# Connectivity check

## FPP Networks
To get cross-node connectivity with FPP networking, proper VXLAN objects need to be created in the cluster.

To check which `vxlan` network is used by UPG, see Network Attachment Definitions in the cluster:

```bash
$ kubectl get network-attachment-definitions.k8s.cni.cncf.io -n {UPG-NS}
```

Output example:

```bash
NAME                 AGE
...
upg-fpp-prox01-grx   4h57m
upg-fpp-prox01-sgi   4h57m
upg-fpp-prox01-sxb   4h57m
```

To view the full Network Attachment Definition YAML of `upg-fpp-prox01-grx`, run:

```bash
$ kubectl get network-attachment-definitions.k8s.cni.cncf.io -n {UPG-NS} upg-fpp-prox01-grx -oyaml
```

Output example:

```yaml
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
...
  name: upg-fpp-prox01-grx
  namespace: upg-fpp
spec:
  config: |-
    {
      "cniVersion": "0.3.0",
      "ipam": {
        "addresses":
        [
          {
            "address": "198.18.0.20/24"
          }
        ],
        "type": "static"
      },
      "mtu": 9000,
      "name": "grx",
      "table": 100,
      "type": "fpp-cni",
      "vni": 50,
      "vppIfaceType": "memif"
    }
```

VXLAN object with `vni: 50` should be created in the cluster:

```bash
$ kubectl get vxlans.fpp-manager.cennso.com -n {UPG-NS} -owide
```

Output example:

```bash
NAME    VNI
grx50   50
sgi51   51
sx56    56
```

If required VXLAN is missing, it needs to be created. For example:

```yaml
apiVersion: fpp-manager.cennso.com/v1alpha1
kind: VXLAN
metadata:
  labels:
    name: grx50
  name: grx50
  namespace: {UPG-NS}
spec:
  vni: 50
```

## Check IP assignments

To check what IP addresses are configured for the UPG, exec into UPG pod and run:

```bash
$ vppctl sh int address
```

Output example:

```bash
grx (up):
  L3 198.18.0.20/24 ip4 table-id 100 fib-idx 1
local0 (dn):
sgi (up):
  L3 198.19.0.20/24 ip4 table-id 200 fib-idx 2
sxb (up):
  L3 172.20.0.20/24
upf-nwi-cp (up):
upf-nwi-epc (up):
upf-nwi-sgi (up):
```

If addresses are not there, check UPG pod logs in Kubernetes or [VPP logs](https://docs.cennso.com/components/upg/2.2/troubleshooting/verification.md#check-vpp-logs).
VPPInterface objects also can be checked, see the [Interface Verification section](https://docs.cennso.com/components/upg/2.2/troubleshooting/verification.md#check-vpp-interfaces).

## Ping to SMF
Networking connectivity can be checked, if UPG can reach SMF, exec into UPG pod and run:

```bash
$ vppctl ping 172.20.0.10
116 bytes from 172.20.0.10: icmp_seq=1 ttl=64 time=.0951 ms
116 bytes from 172.20.0.10: icmp_seq=2 ttl=64 time=.0705 ms
116 bytes from 172.20.0.10: icmp_seq=3 ttl=64 time=.0709 ms
116 bytes from 172.20.0.10: icmp_seq=4 ttl=64 time=.0686 ms
116 bytes from 172.20.0.10: icmp_seq=5 ttl=64 time=.0677 ms

Statistics: 5 sent, 5 received, 0% packet loss
```

`172.20.0.10` is the SMF IP address. It should be known from the deployment topology.

If the endpoint is not reachable, check if [FPP networks](#fpp-networks) are configured correctly.

## Ping to GRX Peer

Connectivity can be checked toward GRX gateway, exec to UPG pod and run:

```bash
$ vppctl ping 198.18.0.30 source grx
116 bytes from 198.18.0.30: icmp_seq=1 ttl=64 time=.1215 ms
116 bytes from 198.18.0.30: icmp_seq=2 ttl=64 time=.1132 ms
116 bytes from 198.18.0.30: icmp_seq=3 ttl=64 time=.1145 ms
116 bytes from 198.18.0.30: icmp_seq=4 ttl=64 time=.1681 ms
116 bytes from 198.18.0.30: icmp_seq=5 ttl=64 time=.1085 ms

Statistics: 5 sent, 5 received, 0% packet loss
```

`198.18.0.30` is an IP address in GRX/Access network. It should be known from the deployment topology.

## Ping to SGI side

UPG in `PGW` mode can also reach the SGi network with a ping probe, run from the UPG pod:

```bash
$ vppctl ping 198.19.0.100 source sgi
116 bytes from 198.19.0.100: icmp_seq=1 ttl=64 time=.1783 ms
116 bytes from 198.19.0.100: icmp_seq=2 ttl=64 time=.1173 ms
116 bytes from 198.19.0.100: icmp_seq=3 ttl=64 time=.1521 ms
116 bytes from 198.19.0.100: icmp_seq=4 ttl=64 time=.1151 ms
116 bytes from 198.19.0.100: icmp_seq=5 ttl=64 time=.1143 ms

Statistics: 5 sent, 5 received, 0% packet loss
```

It is useful to check the next hop IP address in SGi network, which can verify UPG's ability to
route User Equipment traffic.

## Check PFCP traffic

UPG hosts the PFCP server, which listens on port 8805. PFCP communication is initiated from SMF, using UDP datagrams.

To diagnose if PFCP connectivity is working OK, try to dump traffic in SMF or UPG pod on the SX interface.
To dump traffic in the UPG pod, follow the [`How to capture traffic in UPG`](https://docs.cennso.com/components/upg/2.2/troubleshooting/traffic-capturing.md#traffic-capturing) section.

After a successful traffic dump, check if `PFCP Heartbeat Request` is received in UPG from SMF.
Also, check if `PFCP Heartbeat Response` is sent from UPG to SMF.

If no heartbeat messages are visible in PCAPs, please check UPG [SX IP address](#check-ip-assignments), SMF configuration
and [FPP networks](#fpp-networks).
