blob: 9181a6ac521231527e361096cbb64c22c8f4faac [file] [log] [blame]
Daniele Moroed033562021-10-04 16:12:31 +02001.. _stratum_chassis_config:
2
Yi Tseng22e7dbc2021-09-28 14:32:15 -07003Stratum Chassis Configuration
4=============================
5
Carmelo Cascone43989982021-10-12 00:01:19 -07006Chassis config is an internal data structure used by Stratum. The term "chassis"
7refers to a switching box with one or more switching nodes (e.g., chips). The
8chassis config file is usually placed on disk and loaded when starting Stratum.
9This config includes all the not-so-frequent settings that are required before
10the switch can accept flow programming requests from the controller.
11
12In the following, we provide a **non-exhaustive overview of the configurations
13relevant to SD-Fabric for Tofino-based devices**. For a complete reference check
14out the `ChassisConfig Protobuf message format
15<https://github.com/stratum/stratum/blob/main/stratum/hal/lib/common/common.proto#L824-L833>`_
16and the `guide for running Stratum on Tofino-based switches
17<https://github.com/stratum/stratum/blob/main/stratum/hal/bin/barefoot/README.run.md>`_
18in the Stratum repository.
19
Yi Tseng22e7dbc2021-09-28 14:32:15 -070020.. tip::
21
Carmelo Cascone43989982021-10-12 00:01:19 -070022 Check out the `Stratum repository
23 <https://github.com/stratum/stratum/tree/main/stratum/hal/config>`_ for
24 examples of chassis config files for different switch platforms.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070025
Carmelo Cascone43989982021-10-12 00:01:19 -070026 See the :ref:`deployment_guide` to learn about how to deploy Stratum
Yi Tseng22e7dbc2021-09-28 14:32:15 -070027 with a custom chassis config.
28
Yi Tseng22e7dbc2021-09-28 14:32:15 -070029.. note::
30
Carmelo Cascone43989982021-10-12 00:01:19 -070031 In Stratum the external interface for pushing config is gNMI. The protobuf
32 realization of the YANG models for the config is internally converted to a
33 chassis config before it is consumed by the internal stack components. Not
34 all configurations are available through gNMI, for this reason we recommend
35 using the chassis config file.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070036
Carmelo Cascone43989982021-10-12 00:01:19 -070037 The file uses the protobuf text format, check out
Yi Tseng22e7dbc2021-09-28 14:32:15 -070038 `the protobuf language guide for more info <https://developers.google.com/protocol-buffers/docs/overview?hl=en>`_
39
40Chassis
41-------
Carmelo Cascone43989982021-10-12 00:01:19 -070042A valid chassis config includes a ``chassis``, a ``node`` field, and one
43or more ``singleton_port`` fields.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070044
45A ``chassis`` uniquely identifies a switch with a single management interface.
46Each chassis may contain one or more slots (aka linecards),
47and one or more switching nodes (aka chips) on each slot.
48
49A chassis contains the following fields:
50
Carmelo Cascone43989982021-10-12 00:01:19 -070051* ``platform``: The chassis platform, e.g., ``PLT_GENERIC_BAREFOOT_TOFINO`` for
52 Tofino-based devices (check out `here <https://github.com/stratum/stratum/blob/main/stratum/hal/lib/common/common.proto#L33-L47>`_ for other platforms). **Required**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070053* ``name``: An arbitrary name for the chassis. **Optional**
Carmelo Cascone43989982021-10-12 00:01:19 -070054* ``config_params``: Parameters for the entire chassis, usually empty for Tofino-based devices. **Optional**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070055
56Node
57----
58
59A ``node`` uniquely identifies a single switching node (aka chip) on a chassis linecard
60and all its flow-related and config-related parameters.
61
62A node contains the following fields:
63
Carmelo Cascone43989982021-10-12 00:01:19 -070064* ``id``: An arbitrary ID of the switch node on the chassis (corresponds to the P4Runtime device ID). **Required**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070065* ``name``: An arbitrary name for the switching node. **Optional**
Carmelo Cascone43989982021-10-12 00:01:19 -070066* ``slot``: The 1-base index of the slot (aka linecard) to which this node belongs. **Required**
67* ``index``: An optional 1-based index of the node within the chassis. **Optional**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070068
Daniele Moroed033562021-10-04 16:12:31 +020069.. _singleton_port:
70
Yi Tseng22e7dbc2021-09-28 14:32:15 -070071Singleton Port
72--------------
73
Carmelo Cascone43989982021-10-12 00:01:19 -070074A ``singleton port`` uniquely identifies a switch port and it contains the following fields:
Yi Tseng22e7dbc2021-09-28 14:32:15 -070075
Carmelo Cascone43989982021-10-12 00:01:19 -070076* ``id``: An arbitrary ID, unique in the scope of a chassis. **Required**
77* ``name``: An optional user friendly name for the port (e.g., ``10/1`` to identify channel
78 1 of front-panel port 10). **Required**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070079
Carmelo Cascone43989982021-10-12 00:01:19 -070080 ONOS obtains this name via gNMI and uses it internally to represent ports.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070081
82* ``slot``: The 1-base index of the slot (aka linecard) of the port. **Required**
83* ``port``: The 1-base index of the singleton port on the slot. **Required**
84* ``channel``: The 1-base channel index. Absence or zero means non-channelized. **Optional**
85* ``speed_bps``: The speed of the port in bps. **Required**
86* ``node``: The id of the corresponding node that the port belongs to. **Required**
Carmelo Cascone43989982021-10-12 00:01:19 -070087* ``config_params``: **Optional**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070088
Carmelo Cascone43989982021-10-12 00:01:19 -070089 * ``admin_state``: The initial admin state for this port, disabled by default.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070090
91 * Choose from ``ADMIN_STATE_DISABLED`` or ``ADMIN_STATE_ENABLED``.
92
Yi Tseng22e7dbc2021-09-28 14:32:15 -070093 * ``autoneg``: Whether auto-negotiation is enabled or not for this port.
94
95 * Choose from ``TRI_STATE_FALSE`` or ``TRI_STATE_TRUE``
96 * The initial configuration might be different if this field is empty, based on the
97 platform or the connector you are using.
98
Carmelo Cascone43989982021-10-12 00:01:19 -070099 * ``fec_mode``: Forward Error Correction (FEC) mode
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700100
101 * Choose from ``FEC_MODE_ON``, ``FEC_MODE_OFF``, or ``FEC_MODE_AUTO``
102
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700103Example chassis config
104----------------------
105
Carmelo Cascone43989982021-10-12 00:01:19 -0700106In this example, we want to set up a **Tofino-based switch** with only one node, one slot,
107and two ports:
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700108
Carmelo Cascone43989982021-10-12 00:01:19 -0700109* Port 1: 100G port without channelization, enabled by default, without auto-negotiation.
110* Port 2: break out port with four 10G channels, enabled by default, with auto-negotiation.
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700111
112.. image:: ../images/chassis-config-example.svg
113 :width: 500px
114
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700115.. code-block::
116
117 description: "A chassis config example."
118 chassis {
119 platform: PLT_GENERIC_BAREFOOT_TOFINO
120 name: "leaf-1"
121 }
122 nodes {
123 id: 1
124 slot: 1
125 index: 1
126 }
127 singleton_ports {
128 id: 1
129 name: "1/0"
130 slot: 1
131 port: 1
132 speed_bps: 100000000000 # 100G
133 config_params {
134 admin_state: ADMIN_STATE_ENABLED
135 autoneg: TRI_STATE_FALSE
136 }
137 node: 1
138 }
139 singleton_ports {
140 id: 200
141 name: "2/0"
142 slot: 1
143 port: 2
144 channel: 1
145 speed_bps: 10000000000 # 10G
146 config_params {
147 admin_state: ADMIN_STATE_ENABLED
148 autoneg: TRI_STATE_TRUE
149 }
150 node: 1
151 }
152 singleton_ports {
153 id: 201
154 name: "2/1"
155 slot: 1
156 port: 2
157 channel: 2
158 speed_bps: 10000000000 # 10G
159 config_params {
160 admin_state: ADMIN_STATE_ENABLED
161 autoneg: TRI_STATE_TRUE
162 }
163 node: 1
164 }
165 singleton_ports {
166 id: 202
167 name: "2/2"
168 slot: 1
169 port: 2
170 channel: 3
171 speed_bps: 10000000000 # 10G
172 config_params {
173 admin_state: ADMIN_STATE_ENABLED
174 autoneg: TRI_STATE_TRUE
175 }
176 node: 1
177 }
178 singleton_ports {
179 id: 203
180 name: "2/3"
181 slot: 1
182 port: 2
183 channel: 4
184 speed_bps: 10000000000 # 10G
185 config_params {
186 admin_state: ADMIN_STATE_ENABLED
187 autoneg: TRI_STATE_TRUE
188 }
189 node: 1
190 }