Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 1 | BBSim Configuration |
| 2 | =================== |
| 3 | |
| 4 | BBSim startup options |
| 5 | --------------------- |
| 6 | |
| 7 | ``BBSim`` supports a series of options that can be set at startup, you can see |
| 8 | the list via ``./bbsim --help`` |
| 9 | |
| 10 | .. code:: bash |
| 11 | |
| 12 | $ ./bbsim --help |
| 13 | Usage of ./bbsim: |
| 14 | -api_address string |
| 15 | IP address:port |
| 16 | -authRetry |
| 17 | Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success |
| 18 | -ca string |
| 19 | Set the mode for controlled activation of PON ports and ONUs |
| 20 | -config string |
| 21 | Configuration file path |
| 22 | -cpuprofile string |
| 23 | write cpu profile to file |
| 24 | -delay int |
| 25 | The delay between ONU DISCOVERY batches in milliseconds (1 ONU per each PON PORT at a time |
| 26 | -dhcpRetry |
| 27 | Set this flag if BBSim should retry DHCP upon failure until success |
| 28 | -enableEvents |
| 29 | Enable sending BBSim events on configured kafka server |
| 30 | -enableperf |
| 31 | Setting this flag will cause BBSim to not store data like traffic schedulers, flows of ONUs etc.. |
| 32 | -kafkaAddress string |
| 33 | IP:Port for kafka |
| 34 | -kafkaEventTopic string |
| 35 | Ability to configure the topic on which BBSim publishes events on Kafka |
| 36 | -logCaller |
| 37 | Whether to print the caller filename or not |
| 38 | -logLevel string |
| 39 | Set the log level (trace, debug, info, warn, error) |
| 40 | -nni int |
| 41 | Number of NNI ports per OLT device to be emulated |
| 42 | -olt_id int |
| 43 | OLT device ID |
| 44 | -onu int |
| 45 | Number of ONU devices per PON port to be emulated |
| 46 | -openolt_address string |
| 47 | IP address:port |
| 48 | -pon int |
| 49 | Number of PON ports per OLT device to be emulated |
| 50 | -rest_api_address string |
| 51 | IP address:port |
| 52 | -services string |
| 53 | Service Configuration file path |
| 54 | |
| 55 | |
| 56 | ``BBSim`` also looks for a configuration file in ``configs/bbsim.yaml`` from |
| 57 | which it reads a number of default settings. The command line options listed |
| 58 | above override the corresponding configuration file settings. A sample |
| 59 | configuration file is given below: |
| 60 | |
| 61 | .. literalinclude:: ../../configs/bbsim.yaml |
| 62 | |
| 63 | .. _ConfiguringServices: |
| 64 | |
| 65 | Configuring RG Services |
| 66 | ----------------------- |
| 67 | |
| 68 | BBSim supports different services in the RG. |
| 69 | Those services are described through a configuration file that is specified via the ``-services`` flag. |
| 70 | |
| 71 | Below are examples of the tree commonly used configurations: |
| 72 | |
| 73 | .. literalinclude:: ../../configs/att-services.yaml |
| 74 | |
| 75 | .. literalinclude:: ../../configs/dt-services.yaml |
| 76 | |
| 77 | .. literalinclude:: ../../configs/tt-services.yaml |
| 78 | |
| 79 | Controlled PON and ONU activation |
| 80 | --------------------------------- |
| 81 | |
| 82 | BBSim provides support for controlled PON and ONU activation. This gives you the ability |
| 83 | to manually enable PON Ports and ONUs as needed. |
| 84 | |
| 85 | By default both PON ports and ONUs are automatically activated when OLT is enabled. This can |
| 86 | be controlled using ``-ca`` option. |
| 87 | |
| 88 | ``-ca`` can be set to one of below four modes: |
| 89 | |
| 90 | - default: PON ports and ONUs are automatic activated (default behavior). |
| 91 | |
| 92 | - only-onu: PON ports automatically enabled and ONUs activated on demand |
| 93 | On Enable OLT, IntfIndications for all PON ports are sent but ONU discovery indications are not sent. |
| 94 | When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU. |
| 95 | |
| 96 | - only-pon: PON ports enabled on demand and ONUs automatically activated |
| 97 | On Enable OLT, neither IntfIndications for PON ports nor ONU discovery indications are sent. |
| 98 | When EnablePonIf request is received at OpenOLT server, then that PON port is enabled and |
| 99 | IntfIndication is sent for that PON and all ONUs under that ports are discovered automatically. |
| 100 | |
| 101 | - both: Both PON ports and ONUs are activated on demand |
| 102 | On Enable OLT, neither IntfIndication for PON ports nor ONU discovery indications are sent. |
| 103 | When EnablePonIf request is received on OpenOLT server then |
| 104 | IntfIndication is sent for that PON but no ONU discovery indication |
| 105 | will be sent. |
| 106 | When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU. |
| 107 | |
| 108 | Pon Port and ONU on demand activation is managed via ``BBSimCtl``. |
| 109 | You can find more information in the :ref:`Operations` page. |
| 110 | |
| 111 | Publishing BBSim Events on kafka |
| 112 | -------------------------------- |
| 113 | |
| 114 | BBSim provides option for publishing events on kafka. To publish events on |
| 115 | kafka, set BBSimEvents flag and configure kafkaAddress. |
| 116 | |
| 117 | Once BBSim is started, it will publish events (as and when they happen) on |
| 118 | topic ``BBSim-OLT-<id>-Events``. |
| 119 | |
| 120 | Types of Events: |
| 121 | - OLT-enable-received |
| 122 | - OLT-disable-received |
| 123 | - OLT-reboot-received |
| 124 | - OLT-reenable-received |
| 125 | - ONU-discovery-indication-sent |
| 126 | - ONU-activate-indication-received |
| 127 | - MIB-upload-received |
| 128 | - MIB-upload-done |
| 129 | - Flow-add-received |
| 130 | - Flow-remove-received |
| 131 | - ONU-authentication-done |
| 132 | - ONU-DHCP-ACK-received |
| 133 | |
| 134 | Sample output of kafkacat consumer for BBSim with OLT-ID 4: |
| 135 | |
| 136 | .. code:: bash |
| 137 | |
| 138 | $ kafkacat -b localhost:9092 -t BBSim-OLT-4-Events -C |
| 139 | {"EventType":"OLT-enable-received","OnuSerial":"","OltID":4,"IntfID":-1,"OnuID":-1,"EpochTime":1583152243144,"Timestamp":"2020-03-02 12:30:43.144449453"} |
| 140 | {"EventType":"ONU-discovery-indication-sent","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":0,"EpochTime":1583152243227,"Timestamp":"2020-03-02 12:30:43.227183506"} |
| 141 | {"EventType":"ONU-activate-indication-received","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":1,"EpochTime":1583152243248,"Timestamp":"2020-03-02 12:30:43.248225467"} |
| 142 | {"EventType":"MIB-upload-received","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":1,"EpochTime":1583152243299,"Timestamp":"2020-03-02 12:30:43.299480183"} |