blob: 3b50fef9037ef97622322901306286544ca5b5b2 [file] [log] [blame]
Matteo Scandoloe383d5d2019-10-25 14:47:27 -07001.. _Operations:
2
Matteo Scandolof380a972020-09-11 12:09:40 -07003Operate BBSim
4=============
Matteo Scandoloe383d5d2019-10-25 14:47:27 -07005
6If you are testing basic functionality using BBSim no operator intervention is required.
7
8When you ``enable`` the device in VOLTHA the simulator will:
9
10- activate all the configured ONUs
Matteo Scandolo0e9fabf2020-09-30 17:19:27 -070011- 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 Scandolof380a972020-09-11 12:09:40 -070013- wait for the DHCP flow for each Service that requires it and trigger the DHCP state machine as soon as it's received
14
15BBSimCtl
16--------
17
18BBSim comes with a gRPC interface to control the internal state. This
19interface 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 Scandoloe383d5d2019-10-25 14:47:27 -070044
45Access bbsimctl
Matteo Scandolof380a972020-09-11 12:09:40 -070046+++++++++++++++
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070047
Matteo Scandolof380a972020-09-11 12:09:40 -070048When running a test you can check the state of each ONU using ``BBSimCtl``.
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070049
50The easiest way to use ``bbsimctl`` is to ``exec`` inside the ``bbsim`` container:
51
52.. code:: bash
53
Matteo Scandolof380a972020-09-11 12:09:40 -070054 kubectl -n voltha exec -it $(kubectl -n voltha get pods -l app=bbsim -o name) -- /bin/bash
55
56In case you prefer to run ``bbsimctl`` on your machine,
57it 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 Scandoloe383d5d2019-10-25 14:47:27 -070066
67Check the ONU Status
Matteo Scandolof380a972020-09-11 12:09:40 -070068++++++++++++++++++++
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070069
70.. code:: bash
71
72 $ bbsimctl onu list
Matteo Scandolof380a972020-09-11 12:09:40 -070073 PONPORTID ID PORTNO SERIALNUMBER OPERSTATE INTERNALSTATE
74 0 1 0 BBSM00000001 up enabled
75
76Check 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 Scandoloe383d5d2019-10-25 14:47:27 -070087
88Advanced operations
Matteo Scandolof380a972020-09-11 12:09:40 -070089+++++++++++++++++++
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070090
91In certain cases you may want to execute operations on the BBSim ONUs.
92
93Here 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 Scandolof380a972020-09-11 12:09:40 -0700112 alarms
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700113 auth_restart
114 dhcp_restart
Matteo Scandolof380a972020-09-11 12:09:40 -0700115 flows
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700116 get
Matteo Scandolof380a972020-09-11 12:09:40 -0700117 igmp
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700118 list
119 poweron
Matteo Scandolof380a972020-09-11 12:09:40 -0700120 services
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700121 shutdown
Matteo Scandolof380a972020-09-11 12:09:40 -0700122 traffic_schedulers
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700123
Matteo Scandolof380a972020-09-11 12:09:40 -0700124Enable ONUs
125+++++++++++
126
127``BBSimCtl`` gives you the ability to control the device lifecycle,
128for example you can turn ONUs on and off:
129
130.. code:: bash
131
132 $ bbsimctl onu shutdown BBSM00000001
133 [Status: 0] ONU BBSM00000001 successfully shut down.
134
135 $ bbsimctl onu poweron BBSM00000001
136 [Status: 0] ONU BBSM00000001 successfully powered on.
137
138Autocomplete
139++++++++++++
140
141``bbsimctl`` comes with autocomplete, just run:
142
143.. code:: bash
144
145 source <(bbsimctl completion bash)
146
147Other APIS
148----------
149
150.. toctree::
151 :maxdepth: 1
152
Matteo Scandolo0e9fabf2020-09-30 17:19:27 -0700153 api.rst