blob: 5998714132db9e4fc7b2adf705251786a7c624e6 [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 Scandolo53b1a372022-01-11 15:20:06 -080013 Usage of ./bbsim:
14 -api_address string
15 IP address:port (default ":50070")
Holger Hildebrandtb9a3dd02022-05-12 08:20:41 +000016 -authRetry bool
17 Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success (default false)
Matteo Scandolo53b1a372022-01-11 15:20:06 -080018 -bp_format string
19 Bandwidth profile format, 'mef' or 'ietf' (default "mef")
20 -ca string
21 Set the mode for controlled activation of PON ports and ONUs (default "default")
22 -config string
23 Configuration file path (default "configs/bbsim.yaml")
24 -cpuprofile string
Holger Hildebrandtb9a3dd02022-05-12 08:20:41 +000025 write cpu profile to file (default "")
Matteo Scandolo53b1a372022-01-11 15:20:06 -080026 -delay int
27 The delay between ONU DISCOVERY batches in milliseconds (1 ONU per each PON PORT at a time (default 200)
Holger Hildebrandtb9a3dd02022-05-12 08:20:41 +000028 -dhcpRetry bool
29 Set this flag if BBSim should retry DHCP upon failure until success (default false)
Matteo Scandolo53b1a372022-01-11 15:20:06 -080030 -dmi_server_address string
31 IP address:port (default ":50075")
Holger Hildebrandtb9a3dd02022-05-12 08:20:41 +000032 -enableEvents bool
33 Enable sending BBSim events on configured kafka server (default false)
34 -enableperf bool
35 Setting this flag will cause BBSim to not store data like traffic schedulers, flows of ONUs etc.. (default false)
36 -injectOmciUnknownAttributes bool
37 Generate a MibDB packet with Unknown Attributes (default false)
38 -injectOmciUnknownMe bool
39 Generate a MibDB packet with Unknown Me (default false)
40 -omccVersion int
41 Set OMCC version to be returned in OMCI response of ME Onu2G (default 163 (0xA3))
Matteo Scandolo53b1a372022-01-11 15:20:06 -080042 -kafkaAddress string
43 IP:Port for kafka (default ":9092")
44 -kafkaEventTopic string
Holger Hildebrandtb9a3dd02022-05-12 08:20:41 +000045 Ability to configure the topic on which BBSim publishes events on Kafka (default "")
46 -logCaller bool
47 Whether to print the caller filename or not (default false)
Matteo Scandolo53b1a372022-01-11 15:20:06 -080048 -logLevel string
49 Set the log level (trace, debug, info, warn, error) (default "debug")
50 -nni int
51 Number of NNI ports per OLT device to be emulated (default 1)
Elia Battiston420c9092022-02-02 12:17:54 +010052 -nni_speed uint
53 Reported speed of the NNI ports in Mbps (default 1000)
Matteo Scandolo53b1a372022-01-11 15:20:06 -080054 -oltRebootDelay int
55 Time that BBSim should before restarting after a reboot (default 60)
56 -olt_id int
Holger Hildebrandtb9a3dd02022-05-12 08:20:41 +000057 OLT device ID (default 0)
Matteo Scandolo53b1a372022-01-11 15:20:06 -080058 -omci_response_rate int
59 Amount of OMCI messages to respond to (default 10)
60 -onu int
61 Number of ONU devices per PON port to be emulated (default 1)
62 -openolt_address string
63 IP address:port (default ":50060")
64 -pon int
65 Number of PON ports per OLT device to be emulated (default 1)
Elia Battistonb7bea222022-02-18 16:25:00 +010066 -pon_port_config_file string
Holger Hildebrandtb9a3dd02022-05-12 08:20:41 +000067 Pon Interfaces Configuration file path (default "")
Elia Battistonac63b112022-01-12 18:40:49 +010068 -pots int
69 Number of POTS UNI Ports per ONU device to be emulated (default 0)
Matteo Scandolo53b1a372022-01-11 15:20:06 -080070 -rest_api_address string
71 IP address:port (default ":50071")
72 -services string
73 Service Configuration file path (default "configs/att-services.yaml")
74 -uni int
75 Number of UNI Ports per ONU device to be emulated (default 4)
76
Matteo Scandolo93566702020-09-30 15:19:27 -070077
Matteo Scandolof380a972020-09-11 12:09:40 -070078
79
80``BBSim`` also looks for a configuration file in ``configs/bbsim.yaml`` from
81which it reads a number of default settings. The command line options listed
82above override the corresponding configuration file settings. A sample
83configuration file is given below:
84
85.. literalinclude:: ../../configs/bbsim.yaml
86
87.. _ConfiguringServices:
88
89Configuring RG Services
90-----------------------
91
92BBSim supports different services in the RG.
93Those services are described through a configuration file that is specified via the ``-services`` flag.
94
95Below are examples of the tree commonly used configurations:
96
97.. literalinclude:: ../../configs/att-services.yaml
98
99.. literalinclude:: ../../configs/dt-services.yaml
100
101.. literalinclude:: ../../configs/tt-services.yaml
102
103Controlled PON and ONU activation
104---------------------------------
105
106BBSim provides support for controlled PON and ONU activation. This gives you the ability
107to manually enable PON Ports and ONUs as needed.
108
109By default both PON ports and ONUs are automatically activated when OLT is enabled. This can
110be controlled using ``-ca`` option.
111
112``-ca`` can be set to one of below four modes:
113
114- default: PON ports and ONUs are automatic activated (default behavior).
115
116- only-onu: PON ports automatically enabled and ONUs activated on demand
117 On Enable OLT, IntfIndications for all PON ports are sent but ONU discovery indications are not sent.
118 When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU.
119
120- only-pon: PON ports enabled on demand and ONUs automatically activated
121 On Enable OLT, neither IntfIndications for PON ports nor ONU discovery indications are sent.
122 When EnablePonIf request is received at OpenOLT server, then that PON port is enabled and
123 IntfIndication is sent for that PON and all ONUs under that ports are discovered automatically.
124
125- both: Both PON ports and ONUs are activated on demand
126 On Enable OLT, neither IntfIndication for PON ports nor ONU discovery indications are sent.
127 When EnablePonIf request is received on OpenOLT server then
128 IntfIndication is sent for that PON but no ONU discovery indication
129 will be sent.
130 When PoweronONU request is received at BBSim API server then ONU discovery indication is sent for that ONU.
131
132Pon Port and ONU on demand activation is managed via ``BBSimCtl``.
133You can find more information in the :ref:`Operations` page.
134
135Publishing BBSim Events on kafka
136--------------------------------
137
138BBSim provides option for publishing events on kafka. To publish events on
139kafka, set BBSimEvents flag and configure kafkaAddress.
140
141Once BBSim is started, it will publish events (as and when they happen) on
142topic ``BBSim-OLT-<id>-Events``.
143
144Types of Events:
145 - OLT-enable-received
146 - OLT-disable-received
147 - OLT-reboot-received
148 - OLT-reenable-received
149 - ONU-discovery-indication-sent
150 - ONU-activate-indication-received
151 - MIB-upload-received
152 - MIB-upload-done
153 - Flow-add-received
154 - Flow-remove-received
155 - ONU-authentication-done
156 - ONU-DHCP-ACK-received
157
158Sample output of kafkacat consumer for BBSim with OLT-ID 4:
159
160.. code:: bash
161
162 $ kafkacat -b localhost:9092 -t BBSim-OLT-4-Events -C
163 {"EventType":"OLT-enable-received","OnuSerial":"","OltID":4,"IntfID":-1,"OnuID":-1,"EpochTime":1583152243144,"Timestamp":"2020-03-02 12:30:43.144449453"}
164 {"EventType":"ONU-discovery-indication-sent","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":0,"EpochTime":1583152243227,"Timestamp":"2020-03-02 12:30:43.227183506"}
165 {"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 -0700166 {"EventType":"MIB-upload-received","OnuSerial":"BBSM00040001","OltID":4,"IntfID":0,"OnuID":1,"EpochTime":1583152243299,"Timestamp":"2020-03-02 12:30:43.299480183"}