Adding scale reports for BBSim using BBr
Change-Id: I2a41fd37d99905d9baf7ce75b13aeb93fac7781d
diff --git a/README.md b/README.md
index b6dee44..4566a7d 100644
--- a/README.md
+++ b/README.md
@@ -144,13 +144,4 @@
More advanced documentation lives in the [here](./docs/README.md)
-## Know Issues
-
-In some runs, EAPOL fails with:
-```
-time="2019-09-20T21:24:31Z" level=error msg="Can't send EapStart Message: ONU {intfid:1, onuid:2} - Not DONE (GemportID is not set)" IntfId=1 OnuId=2 OnuSn=BBSM00000102 module=EAPOL
-time="2019-09-20T21:24:31Z" level=error msg="ONU failed to authenticate!" IntfId=1 OnuId=2 OnuSn=BBSM00000102 module=ONU
-```
-Investigate why this happens (we believe the source to be in the OMCI library)
-
> This project structure is based on [golang-standards/project-layout](https://github.com/golang-standards/project-layout).
diff --git a/docs/assets/bbr_runs.png b/docs/assets/bbr_runs.png
new file mode 100644
index 0000000..f436d44
--- /dev/null
+++ b/docs/assets/bbr_runs.png
Binary files differ
diff --git a/docs/bbr.md b/docs/bbr.md
index fafdf77..359d106 100644
--- a/docs/bbr.md
+++ b/docs/bbr.md
@@ -1,5 +1,17 @@
# BBR
+BBR (a.k.a BBSim Reflector) is a tool designed to scale test BBSim.
+It is responsible to emulate ONOS and VOLTHA in order to quickly reply
+to any message that BBSim sends.
+
+Here is a graph of the measuraments of BBSim performance captured over
+10 runs with different PON Layout
+
+![BBSim Performances](./assets/bbr_runs.png "BBSim Performances")
+
+
+## Run BBR
+
To run `bbr` you need to have a `bbsim` instance running.
You can start `bbsim` locally with:
diff --git a/tests/bbr.sh b/tests/bbr.sh
new file mode 100644
index 0000000..434cb56
--- /dev/null
+++ b/tests/bbr.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# Copyright 2018-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.
+
+usage()
+{
+ echo " "
+ echo "Runs BBR against BBSim a number of times and output the results in a file name results.logs"
+ echo " "
+ echo "Usage: $0 [--onus|--pons|--runs]" >&2
+ echo " "
+ echo " -o, --onus Number of ONUs to emulate on each PON"
+ echo " -p, --pons Number of PONs to emulate"
+ echo " -r, --runs Number of runs to perform"
+ echo " "
+ echo "Example usages:"
+ echo " ./$0 -i -p 2 -o 32 -r 10"
+ echo " "
+}
+
+run()
+{
+ echo "Running with: ${ONU} Onus ${PON} Pons for ${RUN} times" >> results.logs
+ for i in {0..10}
+ do
+ echo "RUN Number: $i"
+ docker rm -f bbsim
+ DOCKER_RUN_ARGS="-pon ${PON} -onu ${ONU}" make docker-run
+ sleep 5
+ ./bbr -pon $PON -onu $ONU 2>&1 | tee bbr.logs
+ docker logs bbsim 2>&1 | tee bbsim.logs
+ echo "RUN Number: $i" >> results.logs
+ cat bbr.logs | grep Duration | awk '{print $5}' >> results.logs
+ done
+}
+
+ONU=1
+PON=1
+RUN=10
+
+while [ "$1" != "" ]; do
+ case $1 in
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ -o | --onus ) ONU=$2
+ ;;
+ -p | --pons ) PON=$2
+ ;;
+ -r | --runs ) RUN=$2
+ ;;
+ --) # End of all options
+ shift
+ break
+ ;;
+ esac
+ shift
+done
+
+run
+