BBSim Internals¶
BBSim heavily leverages state machines to control the device lifecycle and channels to propagate and react to state changes.
The most common pattern throughout the code is that any operations,
for example a gRPC call to the ActivateOnu
endpoint will result in:
A state change in the ONU device, that will
Send a message on the ONU Channel, that will
Trigger some operation (for example send Indications to the OLT)
OLT State Machine¶
Here is a list of possible states for an OLT:
Initialized |
Enabled |
Disabled |
Deleted |
|
---|---|---|---|---|
Data model is created for OLT, NNIs, PONs and ONUs |
Starts the listener on the NNI interface and the DHCP server,
Starts the OLT gRPC server,
Moves the ONUs to |
Sends OLT, NNIs and PONs |
Transition the ONUs into |
Stops the OLT gRPC Server |
Below is a diagram of the state machine allowed transitions:
ONU State Machine¶
Here is a list of possible state transitions for an ONU in BBSim:
Transition |
Starting States |
End State |
Notes |
---|---|---|---|
created |
|||
initialize |
created, disabled, pon_disabled |
initialized |
|
discover |
initialized |
discovered |
|
enable |
discovered, disabled, pon_disabled |
enabled |
|
disable |
enabled |
disabled |
This state signifies that the ONU has been disabled |
pon_disabled |
enabled |
pon_disabled |
This state signifies that the parent PON Port has been disabled, the ONU state hasn’t been affected. |
Below is a diagram of the state machine:
In blue PON related states
In purple operator driven states