blob: 72c636d7fa5eaf4527e392559360090f9e8694c6 [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 Scandolof380a972020-09-11 12:09:40 -070011- 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
14BBSimCtl
15--------
16
17BBSim comes with a gRPC interface to control the internal state. This
18interface 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 Scandoloe383d5d2019-10-25 14:47:27 -070043
44Access bbsimctl
Matteo Scandolof380a972020-09-11 12:09:40 -070045+++++++++++++++
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070046
Matteo Scandolof380a972020-09-11 12:09:40 -070047When running a test you can check the state of each ONU using ``BBSimCtl``.
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070048
49The easiest way to use ``bbsimctl`` is to ``exec`` inside the ``bbsim`` container:
50
51.. code:: bash
52
Matteo Scandolof380a972020-09-11 12:09:40 -070053 kubectl -n voltha exec -it $(kubectl -n voltha get pods -l app=bbsim -o name) -- /bin/bash
54
55In case you prefer to run ``bbsimctl`` on your machine,
56it 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 Scandoloe383d5d2019-10-25 14:47:27 -070065
66Check the ONU Status
Matteo Scandolof380a972020-09-11 12:09:40 -070067++++++++++++++++++++
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070068
69.. code:: bash
70
71 $ bbsimctl onu list
Matteo Scandolof380a972020-09-11 12:09:40 -070072 PONPORTID ID PORTNO SERIALNUMBER OPERSTATE INTERNALSTATE
73 0 1 0 BBSM00000001 up enabled
74
75Check 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 Scandoloe383d5d2019-10-25 14:47:27 -070086
87Advanced operations
Matteo Scandolof380a972020-09-11 12:09:40 -070088+++++++++++++++++++
Matteo Scandoloe383d5d2019-10-25 14:47:27 -070089
90In certain cases you may want to execute operations on the BBSim ONUs.
91
92Here 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 Scandolof380a972020-09-11 12:09:40 -0700111 alarms
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700112 auth_restart
113 dhcp_restart
Matteo Scandolof380a972020-09-11 12:09:40 -0700114 flows
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700115 get
Matteo Scandolof380a972020-09-11 12:09:40 -0700116 igmp
Matteo Scandoloe383d5d2019-10-25 14:47:27 -0700117 list
118 poweron
Matteo Scandolof380a972020-09-11 12:09:40 -0700119 services
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700120 shutdown
Matteo Scandolof380a972020-09-11 12:09:40 -0700121 traffic_schedulers
Zack Williams4b0ef4d2019-12-18 14:25:20 -0700122
Matteo Scandolof380a972020-09-11 12:09:40 -0700123Enable ONUs
124+++++++++++
125
126``BBSimCtl`` gives you the ability to control the device lifecycle,
127for 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
137Autocomplete
138++++++++++++
139
140``bbsimctl`` comes with autocomplete, just run:
141
142.. code:: bash
143
144 source <(bbsimctl completion bash)
145
146Other APIS
147----------
148
149.. toctree::
150 :maxdepth: 1
151
152 api.rst