travelping / upg-vpp

User Plane Gateway (UPG) based on VPP
Apache License 2.0
150 stars 51 forks source link

Fix and improve 'show upf session' #296

Closed ivan4th closed 2 years ago

ivan4th commented 2 years ago

Fix filtering by hex UP SEIDs (show upf session up seid 0x...) Add show upf session 0x... flows to show the flows related to the session. Limit show upf session to displaying 100 sessions by default. This can be overridden via show upf session limit N (limit 0 stands for unlimited)

hwinkel commented 2 years ago

Do we have by IMSI as well, as we signal the imsi now down to UPG from SMC As part of PFCP IEs

RoadRunnr commented 2 years ago

Do we have by IMSI as well, as we signal the imsi now down to UPG from SMC As part of PFCP IEs

This would require additional hashes to index the session by IMSI/IMEI/MSISDN/what-not. The overhead and potential for problems is IMHO not worth it.

ivan4th commented 2 years ago

Well, risk-wise a dumber approach of traversing the whole session pool looking for a particular IMSI might not be that bad, if it is not done repeatedly in a tight loop, which typically doesn't happen during CLI debug sessions.

From the experience, show upf flows doesn't cause disruptions most of the time despite going over the whole flowtable, and the session pool usually contains fewer entries. The risk of the disruption from show upf session stems from generating the output, not from examining the data structures.

ivan4th commented 2 years ago

Updated the PR. The syntax now is

show upf session [up seid 0x... [flows]] [limit N]

Indeed, I think showing just 100 sessions are still useful b/c of 2 possibilities 1) Pure debug/test settings where the actual number of sessions is less than 100 2) To get some clues from a small subset of sessions in the system

And having the limit in place by default is also critical b/c show upf session is known to have caused actual UPG crashes in prod due to the amount of output.

I've also added limit N option to show upf flows. There's no limit by default b/c as far as I know, UPG never ever has crashed in prod when executing this command. But the limit may be useful for synthetic situations where unusually high number of flows is created using TPLoad or TRex, for example.