blob: 70089a36c336d41dc83f30f082a8a963f9e2b74f [file] [log] [blame]
Matteo Scandolof380a972020-09-11 12:09:40 -07001BBSim Configuration
2===================
3
4BBSim startup options
5---------------------
6
7``BBSim`` supports a series of options that can be set at startup, you can see
8the list via ``./bbsim --help``
9
10.. code:: bash
11
12 $ ./bbsim --help
Matteo Scandolo93566702020-09-30 15:19:27 -070013 Usage of /app/bbsim:
14 -api_address string
15 IP address:port (default ":50070")
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 (default "default")
20 -config string
21 Configuration file path (default "configs/bbsim.yaml")
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 (default 200)
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 (default ":9092")
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) (default "debug")
40 -nni int
41 Number of NNI ports per OLT device to be emulated (default 1)
42 -oltRebootDelay int
43 Time that BBSim should before restarting after a reboot (default 60)
44 -olt_id int
45 OLT device ID
46 -onu int
47 Number of ONU devices per PON port to be emulated (default 1)
48 -openolt_address string
49 IP address:port (default ":50060")
50 -pon int
51 Number of PON ports per OLT device to be emulated (default 1)
52 -rest_api_address string
53 IP address:port (default ":50071")
54 -services string
55 Service Configuration file path (default "configs/att-services.yaml")
Holger Hildebrandtc10bab12021-04-27 09:23:48 +000056 -omci_response_rate int
57 Amount of OMCI messages to respond to - ranges from 0 (drop all messages)
58 to 10 (respond to all messages) so that if it's set to 9 we don't respond to every 10th message.
Matteo Scandolo93566702020-09-30 15:19:27 -070059
Matteo Scandolof380a972020-09-11 12:09:40 -070060
61
62``BBSim`` also looks for a configuration file in ``configs/bbsim.yaml`` from
63which it reads a number of default settings. The command line options listed
64above override the corresponding configuration file settings. A sample
65configuration file is given below:
66
67.. literalinclude:: ../../configs/bbsim.yaml
68
69.. _ConfiguringServices:
70
71Configuring RG Services
72-----------------------
73
74BBSim supports different services in the RG.
75Those services are described through a configuration file that is specified via the ``-services`` flag.
76
77Below are examples of the tree commonly used configurations:
78
79.. literalinclude:: ../../configs/att-services.yaml
80
81.. literalinclude:: ../../configs/dt-services.yaml
82
83.. literalinclude:: ../../configs/tt-services.yaml
84
85Controlled PON and ONU activation
86---------------------------------
87
88BBSim provides support for controlled PON and ONU activation. This gives you the ability
89to manually enable PON Ports and ONUs as needed.
90
91By default both PON ports and ONUs are automatically activated when OLT is enabled. This can
92be controlled using ``-ca`` option.
93
94``-ca`` can be set to one of below four modes:
95
96- default: PON ports and ONUs are automatic activated (default behavior).
97
98- only-onu: PON ports automatically enabled and ONUs activated on demand
99 On Enable OLT, IntfIndications for all PON ports are sent but ONU discovery indications are not sent.
100 When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU.
101
102- only-pon: PON ports enabled on demand and ONUs automatically activated
103 On Enable OLT, neither IntfIndications for PON ports nor ONU discovery indications are sent.
104 When EnablePonIf request is received at OpenOLT server, then that PON port is enabled and
105 IntfIndication is sent for that PON and all ONUs under that ports are discovered automatically.
106
107- both: Both PON ports and ONUs are activated on demand
108 On Enable OLT, neither IntfIndication for PON ports nor ONU discovery indications are sent.
109 When EnablePonIf request is received on OpenOLT server then
110 IntfIndication is sent for that PON but no ONU discovery indication
111 will be sent.
112 When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU.
113
114Pon Port and ONU on demand activation is managed via ``BBSimCtl``.
115You can find more information in the :ref:`Operations` page.
116
117Publishing BBSim Events on kafka
118--------------------------------
119
120BBSim provides option for publishing events on kafka. To publish events on
121kafka, set BBSimEvents flag and configure kafkaAddress.
122
123Once BBSim is started, it will publish events (as and when they happen) on
124topic ``BBSim-OLT-<id>-Events``.
125
126Types of Events:
127 - OLT-enable-received
128 - OLT-disable-received
129 - OLT-reboot-received
130 - OLT-reenable-received
131 - ONU-discovery-indication-sent
132 - ONU-activate-indication-received
133 - MIB-upload-received
134 - MIB-upload-done
135 - Flow-add-received
136 - Flow-remove-received
137 - ONU-authentication-done
138 - ONU-DHCP-ACK-received
139
140Sample output of kafkacat consumer for BBSim with OLT-ID 4:
141
142.. code:: bash
143
144 $ kafkacat -b localhost:9092 -t BBSim-OLT-4-Events -C
145 {"EventType":"OLT-enable-received","OnuSerial":"","OltID":4,"IntfID":-1,"OnuID":-1,"EpochTime":1583152243144,"Timestamp":"2020-03-02 12:30:43.144449453"}
146 {"EventType":"ONU-discovery-indication-sent","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":0,"EpochTime":1583152243227,"Timestamp":"2020-03-02 12:30:43.227183506"}
147 {"EventType":"ONU-activate-indication-received","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":1,"EpochTime":1583152243248,"Timestamp":"2020-03-02 12:30:43.248225467"}
Matteo Scandolo0e9fabf2020-09-30 17:19:27 -0700148 {"EventType":"MIB-upload-received","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":1,"EpochTime":1583152243299,"Timestamp":"2020-03-02 12:30:43.299480183"}