blob: 0ddbe1ef759d1e9315889387e4bed75951fb65fb [file] [log] [blame]
BBSim Configuration
===================
BBSim startup options
---------------------
``BBSim`` supports a series of options that can be set at startup, you can see
the list via ``./bbsim --help``
.. code:: bash
$ ./bbsim --help
Usage of ./bbsim:
-api_address string
IP address:port
-authRetry
Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success
-ca string
Set the mode for controlled activation of PON ports and ONUs
-config string
Configuration file path
-cpuprofile string
write cpu profile to file
-delay int
The delay between ONU DISCOVERY batches in milliseconds (1 ONU per each PON PORT at a time
-dhcpRetry
Set this flag if BBSim should retry DHCP upon failure until success
-enableEvents
Enable sending BBSim events on configured kafka server
-enableperf
Setting this flag will cause BBSim to not store data like traffic schedulers, flows of ONUs etc..
-kafkaAddress string
IP:Port for kafka
-kafkaEventTopic string
Ability to configure the topic on which BBSim publishes events on Kafka
-logCaller
Whether to print the caller filename or not
-logLevel string
Set the log level (trace, debug, info, warn, error)
-nni int
Number of NNI ports per OLT device to be emulated
-olt_id int
OLT device ID
-onu int
Number of ONU devices per PON port to be emulated
-openolt_address string
IP address:port
-pon int
Number of PON ports per OLT device to be emulated
-rest_api_address string
IP address:port
-services string
Service Configuration file path
``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 configuration file settings. A sample
configuration file is given below:
.. literalinclude:: ../../configs/bbsim.yaml
.. _ConfiguringServices:
Configuring RG Services
-----------------------
BBSim supports different services in the RG.
Those services are described through a configuration file that is specified via the ``-services`` flag.
Below are examples of the tree commonly used configurations:
.. literalinclude:: ../../configs/att-services.yaml
.. literalinclude:: ../../configs/dt-services.yaml
.. literalinclude:: ../../configs/tt-services.yaml
Controlled PON and ONU activation
---------------------------------
BBSim provides support for controlled PON and ONU activation. This gives you the ability
to manually enable PON Ports and ONUs as needed.
By default both PON ports and ONUs are automatically activated when OLT is enabled. This can
be controlled using ``-ca`` option.
``-ca`` can be set to one of below four modes:
- default: PON ports and ONUs are automatic activated (default behavior).
- only-onu: PON ports automatically enabled and ONUs activated on demand
On Enable OLT, IntfIndications for all PON ports are sent but ONU discovery indications are not sent.
When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU.
- only-pon: PON ports enabled on demand and ONUs automatically activated
On Enable OLT, neither IntfIndications for PON ports nor ONU discovery indications are sent.
When EnablePonIf request is received at OpenOLT server, then that PON port is enabled and
IntfIndication is sent for that PON and all ONUs under that ports are discovered automatically.
- both: Both PON ports and ONUs are activated on demand
On Enable OLT, neither IntfIndication for PON ports nor ONU discovery indications are sent.
When EnablePonIf request is received on OpenOLT server then
IntfIndication is sent for that PON but no ONU discovery indication
will be sent.
When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU.
Pon Port and ONU on demand activation is managed via ``BBSimCtl``.
You can find more information in the :ref:`Operations` page.
Publishing BBSim Events on kafka
--------------------------------
BBSim provides option for publishing events on kafka. To publish events on
kafka, set BBSimEvents flag and configure kafkaAddress.
Once BBSim is started, it will publish events (as and when they happen) on
topic ``BBSim-OLT-<id>-Events``.
Types of Events:
- OLT-enable-received
- OLT-disable-received
- OLT-reboot-received
- OLT-reenable-received
- ONU-discovery-indication-sent
- ONU-activate-indication-received
- MIB-upload-received
- MIB-upload-done
- Flow-add-received
- Flow-remove-received
- ONU-authentication-done
- ONU-DHCP-ACK-received
Sample output of kafkacat consumer for BBSim with OLT-ID 4:
.. code:: bash
$ kafkacat -b localhost:9092 -t BBSim-OLT-4-Events -C
{"EventType":"OLT-enable-received","OnuSerial":"","OltID":4,"IntfID":-1,"OnuID":-1,"EpochTime":1583152243144,"Timestamp":"2020-03-02 12:30:43.144449453"}
{"EventType":"ONU-discovery-indication-sent","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":0,"EpochTime":1583152243227,"Timestamp":"2020-03-02 12:30:43.227183506"}
{"EventType":"ONU-activate-indication-received","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":1,"EpochTime":1583152243248,"Timestamp":"2020-03-02 12:30:43.248225467"}
{"EventType":"MIB-upload-received","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":1,"EpochTime":1583152243299,"Timestamp":"2020-03-02 12:30:43.299480183"}