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