Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 1 | .. _Operations: |
| 2 | |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 3 | Operate BBSim |
| 4 | ============= |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 5 | |
| 6 | If you are testing basic functionality using BBSim no operator intervention is required. |
| 7 | |
| 8 | When you ``enable`` the device in VOLTHA the simulator will: |
| 9 | |
| 10 | - activate all the configured ONUs |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 11 | - wait for the EAPOL flow for each Service that requires it and trigger the authentication state machine as soon as it's received |
| 12 | - wait for the DHCP flow for each Service that requires it and trigger the DHCP state machine as soon as it's received |
| 13 | |
| 14 | BBSimCtl |
| 15 | -------- |
| 16 | |
| 17 | BBSim comes with a gRPC interface to control the internal state. This |
| 18 | interface can be queried using `bbsimctl` (the tool can be build with |
| 19 | `make build` and it's available inside the `bbsim` container): |
| 20 | |
| 21 | .. code:: bash |
| 22 | |
| 23 | $ ./bbsimctl --help |
| 24 | Usage: |
| 25 | bbsimctl [OPTIONS] <command> |
| 26 | |
| 27 | Global Options: |
| 28 | -c, --config=FILE Location of client config file [$BBSIMCTL_CONFIG] |
| 29 | -s, --server=SERVER:PORT IP/Host and port of XOS |
| 30 | -d, --debug Enable debug mode |
| 31 | |
| 32 | Help Options: |
| 33 | -h, --help Show this help message |
| 34 | |
| 35 | Available commands: |
| 36 | completion generate shell compleition |
| 37 | config generate bbsimctl configuration |
| 38 | log set bbsim log level |
| 39 | olt OLT Commands |
| 40 | onu ONU Commands |
| 41 | pon PON Commands |
| 42 | service Service Commands |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 43 | |
| 44 | Access bbsimctl |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 45 | +++++++++++++++ |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 46 | |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 47 | When running a test you can check the state of each ONU using ``BBSimCtl``. |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 48 | |
| 49 | The easiest way to use ``bbsimctl`` is to ``exec`` inside the ``bbsim`` container: |
| 50 | |
| 51 | .. code:: bash |
| 52 | |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 53 | kubectl -n voltha exec -it $(kubectl -n voltha get pods -l app=bbsim -o name) -- /bin/bash |
| 54 | |
| 55 | In case you prefer to run ``bbsimctl`` on your machine, |
| 56 | it can be configured via a config file such as: |
| 57 | |
| 58 | .. code:: bash |
| 59 | |
| 60 | $ cat ~/.bbsim/config |
| 61 | apiVersion: v1 |
| 62 | server: 127.0.0.1:50070 |
| 63 | grpc: |
| 64 | timeout: 10s |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 65 | |
| 66 | Check the ONU Status |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 67 | ++++++++++++++++++++ |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 68 | |
| 69 | .. code:: bash |
| 70 | |
| 71 | $ bbsimctl onu list |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 72 | PONPORTID ID PORTNO SERIALNUMBER OPERSTATE INTERNALSTATE |
| 73 | 0 1 0 BBSM00000001 up enabled |
| 74 | |
| 75 | Check the Service Status |
| 76 | ++++++++++++++++++++++++ |
| 77 | |
| 78 | .. code:: bash |
| 79 | |
| 80 | $ bbsimctl onu services BBSM00000001 |
| 81 | ONUSN INTERNALSTATE NAME HWADDRESS STAG CTAG NEEDSEAPOL NEEDSDHCP NEEDSIGMP GEMPORT EAPOLSTATE DHCPSTATE IGMPSTATE |
| 82 | BBSM00000001 initialized hsia 2e:60:00:00:01:00 900 900 false false false 1056 created created created |
| 83 | BBSM00000001 initialized voip 2e:60:00:00:01:01 333 444 false true false 1104 created dhcp_ack_received created |
| 84 | BBSM00000001 initialized vod 2e:60:00:00:01:02 555 55 false true true 1084 created dhcp_ack_received igmp_join_started |
| 85 | BBSM00000001 initialized MC 2e:60:00:00:01:03 550 55 false false false 0 created created created |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 86 | |
| 87 | Advanced operations |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 88 | +++++++++++++++++++ |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 89 | |
| 90 | In certain cases you may want to execute operations on the BBSim ONUs. |
| 91 | |
| 92 | Here are the one currently supported, for more usage information use the following commands: |
| 93 | |
| 94 | .. code:: bash |
| 95 | |
| 96 | $ bbsimctl onu --help |
| 97 | Usage: |
| 98 | bbsimctl [OPTIONS] onu <command> |
| 99 | |
| 100 | Commands to query and manipulate ONU devices |
| 101 | |
| 102 | Global Options: |
| 103 | -c, --config=FILE Location of client config file [$BBSIMCTL_CONFIG] |
| 104 | -s, --server=SERVER:PORT IP/Host and port of XOS |
| 105 | -d, --debug Enable debug mode |
| 106 | |
| 107 | Help Options: |
| 108 | -h, --help Show this help message |
| 109 | |
| 110 | Available commands: |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 111 | alarms |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 112 | auth_restart |
| 113 | dhcp_restart |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 114 | flows |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 115 | get |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 116 | igmp |
Matteo Scandolo | e383d5d | 2019-10-25 14:47:27 -0700 | [diff] [blame] | 117 | list |
| 118 | poweron |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 119 | services |
Zack Williams | 4b0ef4d | 2019-12-18 14:25:20 -0700 | [diff] [blame] | 120 | shutdown |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 121 | traffic_schedulers |
Zack Williams | 4b0ef4d | 2019-12-18 14:25:20 -0700 | [diff] [blame] | 122 | |
Matteo Scandolo | f380a97 | 2020-09-11 12:09:40 -0700 | [diff] [blame] | 123 | Enable ONUs |
| 124 | +++++++++++ |
| 125 | |
| 126 | ``BBSimCtl`` gives you the ability to control the device lifecycle, |
| 127 | for example you can turn ONUs on and off: |
| 128 | |
| 129 | .. code:: bash |
| 130 | |
| 131 | $ bbsimctl onu shutdown BBSM00000001 |
| 132 | [Status: 0] ONU BBSM00000001 successfully shut down. |
| 133 | |
| 134 | $ bbsimctl onu poweron BBSM00000001 |
| 135 | [Status: 0] ONU BBSM00000001 successfully powered on. |
| 136 | |
| 137 | Autocomplete |
| 138 | ++++++++++++ |
| 139 | |
| 140 | ``bbsimctl`` comes with autocomplete, just run: |
| 141 | |
| 142 | .. code:: bash |
| 143 | |
| 144 | source <(bbsimctl completion bash) |
| 145 | |
| 146 | Other APIS |
| 147 | ---------- |
| 148 | |
| 149 | .. toctree:: |
| 150 | :maxdepth: 1 |
| 151 | |
| 152 | api.rst |