Commit 08731df7 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: enb/generic: Switch cell type to be a runtime parameter

In other words merge enb and gnb into sole enb that can handle both LTE and NR
cells at the same time and simultaneously.

Previously which type of Radio Access Technology to use - LTE or NR - was
static parameter of particular software - it was possible to instantiate cells
only with selected RAT for particular template.

In MultiRU it is possible to generally instantiate all kind of cells -
LTE/NR and TDD/FDD all at the same time and each served by a different kind of Radio Unit.

-> Switch cell type to be runtime parameter as the final step to be able to do that.

For generic cell definitions are now required to come with cell_type=lte|nr
parameter. In schemas cell_list now includes oneOf for lte|nr cell instead of
particular cell type. Similar adaption is done for ncell_list and
x2_peers/xn_peers are merged into just peers with similar oneOf.

Global gnb-specific parameters of went-away gnb are also added as global ones to enb:

  - gnb_id
  - gnb_id_bits
  - amf_list
  - plmn_list (as plmn_list_5g not to conflict with plmn_list)
  - nssai

They must be present if there are NR cells.

Full backward compatibility is preserved for ORS: now it injects cells to
generic with particular cell_type annotations and translates ORS-specific
x2_peers/xn_peers and gnb/plmn_list to proper generic parameters.

In ORS-gnb schema gnb_stats_fetch_period and gnb_drb_stats_enabled had to be
renamed to enb_stats_fetch_period and enb_drb_stats_enabled, but once again,
full backward compatibility is preserved because ORS mode already had the
following in its proxy:

    {#- backward compatibility: if ORS is running in gnb mode, and gnb_* parameters
        are present, replace their generic enb_* counterparts with gnb_* ones #}
    ...

The diff for rendered enb.cfg and gnb.cfg, that simulate ORS, before and after
hereby patch is also empty.
parent a9101bd9
......@@ -5,6 +5,7 @@
"type": "object",
"required": [
"cell_type",
"rf_mode",
"pci",
"cell_id",
......@@ -13,6 +14,11 @@
],
"properties": {
"cell_type": {
"type": "string",
"options": { "hidden": true }
},
"rf_mode": {
"title": "RF mode",
"description": "Mode for TX/RX radio multiplexing: Frequency- or Time- Domain Division",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Cell",
"type": "object",
"oneOf": [
{ "$ref": "../cell/lte/input-schema.json" },
{ "$ref": "../cell/nr/input-schema.json" }
]
}
......@@ -18,6 +18,12 @@
"properties": {
"$ref": "../../cell/common.json#/properties",
"cell_type": {
"$ref": "#/properties/cell_type",
"const": "lte",
"template": "lte"
},
"tdd_ul_dl_config": {
"title": "TDD Configuration",
"type": "string",
......
......@@ -5,6 +5,7 @@
"type": "object",
"required": [
"cell_type",
"rf_mode",
"pci",
"cell_id",
......@@ -17,6 +18,12 @@
"properties": {
"$ref": "../../cell/common.json#/properties",
"cell_type": {
"$ref": "#/properties/cell_type",
"const": "nr",
"template": "nr"
},
"tdd_ul_dl_config": {
"title": "TDD Configuration",
"type": "string",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Values returned by Cell instantiation (stub)",
"type": "object",
"properties": {}
}
......@@ -687,7 +687,7 @@
ssb_period: 20,
plmn_list: [
{%- for _, plmn in slapparameter_dict.plmn_list |dictsort %}
{%- for _, plmn in slapparameter_dict.plmn_list_5g |dictsort %}
{
plmn: "{{ plmn.plmn }}",
tac: {{ plmn.tac }},
......
......@@ -8,7 +8,7 @@
"description": "Cell List",
"patternProperties": {
".*": {
"$ref": "cell/lte/input-schema.json"
"$ref": "cell/input-schema.json"
}
},
"type": "object",
......@@ -49,7 +49,7 @@
"type": "object"
},
"plmn_list": {
"title": "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": {
".*": {
......@@ -77,28 +77,107 @@
},
"type": "object"
},
"gnb_id": {
"title": "gNB ID",
"description": "gNB ID. (must be set if there are NR cells)",
"type": "string"
},
"gnb_id_bits": {
"title": "gNB ID bits",
"description": "Number of bits for the gNodeB global identifier. (range 22 to 32)",
"type": "number",
"default": 28
},
"amf_list": {
"title": "AMF list",
"description": "List of AMF to which the gNodeB is connected. (must be set if there are NR cells)",
"patternProperties": {
".*": {
"properties": {
"amf_addr": {
"title": "AMF Address",
"description": "IP address (and optional port) of NGAP SCTP connection to the AMF. The default port is 38412.",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"plmn_list_5g": {
"title": "PLMN list (5G)",
"description": "List of PLMNs broadcasted by the gNodeB, at most 12. (must be set if there are NR cells)",
"patternProperties": {
".*": {
"properties": {
"plmn": {
"title": "Public Land Mobile Network",
"description": "Public Land Mobile Network",
"type": "string"
},
"tac": {
"$ref": "cell/nr/input-schema.json#/$defs/tac"
},
"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"
},
"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": {}
},
"ncell_list": {
"title": "Neighbour Cell Info",
"description": "Neighbour Cell Info",
"patternProperties": {
".*": {
"$ref": "peer/cell/lte/input-schema.json"
"$ref": "peer/cell/input-schema.json"
}
},
"type": "object",
"default": {}
},
"x2_peers": {
"title": "X2 Peers",
"description": "X2 Peers",
"peers": {
"title": "Peers",
"description": "Peers",
"patternProperties": {
".*": {
"properties": {
"x2_addr": {
"$ref": "peer/lte/input-schema.json#/properties/x2_addr"
}
},
"type": "object"
"$ref": "peer/input-schema.json"
}
},
"type": "object",
......@@ -134,14 +213,14 @@
"type": "boolean"
},
"enb_stats_fetch_period": {
"title": "eNB statistics fetch period (seconds)",
"description": "Describes how often a call to Amarisoft remote API is made to get eNB statistics",
"title": "eNB/gNB statistics fetch period (seconds)",
"description": "Describes how often a call to Amarisoft remote API is made to get eNB/gNB statistics",
"type": "number",
"default": 60
},
"enb_drb_stats_enabled": {
"title": "Enable eNB drb statistics",
"description": "Enable eNB drb statistics through 100Hz polling, needed for E-UTRAN IP Throughput KPI",
"title": "Enable eNB/gNB drb statistics",
"description": "Enable eNB/gNB drb statistics through 100Hz polling, needed for E-UTRAN IP Throughput KPI",
"type": "boolean",
"default": true
},
......
{
"$schema": "http://json-schema.org/draft-04/schema",
"description": "Values returned by eNB instantiation (stub)",
"description": "Values returned by eNB/gNB instantiation (stub)",
"type": "object",
"properties": {}
}
{#- enb_mode indicates with which mode enb is instantiated with - enb | gnb #}
{%- set enb_mode = slap_configuration['slap-software-type'] %}
{%- do assert(enb_mode in ('enb', 'gnb'), enb_mode) %}
{%- set do_lte = (enb_mode == 'enb') %}
{%- set do_nr = (enb_mode == 'gnb') %}
# instance-enb implements eNB/gNB service.
{#- defaults for global eNB/gNB parameters.
TODO automatically load enb defaults from JSON schema #}
......@@ -14,8 +9,7 @@
'gnb_id_bits': 28,
'nssai': {'1': {'sst': 1}},
"ncell_list": {},
"x2_peers": {},
"xn_peers": {},
"peers": {},
} %}
{%- set gtp_addr_lo = '127.0.1.1' %}
{%- for k,v in enb_defaults|dictsort %}
......@@ -202,8 +196,6 @@ context =
raw gtp_addr_v6 {{ my_ipv6 }}
raw gtp_addr_v4 {{ lan_ipv4 }}
raw gtp_addr_lo {{ gtp_addr_lo }}
json do_lte {{ do_lte | tojson }}
json do_nr {{ do_nr | tojson }}
import netaddr netaddr
${:extra-context}
......
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"cell_list": {
"title": "Cell List",
"description": "Cell List",
"patternProperties": {
".*": {
"$ref": "cell/nr/input-schema.json"
}
},
"type": "object",
"default": {}
},
"user-authorized-key": {
"title": "User Authorized Key",
"description": "SSH public key in order to connect to the SSH server of this instance.",
"textarea": true,
"type": "string"
},
"gnb_id": {
"title": "gNB ID",
"description": "gNB ID. (must be set if there are NR cells)",
"type": "string"
},
"gnb_id_bits": {
"title": "gNB ID bits",
"description": "Number of bits for the gNodeB global identifier. (range 22 to 32)",
"type": "number",
"default": 28
},
"amf_list": {
"title": "AMF list",
"description": "List of AMF to which the gNodeB is connected. (must set if there are NR cells)",
"patternProperties": {
".*": {
"properties": {
"amf_addr": {
"title": "AMF Address",
"description": "IP address (and optional port) of NGAP SCTP connection to the AMF. The default port is 38412.",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"plmn_list": {
"title": "PLMN list",
"description": "List of PLMNs broadcasted by the gNodeB, at most 12. (must set if there are NR cells)",
"patternProperties": {
".*": {
"properties": {
"plmn": {
"title": "Public Land Mobile Network",
"description": "Public Land Mobile Network",
"type": "string"
},
"tac": {
"$ref": "cell/nr/input-schema.json#/$defs/tac"
},
"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"
},
"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": {}
},
"ncell_list": {
"title": "Neighbour Cell Info",
"description": "Neighbour Cell Info",
"patternProperties": {
".*": {
"$ref": "peer/cell/nr/input-schema.json"
}
},
"type": "object",
"default": {}
},
"xn_peers": {
"title": "XN Peers",
"description": "XN Peers",
"patternProperties": {
".*": {
"properties": {
"xn_addr": {
"$ref": "peer/nr/input-schema.json#/properties/xn_addr"
}
},
"type": "object"
}
},
"type": "object",
"default": {}
},
"websocket_password": {
"title": "Websocket password",
"description": "Activates websocket for remote control and sets password",
"type": "string"
},
"log_phy_debug": {
"title": "Physical layer log debug",
"description": "Enable debug mode for physical layer logs",
"type": "boolean",
"default": false
},
"gps_sync": {
"default": false,
"title": "GPS synchronisation",
"description": "True if GPS should be used for synchronisation",
"type": "boolean"
},
"disable_sdr": {
"default": false,
"title": "Disable SDR",
"description": "Disables radio",
"type": "boolean"
},
"use_ipv4": {
"default": false,
"title": "Use IPv4",
"description": "Set to true to use IPv4 for AMF / MME addresses",
"type": "boolean"
},
"gnb_stats_fetch_period": {
"title": "gNB statistics fetch period (seconds)",
"description": "Describes how often a call to Amarisoft remote API is made to get gNB statistics",
"type": "number",
"default": 60
},
"gnb_drb_stats_enabled": {
"title": "Enable gNB drb statistics",
"description": "Enable gNB drb statistics through 100Hz polling, needed for E-UTRAN IP Throughput KPI",
"type": "boolean",
"default": true
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
"type": "number",
"default": 0
},
"min_rxtx_delay": {
"title": "Minimum available time for radio front end processing (ms)",
"description": "Baseband latency promise will fail if minimum TX/RX diff reaches threshold (lower than this value)",
"type": "number",
"default": 0
},
"xlog_fluentbit_forward_host": {
"title": "Address to Forward Xlog by Fluenbit",
"description": "Address of Remote Fluentd or Fluentbit Server to Forward Xlog",
"type": "string"
},
"xlog_fluentbit_forward_port": {
"title": "Port to Forward Xlog by Fluentbit",
"description": "Optional Port of Remote Fluentd or Fluentbit Server to Forward Xlog",
"type": "string"
},
"xlog_fluentbit_forward_shared_key": {
"title": "Shared Key to Forward Xlog by Fluentbit",
"description": "Secret Key Shared with Remote Fluentd or Fluentbit Server for Authentication when Forwarding Xlog",
"type": "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema",
"description": "Values returned by gNB instantiation (stub)",
"type": "object",
"properties": {}
}
# instance-ors-enb translates ORS enb/gnb into generic enb/gnb with 1 SDR RU and 1 CELL.
# instance-ors-enb translates ORS enb/gnb into generic enb with 1 SDR RU and 1 CELL.
{#- enb_mode indicates with which mode ors' enb is instantiated with - enb | gnb #}
{%- set enb_mode = slap_configuration['slap-software-type'] %}
......@@ -20,6 +20,7 @@
"mme_list": {'1': {'mme_addr': '127.0.1.100'}},
"plmn_list": {"1": {'plmn': '00101'}},
"ncell_list": {},
"x2_peers": {},
"inactivity_timer": 10000,
} %}
{%- set ors_gnb_defaults = {
......@@ -36,6 +37,7 @@
"amf_list": {'1': {'amf_addr': '127.0.1.100'}},
"plmn_list": {'1': {'plmn': '00101', 'tac': 100}},
"ncell_list": {},
"xn_peers": {},
"inactivity_timer": 10000,
} %}
......@@ -66,6 +68,7 @@
{%- if enb_mode == 'enb' %}
{%- set cell = {
'cell_type': 'lte',
'dl_earfcn': ors_version['current-earfcn'],
'bandwidth': float(slapparameter_dict.bandwidth.removesuffix(' MHz')),
'tac': slapparameter_dict.tac,
......@@ -74,6 +77,7 @@
%}
{%- elif enb_mode == 'gnb' %}
{%- set cell = {
'cell_type': 'nr',
'dl_nr_arfcn': ors_version['current-nr-arfcn'],
'nr_band': ors_version['current-nr-band'],
'bandwidth': slapparameter_dict.nr_bandwidth,
......@@ -111,6 +115,7 @@
{%- endif %}
{%- endmacro %}
{%- if enb_mode == 'enb' %}
{%- do peercell.update({'cell_type': 'lte'}) %}
{%- if 'cell_id' in ncell %}
{%- do peercell.update({'e_cell_id': ncell.cell_id}) %}
{%- endif %}
......@@ -118,6 +123,7 @@
{%- do _('dl_earfcn') %}
{%- do _('tac', '0x0001') %}
{%- elif enb_mode == 'gnb' %}
{%- do peercell.update({'cell_type': 'nr'}) %}
{%- do _('nr_cell_id') %}
{%- do _('gnb_id_bits') %}
{%- do _('pci') %}
......@@ -129,6 +135,38 @@
{%- endfor %}
{#- translate ORS x2_peers/xn_peers to generic peers #}
{%- set peers = {} %}
{%- do slapparameter_dict.update({'peers': peers}) %}
{%- if enb_mode == 'lte' %}
{%- for k, peer in slapparameter_dict.x2_peers|dictsort %}
{%- do peers.update({'X2_PEER%s' % k: {
'peer_type': 'nr',
'x2_addr': peer.x2_addr,
}
})
%}
{%- endfor %}
{%- elif enb_mode == 'nr' %}
{%- for k, peer in slapparameter_dict.xn_peers|dictsort %}
{%- do peers.update({'XN_PEER%s' % k: {
'peer_type': 'nr',
'xn_addr': peer.xn_addr
}
})
%}
{%- endfor %}
{%- 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' %}
......
......@@ -43,15 +43,15 @@
"$ref": "instance-ors-enb-input-schema.json#/properties/rx_gain"
},
"gnb_id": {
"$ref": "instance-gnb-input-schema.json#/properties/gnb_id",
"$ref": "instance-enb-input-schema.json#/properties/gnb_id",
"default": "0x12345"
},
"gnb_id_bits": {
"$ref": "instance-gnb-input-schema.json#/properties/gnb_id_bits",
"$ref": "instance-enb-input-schema.json#/properties/gnb_id_bits",
"default": 28
},
"amf_list": {
"$ref": "instance-gnb-input-schema.json#/properties/amf_list",
"$ref": "instance-enb-input-schema.json#/properties/amf_list",
"default": {
"1": {
"amf_addr": "127.0.1.100"
......@@ -59,7 +59,7 @@
}
},
"plmn_list": {
"$ref": "instance-gnb-input-schema.json#/properties/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)",
"default": {
"1": {
......@@ -69,7 +69,7 @@
}
},
"nssai": {
"$ref": "instance-gnb-input-schema.json#/properties/nssai"
"$ref": "instance-enb-input-schema.json#/properties/nssai"
},
"nr_handover_a3_offset": {
"title": "A3 offset for NR handover",
......@@ -170,11 +170,11 @@
"use_ipv4": {
"$ref": "instance-ors-enb-input-schema.json#/properties/use_ipv4"
},
"gnb_stats_fetch_period": {
"$ref": "instance-gnb-input-schema.json#/properties/gnb_stats_fetch_period"
"enb_stats_fetch_period": {
"$ref": "instance-ors-enb-input-schema.json#/properties/enb_stats_fetch_period"
},
"gnb_drb_stats_enabled": {
"$ref": "instance-gnb-input-schema.json#/properties/gnb_drb_stats_enabled"
"enb_drb_stats_enabled": {
"$ref": "instance-ors-enb-input-schema.json#/properties/enb_drb_stats_enabled"
},
"max_rx_sample_db": {
"$ref": "instance-ors-enb-input-schema.json#/properties/max_rx_sample_db"
......
......@@ -22,7 +22,7 @@ extra-context =
# ORS-specific enb and gnb
# both are served by instance-ors-enb, which translates
# ORS enb/gnb schemas to generic enb/gnb with only one RU and one LTE or NR CELL
# ORS enb/gnb schemas to generic enb with only one RU and one LTE or NR CELL
[dynamic-template-ors-enb]
< = dynamic-template-enb
url = ${template-ors-enb:target}
......
......@@ -101,7 +101,6 @@ init =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
enb = dynamic-template-enb:output
gnb = dynamic-template-enb:output
core-network = dynamic-template-core-network:output
ue = dynamic-template-ue:output
RootSoftwareInstance = $${:core-network}
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer Cell. Common properties",
"type": "object",
"required": [
"cell_type",
"pci",
"tac"
],
"properties": {
"cell_type": {
"type": "string",
"options": { "hidden": true }
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer Cell",
"type": "object",
"oneOf": [
{ "$ref": "../../peer/cell/lte/input-schema.json" },
{ "$ref": "../../peer/cell/nr/input-schema.json" }
]
}
......@@ -5,6 +5,7 @@
"type": "object",
"required": [
"cell_type",
"pci",
"tac",
......@@ -13,6 +14,12 @@
],
"properties": {
"cell_type": {
"$ref": "../../../peer/cell/common.json#/properties/cell_type",
"const": "lte",
"template": "lte"
},
"e_cell_id": {
"title": "E-UTRAN Cell ID",
"description": "28 bit E-UTRAN cell identity. Concatenation of enb_id and cell_id of the neighbour cell.",
......
......@@ -5,6 +5,7 @@
"type": "object",
"required": [
"cell_type",
"pci",
"tac",
......@@ -16,6 +17,12 @@
],
"properties": {
"cell_type": {
"$ref": "../../../peer/cell/common.json#/properties/cell_type",
"const": "nr",
"template": "nr"
},
"nr_cell_id": {
"title": "NR Cell ID",
"description": "Concatenation of gnb_id and cell_id of the neighbour cell",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Values returned by Peer Cell instantiation (stub)",
"type": "object",
"properties": {}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer. Common properties",
"type": "object",
"required": [
"peer_type"
],
"properties": {
"peer_type": {
"type": "string",
"options": { "hidden": true }
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer eNB/gNB",
"type": "object",
"oneOf": [
{ "$ref": "../peer/lte/input-schema.json" },
{ "$ref": "../peer/nr/input-schema.json" }
]
}
......@@ -5,10 +5,18 @@
"type": "object",
"required": [
"peer_type",
"x2_addr"
],
"properties": {
"peer_type": {
"$ref": "../../peer/common.json#/properties/peer_type",
"const": "lte",
"template": "lte"
},
"x2_addr": {
"title": "X2 Address",
"description": "X2 Address of the neighbour node (eNB Address)",
......
......@@ -5,10 +5,18 @@
"type": "object",
"required": [
"peer_type",
"xn_addr"
],
"properties": {
"peer_type": {
"$ref": "../../peer/common.json#/properties/peer_type",
"const": "nr",
"template": "nr"
},
"xn_addr": {
"title": "XN Address",
"description": "XN Address of the neighbour node (gNB Address)",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Values returned by Peer eNB/gNB instantiation (stub)",
"type": "object",
"properties": {}
}
......@@ -134,7 +134,6 @@
{%- do _ru_set_defaults(ru) %}
{%- do ru_dict.update({ru_ref: ru}) %}
{%- do cell.update({'cell_type': 'lte' if do_lte else 'nr'}) %}
{%- do _cell_set_defaults(cell, cell_dict) %}
{%- endfor %}
......@@ -195,19 +194,9 @@
peer_dict keeps configured peers: {} peer reference -> peer
#}
{%- macro load_peer(peer_dict) %}
{%- if do_lte %}
{%- for ref, peer in slapparameter_dict.x2_peers %}
{%- do peer.update({'peer_type': 'lte'}) %}
{%- do peer_dict.update({ref: peer}) %}
{%- endfor %}
{%- elif do_nr %}
{%- for ref, peer in slapparameter_dict.xn_peers %}
{%- do peer.update({'peer_type': 'nr'}) %}
{%- do peer_dict.update({ref: peer}) %}
{%- endfor %}
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
{%- for ref, peer in slapparameter_dict.peers|dictsort %}
{%- do peer_dict.update({ref: peer}) %}
{%- endfor %}
{%- endmacro %}
......@@ -217,13 +206,6 @@
#}
{%- macro load_peercell(peercell_dict) %}
{%- for ref, peercell in slapparameter_dict.ncell_list|dictsort %}
{%- if do_lte %}
{%- do peercell.update({'cell_type': 'lte'}) %}
{%- elif do_nr %}
{%- do peercell.update({'cell_type': 'nr'}) %}
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
{%- do peercell_dict.update({ref: peercell}) %}
{%- endfor %}
{%- endmacro %}
......
......@@ -39,10 +39,7 @@ def j2render(src, out, jcfg):
f.write(r._render().decode())
def do(src, out, rat, slapparameter_dict):
assert rat in ('lte', 'nr')
jdo_lte = json.dumps(rat == 'lte')
jdo_nr = json.dumps(rat == 'nr')
def do(src, out, slapparameter_dict):
defaults = {
"com_ws_port": 9001,
"com_addr": "127.0.1.2",
......@@ -50,8 +47,7 @@ def do(src, out, rat, slapparameter_dict):
"gnb_id_bits": 28,
"nssai": {'1': {'sst': 1}},
"ncell_list": {},
"x2_peers": {},
"xn_peers": {},
"peers": {},
"gtp_addr": "127.0.1.1",
}
slapparameter_dict = slapparameter_dict.copy()
......@@ -66,8 +62,6 @@ def do(src, out, rat, slapparameter_dict):
"slapparameter_dict": %(jslapparameter_dict)s
}"""
json_params = """{
"do_lte": %(jdo_lte)s,
"do_nr": %(jdo_nr)s,
"ors": {"one-watt": true},
"slap_configuration": {
"tap-name": "slaptap9"
......@@ -88,12 +82,14 @@ def do(src, out, rat, slapparameter_dict):
def do_enb():
peer_lte = {
'cell_type': 'lte',
'e_cell_id': '0x12345',
'pci': 35,
'dl_earfcn': 700,
'tac': 123,
}
peer_nr = {
'cell_type': 'nr',
'nr_cell_id': '0x77712',
'gnb_id_bits': 22,
'dl_nr_arfcn': 520000,
......@@ -113,9 +109,10 @@ def do_enb():
'rx_gain': 43,
}
do('enb.jinja2.cfg', 'enb.cfg', 'lte', {
do('enb.jinja2.cfg', 'enb.cfg', {
'enb_id': "0x1A2D0",
'cell_list': {'CELL': {
'cell_type': 'lte',
'rf_mode': 'tdd',
'dl_earfcn': 36100,
'bandwidth': 10,
......@@ -131,10 +128,11 @@ def do_enb():
'plmn_list': {"1": {'plmn': '00101'}},
"ncell_list": {'1': peer_lte},
})
do('enb.jinja2.cfg', 'gnb.cfg', 'nr', {
do('enb.jinja2.cfg', 'gnb.cfg', {
'gnb_id': "0x12345",
'gnb_id_bits': 28,
'cell_list': {'CELL': {
'cell_type': 'nr',
'rf_mode': 'tdd',
'dl_nr_arfcn': 380000,
'nr_band': 39,
......@@ -147,17 +145,17 @@ def do_enb():
'inactivity_timer': 10000,
'ru': ru,
}},
"amf_list": {"1": {"amf_addr": "127.0.1.100"}},
"plmn_list": {'1': {'plmn': '00101', 'tac': 100}},
"ncell_list": {'1': peer_nr},
"amf_list": {"1": {"amf_addr": "127.0.1.100"}},
"plmn_list_5g": {'1': {'plmn': '00101', 'tac': 100}},
"ncell_list": {'1': peer_nr},
})
# TODO render drb.cfg + sib.asn for all cells
def do_ue():
do('ue.jinja2.cfg', 'ue-lte.cfg', 'lte', {'ue_type': 'lte', 'rue_addr': 'host1'})
do('ue.jinja2.cfg', 'ue-nr.cfg', 'nr', {'ue_type': 'nr', 'rue_addr': 'host2'})
do('ue.jinja2.cfg', 'ue-lte.cfg', {'ue_type': 'lte', 'rue_addr': 'host1'})
do('ue.jinja2.cfg', 'ue-nr.cfg', {'ue_type': 'nr', 'rue_addr': 'host2'})
def main():
......
......@@ -4,28 +4,20 @@
"serialisation": "json-in-xml",
"software-type": {
"enb": {
"title": "eNB",
"title": "eNB/gNB",
"software-type": "enb",
"description": "eNodeB Configuration",
"description": "eNodeB/gNodeB Configuration",
"request": "instance-enb-input-schema.json",
"response": "instance-enb-schema.json",
"index": 1
},
"gnb": {
"title": "gNB",
"software-type": "gnb",
"description": "gNodeB Configuration",
"request": "instance-gnb-input-schema.json",
"response": "instance-gnb-schema.json",
"index": 2
},
"core-network": {
"title": "Core Network",
"software-type": "core-network",
"description": "Core Network Configuration",
"request": "instance-core-network-input-schema.json",
"response": "instance-core-network-schema.json",
"index": 3
"index": 2
},
"core-network-slave": {
"title": "→ Core Network | Sim Card",
......@@ -34,7 +26,7 @@
"request": "sim/input-schema.json",
"response": "sim/schema.json",
"shared": true,
"index": 4
"index": 3
},
"ue": {
"title": "UE",
......@@ -42,7 +34,7 @@
"software-type": "ue",
"request": "instance-ue-input-schema.json",
"response": "instance-ue-schema.json",
"index": 5
"index": 4
}
}
}
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