Commit 6089e10f authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'x/lte-multiru' into xy/lte-multiru

- generic: mme_list and amf_list are now required to be explicitly set
- generic: plmn list for 5G is now configured via plmn_list_5g.
           plmn_list    is now required to be set when there are LTE cells
           plmn_list_5g is now required to be set when there are NR  cells
- generic: exposing measurment config is left as TODO
- generic: rework how defaults are handled - they are now started to be kept
           centralized in instance-enb head with TODO to load them from json
           schema.
- fix/rework gtpu computation
- fix more tojson usage to avoid issues wrt buildout
- misc ...
parents 0a0eb065 3a279a19
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"plmn_list": {
"title": "PLMN list",
"description": "List of PLMNs broadcasted by the gNodeB, at most 12 (default: 00101)",
"patternProperties": {
".*": {
"properties": {
"plmn": {
"default": "00101",
"title": "Public Land Mobile Network",
"description": "Public Land Mobile Network",
"type": "string"
},
"tac": {
"default": 100,
"title": "Tracking Area Code",
"description": "Integer (range 0 to 16777215)",
"type": "number"
},
"ranac": {
"title": "Optional integer (range 0 to 255)",
"description": "RAN Area Code",
"type": "number"
},
"reserved": {
"default": false,
"title": "Reserved",
"description": "True if the cell is reserved for operator use.",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object",
"default": {}
},
"nssai": {
"title": "AMF slices configuration",
"description": "AMF slices configuration.",
"patternProperties": {
".*": {
"properties": {
"sst": {
"default": 1,
"title": "Slice Service Type",
"description": "Integer (range 1 to 255).",
"type": "number"
},
"sd": {
"default": "0x000032",
"title": "Slice Differentiator",
"description": "Optional integer (range 0 to 0xFFFFFE)",
"type": "string"
}
},
"type": "object"
}
},
"type": "object",
"default": {}
},
"nr_handover_a3_offset": {
"title": "A3 offset for NR handover",
"description": "RSRP gain offset between gNBs which will trigger handover",
"type": "number",
"default": 6
},
"nr_handover_time_to_trigger": {
"title": "Time to Trigger for NR handover",
"description": "Time to trigger after which NR handover will be triggered if A3 offset is reached",
"type": "number",
"enum": [
0,
40,
64,
80,
100,
128,
160,
256,
320,
480,
512,
640,
1024,
1280,
2560,
5120
],
"default": 100
}
}
}
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = 883fc0c659b94ad732809db09d4f4665
md5sum = f1309feb2d86e61f0c542a97594622f9
[template-ors]
filename = instance-ors.cfg
......@@ -28,7 +28,7 @@ md5sum = 9c1cf42bbf5286f8ddd4e14f19447d30
[ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = af0d3626f504af02f22780696820e401
md5sum = 415d002d8f89e11194de24223edb3b02
[ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
......@@ -36,7 +36,7 @@ md5sum = b7906ca3a6b17963f78f680fc0842b74
[ru_lopcomm_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/lopcomm/libinstance.jinja2.cfg
md5sum = 667bf3d0af1ae3e6d740c667957449dc
md5sum = ec34535512448db3fa40caa00bee3151
[ru_sunwave_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sunwave/libinstance.jinja2.cfg
......@@ -88,19 +88,19 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 29b5a5a61b0498681d480726be9e56bf
md5sum = d6b3e494db278d2ecc28ea1a9e4a7826
[template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg
md5sum = 8edc4511be7204d1096e0c1cc00802e4
md5sum = fae3b18f36b4196617b8a48251e39726
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
md5sum = c807be73b9304f5a4c7483a3776bbc17
md5sum = 9402b750221765b6b124cf5ecb3e520c
[template-ue]
_update_hash_filename_ = instance-ue.jinja2.cfg
md5sum = be16ae9b38dd4e46c09bc9eb4bb7eb93
md5sum = 096c7cbf869e2c2ae783821ec8391bbd
[template-obsolete]
_update_hash_filename_ = instance-obsolete.jinja2.cfg
......@@ -112,7 +112,7 @@ md5sum = dcaac06553a3222b14c0013a13f4a149
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
md5sum = 43ae4e7f94f2c84cef07a273f6b2e668
md5sum = d395d9ef1d9631b44f57da271284bf54
[drb_lte.jinja2.cfg]
filename = config/drb_lte.jinja2.cfg
......
......@@ -117,20 +117,18 @@
{{ slaplte.ru_config(iru_dict, slapparameter_dict) }}
{%- if slapparameter_dict.get('websocket_password', '') %}
com_addr: "[{{ gtp_addr_v6 }}]:{{ slap_configuration['configuration.com_ws_port'] }}",
com_addr: "[{{ gtp_addr_v6 }}]:{{ slapparameter_dict.com_ws_port }}",
com_auth: {
password: "{{ slapparameter_dict['websocket_password'] }}",
},
{%- else %}
com_addr: "{{ slap_configuration['configuration.com_addr'] }}:{{ slap_configuration['configuration.com_ws_port'] }}",
com_addr: "{{ slapparameter_dict.com_addr }}:{{ slapparameter_dict.com_ws_port }}",
{%- endif %}
{% if do_lte %}
// LTE core network
mme_list: [
{%- for _, mme in slapparameter_dict.get('mme_list',
{'1':{'mme_addr': slap_configuration['configuration.mme_addr']}})
| dictsort %}
{%- for _, mme in slapparameter_dict.mme_list |dictsort %}
{
mme_addr: "{{ mme['mme_addr'] }}",
},
......@@ -141,9 +139,7 @@
{% if do_nr %}
// NR core network
amf_list: [
{%- for _, amf in slapparameter_dict.get('amf_list',
{'1':{'amf_addr': slap_configuration['configuration.amf_addr']}})
| dictsort %}
{%- for _, amf in slapparameter_dict.amf_list |dictsort %}
{
amf_addr: "{{ amf['amf_addr'] }}",
},
......@@ -151,6 +147,38 @@
],
{%- endif %}
{#- listen-address for GTP-U - either explicitly given, or autodetect #}
{%- if slapparameter_dict.get('gtp_addr') %}
gtp_addr: "{{ slapparameter_dict.gtp_addr }}",
{%- else %}
{#- use loopback if address of core network is on loopback as well #}
{%- set vcore = [] %}
{%- if do_lte %}
{%- do vcore.extend(slapparameter_dict.mme_list |dictsort |map(attribute='1.mme_addr')) %}
{%- endif %}
{%- if do_nr %}
{%- do vcore.extend(slapparameter_dict.amf_list |dictsort |map(attribute='1.amf_addr')) %}
{%- endif %}
{#- remove optional :port from addresses and see if they are on loopback #}
{%- set vip = [] %}
{%- for a in vcore %}
{%- set _ = namespace() %}
{%- set _.ip = urllib.parse.urlparse('z://%s' % a).hostname %}
{%- set _.islo = netaddr.IPAddress(_.ip).is_loopback() %}
{%- do vip.append(_) %}
{%- endfor %}
{%- if len(vip) > 0 and all(vip |map(attribute='islo')) %}
gtp_addr: "{{ vip[0].ip }}",
{%- else %}
{#- core is external - use external ipv4/ipv6 #}
{%- if slapparameter_dict.use_ipv4 %}
gtp_addr: "{{ gtp_addr_v4 }}",
{%- else %}
gtp_addr: "{{ gtp_addr_v6 }}",
{%- endif %}
{%- endif %}
{%- endif %}
{#- X2/Xn peers
TODO: add info about peers as shared instances - one instance per peer *ENB*.
then query SlapOS Master about cells configured on that peer ENB and
......@@ -162,15 +190,6 @@
| map(attribute='1._.xn_addr')
| list | tojson }},
{% if slapparameter_dict.get('mme_list', '') or slapparameter_dict.get('amf_list', '') %}
{% if slapparameter_dict.get('use_ipv4', False) %}
gtp_addr: "{{ gtp_addr_v4 }}",
{% else %}
gtp_addr: "{{ gtp_addr_v6 }}",
{% endif %}
{% else %}
gtp_addr: "{{ slap_configuration['configuration.gtp_addr'] }}",
{% endif %}
{%- if do_lte %}
enb_id: {{ slapparameter_dict.enb_id }},
......@@ -181,6 +200,7 @@
en_dc_support: true,
{%- endif %}
{% if do_lte %}
// LTE cells
cell_list: [
{%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %}
......@@ -319,21 +339,13 @@
cell_default: {
plmn_list: [
{%- if slapparameter_dict.get('plmn_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['plmn_list']) %}
{%- if i == 0 -%}
{%- for _, plmn in slapparameter_dict.plmn_list |dictsort %}
{
{%- else -%}
, {
{%- endif %}
plmn: "{{ slapparameter_dict['plmn_list'][k]['plmn'] }}",
reserved: {{ str(slapparameter_dict['plmn_list'][k].get('reserved', false)).lower() }},
attach_without_pdn: {{ str(slapparameter_dict['plmn_list'][k].get('attach_without_pdn', false)).lower() }},
}
{%- endfor -%}
{% else %}
"00101",
{% endif %}
plmn: "{{ plmn.plmn }}",
reserved: {{ plmn.get('reserved', false) |tojson }},
attach_without_pdn: {{ plmn.get('attach_without_pdn', false) |tojson }},
},
{%- endfor %}
],
cyclic_prefix: "normal",
......@@ -400,6 +412,7 @@
}
],
{# TODO fully expose lte meas_config_desc in generic #}
meas_config_desc: {
a1_report_type: "rsrp",
a1_rsrp: -70,
......@@ -417,7 +430,9 @@
meas_gap_config: "gp0",
ho_from_meas: true,
},
{%- endif %}
{% if do_nr %}
// NR cells
nr_cell_list: [
{%- for i, (cell_ref, icell) in enumerate(icell_dict|dictsort) %}
......@@ -715,68 +730,26 @@
ssb_period: 20,
plmn_list: [
{%- if slapparameter_dict.get('plmn_list', '') %}
{%- for i, k in enumerate(slapparameter_dict['plmn_list']) %}
{%- if i == 0 -%}
{%- for _, plmn in slapparameter_dict.plmn_list_5g |dictsort %}
{
{%- else -%}
, {
{%- endif %}
plmn: "{{ slapparameter_dict['plmn_list'][k]['plmn'] }}",
tac: {{ slapparameter_dict['plmn_list'][k].get('tac', 100) }},
{%- if slapparameter_dict['plmn_list'][k].get('ranac', '') %}
ranac: {{ slapparameter_dict['plmn_list'][k]['ranac'] }},
{%- endif %}
reserved: {{ str(slapparameter_dict['plmn_list'][k].get('reserved', false)).lower() }},
nssai: [
{%- if slapparameter_dict.get('nssai', '') %}
{%- for j, k in enumerate(slapparameter_dict['nssai']) %}
{%- if j == 0 %}
{
{%- else -%}
, {
{%- endif %}
sst: {{ slapparameter_dict['nssai'][k]['sst'] }},
{%- if slapparameter_dict['nssai'][k].get('sd', '') %}
sd: {{ slapparameter_dict['nssai'][k]['sd'] }},
{%- endif %}
}
{%- endfor -%}
{% else %}
{
sst: 1,
},
{% endif %}
],
}
{%- endfor -%}
{% else %}
{
plmn: "00101",
tac: 100,
reserved: false,
nssai: [
{%- if slapparameter_dict.get('nssai', '') %}
{%- for j, k in enumerate(slapparameter_dict['nssai']) %}
{%- if j == 0 %}
{
{%- else -%}
, {
{%- endif %}
sst: {{ slapparameter_dict['nssai'][k]['sst'] }},
{%- if slapparameter_dict['nssai'][k].get('sd', '') %}
sd: {{ slapparameter_dict['nssai'][k]['sd'] }},
{%- endif %}
}
{%- endfor -%}
{% else %}
{
sst: 1,
},
{% endif %}
],
plmn: "{{ plmn.plmn }}",
tac: {{ plmn.tac }},
{%- if plmn.get('ranac') %}
ranac: {{ plmn.ranac }},
{%- endif %}
reserved: {{ plmn.get('reserved', false) |tojson }},
nssai: [
{%- for _, nssai in slapparameter_dict.nssai |dictsort %}
{
sst: {{ nssai.sst }},
{%- if nssai.get('sd') %}
sd: {{ nssai.sd }},
{%- endif %}
},
{%- endfor %}
],
},
{%- endif %}
{%- endfor %}
],
si_window_length: 40,
......@@ -959,6 +932,7 @@
cipher_algo_pref: [],
integ_algo_pref: [2, 1],
{# TODO fully expose nr meas_config_desc in generic #}
meas_config_desc: {
a1_report_type: "rsrp",
a1_rsrp: -60,
......@@ -979,4 +953,5 @@
pattern_id: 0
},
},
{%- endif %}
}
......@@ -34,17 +34,15 @@
amf_addr: "127.0.1.100",
},
],
gtp_addr: "127.0.1.100",
x2_peers: ["44.1.1.1", "44.1.1.2"],
xn_peers: ["55.1.1.1", "55.1.1.2"],
gtp_addr: "127.0.1.1",
enb_id: 0x10012,
gnb_id: 0x54321,
gnb_id_bits: 28,
en_dc_support: true,
// LTE cells
cell_list: [
......@@ -155,8 +153,11 @@
cell_default: {
plmn_list: [
"00101",
{
plmn: "31415",
reserved: false,
attach_without_pdn: false,
},
],
cyclic_prefix: "normal",
......@@ -223,6 +224,7 @@
}
],
meas_config_desc: {
a1_report_type: "rsrp",
a1_rsrp: -70,
......@@ -241,6 +243,7 @@
ho_from_meas: true,
},
// NR cells
nr_cell_list: [
......@@ -454,15 +457,14 @@
plmn_list: [
{
plmn: "00101",
tac: 100,
reserved: false,
nssai: [
{
sst: 1,
},
],
plmn: "51413",
tac: 123,
reserved: false,
nssai: [
{
sst: 1,
},
],
},
],
......@@ -646,6 +648,7 @@
cipher_algo_pref: [],
integ_algo_pref: [2, 1],
meas_config_desc: {
a1_report_type: "rsrp",
a1_rsrp: -60,
......
......@@ -183,7 +183,7 @@ context =
section directory directory
section slap_configuration slap-configuration
key slapparameter_dict slap-configuration:configuration
key gtp_addr_v6 slap-configuration:ipv6-random
raw gtp_addr_v6 {{ my_ipv6 }}
raw gtp_addr_v4 {{ lan_ipv4 }}
import netaddr netaddr
key ifup_empty mme-ifup-empty:wrapper-path
......@@ -245,7 +245,7 @@ password = {{ slapparameter_dict['monitor-password'] | string }}
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish.serialised
core-network-ipv6 = ${slap-configuration:ipv6-random}
core-network-ipv6 = {{ my_ipv6 }}
core-network-ipv4 = {{ lan_ipv4 }}
amarisoft-version = {{ lte_version }}
license-expiration = {{ lte_expiration }}
......
......@@ -16,7 +16,7 @@
},
"mme_list": {
"title": "MME list",
"description": "Optional. List of MME to which the gNodeB is connected",
"description": "List of MME to which the eNodeB is connected. (must be set if there are LTE cells)",
"patternProperties": {
".*": {
"properties": {
......@@ -29,8 +29,36 @@
"type": "object"
}
},
"type": "object",
"default": {}
"type": "object"
},
"plmn_list": {
"title": "PLMN list (4G)",
"description": "List of PLMNs broadcasted by the eNodeB, at most 6. (must be set if there are LTE cells)",
"patternProperties": {
".*": {
"properties": {
"plmn": {
"title": "Public Land Mobile Network",
"description": "Public Land Mobile Network",
"type": "string"
},
"attach_without_pdn": {
"default": false,
"title": "Attach Without PDN",
"description": "Optional boolean. Indicates if PLMN supports attach without PDN connectivity.",
"type": "boolean"
},
"reserved": {
"default": false,
"title": "Reserved",
"description": "True if the cell is reserved for operator use.",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
},
"gnb_id": {
"title": "gNB ID",
......@@ -45,7 +73,7 @@
},
"amf_list": {
"title": "AMF list",
"description": "Optional. List of AMF to which the gNodeB is connected",
"description": "List of AMF to which the gNodeB is connected. (must set if there are NR cells)",
"patternProperties": {
".*": {
"properties": {
......@@ -58,26 +86,28 @@
"type": "object"
}
},
"type": "object",
"default": {}
"type": "object"
},
"plmn_list": {
"title": "PLMN list",
"description": "List of PLMNs broadcasted by the eNodeB, at most 6 (default: 00101)",
"plmn_list_5g": {
"title": "PLMN list (5G)",
"description": "List of PLMNs broadcasted by the gNodeB, at most 12. (must set if there are NR cells)",
"patternProperties": {
".*": {
"properties": {
"plmn": {
"default": "00101",
"title": "Public Land Mobile Network",
"description": "Public Land Mobile Network",
"type": "string"
},
"attach_without_pdn": {
"default": false,
"title": "Attach Without PDN",
"description": "Optional boolean. Indicates if PLMN supports attach without PDN connectivity.",
"type": "boolean"
"tac": {
"title": "Tracking Area Code",
"description": "Integer (range 0 to 16777215)",
"type": "number"
},
"ranac": {
"title": "Optional integer (range 0 to 255)",
"description": "RAN Area Code",
"type": "number"
},
"reserved": {
"default": false,
......@@ -89,39 +119,33 @@
"type": "object"
}
},
"type": "object"
},
"nssai": {
"title": "AMF slices configuration",
"description": "AMF slices configuration.",
"patternProperties": {
".*": {
"properties": {
"sst": {
"default": 1,
"title": "Slice Service Type",
"description": "Integer (range 1 to 255).",
"type": "number"
},
"sd": {
"default": "0x000032",
"title": "Slice Differentiator",
"description": "Optional integer (range 0 to 0xFFFFFE)",
"type": "string"
}
},
"type": "object"
}
},
"type": "object",
"default": {}
},
"lte_handover_a3_offset": {
"title": "A3 offset for LTE handover",
"description": "RSRP gain offset between gNBs which will trigger handover",
"type": "number",
"default": 6
},
"lte_handover_time_to_trigger": {
"title": "Time to Trigger for LTE handover",
"description": "Time to trigger after which LTE handover will be triggered if A3 offset is reached",
"type": "number",
"enum": [
0,
40,
64,
80,
100,
128,
160,
256,
320,
480,
512,
640,
1024,
1280,
2560,
5120
],
"default": 480
},
"websocket_password": {
"title": "Websocket password",
"description": "Activates websocket for remote control and sets password",
......
# instance-enb implements eNB/gNB service.
{#- defaults for global eNB/gNB parameters.
TODO automatically enb defaults from JSON schema #}
{%- set enb_defaults = {
"com_ws_port": 9001,
"com_addr": '127.0.1.2',
"use_ipv4": False,
"nssai": {'1': {'sst': 1}}
} %}
{%- for k,v in enb_defaults|dictsort %}
{%- do slapparameter_dict.setdefault(k, v) %}
{%- endfor %}
[buildout]
parts =
directory
......@@ -31,6 +44,12 @@ offline = true
{{ rulib.buildout() }}
[myslap]
# NOTE we don't query slapos.cookbook:slapconfiguration the second time because
# slapparameter_dict is potentially modified with defaults.
parameter_dict = {{ dumps(slapparameter_dict) }}
configuration = {{ dumps(slap_configuration) }}
[monitor-httpd-conf-parameter]
httpd-include-file = {{ buildout_directory }}/etc/httpd-include-file.conf
......@@ -46,19 +65,6 @@ minimum = 8035
maximum = 8055
ip = ${monitor-instance-parameter:monitor-httpd-ipv6}
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = {{ slap_connection['computer-id'] }}
partition = {{ slap_connection['partition-id'] }}
url = {{ slap_connection['server-url'] }}
key = {{ slap_connection['key-file'] }}
cert = {{ slap_connection['cert-file'] }}
configuration.com_ws_port = 9001
configuration.com_addr = 127.0.1.2
configuration.mme_addr = 127.0.1.100
configuration.amf_addr = 127.0.1.100
configuration.gtp_addr = 127.0.1.1
[directory]
recipe = slapos.cookbook:mkdirectory
......@@ -125,7 +131,7 @@ drb_stats_logspec =
rotatespec = 100MB.9
logspec = ${:stats_logspec} ${:drb_stats_logspec}
{%- if slapparameter_dict.get("websocket_password", "") %}
websock = ws://[${slap-configuration:ipv6-random}]:9001
websock = ws://[{{my_ipv6}}]:9001
{%- else %}
websock = ws://127.0.1.2:9001
{%- endif %}
......@@ -185,12 +191,13 @@ extra-context =
context =
json ors false
section directory directory
section slap_configuration slap-configuration
key slapparameter_dict slap-configuration:configuration
key gtp_addr_v6 slap-configuration:ipv6-random
key slap_configuration myslap:configuration
key slapparameter_dict myslap:parameter_dict
raw gtp_addr_v6 {{ my_ipv6 }}
raw gtp_addr_v4 {{ lan_ipv4 }}
import xbuildout xbuildout
import netaddr netaddr
import urllib urllib
${:extra-context}
[enb-config]
......@@ -219,9 +226,9 @@ ipeercell_dict = {{ dumps(ipeercell_dict) }}
<= monitor-publish
recipe = slapos.cookbook:publish.serialised
{%- if slapparameter_dict.get("websocket_password", "") %}
websocket_url = ws://[${slap-configuration:ipv6-random}]:9001
websocket_url = ws://[{{my_ipv6}}]:9001
{%- endif %}
enb-ipv6 = ${slap-configuration:ipv6-random}
enb-ipv6 = {{ my_ipv6 }}
enb-ipv4 = {{ lan_ipv4 }}
amarisoft-version = {{ lte_version }}
license-expiration = {{ lte_expiration }}
......
......@@ -74,10 +74,15 @@
"default": "127.0.1.1"
},
"mme_list": {
"$ref": "instance-enb-input-schema.json#/properties/mme_list"
"$ref": "instance-enb-input-schema.json#/properties/mme_list",
"default": {"1": {"mme_addr": "127.0.1.100"}}
},
"plmn_list": {
"$ref": "instance-enb-input-schema.json#/properties/plmn_list"
"$ref": "instance-enb-input-schema.json#/properties/plmn_list",
"description": "List of PLMNs broadcasted by the eNodeB, at most 6 (default: 00101)",
"default": {
"1": {"plmn": "00101"}
}
},
"lte_handover_a3_offset": {
"title": "A3 offset for LTE handover",
......
......@@ -17,9 +17,8 @@
"tac": "0x0001",
"root_sequence_index": 204,
"enb_id": "0x1A2D0",
"gtp_addr": "127.0.1.1",
"lte_handover_a3_offset": 6,
"lte_handover_a3_time_to_trigger": 480,
"mme_list": {'1': {'mme_addr': '127.0.1.100'}},
"plmn_list": {"1": {'plmn': '00101'}},
"ncell_list": {},
"x2_peers": {},
"inactivity_timer": 10000,
......@@ -36,8 +35,8 @@
"cell_id": "0x01",
"gnb_id": "0x12345",
"gnb_id_bits": 28,
"nr_handover_a3_offset": 6,
"nr_handover_time_to_trigger": 100,
"amf_list": {'1': {'amf_addr': '127.0.1.100'}},
"plmn_list": {'1': {'plmn': '00101', 'tac': 100}},
"ncell_list": {},
"xn_peers": {},
"inactivity_timer": 10000,
......@@ -188,6 +187,14 @@
{%- endif %}
{#- gnb: plmn_list -> plmn_list_5g #}
{%- if enb_mode == 'gnb' %}
{%- set _ = slapparameter_dict %}
{%- do _.update({'plmn_list_5g': _.plmn_list}) %}
{%- do _.pop('plmn_list') %}
{%- endif %}
{#- backward compatibility: if ORS is running in gnb mode, and gnb_* parameters
are present, replace their generic enb_* counterparts with gnb_* ones #}
{%- if enb_mode == 'gnb' %}
......@@ -216,7 +223,8 @@
context -=
json ors false
context +=
json ors {{ ors_version | tojson }}
key ors :ors
ors = {{ dumps(ors_version) }}
# add ORS-specific bits to published information
......
......@@ -51,68 +51,18 @@
"default": 28
},
"amf_list": {
"$ref": "instance-enb-input-schema.json#/properties/amf_list"
"$ref": "instance-enb-input-schema.json#/properties/amf_list",
"default": {"1": {"amf_addr": "127.0.1.100"}}
},
"plmn_list": {
"title": "PLMN list",
"$ref": "instance-enb-input-schema.json#/properties/plmn_list_5g",
"description": "List of PLMNs broadcasted by the gNodeB, at most 12 (default: 00101)",
"patternProperties": {
".*": {
"properties": {
"plmn": {
"default": "00101",
"title": "Public Land Mobile Network",
"description": "Public Land Mobile Network",
"type": "string"
},
"tac": {
"default": 100,
"title": "Tracking Area Code",
"description": "Integer (range 0 to 16777215)",
"type": "number"
},
"ranac": {
"title": "Optional integer (range 0 to 255)",
"description": "RAN Area Code",
"type": "number"
},
"reserved": {
"default": false,
"title": "Reserved",
"description": "True if the cell is reserved for operator use.",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object",
"default": {}
"default": {
"1": {"plmn": "00101", "tac": 100}
}
},
"nssai": {
"title": "AMF slices configuration",
"description": "AMF slices configuration.",
"patternProperties": {
".*": {
"properties": {
"sst": {
"default": 1,
"title": "Slice Service Type",
"description": "Integer (range 1 to 255).",
"type": "number"
},
"sd": {
"default": "0x000032",
"title": "Slice Differentiator",
"description": "Optional integer (range 0 to 0xFFFFFE)",
"type": "string"
}
},
"type": "object"
}
},
"type": "object",
"default": {}
"$ref": "instance-enb-input-schema.json#/properties/nssai"
},
"nr_handover_a3_offset": {
"title": "A3 offset for NR handover",
......
......@@ -23,6 +23,11 @@ offline = true
{{ rulib.buildout() }}
[myslap]
# see instance-enb.jinja2.cfg about myslap
parameter_dict = {{ dumps(slapparameter_dict) }}
configuration = {{ dumps(slap_configuration) }}
[monitor-httpd-conf-parameter]
httpd-include-file = {{ buildout_directory }}/etc/httpd-include-file.conf
......@@ -38,14 +43,6 @@ minimum = 8035
maximum = 8055
ip = ${monitor-instance-parameter:monitor-httpd-ipv6}
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = {{ slap_connection['computer-id'] }}
partition = {{ slap_connection['partition-id'] }}
url = {{ slap_connection['server-url'] }}
key = {{ slap_connection['key-file'] }}
cert = {{ slap_connection['cert-file'] }}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
......@@ -104,9 +101,9 @@ extensions = jinja2.ext.do
extra-context =
context =
section directory directory
section slap_configuration slap-configuration
section pub_info publish-connection-information
key slapparameter_dict slap-configuration:configuration
key slap_configuration myslap:configuration
key slapparameter_dict myslap:parameter_dict
import xbuildout xbuildout
${:extra-context}
......@@ -133,8 +130,8 @@ iue_dict = {{ dumps(iue_dict) }}
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish.serialised
rue_bind_addr = ${slap-configuration:ipv6-random}
com_addr = [${slap-configuration:ipv6-random}]:9002
rue_bind_addr = {{my_ipv6}}
com_addr = [{{my_ipv6}}]:9002
monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html
[monitor-instance-parameter]
......
......@@ -38,6 +38,7 @@ context =
section slap_connection slap-connection
key slapparameter_dict slap-configuration:configuration
key lan_ipv4 lan-ip:ipv4
key my_ipv6 slap-configuration:ipv6-random
$${:extra-context}
import-list =
rawfile slaplte.jinja2 ${slaplte.jinja2:target}
......
......@@ -160,7 +160,6 @@ iru_dict = {{ dumps(iru_dict) }}
{{ part('dnsmasq-service') }}
recipe = slapos.cookbook:wrapper
port = 5353
#ip = ${slap-configuration:tun-ipv4-addr}
command-line = {{ dnsmasq_location }}/sbin/dnsmasq --conf-file=${dnsmasq-config:output} -x ${directory:run}/dnsmasq.pid --local-service --keep-in-foreground
wrapper-path = ${directory:service}/dnsmasq
mode = 0775
......@@ -302,7 +301,7 @@ extensions = jinja2.ext.do
log-output = ${directory:var}/log/amarisoft-rf-info.json.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key slapparameter_dict myslap:parameter_dict
key log_file :log-output
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
raw testing {{ testing }}
......@@ -325,7 +324,7 @@ extensions = jinja2.ext.do
log-output = ${directory:var}/log/amarisoft-stats.json.log
context =
section directory directory
key slapparameter_dict slap-configuration:configuration
key slapparameter_dict myslap:parameter_dict
key log_file :log-output
raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
raw testing {{ testing }}
......
......@@ -31,7 +31,7 @@ is_firmware_updated = ${directory:etc}/{{B('%s.is_firmware_updated' % ru_ref)}}
context =
section directory directory
section vtap vtap.{{ ru.cpri_link._tap }}
key slapparameter_dict slap-configuration:configuration
key slapparameter_dict myslap:parameter_dict
key log_file :log-output
key software_reply_json_log_file :software-reply-json-log-output
key remote_file_path :remote-file-path
......@@ -116,7 +116,7 @@ is_netconf_connected = ${directory:etc}/{{B('%s.is_netconf_connected' % ru_ref)}
context =
section directory directory
section vtap vtap.{{ ru.cpri_link._tap }}
key slapparameter_dict slap-configuration:configuration
key slapparameter_dict myslap:parameter_dict
key log_file :log-output
key json_log_file :json-log-output
key cfg_json_log_file :cfg-json-log-output
......@@ -248,7 +248,7 @@ recipe = slapos.cookbook:userinfo
recipe = slapos.cookbook:free_port
minimum = 22222
maximum = 22231
ip = ${slap-configuration:ipv6-random}
ip = {{my_ipv6}}
[sshd-config]
recipe = slapos.recipe.template:jinja2
......@@ -257,7 +257,7 @@ path_pid = ${directory:run}/sshd.pid
inline =
PidFile ${:path_pid}
Port ${sshd-port:port}
ListenAddress ${slap-configuration:ipv6-random}
ListenAddress {{my_ipv6}}
Protocol 2
HostKey ${sshd-ssh-host-rsa-key:output}
HostKey ${sshd-ssh-host-ecdsa-key:output}
......
......@@ -29,6 +29,8 @@ def j2render(src, out, jcfg):
textctx += 'import nrarfcn_module nrarfcn\n'
textctx += 'import xearfcn_module xlte.earfcn\n'
textctx += 'import xnrarfcn_module xlte.nrarfcn\n'
textctx += 'import urllib urllib\n'
textctx += 'import netaddr netaddr\n'
buildout = None # stub
r = jinja2_template.Recipe(buildout, "recipe", {
'extensions': 'jinja2.ext.do jinja2.ext.loopcontrols',
......@@ -412,11 +414,6 @@ def do_enb():
"slap_configuration": {
"tap-name": "slaptap9",
"slap-computer-partition-id": "slappart9",
"configuration.com_ws_port": 9001,
"configuration.com_addr": "127.0.1.2",
"configuration.mme_addr": "127.0.1.100",
"configuration.amf_addr": "127.0.1.100",
"configuration.gtp_addr": "127.0.1.1",
"slave-instance-list": %(jshared_instance_list)s
},
"directory": {
......@@ -426,7 +423,14 @@ def do_enb():
},
"slapparameter_dict": {
"enb_id": "0x10012",
"gnb_id": "0x54321"
"gnb_id": "0x54321",
"com_ws_port": 9001,
"com_addr": "127.0.1.2",
"mme_list": {"1": {"mme_addr": "127.0.1.100"}},
"amf_list": {"1": {"amf_addr": "127.0.1.100"}},
"plmn_list": {"1": {"plmn": "31415"}},
"plmn_list_5g": {"1": {"plmn": "51413", "tac": 123}},
"nssai": {"1": {"sst": 1}}
}
}""" % locals()
......
......@@ -273,6 +273,22 @@ class ENBTestCase4(RFTestCase4):
'enb_id': '0x17',
'gnb_id': '0x23',
'gnb_id_bits': 30,
'mme_list': {
'1': {'mme_addr': '1.2.3.4'},
'2': {'mme_addr': '[1234::1]:78'},
},
'amf_list': {
'1': {'amf_addr': '4.3.2.1:77'},
'2': {'amf_addr': '4321::1'},
},
'plmn_list': {
'1': {'plmn': '31415'},
'2': {'plmn': '44444', 'attach_without_pdn': True, 'reserved': True},
},
'plmn_list_5g': {
'1': {'plmn': '51413', 'tac': 0x124},
'2': {'plmn': '55555', 'tac': 0x125, 'ranac': 210, 'reserved': True},
},
})}
@classmethod
......@@ -301,8 +317,22 @@ class ENBTestCase4(RFTestCase4):
# basic enb parameters
def test_enb_cfg_basic(t):
assertMatch(t, t.enb_cfg, dict(
enb_id=0x17, gnb_id=0x23, gnb_id_bits=30,
x2_peers=['44.1.1.1'], xn_peers=['55.1.1.1'],
enb_id=0x17, gnb_id=0x23, gnb_id_bits=30,
mme_list=[{'mme_addr': '1.2.3.4'}, {'mme_addr': '[1234::1]:78'}],
amf_list=[{'amf_addr': '4.3.2.1:77'}, {'amf_addr': '4321::1'}],
x2_peers=['44.1.1.1'], xn_peers=['55.1.1.1'],
cell_default={
'plmn_list': [
dict(plmn='31415', attach_without_pdn=False, reserved=False),
dict(plmn='44444', attach_without_pdn=True, reserved=True),
]
},
nr_cell_default={
'plmn_list': [
dict(plmn='51413', tac=0x124, ranac=NO, reserved=False),
dict(plmn='55555', tac=0x125, ranac=210, reserved=True),
]
},
))
# basic cell parameters
......
......@@ -3,7 +3,7 @@
(cd .. && /usr/bin/python3 ../../update-hash)
export SLAPOS_TEST_DEBUG=1
export SLAPOS_TEST_VERBOSE=0
export SLAPOS_TEST_VERBOSE=1
export SLAPOS_TEST_SKIP_SOFTWARE_CHECK=1
export SLAPOS_TEST_SKIP_SOFTWARE_REBUILD=0
......@@ -14,6 +14,7 @@ export SLAPOS_TEST_LOG_DIRECTORY=`pwd`/snapshot
#time ../k/kpython_for_test -m unittest discover -v
time ../k/kpython_for_test -m unittest discover -vf
#time ../k/kpython_for_test -m unittest discover -vf -k TestENBParameters
#time ../k/kpython_for_test -m unittest discover -vf -k TestGNBParameters
#time ../k/kpython_for_test -m unittest discover -vf -k NBParameters
#time ../k/kpython_for_test -m unittest discover -vf -k CoreNetwork
#time ../k/kpython_for_test -m unittest discover -vf -k MonitorGadget
......
......@@ -146,7 +146,8 @@ def test_enb_conf(self):
self.assertEqual(conf['tx_gain'], [enb_param_dict['tx_gain']] * enb_param_dict['n_antenna_dl'])
self.assertEqual(conf['rx_gain'], [enb_param_dict['rx_gain']] * enb_param_dict['n_antenna_ul'])
self.assertEqual(len(conf['cell_list']), 1)
self.assertEqual(len(conf['nr_cell_list']), 0)
self.assertNotIn('nr_cell_list', conf)
self.assertNotIn('nr_cell_default', conf)
cell = conf['cell_list'][0]
self.assertEqual(cell['inactivity_timer'], enb_param_dict['inactivity_timer'])
self.assertEqual(cell['uldl_config'], 6)
......@@ -182,7 +183,8 @@ def test_gnb_conf1(self):
conf = yamlpp_load(conf_file)
self.assertEqual(conf['tx_gain'], [gnb_param_dict1['tx_gain']] * gnb_param_dict1['n_antenna_dl'])
self.assertEqual(conf['rx_gain'], [gnb_param_dict1['rx_gain']] * gnb_param_dict1['n_antenna_ul'])
self.assertEqual(len(conf['cell_list']), 0)
self.assertNotIn('cell_list', conf)
self.assertNotIn('cell_default', conf)
self.assertEqual(len(conf['nr_cell_list']), 1)
nr_cell = conf['nr_cell_list'][0]
self.assertEqual(nr_cell['inactivity_timer'], gnb_param_dict1['inactivity_timer'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment