stratum / fabric-tna

The SD-Fabric data plane
https://docs.sd-fabric.org/
30 stars 15 forks source link

[SDFAB-845] Generate slicing netcfg using script #460

Closed ccascone closed 2 years ago

ccascone commented 2 years ago

This PR updates the existing script to generate both Stratum and ONOS configs for slicing.

The validity of the netcfg output has been manually verified by pushing it to ONOS.

Example YAML input:

# Maximum bitrate allowed for system traffic (in bps)
system_max_rate_bps: 10000000 # 10 Mbps

# Bitrate of the slowest port in the network
network_bottleneck_bps: 1000000000 # 1 Gbps

# Slice configuration
# - name: slice friendly name
#   tcs: list of traffic classes within the slice
#     <tc-type>: control, realtime, or elastic
#       max_rate_bps: maximum bitrate allowed in bps (control and realtime only)
#       gmin_rate_bps: guaranteed minimum rate in bps (elastic only)
slices:
  - name: Slice1
    tcs:
      control:
        max_rate_bps: 10000000 # 10 Mbps
      realtime:
        max_rate_bps: 90000000 # 90 Mbps
      elastic:
        gmin_rate_bps: 50000000 # 50 Mbps
  - name: Slice2
    tcs:
      elastic:
        gmin_rate_bps: 200000000 # 200 Mbps
  - name: Slice3
    tcs:
      control:
        max_rate_bps: 7000000 # 7 Mbps
      realtime:
        max_rate_bps: 80000000 # 80 Mbps

Corresponding netcfg output:

{
  "apps": {
    "org.stratumproject.fabric-tna": {
      "slicing": {
        "slices": {
          "0": {
            "name": "Default",
            "tcs": {
              "REAL_TIME": {
                "queueId": 1,
                "maxRateBps": 10000000,
                "isSystemTc": true
              }
            }
          },
          "1": {
            "name": "Slice1",
            "tcs": {
              "CONTROL": {
                "queueId": 2,
                "maxRateBps": 10000000
              },
              "REAL_TIME": {
                "queueId": 3,
                "maxRateBps": 90000000
              },
              "ELASTIC": {
                "queueId": 5,
                "gminRateBps": 154423076
              }
            }
          },
          "2": {
            "name": "Slice2",
            "tcs": {
              "ELASTIC": {
                "queueId": 6,
                "gminRateBps": 617692307
              }
            }
          },
          "3": {
            "name": "Slice3",
            "tcs": {
              "CONTROL": {
                "queueId": 2,
                "maxRateBps": 7000000
              },
              "REAL_TIME": {
                "queueId": 4,
                "maxRateBps": 80000000
              }
            }
          }
        }
      }
    }
  }
}
codecov[bot] commented 2 years ago

Codecov Report

Merging #460 (6100134) into main (ac45f26) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 6100134 differs from pull request most recent head 757d5b2. Consider uploading reports for the commit 757d5b2 to get more accurate results Impacted file tree graph

@@            Coverage Diff            @@
##               main     #460   +/-   ##
=========================================
  Coverage     69.25%   69.25%           
  Complexity      692      692           
=========================================
  Files            59       59           
  Lines          4616     4616           
  Branches        514      514           
=========================================
  Hits           3197     3197           
  Misses         1157     1157           
  Partials        262      262           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ac45f26...757d5b2. Read the comment docs.