Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Flexric
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
mosaic5g
Flexric
Commits
15c90ac3
Commit
15c90ac3
authored
1 year ago
by
mir
Browse files
Options
Downloads
Patches
Plain Diff
Python filed ignored by .gitignore added
parent
5e727a42
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!29
Dev to master before release 2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/xApp/python3/xapp_mac_rlc_pdcp_gtp_moni.py
+162
-0
162 additions, 0 deletions
examples/xApp/python3/xapp_mac_rlc_pdcp_gtp_moni.py
test/docker/ubuntu20/Dockerfile
+7
-7
7 additions, 7 deletions
test/docker/ubuntu20/Dockerfile
with
169 additions
and
7 deletions
examples/xApp/python3/xapp_mac_rlc_pdcp_gtp_moni.py
0 → 100644
+
162
−
0
View file @
15c90ac3
import
xapp_sdk
as
ric
import
time
import
os
import
pdb
####################
#### MAC INDICATION CALLBACK
####################
# MACCallback class is defined and derived from C++ class mac_cb
class
MACCallback
(
ric
.
mac_cb
):
# Define Python class 'constructor'
def
__init__
(
self
):
# Call C++ base class constructor
ric
.
mac_cb
.
__init__
(
self
)
# Override C++ method: virtual void handle(swig_mac_ind_msg_t a) = 0;
def
handle
(
self
,
ind
):
# Print swig_mac_ind_msg_t
if
len
(
ind
.
ue_stats
)
>
0
:
t_now
=
time
.
time_ns
()
/
1000.0
t_mac
=
ind
.
tstamp
/
1.0
t_diff
=
t_now
-
t_mac
print
(
'
MAC Indication tstamp =
'
+
str
(
t_mac
)
+
'
latency =
'
+
str
(
t_diff
)
+
'
μs
'
)
# print('MAC rnti = ' + str(ind.ue_stats[0].rnti))
####################
#### RLC INDICATION CALLBACK
####################
class
RLCCallback
(
ric
.
rlc_cb
):
# Define Python class 'constructor'
def
__init__
(
self
):
# Call C++ base class constructor
ric
.
rlc_cb
.
__init__
(
self
)
# Override C++ method: virtual void handle(swig_rlc_ind_msg_t a) = 0;
def
handle
(
self
,
ind
):
# Print swig_rlc_ind_msg_t
if
len
(
ind
.
rb_stats
)
>
0
:
t_now
=
time
.
time_ns
()
/
1000.0
t_rlc
=
ind
.
tstamp
/
1.0
t_diff
=
t_now
-
t_rlc
print
(
'
RLC Indication tstamp =
'
+
str
(
ind
.
tstamp
)
+
'
latency =
'
+
str
(
t_diff
)
+
'
μs
'
)
# print('RLC rnti = '+ str(ind.rb_stats[0].rnti))
####################
#### PDCP INDICATION CALLBACK
####################
class
PDCPCallback
(
ric
.
pdcp_cb
):
# Define Python class 'constructor'
def
__init__
(
self
):
# Call C++ base class constructor
ric
.
pdcp_cb
.
__init__
(
self
)
# Override C++ method: virtual void handle(swig_pdcp_ind_msg_t a) = 0;
def
handle
(
self
,
ind
):
# Print swig_pdcp_ind_msg_t
if
len
(
ind
.
rb_stats
)
>
0
:
t_now
=
time
.
time_ns
()
/
1000.0
t_pdcp
=
ind
.
tstamp
/
1.0
t_diff
=
t_now
-
t_pdcp
print
(
'
PDCP Indication tstamp =
'
+
str
(
ind
.
tstamp
)
+
'
latency =
'
+
str
(
t_diff
)
+
'
μs
'
)
# print('PDCP rnti = '+ str(ind.rb_stats[0].rnti))
####################
#### GTP INDICATION CALLBACK
####################
# Create a callback for GTP which derived it from C++ class gtp_cb
class
GTPCallback
(
ric
.
gtp_cb
):
def
__init__
(
self
):
# Inherit C++ gtp_cb class
ric
.
gtp_cb
.
__init__
(
self
)
# Create an override C++ method
def
handle
(
self
,
ind
):
if
len
(
ind
.
gtp_stats
)
>
0
:
t_now
=
time
.
time_ns
()
/
1000.0
t_gtp
=
ind
.
tstamp
/
1.0
t_diff
=
t_now
-
t_gtp
print
(
'
GTP Indication tstamp =
'
+
str
(
ind
.
tstamp
)
+
'
diff =
'
+
str
(
t_diff
)
+
'
μs
'
)
####################
#### GENERAL
####################
ric
.
init
()
conn
=
ric
.
conn_e2_nodes
()
assert
(
len
(
conn
)
>
0
)
for
i
in
range
(
0
,
len
(
conn
)):
print
(
"
Global E2 Node [
"
+
str
(
i
)
+
"
]: PLMN MCC =
"
+
str
(
conn
[
i
].
id
.
plmn
.
mcc
))
print
(
"
Global E2 Node [
"
+
str
(
i
)
+
"
]: PLMN MNC =
"
+
str
(
conn
[
i
].
id
.
plmn
.
mnc
))
####################
#### MAC INDICATION
####################
mac_hndlr
=
[]
for
i
in
range
(
0
,
len
(
conn
)):
mac_cb
=
MACCallback
()
hndlr
=
ric
.
report_mac_sm
(
conn
[
i
].
id
,
ric
.
Interval_ms_1
,
mac_cb
)
mac_hndlr
.
append
(
hndlr
)
time
.
sleep
(
1
)
####################
#### RLC INDICATION
####################
rlc_hndlr
=
[]
for
i
in
range
(
0
,
len
(
conn
)):
rlc_cb
=
RLCCallback
()
hndlr
=
ric
.
report_rlc_sm
(
conn
[
i
].
id
,
ric
.
Interval_ms_1
,
rlc_cb
)
rlc_hndlr
.
append
(
hndlr
)
time
.
sleep
(
1
)
####################
#### PDCP INDICATION
####################
pdcp_hndlr
=
[]
for
i
in
range
(
0
,
len
(
conn
)):
pdcp_cb
=
PDCPCallback
()
hndlr
=
ric
.
report_pdcp_sm
(
conn
[
i
].
id
,
ric
.
Interval_ms_1
,
pdcp_cb
)
pdcp_hndlr
.
append
(
hndlr
)
time
.
sleep
(
1
)
####################
#### GTP INDICATION
####################
gtp_hndlr
=
[]
for
i
in
range
(
0
,
len
(
conn
)):
gtp_cb
=
GTPCallback
()
hndlr
=
ric
.
report_gtp_sm
(
conn
[
i
].
id
,
ric
.
Interval_ms_1
,
gtp_cb
)
gtp_hndlr
.
append
(
hndlr
)
time
.
sleep
(
1
)
time
.
sleep
(
10
)
### End
for
i
in
range
(
0
,
len
(
mac_hndlr
)):
ric
.
rm_report_mac_sm
(
mac_hndlr
[
i
])
for
i
in
range
(
0
,
len
(
rlc_hndlr
)):
ric
.
rm_report_rlc_sm
(
rlc_hndlr
[
i
])
for
i
in
range
(
0
,
len
(
pdcp_hndlr
)):
ric
.
rm_report_pdcp_sm
(
pdcp_hndlr
[
i
])
for
i
in
range
(
0
,
len
(
gtp_hndlr
)):
ric
.
rm_report_gtp_sm
(
gtp_hndlr
[
i
])
# Avoid deadlock. ToDo revise architecture
while
ric
.
try_stop
==
0
:
time
.
sleep
(
1
)
print
(
"
Test finished
"
)
This diff is collapsed.
Click to expand it.
test/docker/ubuntu20/Dockerfile
+
7
−
7
View file @
15c90ac3
...
...
@@ -32,18 +32,18 @@ RUN cd swig && ./autogen.sh && ./configure --prefix=/usr/ && make && make instal
WORKDIR
/
#asn1
RUN
git clone https://github.com/vlm/asn1c.git /asn1c
RUN
cd
asn1c
&&
\
autoreconf
-iv
&&
\
./configure
&&
\
make
&&
\
make
install
#
RUN git clone https://github.com/vlm/asn1c.git /asn1c
#
RUN cd asn1c && \
#
autoreconf -iv && \
#
./configure && \
#
make && \
#
make install
#flexric
RUN
git clone https://gitlab.eurecom.fr/mosaic5g/flexric /flexric
WORKDIR
/flexric
RUN
git checkout
1bc84a0e3a992517d767150933bd086c3126f4ae
RUN
git checkout
dev
RUN
mkdir
build
&&
\
cd
build
&&
\
cmake ..
&&
make
&&
make
install
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment