Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
5e47fa4d
Commit
5e47fa4d
authored
Feb 25, 2019
by
frtabu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ocp_simulator' of
https://gitlab.eurecom.fr/oai/openairinterface5g
into ocp_simulator
parents
6460a32b
382ce8f9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
55 deletions
+66
-55
cmake_targets/build_oai
cmake_targets/build_oai
+2
-2
openair2/LAYER2/MAC/mac_vars.h
openair2/LAYER2/MAC/mac_vars.h
+3
-1
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+1
-3
openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
+1
-1
openair2/RRC/LTE/rrc_UE.c
openair2/RRC/LTE/rrc_UE.c
+3
-3
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+2
-2
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+5
-0
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+49
-43
No files found.
cmake_targets/build_oai
View file @
5e47fa4d
...
...
@@ -187,7 +187,7 @@ function main() {
shift
;;
-C
|
--clean-all
)
CLEAN_ALL
=
1
shift
;;
shift
;;
--clean-kernel
)
clean_kernel
echo_info
"Erased iptables config and removed modules from kernel"
...
...
@@ -417,7 +417,6 @@ function main() {
;;
esac
fi
#Disable CPU Affinity for deadline scheduler
if
[
"
$DEADLINE_SCHEDULER_FLAG_USER
"
=
"True"
]
;
then
CPU_AFFINITY_FLAG_USER
=
"False"
...
...
@@ -509,6 +508,7 @@ function main() {
lte_build_dir
=
lte_build_oai
bin_suffix
=
""
fi
lte_build_dir
=
"lte
${
noS1Dir
}
_build_oai
${
noLOGDirsuffix
}
"
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib
=
params_libconfig
...
...
openair2/LAYER2/MAC/mac_vars.h
View file @
5e47fa4d
...
...
@@ -95,7 +95,9 @@ const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE] = {
uint32_t
RRC_CONNECTION_FLAG
;
UE_MAC_INST
*
UE_mac_inst
;
//[NB_MODULE_MAX];
UE_MAC_INST
*
UE_mac_inst
=
NULL
;
//[NB_MODULE_MAX];
/// Primary component carrier index of eNB
int
pCC_id
[
NUMBER_OF_eNB_MAX
];
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
View file @
5e47fa4d
...
...
@@ -85,8 +85,6 @@ extern uint8_t nfapi_mode;
extern
uint16_t
inst_pdcp_list
[
NUMBER_OF_UE_MAX
];
#endif
extern
Packet_OTG_List_t
*
otg_pdcp_buffer
;
...
...
@@ -122,8 +120,8 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
if
(
LOG_DEBUGFLAG
(
DEBUG_PDCP
)
)
{
debug_pdcp_pc5s_sdu
((
sidelink_pc5s_element
*
)
&
(
sdu_p
->
data
[
sizeof
(
pdcp_data_ind_header_t
)]),
"pdcp_fifo_flush_sdus received aPC5S message"
);
}
}
ret
=
sendto
(
pdcp_pc5_sockfd
,
&
(
sdu_p
->
data
[
sizeof
(
pdcp_data_ind_header_t
)]),
sizeof
(
sidelink_pc5s_element
),
0
,
(
struct
sockaddr
*
)
&
prose_pdcp_addr
,
sizeof
(
prose_pdcp_addr
)
);
}
else
if
(
UE_NAS_USE_TUN
)
{
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
View file @
5e47fa4d
...
...
@@ -248,7 +248,7 @@ void *pdcp_netlink_thread_fct(void *arg)
new_data_p
->
pdcp_read_header
.
data_size
);
}
else
{
LOG_E
(
PDCP
,
"[NETLINK_THREAD] WRONG size %d should be sizeof "
"%l
d
((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))
\n
"
,
"%l
u
((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))
\n
"
,
nas_nlh_rx
->
nlmsg_len
,
sizeof
(
pdcp_data_req_header_t
)
+
sizeof
(
struct
nlmsghdr
));
}
...
...
openair2/RRC/LTE/rrc_UE.c
View file @
5e47fa4d
...
...
@@ -535,7 +535,7 @@ mui_t rrc_mui=0;
/* NAS Attach request with IMSI */
static
const
char
nas_attach_req_imsi
[]
=
{
static
const
char
nas_attach_req_imsi
[]
=
{
0x07
,
0x41
,
/* EPS Mobile identity = IMSI */
0x71
,
0x08
,
0x29
,
0x80
,
0x43
,
0x21
,
0x43
,
0x65
,
0x87
,
...
...
@@ -804,6 +804,7 @@ rrc_ue_establish_drb(
//-----------------------------------------------------------------------------
{
// add descriptor from RRC PDU
int
oip_ifup
=
0
,
ip_addr_offset3
=
0
,
ip_addr_offset4
=
0
;
/* avoid gcc warnings */
(
void
)
oip_ifup
;
...
...
@@ -820,7 +821,7 @@ rrc_ue_establish_drb(
RADIO_ACCESS_BEARER,Rlc_info_um);
*/
if
(
PDCP_USE_NETLINK
)
{
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(
EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U
)
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(
MANAGED_RF) && !defined(ETHERNET
)
ip_addr_offset3
=
0
;
ip_addr_offset4
=
1
;
LOG_I
(
OIP
,
"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d
\n
"
,
ue_mod_idP
,
ip_addr_offset3
+
ue_mod_idP
,
...
...
@@ -843,7 +844,6 @@ rrc_ue_establish_drb(
ipv4_address
(
ip_addr_offset3
+
ue_mod_idP
+
1
,
eNB_index
+
1
));
//daddr
LOG_D
(
RRC
,
"[UE %d] State = Attached (eNB %d)
\n
"
,
ue_mod_idP
,
eNB_index
);
}
# endif
}
return
(
0
);
...
...
openair2/RRC/LTE/rrc_eNB.c
View file @
5e47fa4d
...
...
@@ -6297,8 +6297,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
if
(
PDCP_USE_NETLINK
&&
(
!
LINK_ENB_PDCP_TO_GTPV1U
))
{
// can mean also IPV6 since ether -> ipv6 autoconf
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(
EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADE
RF) && !defined(ETHERNET)
LOG_I
(
OIP
,
"[eNB %d] trying to bring up the OAI interface oai%d
\n
"
,
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(
MANAGED_
RF) && !defined(ETHERNET)
LOG_I
(
OIP
,
"[eNB %d] trying to bring up the OAI interface oai%d
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
module_id
);
oip_ifup
=
nas_config
(
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
5e47fa4d
...
...
@@ -1096,7 +1096,12 @@ extern "C" {
device
->
type
=
USRP_B200_DEV
;
usrp_master_clock
=
30.72e6
;
args
+=
boost
::
str
(
boost
::
format
(
",master_clock_rate=%f"
)
%
usrp_master_clock
);
#if UHD_VERSION < 3131000
args
+=
",num_send_frames=256,num_recv_frames=256, send_frame_size=15360, recv_frame_size=15360"
;
#else
LOG_W
(
HW
,
"Bug in UHD => 3.13.1, reduce paquet size until UHD is fixed
\n
"
);
args
+=
",num_send_frames=256,num_recv_frames=256, send_frame_size=7680, recv_frame_size=7680"
;
#endif
}
if
(
device_adds
[
0
].
get
(
"type"
)
==
"n3xx"
)
{
...
...
targets/ARCH/rfsimulator/simulator.c
View file @
5e47fa4d
/*
Author: Laurent THOMAS, Open Cells for Nokia
copyleft: OpenAirInterface Software Alliance and it's licence
*/
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
...
...
@@ -52,9 +58,9 @@ typedef struct {
uint64_t
initialAhead
;
char
*
ip
;
buffer_t
buf
[
FD_SETSIZE
];
}
tcp_bridge
_state_t
;
}
rfsimulator
_state_t
;
void
allocCirBuf
(
tcp_bridge
_state_t
*
bridge
,
int
sock
)
{
void
allocCirBuf
(
rfsimulator
_state_t
*
bridge
,
int
sock
)
{
buffer_t
*
ptr
=&
bridge
->
buf
[
sock
];
AssertFatal
(
(
ptr
->
circularBuf
=
(
sample_t
*
)
malloc
(
sampleToByte
(
CirSize
,
1
)))
!=
NULL
,
""
);
ptr
->
circularBufEnd
=
((
char
*
)
ptr
->
circularBuf
)
+
sampleToByte
(
CirSize
,
1
);
...
...
@@ -70,7 +76,7 @@ void allocCirBuf(tcp_bridge_state_t *bridge, int sock) {
AssertFatal
(
epoll_ctl
(
bridge
->
epollfd
,
EPOLL_CTL_ADD
,
sock
,
&
ev
)
!=
-
1
,
""
);
}
void
removeCirBuf
(
tcp_bridge
_state_t
*
bridge
,
int
sock
)
{
void
removeCirBuf
(
rfsimulator
_state_t
*
bridge
,
int
sock
)
{
AssertFatal
(
epoll_ctl
(
bridge
->
epollfd
,
EPOLL_CTL_DEL
,
sock
,
NULL
)
!=
-
1
,
""
);
close
(
sock
);
free
(
bridge
->
buf
[
sock
].
circularBuf
);
...
...
@@ -80,7 +86,7 @@ void removeCirBuf(tcp_bridge_state_t *bridge, int sock) {
#define helpTxt "\
\x1b[31m\
tcp_bridge
: error: you have to run one UE and one eNB\n\
rfsimulator
: error: you have to run one UE and one eNB\n\
For this, export RFSIMULATOR=enb (eNB case) or \n\
RFSIMULATOR=<an ip address> (UE case)\n\
\x1b[m"
...
...
@@ -126,7 +132,7 @@ void setblocking(int sock, enum blocking_t active) {
}
int
server_start
(
openair0_device
*
device
)
{
tcp_bridge_state_t
*
t
=
(
tcp_bridge
_state_t
*
)
device
->
priv
;
rfsimulator_state_t
*
t
=
(
rfsimulator
_state_t
*
)
device
->
priv
;
t
->
typeStamp
=
MAGICeNB
;
AssertFatal
((
t
->
listen_sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
>=
0
,
""
);
int
enable
=
1
;
...
...
@@ -146,7 +152,7 @@ int server_start(openair0_device *device) {
}
int
start_ue
(
openair0_device
*
device
)
{
tcp_bridge
_state_t
*
t
=
device
->
priv
;
rfsimulator
_state_t
*
t
=
device
->
priv
;
t
->
typeStamp
=
MAGICUE
;
int
sock
;
AssertFatal
((
sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
>=
0
,
""
);
...
...
@@ -159,14 +165,14 @@ int start_ue(openair0_device *device) {
bool
connected
=
false
;
while
(
!
connected
)
{
LOG_I
(
HW
,
"
tcp_bridge
: trying to connect to %s:%d
\n
"
,
t
->
ip
,
PORT
);
LOG_I
(
HW
,
"
rfsimulator
: trying to connect to %s:%d
\n
"
,
t
->
ip
,
PORT
);
if
(
connect
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
==
0
)
{
LOG_I
(
HW
,
"
tcp_bridge
: connection established
\n
"
);
LOG_I
(
HW
,
"
rfsimulator
: connection established
\n
"
);
connected
=
true
;
}
perror
(
"
tcp_bridge
"
);
perror
(
"
rfsimulator
"
);
sleep
(
1
);
}
...
...
@@ -176,8 +182,8 @@ int start_ue(openair0_device *device) {
return
0
;
}
int
tcp_bridge
_write
(
openair0_device
*
device
,
openair0_timestamp
timestamp
,
void
**
samplesVoid
,
int
nsamps
,
int
nbAnt
,
int
flags
)
{
tcp_bridge
_state_t
*
t
=
device
->
priv
;
int
rfsimulator
_write
(
openair0_device
*
device
,
openair0_timestamp
timestamp
,
void
**
samplesVoid
,
int
nsamps
,
int
nbAnt
,
int
flags
)
{
rfsimulator
_state_t
*
t
=
device
->
priv
;
for
(
int
i
=
0
;
i
<
FD_SETSIZE
;
i
++
)
{
buffer_t
*
ptr
=&
t
->
buf
[
i
];
...
...
@@ -199,7 +205,7 @@ int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void
n
=
fullwrite
(
ptr
->
conn_sock
,
(
void
*
)
tmpSamples
,
sampleToByte
(
nsamps
,
nbAnt
));
if
(
n
!=
sampleToByte
(
nsamps
,
nbAnt
)
)
{
LOG_E
(
HW
,
"
tcp_bridge
: write error ret %d (wanted %ld) error %s
\n
"
,
n
,
sampleToByte
(
nsamps
,
nbAnt
),
strerror
(
errno
));
LOG_E
(
HW
,
"
rfsimulator
: write error ret %d (wanted %ld) error %s
\n
"
,
n
,
sampleToByte
(
nsamps
,
nbAnt
),
strerror
(
errno
));
abort
();
}
...
...
@@ -213,7 +219,7 @@ int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void
return
nsamps
;
}
bool
flushInput
(
tcp_bridge
_state_t
*
t
)
{
bool
flushInput
(
rfsimulator
_state_t
*
t
)
{
// Process all incoming events on sockets
// store the data in lists
struct
epoll_event
events
[
FD_SETSIZE
]
=
{
0
};
...
...
@@ -320,11 +326,12 @@ bool flushInput(tcp_bridge_state_t *t) {
return
nfds
>
0
;
}
int
tcp_bridge_read
(
openair0_device
*
device
,
openair0_timestamp
*
ptimestamp
,
void
**
samplesVoid
,
int
nsamps
,
int
nbAnt
)
{
if
(
nbAnt
!=
1
)
{
LOG_E
(
HW
,
"tcp_bridge: only 1 antenna tested
\n
"
);
exit
(
1
);
}
tcp_bridge_state_t
*
t
=
device
->
priv
;
LOG_D
(
HW
,
"Enter tcp_bridge_read, expect %d samples, will release at TS: %ld
\n
"
,
nsamps
,
t
->
nextTimestamp
+
nsamps
);
int
rfsimulator_read
(
openair0_device
*
device
,
openair0_timestamp
*
ptimestamp
,
void
**
samplesVoid
,
int
nsamps
,
int
nbAnt
)
{
if
(
nbAnt
!=
1
)
{
LOG_E
(
HW
,
"rfsimulator: only 1 antenna tested
\n
"
);
exit
(
1
);
}
rfsimulator_state_t
*
t
=
device
->
priv
;
LOG_D
(
HW
,
"Enter rfsimulator_read, expect %d samples, will release at TS: %ld
\n
"
,
nsamps
,
t
->
nextTimestamp
+
nsamps
);
// deliver data from received data
// check if a UE is connected
int
first_sock
;
...
...
@@ -406,29 +413,28 @@ int tcp_bridge_read(openair0_device *device, openair0_timestamp *ptimestamp, voi
return
nsamps
;
}
int
tcp_bridge_request
(
openair0_device
*
device
,
void
*
msg
,
ssize_t
msg_len
)
{
int
rfsimulator_request
(
openair0_device
*
device
,
void
*
msg
,
ssize_t
msg_len
)
{
abort
();
return
0
;
}
int
tcp_bridge
_reply
(
openair0_device
*
device
,
void
*
msg
,
ssize_t
msg_len
)
{
int
rfsimulator
_reply
(
openair0_device
*
device
,
void
*
msg
,
ssize_t
msg_len
)
{
abort
();
return
0
;
}
int
tcp_bridge
_get_stats
(
openair0_device
*
device
)
{
int
rfsimulator
_get_stats
(
openair0_device
*
device
)
{
return
0
;
}
int
tcp_bridge
_reset_stats
(
openair0_device
*
device
)
{
int
rfsimulator
_reset_stats
(
openair0_device
*
device
)
{
return
0
;
}
void
tcp_bridge
_end
(
openair0_device
*
device
)
{}
int
tcp_bridge
_stop
(
openair0_device
*
device
)
{
void
rfsimulator
_end
(
openair0_device
*
device
)
{}
int
rfsimulator
_stop
(
openair0_device
*
device
)
{
return
0
;
}
int
tcp_bridge
_set_freq
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
,
int
exmimo_dump_config
)
{
int
rfsimulator
_set_freq
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
,
int
exmimo_dump_config
)
{
return
0
;
}
int
tcp_bridge
_set_gains
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
int
rfsimulator
_set_gains
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
return
0
;
}
...
...
@@ -436,37 +442,37 @@ int tcp_bridge_set_gains(openair0_device *device, openair0_config_t *openair0_cf
__attribute__
((
__visibility__
(
"default"
)))
int
device_init
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
//set_log(HW,OAILOG_DEBUG);
tcp_bridge_state_t
*
tcp_bridge
=
(
tcp_bridge_state_t
*
)
calloc
(
sizeof
(
tcp_bridge
_state_t
),
1
);
rfsimulator_state_t
*
rfsimulator
=
(
rfsimulator_state_t
*
)
calloc
(
sizeof
(
rfsimulator
_state_t
),
1
);
if
((
tcp_bridge
->
ip
=
getenv
(
"RFSIMULATOR"
))
==
NULL
)
{
if
((
rfsimulator
->
ip
=
getenv
(
"RFSIMULATOR"
))
==
NULL
)
{
LOG_E
(
HW
,
helpTxt
);
exit
(
1
);
}
tcp_bridge
->
typeStamp
=
strncasecmp
(
tcp_bridge
->
ip
,
"enb"
,
3
)
==
0
?
rfsimulator
->
typeStamp
=
strncasecmp
(
rfsimulator
->
ip
,
"enb"
,
3
)
==
0
?
MAGICeNB:
MAGICUE
;
LOG_I
(
HW
,
"
tcp_bridge: running as %s
\n
"
,
tcp_bridge
->
typeStamp
==
MAGICeNB
?
"eNB"
:
"UE"
);
device
->
trx_start_func
=
tcp_bridge
->
typeStamp
==
MAGICeNB
?
LOG_I
(
HW
,
"
rfsimulator: running as %s
\n
"
,
rfsimulator
->
typeStamp
==
MAGICeNB
?
"eNB"
:
"UE"
);
device
->
trx_start_func
=
rfsimulator
->
typeStamp
==
MAGICeNB
?
server_start
:
start_ue
;
device
->
trx_get_stats_func
=
tcp_bridge
_get_stats
;
device
->
trx_reset_stats_func
=
tcp_bridge
_reset_stats
;
device
->
trx_end_func
=
tcp_bridge
_end
;
device
->
trx_stop_func
=
tcp_bridge
_stop
;
device
->
trx_set_freq_func
=
tcp_bridge
_set_freq
;
device
->
trx_set_gains_func
=
tcp_bridge
_set_gains
;
device
->
trx_write_func
=
tcp_bridge
_write
;
device
->
trx_read_func
=
tcp_bridge
_read
;
device
->
trx_get_stats_func
=
rfsimulator
_get_stats
;
device
->
trx_reset_stats_func
=
rfsimulator
_reset_stats
;
device
->
trx_end_func
=
rfsimulator
_end
;
device
->
trx_stop_func
=
rfsimulator
_stop
;
device
->
trx_set_freq_func
=
rfsimulator
_set_freq
;
device
->
trx_set_gains_func
=
rfsimulator
_set_gains
;
device
->
trx_write_func
=
rfsimulator
_write
;
device
->
trx_read_func
=
rfsimulator
_read
;
/* let's pretend to be a b2x0 */
device
->
type
=
USRP_B200_DEV
;
device
->
openair0_cfg
=&
openair0_cfg
[
0
];
device
->
priv
=
tcp_bridge
;
device
->
priv
=
rfsimulator
;
for
(
int
i
=
0
;
i
<
FD_SETSIZE
;
i
++
)
tcp_bridge
->
buf
[
i
].
conn_sock
=-
1
;
rfsimulator
->
buf
[
i
].
conn_sock
=-
1
;
AssertFatal
((
tcp_bridge
->
epollfd
=
epoll_create1
(
0
))
!=
-
1
,
""
);
tcp_bridge
->
initialAhead
=
openair0_cfg
[
0
].
sample_rate
/
1000
;
// One sub frame
AssertFatal
((
rfsimulator
->
epollfd
=
epoll_create1
(
0
))
!=
-
1
,
""
);
rfsimulator
->
initialAhead
=
openair0_cfg
[
0
].
sample_rate
/
1000
;
// One sub frame
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment