Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
oai-cn5g-fed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
cn5g
oai-cn5g-fed
Merge requests
!50
vpp tutorial update
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
vpp tutorial update
vpp_tutorial_update
into
master
Overview
7
Commits
3
Pipelines
0
Changes
4
All threads resolved!
Hide all comments
Merged
Rohan
requested to merge
vpp_tutorial_update
into
master
2 years ago
Overview
7
Commits
3
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Expand
0
0
Merge request reports
Compare
version 3
version 4
7c9dc1ea
2 years ago
version 3
3de55841
2 years ago
version 2
58246633
2 years ago
version 1
f15d307a
2 years ago
master (base)
and
latest version
latest version
ae44cd33
3 commits,
2 years ago
version 4
7c9dc1ea
3 commits,
2 years ago
version 3
3de55841
2 commits,
2 years ago
version 2
58246633
1 commit,
2 years ago
version 1
f15d307a
1 commit,
2 years ago
Show latest version
2 files
+
204
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
ci-scripts/validateN4UpfReportMessages.py
0 → 100644
+
113
−
0
Options
"""
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the
"
License
"
); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an
"
AS IS
"
BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------------
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
"""
import
argparse
import
os
import
re
import
sys
class
N4Statistics
():
def
__init__
(
self
):
self
.
nbN4Messages
=
0
self
.
totalDuration
=
0
self
.
nbPacketsTotal
=
0
self
.
nbPacketsDL
=
0
self
.
nbPacketsUL
=
0
self
.
totalVolume
=
0
self
.
dlVolume
=
0
self
.
ulVolume
=
0
def
printStats
(
self
):
print
(
f
'
Received
{
self
.
nbN4Messages
}
N4 SESSION REPORT REQUESTS from an UPF
'
)
print
(
f
'
- for a total duration of
{
self
.
totalDuration
}
seconds
'
)
print
(
f
'
- Total Number of Packets :
{
self
.
nbPacketsTotal
}
'
)
print
(
f
'
- DL Number of Packets :
{
self
.
nbPacketsDL
}
'
)
print
(
f
'
- UL Number of Packets :
{
self
.
nbPacketsUL
}
'
)
print
(
f
'
- Total Volume :
{
self
.
totalVolume
}
bytes
'
)
print
(
f
'
- DL Volume :
{
self
.
dlVolume
}
bytes
'
)
print
(
f
'
- UL Volume :
{
self
.
ulVolume
}
bytes
'
)
def
main
()
->
None
:
args
=
_parse_args
()
status
=
analyzeSmfLog
(
args
.
filename
)
sys
.
exit
(
status
)
def
_parse_args
()
->
argparse
.
Namespace
:
parser
=
argparse
.
ArgumentParser
(
description
=
'
Analysis for SMF/UPF N4 Report messages
'
)
parser
.
add_argument
(
'
--filename
'
,
'
-f
'
,
action
=
'
store
'
,
required
=
True
,
help
=
'
Absolute path to the SMF file to analyze
'
)
return
parser
.
parse_args
()
def
analyzeSmfLog
(
logfile
):
if
not
os
.
path
.
isfile
(
logfile
):
print
(
f
'
{
logfile
}
does not exist!
'
)
return
-
1
stats
=
N4Statistics
()
with
open
(
logfile
,
'
r
'
)
as
smfLog
:
printSection
=
False
packetSection
=
False
volumeSection
=
False
for
line
in
smfLog
:
if
re
.
search
(
'
Received N4 SESSION REPORT REQUEST from an UPF
'
,
line
):
printSection
=
True
stats
.
nbN4Messages
+=
1
if
re
.
search
(
'
itti_n4_session_report_response
'
,
line
):
printSection
=
False
volumeSection
=
False
packetSection
=
False
if
printSection
:
res
=
re
.
search
(
'
Duration -> (?P<duration>[0-9]+)
'
,
line
)
if
res
is
not
None
:
stats
.
totalDuration
+=
int
(
res
.
group
(
'
duration
'
))
res
=
re
.
search
(
'
NoP Total -> (?P<total>[0-9]+)
'
,
line
)
if
res
is
not
None
:
stats
.
nbPacketsTotal
+=
int
(
res
.
group
(
'
total
'
))
packetSection
=
True
volumeSection
=
False
res
=
re
.
search
(
'
Volume Total -> (?P<total>[0-9]+)
'
,
line
)
if
res
is
not
None
:
stats
.
totalVolume
+=
int
(
res
.
group
(
'
total
'
))
volumeSection
=
True
packetSection
=
False
res
=
re
.
search
(
'
Uplink -> (?P<ul>[0-9]+)
'
,
line
)
if
res
is
not
None
and
packetSection
:
stats
.
nbPacketsUL
+=
int
(
res
.
group
(
'
ul
'
))
if
res
is
not
None
and
volumeSection
:
stats
.
ulVolume
+=
int
(
res
.
group
(
'
ul
'
))
res
=
re
.
search
(
'
Downlink -> (?P<dl>[0-9]+)
'
,
line
)
if
res
is
not
None
and
packetSection
:
stats
.
nbPacketsDL
+=
int
(
res
.
group
(
'
dl
'
))
if
res
is
not
None
and
volumeSection
:
stats
.
dlVolume
+=
int
(
res
.
group
(
'
dl
'
))
smfLog
.
close
()
stats
.
printStats
()
if
stats
.
nbN4Messages
==
0
:
return
-
1
else
:
return
0
if
__name__
==
'
__main__
'
:
main
()
Loading