• Kirill Smelkov's avatar
    software/ors-amarisoft: enb/generic: Tighten defaults · 95e1a3bd
    Kirill Smelkov authored
    We currently have 2 kinds of software:
    
    - ORS, whose intended usage is small private networks, and
    - generic, whose intended usage is small-to-medium networks.
    
    and currently they both share defaults for their parameters inherited from ORS.
    But what is appropriate for small private networks, might be not so appropriate
    for medium networks.
    
    For example ORS has default enb_id/gnb_id, but in a network with 100 nodes, it
    is better to force every node to be explicitly assigned an id and error
    otherwise. Similarly for cells ORS has defaults for cell_id, but in network
    with many nodes, cell_id needs to be explicitly assigned. With having a default
    there is also a chance to misspell the parameter name, and do not notice it
    because the software will instantiate without an error but work incorrectly.
    
    So in this patch we tighten the defaults for generic:
    
    - enb_id, mme_list become non-optional for LTE
    - gnb_id, afm_list become non-optional for NR
    - plmn_list becomes non-optional for both LTE and NR. The format is different
      in between RATs and so later we will use plmn_list and plmn_list_5g when
      merging enb and gnb.
    
    - the following parameters of LTE cells now needs to be explicitly configured:
      rf_mode, dl_earfcn, bandwidth, cell_id, pci, tac.
    - the following parameters of  NR cells now needs to be explicitly configured:
      rf_mode, dl_nr_arfcn, nr_band, bandwidth, cell_id, pci.
    
    We rework ORS mode to translate its own set of parameters and defaults into
    generic enb/gnb parameters.
    
    We similarly pull some global generic defaults into instance-enb.cfg.jinja2
    with the idea that they could be maintained in one central place. In the future
    it would be good to automatically load them from JSON schemas to avoid
    duplication.
    
    This patch should be backward compatible for ORS, but it introduces the change
    in cell_id and pci in rendered enb.cfg which become 1 instead of 0:
    
        --- a/config/old/enb.cfg
        +++ b/config/out/enb.cfg
        @@ -33,9 +33,9 @@
               n_antenna_dl: 2,
               n_antenna_ul: 2,
    
        -      cell_id:    0x00,
        +      cell_id:    0x01,
               tac:        0x0001,
        -      n_id_cell:  0,
        +      n_id_cell:  1,
               root_sequence_index: 204,
               dl_earfcn:  36100,
               inactivity_timer: 10000,
    
    The defaults for those parameters according to instance-enb-input-schema.json
    are 0x01 and 1. And it looks like enb.jinja2.cfg was changed to emit them starting from
    0 instead of 1 in c4d0958e due to probable thinko in that patch because before
    that patch those parameters were emitted as 0x01 and 1:
    
        nexedi/slapos@c4d0958e
    
    and, once again, the schema says their defaults should be 0x01 and 1 as well.
    
    The rest of the changes in rendered enb.cfg and gnb.cfg should not introduce
    any semantic difference. Please see the appendix for full details.
    
    --------
    
    Appendix. Diff for rendered enb.cfg and gnb.cfg before and after this patch:
    
    ```
    $ ./pythonwitheggs slapos-render-config.py && xdiff -w config/{old,out}
    ```
    
    ```diff
    diff --git a/config/old/enb.cfg b/config/out/enb.cfg
    index 89862f1d9..5842dfc22 100644
    --- a/config/old/enb.cfg
    +++ b/config/out/enb.cfg
    @@ -33,9 +33,9 @@
           n_antenna_dl: 2,
           n_antenna_ul: 2,
    
    -      cell_id:    0x00,
    +      cell_id:    0x01,
           tac:        0x0001,
    -      n_id_cell:  0,
    +      n_id_cell:  1,
           root_sequence_index: 204,
           dl_earfcn:  36100,
           inactivity_timer: 10000,
    @@ -102,8 +102,11 @@
       ],
       cell_default: {
         plmn_list: [
    -      "00101",
    -
    +      {
    +        plmn: "00101",
    +        reserved: false,
    +        attach_without_pdn: false,
    +      },
         ],
         cyclic_prefix: "normal",
    
    diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
    index 1df699a22..635c4baf2 100644
    --- a/config/old/gnb.cfg
    +++ b/config/out/gnb.cfg
    @@ -22,7 +22,7 @@
         },
       ],
       gtp_addr: "127.0.1.1",
    -
    +  xn_peers: [],
       gnb_id_bits: 28,
       gnb_id: 0x12345,
       en_dc_support: true,
    @@ -142,6 +142,7 @@
    
       nr_cell_default: {
         ssb_period: 20,
    +
         plmn_list: [
           {
             plmn: "00101",
    @@ -151,10 +152,10 @@
               {
                 sst: 1,
               },
    -
             ],
           },
         ],
    +
         si_window_length: 40,
         cell_barred: false,
         intra_freq_reselection: true,
    ```
    95e1a3bd
instance-ors-enb.jinja2.cfg 5.03 KB