hnodeb: Updates in HNBLLIF and HNBGW_COnnectioNHandler to support and test IuUP

Depends: osmo-hnodeb.git Change-Id Ibe356fa7b1abaca0091e368db8478e79c09c6cb0
Related: SYS#5516
Change-Id: I19612fce8190dfe14f98d346adb5db4e1c2a08d9
This commit is contained in:
Pau Espin 2021-12-21 14:48:23 +01:00
parent 066f46f9d6
commit 58a69df9a5
4 changed files with 116 additions and 20 deletions

View File

@ -248,13 +248,14 @@ runs on HNBGW_ConnHdlr {
}
/* Initialize and start the RTP emulation component for a ConnHdlr */
function f_HNBGW_rtpem_activate(inout octetstring payload,
HostName remote_host,
PortNumber remote_port,
RtpemConfig cfg := c_RtpemDefaultCfg,
RtpemMode mode := RTPEM_MODE_BIDIR)
function f_HNBGW_rtpem_activate(inout octetstring payload)
runs on HNBGW_ConnHdlr {
/* Step 0: initialize, connect and start the emulation component */
/* Initialize, connect and start the emulation component */
var RtpemConfig cfg := c_RtpemDefaultCfg;
cfg.iuup_mode := true;
cfg.iuup_tx_init := false;
cfg.tx_payload_type := 96;
vc_RTPEM := RTP_Emulation_CT.create(testcasename() & "-RTPEM") alive;
map(vc_RTPEM:RTP, system:RTP);
map(vc_RTPEM:RTCP, system:RTCP);
@ -274,11 +275,15 @@ runs on HNBGW_ConnHdlr {
/* Bind the RTP emulation to the configured address */
f_rtpem_bind(RTPEM_CTRL, g_pars.hnbgw_addr, g_pars.hnbgw_rtp_port);
/* Connect to the IUT's address/port parsed from CRCX ACK */
f_rtpem_connect(RTPEM_CTRL, remote_host, remote_port);
/* Set the given RTP emulation mode */
f_rtpem_mode(RTPEM_CTRL, mode);
f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_RXONLY);
}
function f_HNBGW_rtpem_connect(HostName remote_host, PortNumber remote_port)
runs on HNBGW_ConnHdlr {
f_rtpem_connect(RTPEM_CTRL, remote_host, remote_port);
/* Set the given RTP emulation mode */
f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_BIDIR);
}
}

View File

@ -56,6 +56,8 @@ import from GTPU_Types all;
import from GTP_Templates all;
import from GTP_Emulation all;
import from IuUP_Types all;
modulepar {
/* IP address at which the HNodeB can be reached */
charstring mp_hnodeb_ip := "127.0.0.1";
@ -297,6 +299,10 @@ private function f_tc_cs_mo_call(charstring id) runs on HNBGW_ConnHdlr {
var PortNumber hnodeb_rtp_port;
timer Tu;
var uint32_t audio_conn_id;
var IuUP_FQC fqc := IuUP_FQC_GOOD;
rtp_payload := f_rnd_octstring(6);
f_HNBGW_rtpem_activate(rtp_payload);
f_handle_hnbap_hnb_register_req();
@ -326,11 +332,22 @@ private function f_tc_cs_mo_call(charstring id) runs on HNBGW_ConnHdlr {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "hnodeb RTP local address doesn't match expectations");
}
hnodeb_rtp_port := sd.data.u.audio.u.conn_establish.u.cnf.local_rtp_port;
rtp_payload := f_rnd_octstring(6);
f_HNBGW_rtpem_activate(rtp_payload, hnodeb_rtp_addr, hnodeb_rtp_port);
f_HNBGW_rtpem_connect(hnodeb_rtp_addr, hnodeb_rtp_port);
/* We should eventually receive some RTP/IUUP from the HNBGW once Init phase goes on: */
Tu.start(2.0);
alt {
[] LLSK.receive(f_llsk_rx(tr_HNBLLIF_AUDIO_CONN_DATA_IND(audio_conn_id, ?, enum2int(fqc), ?, rtp_payload)));
[] Tu.timeout {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for Downlink speech frames");
}
}
Tu.stop;
f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_RXONLY);
/* Make sure that Uplink frames are received at the HNBGW */
RTPEM_DATA.clear;
LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_DATA_REQ(audio_conn_id, rtp_payload)));
LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_DATA_REQ(audio_conn_id, 1, enum2int(fqc), 0, rtp_payload)));
Tu.start(2.0);
alt {
[] RTPEM_DATA.receive(PDU_RTP:?) -> value rtp_pdu {
@ -345,10 +362,9 @@ private function f_tc_cs_mo_call(charstring id) runs on HNBGW_ConnHdlr {
}
}
Tu.stop;
/* We should also have received some RTP from the HNBGW: */
LLSK.receive(f_llsk_rx(tr_HNBLLIF_AUDIO_CONN_DATA_IND(audio_conn_id, rtp_payload)));
f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_NONE);
f_sleep(0.5); /* give some time to RTP_Emu to stop sending RTP packets... */
LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_RELEASE_REQ(audio_conn_id)));

View File

@ -251,11 +251,42 @@ template (present) HNBLLIF_Message tr_HNBLLIF_IUH_UNITDATA_IND(template (present
/**********************
* AUDIO SAPI
**********************/
const HNBLLIF_AUDIO_IPTIs IPTIs_default := {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
private function f_subflow_sizes_default() return HNBLLIF_AUDIO_SubflowSizes
{
var HNBLLIF_AUDIO_SubflowSizes ss;
for (var integer i := 0; i < HNBLLIF_MAX_RFCIS; i := i + 1) {
for (var integer j := 0; j < HNBLLIF_MAX_SUBFLOWS; j := j + 1) {
ss[i][j] := 0;
}
}
ss[0][0] := 81; ss[0][1] := 103; ss[0][2] := 60;
ss[1][0] := 39; ss[1][1] := 0; ss[1][2] := 0;
ss[2][0] := 0; ss[2][1] := 0; ss[2][2] := 0;
return ss;
}
template (value) HNBLLIF_Message ts_HNBLLIF_AUDIO_CONN_ESTABLISH_REQ(template (value) uint32_t context_id,
template (value) uint16_t remote_rtp_port,
template (value) HNBLLIF_AddrType remote_rtp_address_type,
template (value) HNBLLIF_Addr remote_addr) := {
template (value) HNBLLIF_Addr remote_addr,
template (value) uint8_t transparent := 0,
template (value) uint8_t data_pdu_type := 0,
template (value) uint16_t supported_versions_mask := 3,
template (value) uint8_t num_rfci := 3,
template (value) uint8_t num_subflows := 3,
template (value) HNBLLIF_AUDIO_SubflowSizes subflow_sizes := f_subflow_sizes_default(),
template (value) uint8_t IPTIs_present := 0,
template (value) HNBLLIF_AUDIO_IPTIs IPTIs := IPTIs_default) := {
sapi := HNBLL_IF_SAPI_AUDIO,
u := {
audio := {
@ -269,7 +300,15 @@ template (value) HNBLLIF_Message ts_HNBLLIF_AUDIO_CONN_ESTABLISH_REQ(template (v
remote_rtp_port := remote_rtp_port,
reserved := 0,
remote_rtp_address_type := remote_rtp_address_type,
remote_addr := remote_addr
remote_addr := remote_addr,
transparent := transparent,
data_pdu_type := data_pdu_type,
supported_versions_mask := supported_versions_mask,
num_rfci := num_rfci,
num_subflows := num_subflows,
subflow_sizes := subflow_sizes,
IPTIs_present := IPTIs_present,
IPTIs := IPTIs
}
}
}
@ -327,7 +366,10 @@ template (value) HNBLLIF_Message ts_HNBLLIF_AUDIO_CONN_RELEASE_REQ(template (val
}
template (present) HNBLLIF_Message tr_HNBLLIF_AUDIO_CONN_DATA_IND(template (present) uint32_t audio_conn_id := ?,
template (present) octetstring data := ?) := {
template (present) uint8_t frame_nr := ?,
template (present) uint8_t fqc := ?,
template (present) uint8_t rfci := ?,
template (present) octetstring data := ?) := {
sapi := HNBLL_IF_SAPI_AUDIO,
u := {
audio := {
@ -338,6 +380,10 @@ template (present) HNBLLIF_Message tr_HNBLLIF_AUDIO_CONN_DATA_IND(template (pres
u := {
ind := {
audio_conn_id := audio_conn_id,
frame_nr := frame_nr,
fqc := fqc,
rfci := rfci,
spare := 0,
data_len := ?,
data := data
}
@ -349,6 +395,9 @@ template (present) HNBLLIF_Message tr_HNBLLIF_AUDIO_CONN_DATA_IND(template (pres
}
template (value) HNBLLIF_Message ts_HNBLLIF_AUDIO_CONN_DATA_REQ(template (value) uint32_t audio_conn_id,
template (value) uint8_t frame_nr,
template (value) uint8_t fqc,
template (value) uint8_t rfci,
template (value) octetstring data) := {
sapi := HNBLL_IF_SAPI_AUDIO,
u := {
@ -360,6 +409,10 @@ template (value) HNBLLIF_Message ts_HNBLLIF_AUDIO_CONN_DATA_REQ(template (value)
u := {
req := {
audio_conn_id := audio_conn_id,
frame_nr := frame_nr,
fqc := fqc,
rfci := rfci,
spare := 0,
data_len := lengthof(data),
data := data
}

View File

@ -241,14 +241,28 @@ type enumerated HNBLLIF_AUDIO_MsgType {
HNBLL_IF_AUDIO_MSG_CONN_DATA ('0002'O)
} with { variant "FIELDLENGTH(16)" };
const integer HNBLLIF_MAX_RFCIS := 64;
const integer HNBLLIF_MAX_SUBFLOWS := 7;
type record length(HNBLLIF_MAX_RFCIS) of uint8_t HNBLLIF_AUDIO_IPTIs;
type record length(HNBLLIF_MAX_SUBFLOWS) of uint16_t HNBLLIF_AUDIO_RFCI_SubflowSizes;
type record length(HNBLLIF_MAX_RFCIS) of HNBLLIF_AUDIO_RFCI_SubflowSizes HNBLLIF_AUDIO_SubflowSizes;
/* CONN_ESTABLISH */
type record HNBLLIF_AUDIO_conn_establish_req {
uint32_t context_id,
uint16_t remote_rtp_port,
uint8_t reserved,
HNBLLIF_AddrType remote_rtp_address_type,
HNBLLIF_Addr remote_addr
} with { variant "" };
HNBLLIF_Addr remote_addr,
uint8_t transparent, /* 1=transparent; 0=SMpSDU */
uint8_t data_pdu_type,
uint16_t supported_versions_mask, /* host byte order */
uint8_t num_rfci,
uint8_t num_subflows,
HNBLLIF_AUDIO_SubflowSizes subflow_sizes,
uint8_t IPTIs_present, /* 1=present; 0=not present */
HNBLLIF_AUDIO_IPTIs IPTIs /* values range 0-15, 4 bits */
} with { variant "" };
type record HNBLLIF_AUDIO_conn_establish_cnf {
uint32_t context_id,
@ -292,12 +306,20 @@ type record HNBLLIF_AUDIO_PrimOp_conn_release {
/* CONN_DATA */
type record HNBLLIF_AUDIO_conn_data_ind {
uint32_t audio_conn_id,
uint8_t frame_nr,
uint8_t fqc, /* enumerated IuUP_FQC */
uint8_t rfci,
uint8_t spare,
uint32_t data_len,
octetstring data /* RANAP message */
} with { variant (data_len) "LENGTHTO (data)" };
type record HNBLLIF_AUDIO_conn_data_req {
uint32_t audio_conn_id,
uint8_t frame_nr,
uint8_t fqc, /* enumerated IuUP_FQC */
uint8_t rfci,
uint8_t spare,
uint32_t data_len,
octetstring data /* RANAP message */
} with { variant (data_len) "LENGTHTO (data)" };