• Kirill Smelkov's avatar
    software/ors-amarisoft: enb/generic: Switch configuration of RU, cell, peer... · 80017f8c
    Kirill Smelkov authored
    software/ors-amarisoft: enb/generic: Switch configuration of RU, cell, peer and peercell to shared instances
    
    Previously we had cell_list, ncell_list and peers parameters and we now remove
    them and rework the software release to accept configuration for said objects
    via shared instances. In other words now it is possible to add Radio Units,
    cells, peers and peer cells on on top of main eNB service.
    
    Schema for parameters of those shared instances is based on what we just recently
    generalized and established in ru/ cell/ peer/ and peer/cell/ input schemas. We
    only add cell_kind=enb|enb_peer addition field to be able to distinguish a cell
    from peercell object, and we add a way for cell to reference RU one way or another.
    
    RU-CELL relation is no longer 1-1: one RU can be generally serving multiple
    cells. For example transmission bandwidth of SDR100 board is ~ 100MHz while
    bandwidth of one LTE cell is max 20MHz. This way it is possible to put several
    cells whose frequencies are nearby each other to be run on the same SDR
    board(*). And in general one Radio Unit can be serving transmission/reception in
    multiple frequency ranges, thus providing ability for multiple cells to be
    served by RU. This way RU is split off from CELL object and each CELL needs to
    say which RU object it wants to use.
    
    There are 3 ways to configure CELL->RU links:
    
    1. CELL references a RU object. This is the most general.
    2. CELL embeds definition of RU object. This variant is provided for simplicity
       of management for users that do not want to split CELL/RU relations.
    3. CELL2 references another cell object and says to use the same RU as CELL1.
       Again, this variant is provided for simplicity of management when users want to
       add a cell on top of same RU when they already started with "2".
    
    Full backward compatibility is provided for ORS. For this instance-ors-enb.jinja2.cfg
    is adjusted to inject synthetic RU/CELL/PEER/PEERCELL shared instances instead
    of translating to slapparameter_dict. As the result for ORS users it works
    without visible change as parameters with original ORS schema are handled as expected.
    
    Rendered files for ORS also stay practically the same as before this patch.
    
    The main change is in slaplte.jinja2 - in the loading routines. The other
    changes are mostly straightforward adaptation because details of how ru_dict,
    cell_dict, peer_dict and peercell_dict are loaded were already localized to
    slaplte and the rest of the code independent from that.
    
    Now, once we switched to shared instances, we will be finally able to add tests
    for updated enb. Please see a soon follow-up patch for that.
    
    And for existing test_ors.py we also temporary workaround breakage of tests,
    because currently generic code does not handle well special characters in
    partition references. For example it currently breaks on spaces with buildout
    complaining that sections with spaces in their name are invalid. We will fix
    that in another soon-followup patch as well, but apply a workaround for now.
    
    (*) see https://tech-academy.amarisoft.com/SDR_MultiCell_OneSdr.html for details.
    
    --------
    
    Appendix. Diff for rendered ORS enb.cfg and gnb.cfg before and after this patch:
    
    ```
    $ ./pythonwitheggs slapos-render-config.py && xdiff config/{old,out}
    ```
    
    ```diff
    diff --git a/config/old/ors/enb/enb.cfg b/config/out/ors/enb/enb.cfg
    index 15f3b68e9..6046d366e 100644
    --- a/config/old/ors/enb/enb.cfg
    +++ b/config/out/ors/enb/enb.cfg
    @@ -6,7 +6,7 @@
    
       // Radio Units
       rf_driver: {
    -      // CELL-RU 2T2R  (sdr)
    +      // RU 2T2R  (sdr)
           name: "sdr",
           args: "dev0=/dev/sdr0",
           rx_antenna:"tx_rx",
    @@ -28,7 +28,7 @@
       // LTE cells
       cell_list: [
    
    -    // CELL  (CELL-RU)
    +    // CELL  (RU)
         {
           rf_port:      0,
           n_antenna_dl: 2,
    @@ -46,7 +46,7 @@
             // Inter-ENB HO
             {
               rat:          "eutra",
    -          cell_id:      0x12345,  // -> 1
    +          cell_id:      0x12345,  // -> PEERCELL1
               n_id_cell:    35,
               dl_earfcn:    700,
               tac:          123,
    diff --git a/config/old/ors/gnb/enb.cfg b/config/out/ors/gnb/enb.cfg
    index ac564db6c..9473f3207 100644
    --- a/config/old/ors/gnb/enb.cfg
    +++ b/config/out/ors/gnb/enb.cfg
    @@ -6,7 +6,7 @@
    
       // Radio Units
       rf_driver: {
    -      // CELL-RU 2T2R  (sdr)
    +      // RU 2T2R  (sdr)
           name: "sdr",
           args: "dev0=/dev/sdr0",
           rx_antenna:"tx_rx",
    @@ -35,7 +35,7 @@
       // NR cells
       nr_cell_list: [
    
    -      // CELL  (CELL-RU)
    +      // CELL  (RU)
           {
             rf_port:      0,
             n_antenna_dl: 2,
    @@ -58,7 +58,7 @@
             // Inter-ENB HO
             {
               rat:          "nr",
    -          nr_cell_id:   0x77712, // -> 1
    +          nr_cell_id:   0x77712, // -> PEERCELL2
               gnb_id_bits:  22,
               n_id_cell:    75,
               dl_nr_arfcn:  520000,
    ```
    80017f8c
common.json 461 Bytes