blob: 7c04a68cc8fe8b62418ebe7e023194c8544ca9bf [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
Zack Williams4b0ef4d2019-12-18 14:25:20 -070025BBSim (a.k.a. BroadBand Simulator) is a tool designed to emulate an `Openolt
26<https://github.com/opencord/openolt>`_ compatible device.
Matteo Scandolo9f619492019-10-25 13:11:58 -070027
28In order to use BBSim you need to have:
29
30- a Kubernetes cluster
31- helm
32- a working installation of VOLTHA
33
Zack Williams4b0ef4d2019-12-18 14:25:20 -070034We strongly recommend the utilization of `kind-voltha
35<https://github.com/ciena/kind-voltha>`_ to setup such environment.
Matteo Scandolo9f619492019-10-25 13:11:58 -070036
37Installation
38------------
39
40Once VOLTHA is up and running, you can deploy BBSim with this command:
41
42.. code:: bash
43
44 helm install -n bbsim cord/bbsim
45
Matteo Scandoloc1147092019-10-29 09:38:33 -070046If you need to specify a custom image for BBSim you can:
47
48.. code:: bash
49
50 helm install -n bbsim cord/bbsim --set images.bbsim.repository=bbsim --set images.bbsim.tag=candidate --set images.bbsim.pullPolicy=Never
51
Zack Williams4b0ef4d2019-12-18 14:25:20 -070052The BBSim installation can be customized to emulate multiple ONUs and multiple
53PON Ports:
Matteo Scandolo9f619492019-10-25 13:11:58 -070054
55.. code:: bash
56
57 helm install -n bbsim cord/bbsim --set onu=8 --set pon=2
58
Matteo Scandoloc1147092019-10-29 09:38:33 -070059BBSim can also be configured to automatically start Authentication or DHCP:
60
61.. code:: bash
62
63 helm install -n bbsim cord/bbsim --set auth=true --set dhcp=true
64
Matteo Scandolo9f619492019-10-25 13:11:58 -070065Once BBSim is installed you can verify that it's running with:
66
67.. code:: bash
68
69 kubectl logs -n voltha -f $(kubectl get pods -n voltha | grep bbsim | awk '{print $1}')
70
71Provision a BBSim OLT in VOLTHA
72-------------------------------
73
74Create the device:
75
76.. code:: bash
77
78 voltctl device create -t openolt -H $(kubectl get -n voltha service/bbsim -o go-template='{{.spec.clusterIP}}'):50060
79
80Enable the device:
81
82.. code:: bash
83
84 voltctl device enable $(voltctl device list --filter Type~openolt -q)
Matteo Scandoloc1147092019-10-29 09:38:33 -070085
86BBSim startup options
87---------------------
88
Zack Williams4b0ef4d2019-12-18 14:25:20 -070089``BBSim`` supports a series of options that can be set at startup, you can see
90the list via ``./bbsim --help``
Matteo Scandoloc1147092019-10-29 09:38:33 -070091
92.. code:: bash
93
94 $ ./bbsim --help
95 Usage of ./bbsim:
96 -auth
97 Set this flag if you want authentication to start automatically
98 -c_tag int
99 C-Tag starting value, each ONU will get a sequential one (targeting 1024 ONUs per BBSim instance the range is big enough) (default 900)
100 -cpuprofile string
101 write cpu profile to file
Matteo Scandolocae57b52019-11-12 10:52:53 -0800102 -delay int
103 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 -0700104 -dhcp
105 Set this flag if you want DHCP to start automatically
106 -logCaller
107 Whether to print the caller filename or not
108 -logLevel string
109 Set the log level (trace, debug, info, warn, error) (default "debug")
110 -nni int
111 Number of NNI ports per OLT device to be emulated (default 1)
112 -olt_id int
113 Number of OLT devices to be emulated
114 -onu int
115 Number of ONU devices per PON port to be emulated (default 1)
116 -pon int
117 Number of PON ports per OLT device to be emulated (default 1)
118 -s_tag int
119 S-Tag value (default 900)
Zdravko Bozakov3ddb2452019-11-29 14:33:41 +0100120
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700121``BBSim`` also looks for a configuration file in ``configs/bbsim.yaml`` from
122which it reads a number of default settings. The command line options listed
123above override the corresponding configuration file settings. A sample
124configuration file is given below:
Zdravko Bozakov3ddb2452019-11-29 14:33:41 +0100125
126.. literalinclude:: ../../configs/bbsim.yaml
Zdravko Bozakov958d81c2019-12-13 22:09:48 +0100127
128Using the BBSim Sadis server in ONOS
129------------------------------------
130
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700131BBSim provides a simple server for testing with the ONOS Sadis app. The server
132listens on port 50074 by default and provides the endpoints
133``subscribers/<id>`` and ``bandwidthprofiles/<id>``.
Zdravko Bozakov958d81c2019-12-13 22:09:48 +0100134
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700135To configure ONOS to use the BBSim ``Sadis`` server endpoints, the Sadis app
136must use be configured as follows (see ``examples/sadis-in-bbsim.json``):
Zdravko Bozakov958d81c2019-12-13 22:09:48 +0100137
138.. literalinclude:: ../../examples/sadis-in-bbsim.json
139
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700140This base configuration may also be obtained directly from the BBSim Sadis
141server:
Zdravko Bozakov958d81c2019-12-13 22:09:48 +0100142
143.. code:: bash
144
145 curl http://<BBSIM_IP>:50074/cfg -o examples/sadis.json
146
147It can then be pushed to the Sadis app using the following command:
148
149.. code:: bash
150
151 curl -sSL --user karaf:karaf \
152 -X POST \
153 -H Content-Type:application/json \
154 http://localhost:8181/onos/v1/network/configuration/apps/org.opencord.sadis \
155 --data @examples/sadis-in-bbsim.json
156
157You can verify the current Sadis configuration:
158
159.. code:: bash
160
161 curl --user karaf:karaf http://localhost:8181/onos/v1/network/configuration/apps/org.opencord.sadis
162
163In ONOS subscriber information can be queried using ``sadis <id>``.