An error occurred fetching the project authors.
  1. 13 Feb, 2024 17 commits
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Cosmetics · acd01805
      Kirill Smelkov authored
      Typos, whitespace changes, etc...
      acd01805
    • Kirill Smelkov's avatar
      software/ors-amarisoft: ue: Generalize UEsim · 30179be5
      Kirill Smelkov authored
      Rework UEsim to be able to work with multiple cells, multiple radio units(*),
      multiple UE all at the same time. RU, CELLs and UEs are now configured,
      simiularly to eNB, via shared instances. Add tests.
      
      Contrary to ORS don't care about backward compatibility here because currently
      we have just a few UEsim deployments and migrating them should be easy.
      
      Please see added schemas, tests and updates slapos-render-config on how to use
      the new system.
      
      (*) contrary to eNB UEsim does not allow to use one RU for two cells,
      30179be5
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb/generic: Protect from buildout code injection · c83fa3cb
      Kirill Smelkov authored
      We currently have at least the following problem:
      
      1. a malfored shared instance reference leads to instantiation failure and
         potential buildout code injection. For example if reference of shared
         instance contains space then buildout fails with something like
      
             zc.buildout.configparser.ParsingError: File contains parsing errors: .../instance-enb.cfg
                 [line 45]: '[promise-testing partition 0.RU-sdr-busy]\n'
      
         since, when requesting, it is possible to use arbitrary characters for
         references, including newline, it also opens the door for code injection attacks.
      
      2. we currently use `json` directive of slapos.recipe.template e.g. as
      
           extra-context =
               json iru_dict   {{ rulib.iru_dict   | tojson }}
      
         this also potentially leads to instantiation failure if JSON(rulib.iru_dict)
         contains buildout control characters.
      
      Solve this problems.
      
      For 1 we develop "buildout encoding" that encodes arbitrary string into form
      that is safe to be used as a name of buildout section. This encoding never fails
      and does not loose information, which means it is safe to be applied
      unconditionanly and there is no chance for two string inputs to result in the
      same encoded form. The encoding also has practical property that it leaves most
      of the strings, that we use in our buildot profiles, intact. Which means that
      the result of the encoding is readable and the encoding can be applied almost
      unconditionally to all strings without hurting instantiation. Then this
      encoding is applied wherever reference of a shared instance is used to form
      e.g. name of buildout section or inside other codes. We apply this encoding
      universally - in config files too to avoid breakage there - e.g. in enb.cfg to
      protect from e.g. \n being inserted in the middle of comment resulting in YAML
      breakage. See documentation of added xbuildout.py for details.
      
      For 2 we switch from `json` to using `dumps` on an object and referring that
      dumps result via `key` directive.
      
      See the following links for preliminary discussions with Jérome and Vincent on
      this topic:
      
      kirr/slapos@d5d4f7c8
      bf6b2ef3
      c83fa3cb
    • 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
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb/generic: Switch cell type to be a runtime parameter · 08731df7
      Kirill Smelkov authored
      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.
      08731df7
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Start to generalize the code to handle multiple peer cells · a9101bd9
      Kirill Smelkov authored
      As with Radio Units and cells organize a registry of peer cells and start to handle
      that registry generally everywhere. The registry is still populated with only
      LTE cells on enb and only NR cells on gnb, but the only place that is aware of
      that is registry loading routine.
      
      In the old code defaults were noticed for tac to be 1 if not provided, and so
      those defaults are pushed to live in ORS now. ORS schemas are also updated
      because that defaults were not declared there.
      
      Generic switches to use peer/cell/lte directly which means that now it accepts
      e_cell_id instead of cell_id as the name for full E-UTRAN cell identity. Full
      backward compatibility is provided for ORS which implements translation of its
      original schema to the new generic one.
      
      Tests will be added later as full tests for generic MultiRU.
      
      Rendered enb.cfg and gnb.cfg change a bit, but the changes are mostly due to
      reordering of fields. The only change with semantic value is
      
          -          ssb_nr_arfcn: ,
          +          ssb_nr_arfcn: 520090,
      
      in gnb.cfg .
      
      The old configuration was invalid anyway because if it is only
      
                    ssb_nr_arfcn: ,
      
      then enb does not start with the following error:
      
          # ../lteenb gnb.cfg
          gnb.cfg:119: unexpected token: ','
      
      Like with many other handover-related fields
      https://tech-academy.amarisoft.com/lteenb.doc#prop.ncell_list.ssb_nr_arfcn
      documents that ssb_nr_arfcn "Must be present" for Inter-gNB HO case. The old
      code was erroneously doing `ncell.get(name, '')` with yielding empty string in
      case a parameter is missing, which is corrected here.
      
      --------
      
      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 1a2c41b6b..252c2e379 100644
      --- a/config/old/enb.cfg
      +++ b/config/out/enb.cfg
      @@ -46,9 +46,9 @@
               // Inter-ENB HO
               {
                 rat:          "eutra",
      +          cell_id:      0x12345,  // -> 1
                 n_id_cell:    35,
                 dl_earfcn:    700,
      -          cell_id:      0x12345,
                 tac:          123,
               },
             ],
      diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
      index 635c4baf2..b401f3513 100644
      --- a/config/old/gnb.cfg
      +++ b/config/out/gnb.cfg
      @@ -58,14 +58,14 @@
               // Inter-ENB HO
               {
                 rat:          "nr",
      +          nr_cell_id:   0x77712, // -> 1
      +          gnb_id_bits:  22,
      +          n_id_cell:    75,
                 dl_nr_arfcn:  520000,
      -          ssb_nr_arfcn: ,
      +          band:         38,
      +          ssb_nr_arfcn: 520090,
                 ul_nr_arfcn:  520000,
      -          n_id_cell:    75,
      -          gnb_id_bits:  22,
      -          nr_cell_id:   0x77712,
                 tac:          321,
      -          band:         38,
                 ssb_subcarrier_spacing: 30,
                 ssb_period: 20,
                 ssb_offset: 0,
      ```
      a9101bd9
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Start to generalize the code to handle multiple peers · 58ff8e24
      Kirill Smelkov authored
      Add X2 peers support for symmetry with XN peers.
      
      As with Radio Units and cells organize a registry of peers and start to handle
      that registry generally everywhere. The registry is still populated with only
      LTE peers on enb and only NR peers on gnb, but the only place that is aware of
      that is registry loading routine.
      
      Tests will be added later as full tests for generic MultiRU.
      
      Rendered gnb.cfg stays the same, but there is a small change in rendered enb
      but the config remains with the previous semantic as before hereby 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 5842dfc22..1a2c41b6b 100644
      --- a/config/old/enb.cfg
      +++ b/config/out/enb.cfg
      @@ -22,6 +22,7 @@
           },
         ],
         gtp_addr: "127.0.1.1",
      +  x2_peers: [],
         enb_id: 0x1A2D0,
      
         // LTE cells
      ```
      58ff8e24
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb+ue: Switch to JSON schemas as the primary source... · bd55f250
      Kirill Smelkov authored
      software/ors-amarisoft: enb+ue: Switch to JSON schemas as the primary source of defaults; stop rendering them
      
      JSON schemas for eNB/gNB and UE specify defaults for many parameters and the
      software release use those defaults when parameters are not explicitly
      specified on the instantiation.
      
      Some primary defaults - for bandwidth and n_antenna DL/UL - were setup in
      render-templates and propagated through all places to avoid duplicating them.
      
      Defaults for many other parameters were duplicated in both JSON schemas and in
      the code that handles those parameters.
      
      To avoid this duplication we either need to extend render-templates and put
      defaults for all the other many parameters there, or just switch to JSON
      schemas to be primary source of those defaults, and use the schemas on
      instantiation by automatically loading them and extracting defaults for all
      parameters from there.
      
      I decided to go the second way because it avoids additional layer of rendering
      and the need to keep on remembering not to put raw defaults in the JSON
      schemas. Evidently this is the same approach that Rapid CDN is going to take
      (see !1380 for details).
      
      In this patch we stop rendering JSON schemas and keep their last rendered
      result. In the later patches we will handle formed duplication there and go on
      to further merge enb and gnb.
      
      UE is handled brutally for now, because it will be much reworked after.
      
      Actually loading JSON schemas is left as TODO as I do not have resources to
      implement that now. Still this step is needed as precondition for further
      patches. I hope bit of duplication for enb/gnb parameters is ok, given that
      they are now centrally maintained and corresponding TODO warning is in place.
      bd55f250
    • 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:
      
          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
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Switch RU to be a runtime parameter · c4ecf5a0
      Kirill Smelkov authored
      Previously RU type was static parameter of particular software - it was
      possible to instantiate cells only with selected RU type for particular template.
      
      In MultiRU it will be 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 RU to be runtime parameter as a preparatory step for that.
      
      There is now only two software releases:
      
        - ORS (software-ors.cfg), and
        - generic (software.cfg).
      
      ORS behaviour stays the same as before here by patch.
      
      For generic each cell in cell_list now needs to explicitly specify which kind
      of RU it wants to use and with which parameters. There are less defaults: for
      example which CPRI board and SFP port to use now needs to be explicitly
      specified.
      
      Only ORS tests are left for now. The old test{LOPCOMM,M2RU,ANY} did not
      exercised any driver-specific functionality and until recently were not run at
      all due to '-' in their file name. We remove them for now and we will add tests
      for generic in a soon follow-up patch after switching LTE/NR cell type to also
      be a runtime parameter.
      
      Backward compatibility:
      
        * nothing changes for ORS
        * for generic all RU-related parameters are now moved from cell_list to
          cell_list.ru, there are several renames and besides ru_type ru_link_type also
          needs to be specified. Please see new RU-related JSON schemas added into
          ru/ for details. Cell_list itself now also does not provide a default with
          one cell - if no cells are configured no cells are instantiated.
      
      --------
      
      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 1b39f7044..89862f1d9 100644
      --- a/config/old/enb.cfg
      +++ b/config/out/enb.cfg
      @@ -6,7 +6,7 @@
      
         // Radio Units
         rf_driver: {
      -      // default-RU 2T2R  (ors)
      +      // CELL-RU 2T2R  (sdr)
             name: "sdr",
             args: "dev0=/dev/sdr0",
             rx_antenna:"tx_rx",
      @@ -27,7 +27,7 @@
         // LTE cells
         cell_list: [
      
      -    // default  (default-RU)
      +    // CELL  (CELL-RU)
           {
             rf_port:      0,
             n_antenna_dl: 2,
      @@ -90,11 +90,11 @@
             srs_hopping_bandwidth: 0,
           },
      
      -    drb_config: "default-drb.cfg",
      +    drb_config: "CELL-drb.cfg",
      
           sib_sched_list: [
             {
      -        filename: "default-sib23.asn",
      +        filename: "CELL-sib23.asn",
               si_periodicity: 16,
             },
           ],
      diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
      index 05deb5ada..1df699a22 100644
      --- a/config/old/gnb.cfg
      +++ b/config/out/gnb.cfg
      @@ -6,7 +6,7 @@
      
         // Radio Units
         rf_driver: {
      -      // default-RU 2T2R  (ors)
      +      // CELL-RU 2T2R  (sdr)
             name: "sdr",
             args: "dev0=/dev/sdr0",
             rx_antenna:"tx_rx",
      @@ -35,7 +35,7 @@
         // NR cells
         nr_cell_list: [
      
      -      // default  (default-RU)
      +      // CELL  (CELL-RU)
             {
               rf_port:      0,
               n_antenna_dl: 2,
      @@ -136,7 +136,7 @@
                 ],
               },
      
      -        drb_config: "default-drb.cfg",
      +        drb_config: "CELL-drb.cfg",
             },
         ],
      ```
      c4ecf5a0
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Switch rf_mode to be runtime parameter · b111a2c1
      Kirill Smelkov authored
      Previously rf_mode was static parameter of particular software - it was
      possible to instantiate cells only of the mode selected for particular template.
      
      In MultiRU it will be possible to generally instantiate all kind of cells -
      LTE/NR and TDD/FDD all at the same time.
      
      -> Switch rf_mode to be runtime parameter as a preparatory step for that.
      
      Software for ORS becomes just software-ors.cfg with software-tdd-ors.cfg
      providing backward compatibility proxy as we have many ORS'es currently
      deployed with that software-release URL. For other softwares backward
      compatibility is not preserved including for software-fdd-ors.cfg because we
      practically have very few deployments with those.
      
      To show tdd_ul_dl_config only for TDD we use conditional feature of new JSON-editor.
      
      Backward compatibility: nothing changes for ORS, for everything else rf_mode
      now needs to be explicitly set in cell parameters if it is not TDD.
      
      Rendered enb.cfg and gnb.cfg stay the same.
      b111a2c1
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Start to generalize the code to handle multiple cells · d015c20c
      Kirill Smelkov authored
      As with Radio Units organize a registry of cells and start to handle that
      registry generally everywhere. Make parameters that configure cells, for
      example tdd_ul_dl_config, dl_earfcn, bandwidth, pci, etc to be per-cell.
      
      Cell registry is still populated from cell_list and slapparameter_dict.
      
      Tests will be added later as full tests for generic MultiRU.
      
      Rendered enb.cfg and gnb.cfg stay practically the same.
      
      Backward compatibility: no change for ORS; For everything else cell parameters
      stop to be global and are moved to cell_list.
      
      --------
      
      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 5c6743c21..1b39f7044 100644
      --- a/config/old/enb.cfg
      +++ b/config/out/enb.cfg
      @@ -1,6 +1,3 @@
      -
      -
      -
       {
         log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
         log_filename: "log/enb.log",
      @@ -93,11 +90,11 @@
             srs_hopping_bandwidth: 0,
           },
      
      -    drb_config: "drb",
      +    drb_config: "default-drb.cfg",
      
           sib_sched_list: [
             {
      -        filename: "sib",
      +        filename: "default-sib23.asn",
               si_periodicity: 16,
             },
           ],
      diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
      index 6b04559c6..1fa637925 100644
      --- a/config/old/gnb.cfg
      +++ b/config/out/gnb.cfg
      @@ -1,6 +1,3 @@
      -
      -
      -
       {
         log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
         log_filename: "log/enb.log",
      @@ -77,7 +74,6 @@
           manual_ref_signal_power: true,
           ss_pbch_block_power: 8,
      
      -
           tdd_ul_dl_config: {
             pattern1: {
                period: 5, /* in ms */
      @@ -148,7 +144,7 @@
             ],
           },
      
      -    drb_config: "drb",
      +    drb_config: "default-drb.cfg",
         },
         ],
         nr_cell_default: {
      ```
      d015c20c
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Start to generalize the code to handle multiple Radio Units · 0a285a34
      Kirill Smelkov authored
      Add code to organize a registry of Radio Units and handle that registry generally everywhere.
      
      RU registry is still populated from cell_list and in practice there still can
      be radio units only of the same type, but besides slaplte.load_ru_and_cell
      which is aware of that, the rest of the code tries to do everything as if
      RUs of different type could be present simultaneously.
      
      Now it is not only lopcomm who can do multiCELL, but also sunwave and SDR as well.
      
      gNB also starts to gain support for cell_list, because cell_list loading is
      uniformly applied to both eNB and gNB. However, since enb.cfg is not yet
      prepared to handle multiple NR cells yet, there is an assert that in case of NR
      there is only one RU/cell present there. We will remove this limitation in a
      follow-up patch.
      
      Later we will also change the loading to load RU descriptions from shared instances
      and they won't be constrained to be Radio Units of the same type. But we need
      to prepare a lot to be able to do that.
      
      One more step forward towards MultiRU.
      
      Tests will be added later as full tests for generic MultiRU.
      
      Backward compatibility: no change for ORS and practically no breaking change for everything else.
      
      --------
      
      Appendix. Diff for rendered enb.cfg and gnb.cfg before and after this patch:
      
      ```
      $ ./pythonwitheggs slapos-render-config.py && git diff -w --no-index config/{old,out}
      ```
      
      ```diff
      diff --git a/config/old/enb.cfg b/config/out/enb.cfg
      index 884483b0a..cafdf42be 100644
      --- a/config/old/enb.cfg
      +++ b/config/out/enb.cfg
      @@ -1,24 +1,22 @@
      
      -
       {
         log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
         log_filename: "log/enb.log",
      
      -
      +  // Radio Units
         rf_driver: {
      +      // default-RU 2T2R  (ors)
             name: "sdr",
             args: "dev0=/dev/sdr0",
      -
             rx_antenna:"tx_rx",
             tdd_tx_mod: 1,
         },
      -  tx_gain: 62,
      -  rx_gain: 43,
      -
      +  tx_gain: [62, 62],
      +  rx_gain: [43, 43],
         com_addr: "127.0.1.2:9001",
         // LTE core network
         mme_list: [
      @@ -36,6 +34,8 @@
      
         // LTE cells
         cell_list: [
      +
      +    // default  (default-RU)
           {
             rf_port:      0,
             n_antenna_dl: 2,
      diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
      index fd57ca3dc..7818b4ea8 100644
      --- a/config/old/gnb.cfg
      +++ b/config/out/gnb.cfg
      @@ -1,24 +1,22 @@
      
      -
       {
         log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,phy.level=info,file.rotate=1G,file.path=/dev/null",
         log_filename: "log/enb.log",
      
      -
      +  // Radio Units
         rf_driver: {
      +      // default-RU 2T2R  (ors)
             name: "sdr",
             args: "dev0=/dev/sdr0",
      -
             rx_antenna:"tx_rx",
             tdd_tx_mod: 1,
         },
      -  tx_gain: 62,
      -  rx_gain: 43,
      -
      +  tx_gain: [62, 62],
      +  rx_gain: [43, 43],
         com_addr: "127.0.1.2:9001",
         // NR core network
         amf_list: [
      ```
      0a285a34
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb+ue: Query slapparameter_dict from master only once · 2149bc2d
      Kirill Smelkov authored
      We are currently querying it in instance.cfg and later, once again, in e.g. instance-enb.jinja2.cfg .
      
      However ORS mode will need to adjust slapparameter_dict with ORS defaults
      and pass it further to generic enb. So it won't work if we use
      slapparameter_dict obtained the second time because the second query will
      return unadjusted original slapparameter_dict.
      
      In this patch we are only doing preparatory step - redo the code not query the
      master from instance-{enb,ue}.jinja2.cfg and work with slapparameter_dict and
      slap_configuration already queried by instance.cfg
      
      For UE the change is trivial.
      
      For eNB instance-enb.jinja2.cfg used to set the defaults for com, mme, amf and
      gtp in the same section used for the second query. We rework those defaults to
      be applied to slapparameter_dict via jinja2 - via the same way we are going to
      later use in ORS mode.
      
      Handling defaults for everything besides gtp_addr is straightforward. For
      gtp_addr it has the semantic difference when explicitly given, and given only
      implicitly. In the latter case the intent of original code is to autodetect
      whether to use an address on loopback, or externally-visible address.
      
      Original code used the check for emptiness of mme_list/amf_list as the
      condition for "use loopback". Since now those lists, after applying their
      defaults, are never empty we rework the code to see if core address is on the
      loopback or not, and use auto-GTP-on-loopback only if core is also on loopback.
      This should, hopefully, be more convenient as it also works ok out of the box
      if core is on loopback, but its address was explicitly specified. Previously
      for such cases gtp_addr was also needed to be specified, and now it should work
      without that.
      
      No change to rendered enb.cfg and gnb.cfg besides whitespace.
      
      Adjust ipv6-random usage in core-network for consistency with enb as well.
      2149bc2d
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Rename cell_list -> cell_dict internally · 0f8ee720
      Kirill Smelkov authored
      That data structure is really a dict, not list. It is more clear to name it appropriately.
      
      -> Do the renaming but keep cell_list intact as described in JSON schemas so
         that external interface remains unchanged.
      
      Rendered enb.cfg and gnb.cfg remain the same.
      0f8ee720
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb+ue: Make ru_type and do_lte/do_nr to be accessible at instance level · fbb0d0c1
      Kirill Smelkov authored
      Not only inside rendered enb.jinja2.cfg and ue.jinja2.cfg because we will need
      that information in slaplte and slaplte is imported by instance-enb and
      instance-ue.
      fbb0d0c1
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb+ue: Stop using slap_configuration to propagate LTE and NR defaults · 563a21ca
      Kirill Smelkov authored
      instance-enb and instance-ue currently setup that slap_configuration with
      LTE/NR defaults to be accessible from enb.jinja2.cfg and ue.jinja2.cfg. But we
      will soon need to have access to those defaults from slaplte.jinja2 as well,
      and it will break if left as is because when slaplte is imported from e.g.
      enb.jinja2 - it will work, but when slaplte is imported from instance-enb it
      will break because parent of instance-enb (instance.cfg) does not setup
      defaults in slap_configuration at that level.
      
      The fix is to either duplicate slap_configuration at instance.cfg level, or to
      switch access to the defaults to go via original default_* parameters.
      
      We go the second way for simplicity.
      563a21ca
  2. 30 Jan, 2024 3 commits
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Merge instance-gnb.jinja2.cfg into instance-enb.jinja2.cfg · 503e50a4
      Kirill Smelkov authored
      In MultiRU one enb will be driving multiple, possible of different kind,
      TDD/FDD and LTE/NR cells all at the same time, because that standard
      functionality of a base station and because original Amarisoft software
      supports that out of the box.
      
      However we currently have enb and gnb services separate and duplicating most of
      each other code.
      
      -> Merge instance-enb.jinja2.cfg and instance-gnb.jinja2.cfg as a preparatory step for MultiRU.
      
      - instance-enb.jinja2.cfg pulls gnb specific bits from instance-gnb.jinja2.cfg
      - instance-gnb.jinja2.cfg goes away effectively switching gnb to use
        ru/libinstance.jinja2.cfg like enb already does
      - For parameters that were duplicated as enb_<X> and gnb_<X>  generic software
        now accepts only enb_<X> with ORS mode wrapper providing backward
        compatibility for gnb_* parameters. For example if gnb_config_link is given
        for a gnb instance, it will be translated to enb_config_link to underlying
        generic enb so that gnb_config_link works correctly.
      
        For ORS we care to provide 100% backward compatibility because there are many ORS'es deployed.
        For generic software we are free to clean things up as needed, because there
        is not much generic deployments at this time.
      
      /cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /proposed-for-review-on !1522
      /reviewed-by TrustMe
      
      --------
      
      Appendix. Diff between instance-enb.jinja2.cfg and instance-gnb.jinja2.cfg before this patch
      
      ```
      $ git diff --no-index instance-enb.jinja2.cfg instance-gnb.jinja2.cfg
      ```
      
      ```diff
      diff --git a/instance-enb.jinja2.cfg b/instance-gnb.jinja2.cfg
      index 6d4ce7e94..6ee62b3ff 100644
      --- a/instance-enb.jinja2.cfg
      +++ b/instance-gnb.jinja2.cfg
      @@ -1,19 +1,25 @@
       {#- defaults for eNB radio parameters.
           NOTE they are installed temporary and will go away after switch to generic multiRU. #}
       {%- do RF.setdefault('tx_gain',     slapparameter_dict.get('tx_gain',     0)) %}
       {%- do RF.setdefault('rx_gain',     slapparameter_dict.get('rx_gain',     0)) %}
      -{%- do RF.setdefault('dl_earfcn',   slapparameter_dict.get('dl_earfcn',   0)) %}
      +{%- do RF.setdefault('dl_nr_arfcn', slapparameter_dict.get('dl_nr_arfcn', 0)) %}
      +{%- do RF.setdefault('nr_band',     slapparameter_dict.get('nr_band',     0)) %}
      
       [buildout]
       parts =
         directory
      -  enb-config
      +  gnb-config
         enb-service
         xamari-xlog-service
       {% if slapparameter_dict.get('xlog_fluentbit_forward_host') %}
         xlog-fluentbit-service
       {% endif %}
      +  amarisoft-stats-service
      +  amarisoft-rf-info-service
      +  check-sdr-busy.py
         check-baseband-latency.py
      +  check-amarisoft-stats-log.py
      +  check-rx-saturated.py
         monitor-base
         publish-connection-information
      
      @@ -23,11 +29,6 @@ eggs-directory = {{ eggs_directory }}
       develop-eggs-directory = {{ develop_eggs_directory }}
       offline = true
      
      -{%- import 'slaplte.jinja2'            as slaplte with context  %}
      -{%- import 'ru_libinstance.jinja2.cfg' as rulib   with context  %}
      -{{ rulib.buildout() }}
      -
      -
       [monitor-httpd-conf-parameter]
       httpd-include-file = {{ buildout_directory }}/etc/httpd-include-file.conf
       port = ${monitor-instance-parameter:monitor-httpd-port}
      @@ -52,10 +53,11 @@ 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
      -configuration.default_lte_bandwidth = {{ default_lte_bandwidth }}
      -configuration.default_lte_inactivity_timer = {{ default_lte_inactivity_timer }}
      +configuration.default_nr_bandwidth = {{ default_nr_bandwidth }}
      +configuration.default_nr_inactivity_timer = {{ default_nr_inactivity_timer }}
      +configuration.default_nr_ssb_pos_bitmap = {{ default_nr_ssb_pos_bitmap }}
       configuration.default_n_antenna_dl = {{ default_n_antenna_dl }}
       configuration.default_n_antenna_ul = {{ default_n_antenna_ul }}
      
      @@ -63,6 +65,7 @@ configuration.default_n_antenna_ul = {{ default_n_antenna_ul }}
       recipe = slapos.cookbook:mkdirectory
       software = {{ buildout_directory }}
       home = ${buildout:directory}
      +etc = ${:home}/etc
       var = ${:home}/var
       etc = ${:home}/etc
       bin = ${:home}/bin
      @@ -73,30 +76,32 @@ service = ${:etc}/service
       promise = ${:etc}/promise
       log = ${:var}/log
      
      -{% if slapparameter_dict.get("enb_config_link", None) %}
      -[enb-config-dl]
      +{% if slapparameter_dict.get("gnb_config_link", None) %}
      +[gnb-config-dl]
       recipe = slapos.recipe.build:download
      -url = {{ slapparameter_dict.get("enb_config_link") }}
      -version = {{ slapparameter_dict.get("enb_config_version") }}
      +url = {{ slapparameter_dict.get("gnb_config_link") }}
      +version = {{ slapparameter_dict.get("gnb_config_version") }}
       offline = false
       {% endif %}
      
       [enb-sh-wrapper]
       recipe = slapos.recipe.template
       output = ${directory:bin}/${:_buildout_section_name_}
      -enb-log = ${directory:log}/enb-output.log
      +gnb-log = ${directory:log}/gnb-output.log
       inline =
         #!/bin/sh
       {% if not slapparameter_dict.get("testing", False) %}
         sudo -n /opt/amarisoft/rm-tmp-lte;
         sudo -n /opt/amarisoft/init-sdr;
         sudo -n /opt/amarisoft/init-enb;
      -  (echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting eNB software..." && echo) >> ${:enb-log};
      -  tail -c 1M ${:enb-log} > ${:enb-log}.tmp;
      -  mv ${:enb-log}.tmp ${:enb-log};
      -  {{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${:enb-log} 2>> ${:enb-log};
      +  (echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting gNB software..." && echo) >> ${:gnb-log};
      +  tail -c 1M ${:gnb-log} > ${:gnb-log}.tmp;
      +  mv ${:gnb-log}.tmp ${:gnb-log};
      +  {{ enb }}/lteenb ${directory:etc}/gnb.cfg >> ${:gnb-log} 2>> ${:gnb-log};
      +
       {% endif %}
      
      +### eNodeB (enb)
       [enb-service]
       recipe = slapos.cookbook:wrapper
       command-line = ${enb-sh-wrapper:output}
      @@ -105,7 +110,7 @@ mode = 0775
       reserve-cpu = True
       pidfile = ${directory:run}/enb.pid
       hash-files =
      -  ${enb-config:output}
      +  ${gnb-config:output}
         ${enb-sh-wrapper:output}
       environment =
         LD_LIBRARY_PATH={{ openssl_location }}/lib
      @@ -114,22 +119,23 @@ environment =
       [xamari-xlog-script]
       recipe = slapos.recipe.template
       output = ${directory:bin}/${:_buildout_section_name_}
      -period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
      +period = {{ slapparameter_dict.get("gnb_stats_fetch_period", 60) }}
       stats_logspec = stats[samples,rf]/${:period}s
      -{%- if slapparameter_dict.get("enb_drb_stats_enabled", True) %}
      +{%- if slapparameter_dict.get("gnb_drb_stats_enabled", True) %}
       drb_stats_logspec = x.drb_stats/${:period}s
       {%- else %}
       drb_stats_logspec =
       {%- endif %}
       rotatespec = 100MB.9
       logspec = ${:stats_logspec} ${:drb_stats_logspec}
      -{%- if slapparameter_dict.get("websocket_password", "") %}
      +logspec = ${:stats_logspec} ${:drb_stats_logspec}
      +{% if slapparameter_dict.get("websocket_password", "") %}
       websock = ws://[${slap-configuration:ipv6-random}]:9001
      -{%- else %}
      +{% else %}
       websock = ws://127.0.1.2:9001
      -{%- endif %}
      +{% endif %}
       xamari = {{ buildout_directory }}/bin/xamari
      -logfile = ${monitor-directory:public}/enb.xlog
      +logfile = ${monitor-directory:public}/gnb.xlog
       inline =
         #!/bin/sh
         exec ${:xamari} xlog --rotate ${:rotatespec} ${:websock} ${:logfile} ${:logspec}
      @@ -177,6 +183,52 @@ wrapper-path = ${directory:service}/${:_buildout_section_name_}
       hash-files = ${:fluentbit-config}
       {% endif %}
      
      +[amarisoft-stats-template]
      +recipe = slapos.recipe.template:jinja2
      +extensions = jinja2.ext.do
      +log-output = ${directory:var}/log/amarisoft-stats.json.log
      +context =
      +  section directory directory
      +  key slapparameter_dict slap-configuration:configuration
      +  key log_file :log-output
      +  raw stats_period {{ slapparameter_dict.get("gnb_stats_fetch_period", 60) }}
      +  raw testing {{ slapparameter_dict.get("testing", False) }}
      +  raw python_path {{ buildout_directory}}/bin/pythonwitheggs
      +mode = 0775
      +url = {{ ru_amarisoft_stats_template }}
      +output = ${directory:bin}/amarisoft-stats.py
      +
      +[amarisoft-rf-info-template]
      +recipe = slapos.recipe.template:jinja2
      +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 log_file :log-output
      +  raw stats_period {{ slapparameter_dict.get("gnb_stats_fetch_period", 60) }}
      +  raw testing {{ slapparameter_dict.get("testing", False) }}
      +  raw python_path {{ buildout_directory}}/bin/pythonwitheggs
      +mode = 0775
      +url = {{ ru_amarisoft_rf_info_template }}
      +output = ${directory:bin}/amarisoft-rf-info.py
      +
      +[amarisoft-stats-service]
      +recipe = slapos.cookbook:wrapper
      +command-line = ${amarisoft-stats-template:output}
      +wrapper-path = ${directory:service}/amarisoft-stats
      +mode = 0775
      +hash-files =
      +  ${amarisoft-stats-template:output}
      +
      +[amarisoft-rf-info-service]
      +recipe = slapos.cookbook:wrapper
      +command-line = ${amarisoft-rf-info-template:output}
      +wrapper-path = ${directory:service}/amarisoft-rf-info
      +mode = 0775
      +hash-files =
      +  ${amarisoft-rf-info-template:output}
      +
       [config-base]
       recipe = slapos.recipe.template:jinja2
       extensions = jinja2.ext.do
      @@ -190,53 +242,47 @@ context =
         raw gtp_addr_v4 {{ lan_ipv4 }}
         raw tx_gain {{ RF.tx_gain }}
         raw rx_gain {{ RF.rx_gain }}
      -  raw earfcn  {{ RF.dl_earfcn }}
      +  raw nr_arfcn {{ RF.dl_nr_arfcn }}
      +  raw nr_band {{ RF.nr_band }}
         raw software_name {{ software_name }}
         raw rf_mode {{ rf_mode }}
         raw trx {{ trx }}
         raw bbu {{ bbu }}
         raw ru_type {{ ru }}
      -  json do_lte true
      -  json do_nr  false
      +  json do_lte false
      +  json do_nr  true
         import  netaddr netaddr
         ${:extra-context}
      
      -[sib-config]
      -<= config-base
      -url = {{ sib23_template }}
      -output = ${directory:etc}/sib23.cfg
      -
       [drb-config]
       <= config-base
      -url = {{ drb_lte_template }}
      +url = {{ drb_nr_template }}
       output = ${directory:etc}/drb.cfg
      
      -[enb-config]
      +[gnb-config]
       <= config-base
      -{% if slapparameter_dict.get("enb_config_link", None) %}
      -url = ${enb-config-dl:target}
      +{% if slapparameter_dict.get("gnb_config_link", None) %}
      +url = ${gnb-config-dl:target}
       {% else %}
       url = {{ enb_template }}
       {% endif %}
      -output = ${directory:etc}/enb.cfg
      +output = ${directory:etc}/gnb.cfg
       extra-context =
           import json_module json
      -    json cell_list {{ rulib.cell_list | tojson }}
      -    key sib23_file sib-config:output
           key drb_file   drb-config:output
       import-list =
           rawfile slaplte.jinja2 {{ slaplte_template }}
      
      -
       [publish-connection-information]
       <= monitor-publish
       recipe = slapos.cookbook:publish.serialised
       {%- if slapparameter_dict.get("websocket_password", "") %}
       websocket_url = ws://[${slap-configuration:ipv6-random}]:9001
       {%- endif %}
      -enb-ipv6 = ${slap-configuration:ipv6-random}
      -enb-ipv4 = {{ lan_ipv4 }}
      -current-earfcn  = {{ RF.dl_earfcn }}
      +gnb-ipv6 = ${slap-configuration:ipv6-random}
      +gnb-ipv4 = {{ lan_ipv4 }}
      +current-nr-arfcn = {{ RF.dl_nr_arfcn }}
      +current-nr-band = {{ RF.nr_band }}
       amarisoft-version = {{ lte_version }}
       license-expiration = {{ lte_expiration }}
       monitor-gadget-url = ${:monitor-base-url}/gadget/software.cfg.html
      @@ -253,10 +299,35 @@ password = {{ slapparameter_dict['monitor-password'] | string }}
       <= monitor-promise-base
       name = ${:_buildout_section_name_}
      
      +[check-sdr-busy.py]
      +<= macro.promise
      +promise = check_sdr_busy
      +config-testing = {{ slapparameter_dict.get("testing", False) }}
      +config-sdr = {{ sdr }}
      +config-sdr_dev  = 0
      +config-dma_chan = 0
      +
       [check-baseband-latency.py]
       <= macro.promise
       promise = check_baseband_latency
       config-testing = {{ slapparameter_dict.get("testing", False) }}
      -config-amarisoft-stats-log = ${ru_amarisoft-stats-template:log-output}
      -config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
      +config-amarisoft-stats-log = ${amarisoft-stats-template:log-output}
      +config-stats-period = {{ slapparameter_dict.get("gnb_stats_fetch_period", 60) }}
       config-min-rxtx-delay = {{ slapparameter_dict.get("min_rxtx_delay", 0) }}
      +
      +[check-amarisoft-stats-log.py]
      +<= macro.promise
      +promise = check_amarisoft_stats_log
      +output = ${directory:plugins}/check-amarisoft-stats-log.py
      +config-testing = {{ slapparameter_dict.get("testing", False) }}
      +config-amarisoft-stats-log = ${amarisoft-stats-template:log-output}
      +config-stats-period = {{ slapparameter_dict.get("gnb_stats_fetch_period", 60) }}
      +
      +[check-rx-saturated.py]
      +<= macro.promise
      +promise = check_rx_saturated
      +config-testing = {{ slapparameter_dict.get("testing", False) }}
      +config-rf-rx-chan-list = {{ list(range(0, int(slapparameter_dict.get('n_antenna_ul', default_n_antenna_ul)))) }}
      +config-amarisoft-stats-log = ${amarisoft-stats-template:log-output}
      +config-stats-period = {{ slapparameter_dict.get("gnb_stats_fetch_period", 60) }}
      +config-max-rx-sample-db = {{ slapparameter_dict.get("max_rx_sample_db", 0) }}
      ```
      503e50a4
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Start to introduce ORS mode · f3f1cb46
      Kirill Smelkov authored
      In MultiRU we are going to have generic software with flexible configuration
      and many features + ORS software, which wraps the generic part, adds ORS
      specific features, and translates simple ORS schema to generic ones.
      
      Let's first move ORS-specific bits to dedicated place as a preparatory step for that:
      
      - add software-ors.cfg . In the future software-ors.cfg will be the entry point
        for ORS mode, but for now it is only a place from where software-ors-* extend from.
      
      - add instance-ors.cfg . We move ORS-specific code from instance.cfg here and
        set it to use instance-ors-enb.jinja2.cfg when instantiating enb/gnb.
      
      - add instance-ors-enb.jinja2.cfg . This pulls ORS-specific code from
        instance-enb.jinja2.cfg + instance-gnb.jinja2.cfg and wraps them with ORS
        context built by instance-ors.cfg
      
      - in the templates the way to see whether it is ORS or not, and if yes, to access
        ORS parameters is changed: now it is always via checking `ors` object, which
        can be either False for non-ORS mode, or dict for ORS mode, and if it is dict
        the keys inside that dict are ORS specific properties, e.g. ors['one-watt'].
      
        This adjustment is handy to organize ORS mode extension from generic with
        generic setting `json ors false` in the context, and ORS mode undoing that and
        setting ORS context properly. I think the code also reads more clear this way, i.e. with
      
       	{%- if one_watt == "True" %}
      
        changed to
      
      	{%- if ors['one-watt'] %}
      
        because in the second variant it is clear that one-watt is a property of ORS.
      
      The rendered configs for enb.cfg and gnb.cfg stay unchanged.
      
      /cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /proposed-for-review-on !1522
      /reviewed-by TrustMe
      f3f1cb46
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Rename ors-id -> comp-id · a6a4d2d4
      Kirill Smelkov authored
      We use computer identifier in fluentd forwarding. This identifier was named as
      ors-id, but it applies not only to ORS, but also to generic deployment with
      BBU.
      
      In the next patch we are going to introduce ORS mode and move ORS-specific
      bits to software-ors.cfg and instance-ors.cfg + co. The computer identifier
      will stay in generic part, because it is generic.
      
      -> To avoid ambiguity rename it to be clearly unrelated to ORS specifics.
      
      /cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /proposed-for-review-on !1522
      /reviewed-by TrustMe
      a6a4d2d4
  3. 25 Jan, 2024 2 commits
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb.jinja2.cfg: Stop using C Preprocessor and switch to Jinja2 completely · 79370ebf
      Kirill Smelkov authored
      To support multiple Radio Units and multiple cells, we will need to loop over them
      and emit corresponding configuration parts taking RU/Cell parameters into
      account for each part. We currently handle some such parameters at Jinja2 level
      (e.g. dl_earfcn), while some other parameters at CPP level (e.g. cell
      bandwidth) and rely on enb to preprocess generated enb.cfg with CPP on its own.
      
      While CPP works ok for simple 1RU-1CELL cases, and CPP is also the tool that Amarisoft
      itself uses in its examples, it has the limitation that it cannot cooperate
      with loops. In other words there can be only one global N_RB_DL #define, and it
      cannot be different for different cells while we are looping over them at
      Jinja2 level. That means that we cannot use CPP to handle multiple cells.
      
      For this reason switch enb.jinja2.cfg to be using Jinja2 only without CPP.
      
      While rendered enb.cfg/gnb.cfg change, we can see that they change in expected
      way, with leaving only blocks that should be active for input parameters. See
      the Appendix for details.
      
      The switch is straightforward but one thing deserves to be mentioned: due to
      limitation of Jinja2, where macros can return only strings, we use JSON
      encoding to be able to return arbitrary types - integers, floats, dicts, etc,
      and use a convention to name such macros with j prefix and wrap their usage
      with J so that whole invocation does not add much noise. See added slaplte.J
      documentation for details.
      
      /cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /reviewed-by @jhuge
      /reviewed-on !1520
      
      --------
      
      Appendix. Diff for rendered enb.cfg/gnb.cfg before and after this patch
      
      ```
      $ git diff --no-index config/{old,out}
      ```
      
      ```diff
      diff --git a/config/old/enb.cfg b/config/out/enb.cfg
      index 23e56c9a9..ee2661640 100644
      --- a/config/old/enb.cfg
      +++ b/config/out/enb.cfg
      @@ -1,14 +1,6 @@
      
      -#define TDD                 1
      -
      -#define N_RB_DL             50
      -
      -#define N_ANTENNA_DL        2
      -
      -#define N_ANTENNA_UL        2
      -
      
       {
      
      @@ -44,8 +36,8 @@
         cell_list: [
           {
             rf_port: 0,
      -      n_antenna_dl: N_ANTENNA_DL,
      -      n_antenna_ul: N_ANTENNA_UL,
      +      n_antenna_dl: 2,
      +      n_antenna_ul: 2,
      
             cell_id: 0x00,
             tac: 0x0001,
      @@ -59,83 +51,33 @@
      
           manual_ref_signal_power: true,
      
      -
      -#if TDD == 1
           uldl_config: 6,
           sp_config: 7,
      -#endif
      -
      -    n_rb_dl: N_RB_DL,
      -#if N_RB_DL == 6
      -    si_coderate: 0.30,
      -#else
      -    si_coderate: 0.20,
      -#endif
      +    n_rb_dl: 50,
      +    si_coderate: 0.2,
      
           pdsch_dedicated: {
      -#if N_ANTENNA_DL == 4
      -      p_a: -6,
      -#elif N_ANTENNA_DL == 2
             p_a: -3,
      -#else
      -      p_a: 0,
      -#endif
             p_b: -1,
           },
      
      -#if N_RB_DL == 6
      -    pdcch_format: 1,
      -#else
      -    pdcch_format: 2,
      -#endif
      -
      -#if N_RB_DL == 6
      -    prach_config_index: 15,
      -#else
      +    pdcch_format:       2,
           prach_config_index: 4,
      -#endif
      -
      -#if N_RB_DL == 6
      -    initial_cqi: 5,
      -#else
      -    initial_cqi: 3,
      -#endif
      +    initial_cqi:        3,
      
           pucch_dedicated: {
             n1_pucch_sr_count: 11,
             cqi_pucch_n_rb: 1,
             n1_pucch_an_cs_count: 8,
             n3_pucch_an_n_rb: 3,
      -#if TDD == 1
             tdd_ack_nack_feedback_mode: "multiplexing", /* TDD only */
      -#endif
           },
      -
      -#if N_ANTENNA_DL >= 2
           m_ri: 8,
           transmission_mode: 3,
      -#endif
      
           srs_dedicated: {
      -#if N_RB_DL == 6
      -      srs_bandwidth_config: 7,
      -      srs_bandwidth: 1,
      -#elif N_RB_DL == 15
      -      srs_bandwidth_config: 6,
      -      srs_bandwidth: 1,
      -#elif N_RB_DL == 25
      -      srs_bandwidth_config: 3,
      -      srs_bandwidth: 1,
      -#elif N_RB_DL == 50
             srs_bandwidth_config: 2,
             srs_bandwidth: 2,
      -#elif N_RB_DL == 75
      -      srs_bandwidth_config: 2,
      -      srs_bandwidth: 2,
      -#else
      -      srs_bandwidth_config: 2,
      -      srs_bandwidth: 3,
      -#endif
             srs_subframe_config: 3,
             srs_period: 40,
             srs_hopping_bandwidth: 0,
      diff --git a/config/old/gnb.cfg b/config/out/gnb.cfg
      index 5bfd3bb01..0b6a1445c 100644
      --- a/config/old/gnb.cfg
      +++ b/config/out/gnb.cfg
      @@ -1,13 +1,6 @@
      
      -#define TDD                 1
      -
      -
      -#define N_ANTENNA_DL        2
      -
      -#define N_ANTENNA_UL        2
      -
      
       {
      
      @@ -50,8 +43,8 @@
         nr_cell_list: [
         {
           rf_port: 0,
      -    n_antenna_dl: N_ANTENNA_DL,
      -    n_antenna_ul: N_ANTENNA_UL,
      +    n_antenna_dl: 2,
      +    n_antenna_ul: 2,
      
           cell_id: 0x01,
           n_id_cell: 500,
      @@ -108,29 +101,10 @@
           csi_rs: {
             nzp_csi_rs_resource: [
               {
      -#if N_ANTENNA_DL == 1
      -          n_ports: 1,
      -          frequency_domain_allocation: "row2",
      -          bitmap: "100000000000",
      -          cdm_type: "no_cdm",
      -#elif N_ANTENNA_DL == 2
                 n_ports: 2,
                 frequency_domain_allocation: "other",
                 bitmap: "100000",
                 cdm_type: "fd_cdm2",
      -#elif N_ANTENNA_DL == 4
      -          n_ports: 4,
      -          frequency_domain_allocation: "row4",
      -          bitmap: "100",
      -          cdm_type: "fd_cdm2",
      -#elif N_ANTENNA_DL == 8
      -          n_ports: 8,
      -          frequency_domain_allocation: "other",
      -          bitmap: "110011",
      -          cdm_type: "fd_cdm2",
      -#else
      -#error unsupported number of DL antennas
      -#endif
               },
      
             ],
      @@ -148,22 +122,10 @@
      
             csi_report_config: [
               {
      -#if N_ANTENNA_DL > 1
                 codebook_config: {
                   codebook_type: "type1",
                   sub_type: "typeI_SinglePanel",
      -#if N_ANTENNA_DL == 2
      -#elif N_ANTENNA_DL == 4
      -            n1: 2,
      -            n2: 1,
      -            codebook_mode: 1,
      -#elif N_ANTENNA_DL == 8
      -            n1: 4,
      -            n2: 1,
      -            codebook_mode: 1,
      -#endif
                 },
      -#endif
               },
             ],
           },
      ```
      79370ebf
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb.jinja2.cfg: Switch ru to be a namespace to hold Radio Unit parameters · 6404f810
      Kirill Smelkov authored
      In the next patch we will switch usage of C Preprocessor to Jinja2, and in jinja2 doing set from under if, as e.g. in
      
          {%- if ru == 'm2ru' %}
          {%-   set n_antenna_ul = 1  %}
          {%- endif %}
      
      does _not_ have the effect of setting n_antenna_ul=1 outside of the if block.
      
      That, however, can be worked around with usage of namespace objects, so the following works as intended:
      
          {%- set x = namespace() %}
          {%- if ru == 'm2ru' %}
          {%-   set x.n_antenna_ul = 1  %}
          {%- endif %}
      
      with x.n_antenna_ul=1 if ru was m2ru.
      
      So taking into account this, and that in MultiRU ru will be denoting
      RadioUnit-related configuration, let's switch ru to be a namespace object with
      ru.ru_type denoting type of attached radio unit.
      
      This both goes as a preparatory step for MultiRU and also allows to switch from
      CPP to Jinja2 in the next patch.
      
      /cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /reviewed-by @jhuge
      /reviewed-on nexedi/slapos!1520
      6404f810
  4. 19 Jan, 2024 3 commits
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Merge gnb.jinja2.cfg into enb.jinja2.cfg · f365a440
      Kirill Smelkov authored
      In MultiRU there will be only one ENB which supports all TDD, FDD, LTE and NR
      cells and different types of radio units - all at the same time. This patch is
      preparatory step for that: it merges gnb configuration template into enb
      configuration template, so that enb.jinja2.cfg now serves both enb and gnb
      instances.
      
      In this patch for now we only move code from gnb.jinja2.cfg without changing
      it(*) and wrap parts with `if do_lte` and `if do_nr` correspondingly.
      
      The end result of rendered enb.cfg and gnb.cfg stays the same modulo space
      changes and added innoccent `#define TDD` as Appendix shows.
      
      (*) the only exception is set up of gtp_addr which has practically the same
      code, was wrapped with `if mme_list` in enb and `if amf_list` in gnb, and is now
      wrapped with `if mme_list or amf_list`.
      
      /cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /reviewed-by @jhuge
      /reviewed-on !1512
      
      --------
      
      Appendix. Diff for rendered enb.cfg and gnb.cfg before and after this patch.
      
      ```
      $ ./pythonwitheggs slapos-render-config.py && (git diff -w --no-index config/enb.cfg.old config/enb.cfg ; git diff -w --no-index config/gnb.cfg.old config/gnb.cfg)
      ```
      
      ```diff
      diff --git a/config/enb.cfg.old b/config/enb.cfg
      index fdf3ab24d..cb46697ea 100644
      --- a/config/enb.cfg.old
      +++ b/config/enb.cfg
      @@ -1,11 +1,15 @@
      
      +
       #define TDD                 1
      
       #define N_RB_DL             50
      +
       #define N_ANTENNA_DL        2
      +
       #define N_ANTENNA_UL        2
      
      +
       {
      
         log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,s1ap.level=debug,s1ap.max_size=1,x2ap.level=debug,x2ap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rota>
      @@ -24,7 +28,6 @@
         rx_gain: 43,
      
         com_addr: "127.0.1.2:9001",
      -
         mme_list: [
      
           {
      @@ -33,9 +36,9 @@
      
         ],
      
      +
         gtp_addr: "127.0.1.1",
      
      -
         enb_id: 0x1A2D0,
      
         cell_list: [{
      @@ -49,7 +52,6 @@
             ],
           }
         ],
      -
         cell_default: {
           plmn_list: [
             "00101",
      @@ -226,4 +228,6 @@
         meas_gap_config: "gp0",
         ho_from_meas: true,
         },
      +
      +
       }
      \ No newline at end of file
      diff --git a/config/gnb.cfg.old b/config/gnb.cfg
      index e3d671e09..4e47a2094 100644
      --- a/config/gnb.cfg.old
      +++ b/config/gnb.cfg
      @@ -1,15 +1,21 @@
      
      +
      +#define TDD                 1
      +
      +
       #define N_ANTENNA_DL        2
      
       #define N_ANTENNA_UL        2
      
      +
       {
      
         log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,ngap.level=debug,ngap.max_size=1,xnap.level=debug,xnap.max_size=1,rrc.level=debug,rrc.max_size=1,phy.level=info,file.rota>
      
         log_filename: "log/gnb.log",
      
      +
         rf_driver: {
             name: "sdr",
             args: "dev0=/dev/sdr0",
      @@ -30,15 +36,17 @@
         ],
      
      -
      -
         gtp_addr: "127.0.1.1",
      
         gnb_id_bits: 28,
         gnb_id: 0x12345,
         en_dc_support: true,
      -  cell_list: [],
      +
      +  cell_list: [
      +  ],
      +
      +
         nr_cell_list: [
         {
           rf_port: 0,
      ```
      f365a440
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Push amarisoft-stats.jinja2.py and amarisoft-rf-info.jinja2.py into ru/ · 7502f5a1
      Kirill Smelkov authored
      Because
      
      1) those services are needed and used only by ru/ promises like check_cpri_lock
         and check_rx_saturated.
      2) in general we will need to initialize and setup radio units not only in eNB -
         for example UEsim will use the same code library to initialize radio units.
         Thus the proper place to keep everything required for RU to be operational have to
         be located inside ru/ and activated by that radio-units library.
      
      Push corresponding code from instance-enb to ru/ and do only minor adjustments
      to instance-gnb trying not to break it, since gnb does not currently use rulib,
      and because in the future gnb will be replaced by enb which will be serving
      both lte and nr cells in the same service.
      
      /cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /reviewed-by @jhuge
      /reviewed-on nexedi/slapos!1511
      7502f5a1
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Push SSH server code into ru/lopcomm/ · d29ece87
      Kirill Smelkov authored
      Because:
      
      - ssh server is needed for and used by ru/lopcomm/ only
      - in general we will need to initialize and setup radio units not only in eNB -
        for example UEsim will use the same code library to initialize radio units.
        Thus the proper place to keep everything required for RU to be operational have to
        be located inside ru/ and activated by that radio-units library.
      
      /cc @lu.xu, @tomo, @xavier_thompson, @Daetalus
      /reviewed-by @jhuge
      /reviewed-on !1510
      d29ece87
  5. 29 Nov, 2023 2 commits
  6. 28 Nov, 2023 2 commits
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Push code, that organizes DHCP server for Radio Units, into ru/ · 17ea91a8
      Kirill Smelkov authored
      We already pushed dnsmasq part, that serves radio units into enb in 9f2b9db5.
      However we need to push those bits further to ru/ for the following reasons:
      
      - DHCP server is used to provide Radio Units with IP address only.
      - without IP address assigned those RUs cannot be initialized and do not go to radio at all.
      - in general we will need to initialize and setup radio units not only in eNB -
        for example UEsim will use the same code library to initialize radio units.
        Thus the proper place to keep everything required for RU to be operational have to
        be located inside ru/ and activated by that radio-units library.
      
      /cc @jhuge, @xavier_thompson, @Daetalus
      /reviewed-by @lu.xu
      /reviewed-on nexedi/slapos!1479
      17ea91a8
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Enable check-rx-saturated promise for Lopcomm Radio Unit as well · f5a8747d
      Kirill Smelkov authored
      The code had check-rx-saturated under `if not ru == "lopcomm"`, but checking RX
      signal for saturation is implemented on eNB side, not by RU itself, and is
      RU-independent because eNB only receives raw samples from RU and decides on its
      own whether those samples are higher than saturation margin or not.
      
      As an extra proof that checking for RX saturation is meaningful for Lopcomm too here is how samples.rx data can look like in the case of 2 Lopcomm Radio Units:
      
          root@callbox-005:/srv/slapgrid/slappart16/var/log# cat amarisoft-stats.json.log |jq .data.samples.rx
          [
            {
              "rms": -382.3080749511719,
              "max": -382.3080749511719,
              "sat": 0,
              "count": 1221181440,
              "rms_dbm": -382.3080749511719
            },
            {
              "rms": -382.3080749511719,
              "max": -382.3080749511719,
              "sat": 0,
              "count": 1221179392,
              "rms_dbm": -382.3080749511719
            }
          ]
          ...
      
      i.e. all the data, that check-rx-saturated promise works on, is there.
      
      /cc @jhuge, @xavier_thompson, @Daetalus
      /reviewed-by @lu.xu
      /reviewed-on !1478
      f5a8747d
  7. 21 Nov, 2023 2 commits
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Fix enb.cfg build in standalone mode (cell_list) · 32f9e132
      Kirill Smelkov authored
      In b0c37a4a (software/ors-amarisoft: Start to generalize existing
      lopcomm/multicell into multiRU slowly) I deduplicated cell_list initialization
      and moved it into single place, but overlooked that enb.cfg build became broken
      in standalone mode:
      
          .../software/ors-amarisoft$ ./pythonwitheggs slapos-render-config.py
          Traceback (most recent call last):
            File "/srv/slapgrid/slappart35/srv/project/slapos/software/ors-amarisoft/./pythonwitheggs", line 47, in <module>
              exec(compile(__file__f.read(), __file__, "exec"))
            File "slapos-render-config.py", line 88, in <module>
              do('enb', {"tdd_ul_dl_config": "[Configuration 6] 5ms 5UL 3DL (maximum uplink)"})
            File "slapos-render-config.py", line 86, in do
              j2render(cfg, json_params % locals())
            File "slapos-render-config.py", line 34, in j2render
              f.write(r._render().decode())
            File ".../eggs/slapos.recipe.template-5.1-py3.9.egg/slapos/recipe/template/jinja2_template.py", line 215, in _render
              return template_object.render(**self.context).encode(self.encoding)
            File ".../eggs/Jinja2-2.11.3-py3.9.egg/jinja2/environment.py", line 1090, in render
              self.environment.handle_exception()
            File ".../eggs/Jinja2-2.11.3-py3.9.egg/jinja2/environment.py", line 832, in handle_exception
              reraise(*rewrite_traceback_stack(source=source))
            File ".../eggs/Jinja2-2.11.3-py3.9.egg/jinja2/_compat.py", line 28, in reraise
              raise value.with_traceback(tb)
            File "config/enb.jinja2.cfg", line 1, in top-level template code
              {%- set cell_count = cell_list|length %}
          jinja2.exceptions.UndefinedError: 'cell_list' is undefined
      
      -> Fix it by teaching enb.jinja2.cfg to also load cell list in standalone by itself.
      
      Not touching gnb.jinja2.cfg as currently gnb does not support multicell at all,
      and in the future it will be sole enb.cfg to handle both LTE and NR
      simultaneously.
      
      /cc @jhuge, @lu.xu, @xavier_thompson, @Daetalus
      32f9e132
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Start to put common code to load cells and radio units... · 23581dc2
      Kirill Smelkov authored
      software/ors-amarisoft: Start to put common code to load cells and radio units and handle them into slaplte package
      
      We will soon need to use that shared code not only from radio library under ru/ ,
      but also from enb.jinja2.cfg and to fix slapos-render-config.
      
      /cc @jhuge, @lu.xu, @xavier_thompson, @Daetalus
      23581dc2
  8. 17 Nov, 2023 3 commits
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Adjust DHCP server to provide dedicated IPv6 to each Radio Unit · cbc3929c
      Kirill Smelkov authored
      By reusing recently added "split TAP" infrastructure we can adjust dnsmasq
      configuration to provide unique IPv6 to each RU.
      
      - ru_mac_addr becomes per-RU setting and without default. We talked with Lu, and
        since now all Lopcomm units are shipped from the factory with unique MAC, it
        both does not make sense to provide the default, and we can rely on all units
        to have different MACs and configure DHCP replies based on that.
      
      - No need to provide /64 network to every RU. We cannot actually do that anyway
        because normally SlapOS provides /71 address range for its slaptap. In the
        new configuration everything works with smaller networks just ok.
      
      /cc @jhuge, @xavier_thompson, @Daetalus
      /reviewed-by @lu.xu
      /reviewed-on nexedi/slapos!1472
      cbc3929c
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Split dnsmasq.cfg into for-core and for-enb · 9f2b9db5
      Kirill Smelkov authored
      Core Network and ENB use dnsmasq for completely different purposes:
      
      - core network uses it to provide DNS server, while
      - enb uses dnsmasq to provide DHCP server for Radio Units to be able to access
        Control & Management channel on the CPRI link.
      
      -> Even though both those services are handled via same dnsmasq program, it
         makes sense to split dnsmasq config for clarity and as preparation for
         further adjustments of enb part.
      
         We also push config rendering down to -core and -enb instances also for
         clarity, and because in enb case rendering will need to know set of
         configured Radio Units - information that will become loaded only at
         instance-enb.
      
      /cc @jhuge, @xavier_thompson, @Daetalus
      /reviewed-by @lu.xu
      /reviewed-on nexedi/slapos!1472
      9f2b9db5
    • Kirill Smelkov's avatar
      software/ors-amarisoft: enb: Move DRB configuration to standalone file · 8c841ce6
      Kirill Smelkov authored
      This is preparatory step for multiRU: when there will be several LTE cells,
      each possibly having different RF mode, we'll need to configure DRB per-cell.
      
      -> Move DRB configuration to separate jinja2 template to prepare to handle that.
      
      This is 99% movement only, without changing the code for DRB profile. We'll
      adjust the DRB profile a bit as another preparatory step in the next patch.
      
      /cc @xavier_thompson, @Daetalus
      /reviewed-by @jhuge, @lu.xu
      /reviewed-on nexedi/slapos!1473
      8c841ce6
  9. 16 Nov, 2023 1 commit
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Start to generalize existing lopcomm/multicell into multiRU slowly · b0c37a4a
      Kirill Smelkov authored
      Lopcomm part of the SR already has some partial support for cell_list: if
      multiple cells are defined there enb.cfg will have multiple CPRI radio units
      and multiple cells configured. But so far all promises, except cpri-link, were
      done only for one RU.
      
      -> Fix that by starting to generalize RUlib code to handle multiple radio
      units, invoking model-specific RU driver for each RU, and adjusting ru/lopcomm
      instance code to correctly generate and activate different promises for
      different radio units.
      
      After the patch multiRU support is still very incomplete, but it is a step forward.
      
      /cc @xavier_thompson, @Daetalus
      /reviewed-by @lu.xu
      /partly-reviewed-by @jhuge
      /reviewed-at !1467
      b0c37a4a
  10. 13 Nov, 2023 1 commit
  11. 06 Nov, 2023 1 commit
    • Kirill Smelkov's avatar
      software/ors-amarisoft: Start to organize Radio Unit related bits under ru/ · 4097a1bb
      Kirill Smelkov authored
      Bring more structure to RU-specific code as a preparatory step for multiRU support:
      
      - move RU-specific files under ru/<RU-type>/ . This mostly moves Lopcomm programs and configuration files there.
      - move RU-specific instance code there as well. This also mostly moves Lopcomm specific services and promises there.
      - bring more structure in naming. As buildout has global namespace use ru_<RU-type>_ prefix to avoid collision in names.
      
      This should be a preparatory patch with practically no semantic change, but
      preparing ground for further multiRU landing.
      
      /cc @xavier_thompson, @Daetalus
      /reviewed-by @jhuge, @lu.xu
      /reviewed-on nexedi/slapos!1466
      4097a1bb
  12. 02 Nov, 2023 2 commits
  13. 31 Oct, 2023 1 commit