blob: 4b0af7dec347fc9cb845bc6eea5a0a53e3031089 [file] [log] [blame]
Matteo Scandolo9f619492019-10-25 13:11:58 -07001.. BBSim documentation master file, created by
2 sphinx-quickstart on Fri Oct 25 12:03:42 2019.
3 You can adapt this file completely to your liking, but it should at least
4 contain the root `toctree` directive.
5
6Welcome to BBSim's documentation!
7=================================
8
9.. toctree::
10 :maxdepth: 2
11 :caption: Contents:
12
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070013 operations.rst
Matteo Scandolo9f619492019-10-25 13:11:58 -070014 onu-state-machine.rst
Matteo Scandolod02b79b2019-12-05 16:42:13 -080015 olt-state-machine.rst
Matteo Scandolo9f619492019-10-25 13:11:58 -070016 development-dependencies.rst
17 bbr.rst
18 bbsimctl.rst
Zdravko Bozakov2da76342019-10-21 09:47:35 +020019 api.rst
Matteo Scandolo9f619492019-10-25 13:11:58 -070020
21
22Quickstart
23----------
24
25BBSim (a.k.a. BroadBand Simulator) is a tool designed to emulate an `Openolt <https://github.com/opencord/openolt>`_
26compatible device.
27
28In order to use BBSim you need to have:
29
30- a Kubernetes cluster
31- helm
32- a working installation of VOLTHA
33
34We strongly recommend the utilization of `kind-voltha <https://github.com/ciena/kind-voltha>`_ to setup such environment.
35
36Installation
37------------
38
39Once VOLTHA is up and running, you can deploy BBSim with this command:
40
41.. code:: bash
42
43 helm install -n bbsim cord/bbsim
44
Matteo Scandoloc1147092019-10-29 09:38:33 -070045If you need to specify a custom image for BBSim you can:
46
47.. code:: bash
48
49 helm install -n bbsim cord/bbsim --set images.bbsim.repository=bbsim --set images.bbsim.tag=candidate --set images.bbsim.pullPolicy=Never
50
Matteo Scandolo9f619492019-10-25 13:11:58 -070051The BBSim installation can be customized to emulate multiple ONUs and multiple PON Ports:
52
53.. code:: bash
54
55 helm install -n bbsim cord/bbsim --set onu=8 --set pon=2
56
Matteo Scandoloc1147092019-10-29 09:38:33 -070057BBSim can also be configured to automatically start Authentication or DHCP:
58
59.. code:: bash
60
61 helm install -n bbsim cord/bbsim --set auth=true --set dhcp=true
62
Matteo Scandolo9f619492019-10-25 13:11:58 -070063Once BBSim is installed you can verify that it's running with:
64
65.. code:: bash
66
67 kubectl logs -n voltha -f $(kubectl get pods -n voltha | grep bbsim | awk '{print $1}')
68
69Provision a BBSim OLT in VOLTHA
70-------------------------------
71
72Create the device:
73
74.. code:: bash
75
76 voltctl device create -t openolt -H $(kubectl get -n voltha service/bbsim -o go-template='{{.spec.clusterIP}}'):50060
77
78Enable the device:
79
80.. code:: bash
81
82 voltctl device enable $(voltctl device list --filter Type~openolt -q)
Matteo Scandoloc1147092019-10-29 09:38:33 -070083
84BBSim startup options
85---------------------
86
87``BBSim`` supports a series of options that can be set at startup, you can see the list via ``./bbsim --help``
88
89.. code:: bash
90
91 $ ./bbsim --help
92 Usage of ./bbsim:
93 -auth
94 Set this flag if you want authentication to start automatically
95 -c_tag int
96 C-Tag starting value, each ONU will get a sequential one (targeting 1024 ONUs per BBSim instance the range is big enough) (default 900)
97 -cpuprofile string
98 write cpu profile to file
Matteo Scandolocae57b52019-11-12 10:52:53 -080099 -delay int
100 The delay between ONU DISCOVERY batches in milliseconds (1 ONU per each PON PORT at a time (default 200)
Matteo Scandoloc1147092019-10-29 09:38:33 -0700101 -dhcp
102 Set this flag if you want DHCP to start automatically
103 -logCaller
104 Whether to print the caller filename or not
105 -logLevel string
106 Set the log level (trace, debug, info, warn, error) (default "debug")
107 -nni int
108 Number of NNI ports per OLT device to be emulated (default 1)
109 -olt_id int
110 Number of OLT devices to be emulated
111 -onu int
112 Number of ONU devices per PON port to be emulated (default 1)
113 -pon int
114 Number of PON ports per OLT device to be emulated (default 1)
115 -s_tag int
116 S-Tag value (default 900)
Zdravko Bozakov3ddb2452019-11-29 14:33:41 +0100117
118``BBSim`` also looks for a configuration file in ``configs/bbsim.yaml`` from which it reads a number of default settings. The command line options listed above override the corresponding coniguration file settings. A sample configuration file is given below:
119
120.. literalinclude:: ../../configs/bbsim.yaml
Zdravko Bozakov958d81c2019-12-13 22:09:48 +0100121
122Using the BBSim Sadis server in ONOS
123------------------------------------
124
125BBSim provides a simple server for testing with the ONOS Sadis app. The server listens on port 50074 by default and provides the endpoints ``subscribers/<id>`` and ``bandwidthprofiles/<id>``.
126
127To configure ONOS to use the BBSim ``Sadis`` server endpoints, the Sadis app must use be configured as follows (see ``examples/sadis-in-bbsim.json``):
128
129.. literalinclude:: ../../examples/sadis-in-bbsim.json
130
131This base configuration may also be obtained directly from the BBSim Sadis server:
132
133.. code:: bash
134
135 curl http://<BBSIM_IP>:50074/cfg -o examples/sadis.json
136
137It can then be pushed to the Sadis app using the following command:
138
139.. code:: bash
140
141 curl -sSL --user karaf:karaf \
142 -X POST \
143 -H Content-Type:application/json \
144 http://localhost:8181/onos/v1/network/configuration/apps/org.opencord.sadis \
145 --data @examples/sadis-in-bbsim.json
146
147You can verify the current Sadis configuration:
148
149.. code:: bash
150
151 curl --user karaf:karaf http://localhost:8181/onos/v1/network/configuration/apps/org.opencord.sadis
152
153In ONOS subscriber information can be queried using ``sadis <id>``.
154