Both the Upstream and Downstream Bandwidth Profiles can be 'named' and Referenced from a Subscriber Record in the SADIS DB on ONOS.

When the vOLT Appplication uses a Subscriber Record for OpenFlow message generation to VOLTHA the vOLT Application Must read the Bandwidth Profile name and be able to retrieve the Profile from a Database of Bandwidth Profiles. The Named Profile is converted to a Meter and Meter Band(s) and configured on the VOLTHA Instance, and the Flows will reference the Meter.

Note the code should be written to follow the SADIS DB model where it is designed to reference an external database but the DB records can be cached locally.

The Upstream Bandwidth Profile will consist of the following optional components:

EIR (Bits/Sec)

EBS (Bytes)

CIR (Bits/Sec)

CBS (Bits/Sec)

AIR (Bits/Sec)

The Downstream Bandwidth Profile will consist of the following optional components:

EIR (Bits/Sec)

EBS (Bytes)

CIR (Bits/Sec)

CBS (Bits/Sec)

 Each bandwidth component will be interpreted as defined in the Technology Profile Whitepaper ([^vOLTHA_Access_Tech_AugmentationV0.6.pdf]

)

Change-Id: Ie4edf4e9f27e9b5b9a84e6c733dc4f283a9996a7
diff --git a/app/src/main/resources/custom-topo.py b/app/src/main/resources/custom-topo.py
new file mode 100644
index 0000000..dfb414d
--- /dev/null
+++ b/app/src/main/resources/custom-topo.py
@@ -0,0 +1,69 @@
+'''
+ Copyright 2016-present Open Networking Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+'''
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.net import Mininet
+from mininet.topo import Topo
+from mininet.node import RemoteController, UserSwitch
+
+class MinimalTopo( Topo ):
+    "Minimal topology with a single switch and two hosts"
+
+    def build( self ):
+        # Create two hosts.
+        h1 = self.addHost( 'h1' )
+        h2 = self.addHost( 'h2' )
+
+        # Create a switch
+        s1 = self.addSwitch( 's1', cls=UserSwitch)
+
+        # Add links between the switch and each host
+        self.addLink( s1, h1 )
+        self.addLink( s1, h2 )
+
+def runMinimalTopo():
+    "Bootstrap a Mininet network using the Minimal Topology"
+
+    # Create an instance of our topology
+    topo = MinimalTopo()
+
+    # Create a network based on the topology using OVS and controlled by
+    # a remote controller.
+    net = Mininet(
+        topo=topo,
+        controller=lambda name: RemoteController( name, ip='127.0.0.1' ),
+        switch=UserSwitch,
+        autoSetMacs=True )
+
+    # Actually start the network
+    net.start()
+
+    # Drop the user in to a CLI so user can run commands.
+    CLI( net )
+
+    # After the user exits the CLI, shutdown the network.
+    net.stop()
+
+if __name__ == '__main__':
+    # This runs if this file is executed directly
+    setLogLevel( 'info' )
+    runMinimalTopo()
+
+# Allows the file to be imported using `mn --custom <filename> --topo minimal`
+topos = {
+    'minimal': MinimalTopo
+}