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

# Session related operations

This section describes how to debug session-related aspects in UPG. These commands should be executed in the UPG pod running in the Core Cluster.

1. [Check sessions status](#check-sessions-status)
1. [Check flows status](#check-flows-info)

## Check Sessions Status

The number of sessions handled per UPG instance is exposed with the metric `vpp_upf_total_sessions`.

To display detailed PFCP session information, run inside the UPG pod:

```bash
vppctl show upf session
```

> **Warning**
>
> Note that the output can be very large and may affect the UPG operation, or
cause it to stop. By default result is limited to 100 entries.

To print more than 100 entries in session output, use `show upf session limit N` where `N` set to `0` means no limit.

For a description of the known session SEID, filtering may be used:

```bash
vppctl show upf session up seid 0x898ca65801c51af2
```

And to display flows related to the selected session:

```bash
vppctl show upf session up seid 0x898ca65801c51af2 flows
```

This filters by UP (User Plane) SEID (at the moment, the CP and UPG SEIDs are the same, but later that may change).

In the first line, the `peer` is visible; this is the IP address of SMC.

```
Session id=1 SEIDs UP:0x527f3fe7fbc350ef CP:0x527f3fe7fbc350ef peer=172.20.0.10
Status: flow_mode=disabled inactivity=43200s thread=0 created: 2026/02/12 14:07:12.254
User ID: IMSI:901406000520011,IMEI:0898802406000630,MSISDN:88228560500011
Last packets UL: 2026/02/12 14:07:25.258 DL: (none)
- Endpoint[0]: nwi=epc intf=access UL ue_ip4=10.25.83.236
    gtpu: teid=0xF3B60239 choose=0x01 ep4=198.18.0.20
  - PDR#2[0]: prec=100 far=#2 urrs=#[1,2]
      match: permit out ip from any to assigned
- Endpoint[1]: nwi=sgi intf=sgi DL fib4=1 ue_ip4=10.25.83.236
  - PDR#1[1]: prec=100 far=#1 urrs=#[1,2]
      match: permit out ip from any to assigned
- FAR#2[0]: FORWARD nwi=sgi intf=sgi
- FAR#1[1]: FORWARD nwi=epc intf=access
    gtpu: teid=0x8055000C addr4=198.18.0.31
- URR#1[0]: seq=0 [duration,volume,] next_timer=(never)
    triggers: []
    status: [ ]
    start: 2026/02/12 14:07:12.254  first: 2026/02/12 14:07:17.258  last: 2026/02/12 14:07:25.258
    bytes: total=168 ul=168 dl=0
    packets: total=2 ul=2 dl=0
    duration: 20s
- URR#2[1]: seq=0 [duration,volume,] next_timer=2026/02/12 14:11:57.254
    triggers: [VOLTH,TIMTH,VOLQU,TIMQU,QUVTI,]
    status: [ ]
    start: 2026/02/12 14:07:12.254  first: 2026/02/12 14:07:17.258  last: 2026/02/12 14:07:25.258
    bytes: total=168 ul=168 dl=0
    packets: total=2 ul=2 dl=0
    duration: 20s
    vol_quota: total=2147483648 ul=0 dl=0
    vol_quota_left: total=2147483648 ul=0 dl=0
    vol_threshold: total=1073741824 ul=0 dl=0
    vol_threshold_left: total=1073741824 ul=0 dl=0
    time_quota: 960s
    time_quota_left: 960s
    time_threshold: 840s
    time_threshold_left: 840s
    quota_validity_time: 285s base=2026/02/12 14:07:12.254
    monitoring_time: 2026/02/12 14:12:00.000
```

A bit of explanation regarding the abbreviations used in the output:

- SEID being the Session Identifier
- PDR stands for Packet Detection Rule
- FAR stands for Forwarding Action Rule
- URR stands for Usage Reporting Rule

Interpreting the session configuration based on the example above:

1. The session has 2 endpoints:
   a. `Endpoint[0]` represents the upload direction from User Equipment.
      1. It uses **epc** NWI for the "mobile network" side of the UPG.
      2. The User Equipment IP is `10.25.83.236`.
      3. This connection has Tunnel Endpoint ID (teid) and UPG's Access IP (`198.18.0.20`).
      4. The linked PDR is `PDR#2`,
         1. Defines that `FAR#2` should be applied to this traffic.
         2. URRs `URR1` and `URR2` are used
   b. `Endpoint[1]` represents the download direction to the User Equipment.
      1. It uses **sgi** NWI for the WAN side of the UPG.
      2. The User Equipment IP is `10.25.83.236`.
      3. The linked PDR is `PDR#1`,
         1. Defines that `FAR#1` should be applied to this traffic.
         2. URRs `URR1` and `URR2` are used
2. So the defined packet forwardings are:
   1. The UE traffic from **epc** NWI should be forwarded to **sgi** NWI
   2. The WAN traffic from the **sgi** NWI should be forwarded to UE using **epc** NWI

The following output shows session info when `TDF` mode is enabled:

```
Session id=10 SEIDs UP:0x8b7e3af895a569e7 CP:0x8b7e3af895a569e7 peer=172.18.0.32
Status: flow_mode=create thread=0 created: 2026/02/12 12:39:20.281
User ID: IMSI:001010100000009,IMEI:2222900000090,MSISDN:444440000009
Last packets UL: 2026/02/12 12:41:57.855 DL: 2026/02/12 12:41:57.832
- Endpoint[0]: nwi=access intf=access UL fib4=4 ue_ip4=10.19.76.32
  - PDR#4[0]: prec=100 far=#4 urrs=#[1,2,5]
      match: permit out ip from 198.19.0.0/24 to assigned
  - PDR#2[2]: prec=200 far=#2 urrs=#[1,2,3,4]
      match: permit out ip from any to assigned
- Endpoint[1]: nwi=sgi-de intf=sgi DL fib4=1 ue_ip4=10.19.76.32
  - PDR#3[1]: prec=100 far=#3 urrs=#[1,2,5]
      match: permit out ip from 198.19.0.0/24 to assigned
  - PDR#1[3]: prec=200 far=#1 urrs=#[1,2,3,4]
      match: permit out ip from any to assigned
- FAR#4[0]: FORWARD nwi=sgi-de intf=sgi nat
- FAR#2[1]: FORWARD nwi=sgi-de intf=sgi nat
- FAR#3[2]: FORWARD nwi=access intf=access
- FAR#1[3]: FORWARD nwi=access intf=access
- URR#1[0]: seq=0 [duration,volume,] next_timer=(never)
    triggers: []
    status: [ ]
    start: 2026/02/12 12:39:20.281  first: 2026/02/12 12:39:20.313  last: 2026/02/12 12:41:57.855
    bytes: total=11671620 ul=5823112 dl=5848508
    packets: total=31771 ul=15608 dl=16163
    duration: 157s
    linked_urrs: #[3]
- URR#2[1]: seq=0 [duration,volume,] next_timer=2026/02/12 13:09:20.281
    triggers: [PERIO,]
    status: [ ]
    start: 2026/02/12 12:39:20.281  first: 2026/02/12 12:39:20.313  last: 2026/02/12 12:41:57.855
    bytes: total=11671620 ul=5823112 dl=5848508
    packets: total=31771 ul=15608 dl=16163
    duration: 157s
    measurement_period: 1800s base=2026/02/12 12:39:20.281
- URR#5[2]: seq=0 [duration,volume,] next_timer=2026/02/12 13:09:20.281
    triggers: [VOLQU,TIMQU,QUVTI,]
    status: [ ]
    start: 2026/02/12 12:39:20.281  first: 2026/02/12 12:39:20.313  last: 2026/02/12 12:41:57.855
    bytes: total=11671620 ul=5823112 dl=5848508
    packets: total=31771 ul=15608 dl=16163
    duration: 157s
    vol_quota: total=999999999 ul=0 dl=0
    vol_quota_left: total=999999999 ul=0 dl=0
    time_quota: 5400s
    time_quota_left: 5400s
    quota_validity_time: 1800s base=2026/02/12 12:39:20.281
- URR#3[3]: seq=0 [volume,] next_timer=2026/02/12 23:00:00.000
    triggers: [LIUSA,]
    status: [ ]
    start: 2026/02/12 12:39:20.281  first: (none)  last: (none)
    bytes: total=0 ul=0 dl=0
    packets: total=0 ul=0 dl=0
    duration: 0s
    monitoring_time: 2026/02/12 23:00:00.000
- URR#4[4]: seq=0 [duration,volume,] next_timer=2026/02/12 13:09:20.281
    triggers: [VOLQU,TIMQU,QUVTI,]
    status: [ ]
    start: 2026/02/12 12:39:20.281  first: (none)  last: (none)
    bytes: total=0 ul=0 dl=0
    packets: total=0 ul=0 dl=0
    duration: 157s
    vol_quota: total=10000000000 ul=0 dl=0
    vol_quota_left: total=10000000000 ul=0 dl=0
    time_quota: 315602747s
    time_quota_left: 315602747s
    quota_validity_time: 1800s base=2026/02/12 12:39:20.281
- NAT: pool=pool-de addr4=10.100.16.11 ports=1024-1055 binding_id=55
```

## Check Flows Info

The number of flows handled per UPG instance is exposed with metric `vpp_upf_flow_count`.

Starting from UPG 3, not all UPG sessions have flows created. The flows are created in cases when:
- NAT is used
- IPFix is defined
- There are more than 16 ACLs defined for forwarded traffic

To see details of the flows initiated by the UEs, use the command:

```bash
vppctl show upf flows
```

> **Warning**
>
> The output can be very large, and in some cases, this may affect the UPG operation. By default, 100 entries are listed.

To print more than 100 entries in the flows output, use `show upf flow limit N`,
where `N` set to `0` means no limit.

Example output of `show upf flows`:

```bash
flows for worker 0:
[3] UDP 10.22.231.82:10000 <-> 198.19.0.161:20000 sid=3 pkts=5239/5253 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.4:1040
[1] UDP 10.0.28.191:10000 <-> 198.19.0.161:20000 sid=2 pkts=5202/5200 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.3:1040
[2] UDP 10.19.59.62:10000 <-> 198.19.0.161:20000 sid=4 pkts=5151/4754 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.5:1040
[6] UDP 10.1.183.103:10000 <-> 198.19.0.161:20000 sid=7 pkts=5070/5114 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.8:1040
[0] UDP 10.17.175.74:10000 <-> 198.19.0.161:20000 sid=1 pkts=5254/5179 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.2:1040
[5] UDP 10.25.181.195:10000 <-> 198.19.0.161:20000 sid=6 pkts=5101/5389 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.7:1040
[7] UDP 10.20.254.110:10000 <-> 198.19.0.161:20000 sid=8 pkts=4992/5139 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.9:1040
[8] UDP 10.11.143.188:10000 <-> 198.19.0.161:20000 sid=9 pkts=5163/5039 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.10:1040
[4] UDP 10.26.177.4:10000 <-> 198.19.0.161:20000 sid=5 pkts=5254/5389 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.6:1040
[9] UDP 10.19.76.32:10000 <-> 198.19.0.161:20000 sid=10 pkts=5167/5186 pdr=#4[0]/#3[1] lifetime=300s nat=10.100.16.11:1040
```
