blob: 2a8a317965a02d49a44e3053103db76ab050f8c8 [file] [log] [blame]
Charles Chanfcfe8902022-02-02 17:06:27 -08001.. SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
2.. SPDX-License-Identifier: Apache-2.0
3
Daniele Moroed033562021-10-04 16:12:31 +02004.. _stratum_chassis_config:
5
Yi Tseng22e7dbc2021-09-28 14:32:15 -07006Stratum Chassis Configuration
7=============================
8
Carmelo Cascone43989982021-10-12 00:01:19 -07009Chassis config is an internal data structure used by Stratum. The term "chassis"
10refers to a switching box with one or more switching nodes (e.g., chips). The
11chassis config file is usually placed on disk and loaded when starting Stratum.
12This config includes all the not-so-frequent settings that are required before
13the switch can accept flow programming requests from the controller.
14
15In the following, we provide a **non-exhaustive overview of the configurations
16relevant to SD-Fabric for Tofino-based devices**. For a complete reference check
17out the `ChassisConfig Protobuf message format
18<https://github.com/stratum/stratum/blob/main/stratum/hal/lib/common/common.proto#L824-L833>`_
19and the `guide for running Stratum on Tofino-based switches
20<https://github.com/stratum/stratum/blob/main/stratum/hal/bin/barefoot/README.run.md>`_
21in the Stratum repository.
22
Yi Tseng22e7dbc2021-09-28 14:32:15 -070023.. tip::
24
Carmelo Cascone43989982021-10-12 00:01:19 -070025 Check out the `Stratum repository
26 <https://github.com/stratum/stratum/tree/main/stratum/hal/config>`_ for
27 examples of chassis config files for different switch platforms.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070028
Carmelo Cascone43989982021-10-12 00:01:19 -070029 See the :ref:`deployment_guide` to learn about how to deploy Stratum
Yi Tseng22e7dbc2021-09-28 14:32:15 -070030 with a custom chassis config.
31
Yi Tseng22e7dbc2021-09-28 14:32:15 -070032.. note::
33
Carmelo Cascone43989982021-10-12 00:01:19 -070034 In Stratum the external interface for pushing config is gNMI. The protobuf
35 realization of the YANG models for the config is internally converted to a
36 chassis config before it is consumed by the internal stack components. Not
37 all configurations are available through gNMI, for this reason we recommend
38 using the chassis config file.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070039
Carmelo Cascone43989982021-10-12 00:01:19 -070040 The file uses the protobuf text format, check out
Yi Tseng22e7dbc2021-09-28 14:32:15 -070041 `the protobuf language guide for more info <https://developers.google.com/protocol-buffers/docs/overview?hl=en>`_
42
43Chassis
44-------
Carmelo Cascone43989982021-10-12 00:01:19 -070045A valid chassis config includes a ``chassis``, a ``node`` field, and one
46or more ``singleton_port`` fields.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070047
48A ``chassis`` uniquely identifies a switch with a single management interface.
49Each chassis may contain one or more slots (aka linecards),
50and one or more switching nodes (aka chips) on each slot.
51
52A chassis contains the following fields:
53
Carmelo Cascone43989982021-10-12 00:01:19 -070054* ``platform``: The chassis platform, e.g., ``PLT_GENERIC_BAREFOOT_TOFINO`` for
55 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 -070056* ``name``: An arbitrary name for the chassis. **Optional**
Carmelo Cascone43989982021-10-12 00:01:19 -070057* ``config_params``: Parameters for the entire chassis, usually empty for Tofino-based devices. **Optional**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070058
59Node
60----
61
62A ``node`` uniquely identifies a single switching node (aka chip) on a chassis linecard
63and all its flow-related and config-related parameters.
64
65A node contains the following fields:
66
Carmelo Cascone43989982021-10-12 00:01:19 -070067* ``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 -070068* ``name``: An arbitrary name for the switching node. **Optional**
Carmelo Cascone43989982021-10-12 00:01:19 -070069* ``slot``: The 1-base index of the slot (aka linecard) to which this node belongs. **Required**
70* ``index``: An optional 1-based index of the node within the chassis. **Optional**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070071
Daniele Moroed033562021-10-04 16:12:31 +020072.. _singleton_port:
73
Yi Tseng22e7dbc2021-09-28 14:32:15 -070074Singleton Port
75--------------
76
Carmelo Cascone43989982021-10-12 00:01:19 -070077A ``singleton port`` uniquely identifies a switch port and it contains the following fields:
Yi Tseng22e7dbc2021-09-28 14:32:15 -070078
Carmelo Cascone43989982021-10-12 00:01:19 -070079* ``id``: An arbitrary ID, unique in the scope of a chassis. **Required**
80* ``name``: An optional user friendly name for the port (e.g., ``10/1`` to identify channel
81 1 of front-panel port 10). **Required**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070082
Carmelo Cascone43989982021-10-12 00:01:19 -070083 ONOS obtains this name via gNMI and uses it internally to represent ports.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070084
85* ``slot``: The 1-base index of the slot (aka linecard) of the port. **Required**
86* ``port``: The 1-base index of the singleton port on the slot. **Required**
87* ``channel``: The 1-base channel index. Absence or zero means non-channelized. **Optional**
88* ``speed_bps``: The speed of the port in bps. **Required**
89* ``node``: The id of the corresponding node that the port belongs to. **Required**
Carmelo Cascone43989982021-10-12 00:01:19 -070090* ``config_params``: **Optional**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070091
Carmelo Cascone43989982021-10-12 00:01:19 -070092 * ``admin_state``: The initial admin state for this port, disabled by default.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070093
94 * Choose from ``ADMIN_STATE_DISABLED`` or ``ADMIN_STATE_ENABLED``.
95
Yi Tseng22e7dbc2021-09-28 14:32:15 -070096 * ``autoneg``: Whether auto-negotiation is enabled or not for this port.
97
98 * Choose from ``TRI_STATE_FALSE`` or ``TRI_STATE_TRUE``
99 * The initial configuration might be different if this field is empty, based on the
100 platform or the connector you are using.
101
Carmelo Cascone43989982021-10-12 00:01:19 -0700102 * ``fec_mode``: Forward Error Correction (FEC) mode
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700103
104 * Choose from ``FEC_MODE_ON``, ``FEC_MODE_OFF``, or ``FEC_MODE_AUTO``
105
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700106Example chassis config
107----------------------
108
Carmelo Cascone43989982021-10-12 00:01:19 -0700109In this example, we want to set up a **Tofino-based switch** with only one node, one slot,
110and two ports:
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700111
Carmelo Cascone43989982021-10-12 00:01:19 -0700112* Port 1: 100G port without channelization, enabled by default, without auto-negotiation.
113* Port 2: break out port with four 10G channels, enabled by default, with auto-negotiation.
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700114
115.. image:: ../images/chassis-config-example.svg
116 :width: 500px
117
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700118.. code-block::
119
120 description: "A chassis config example."
121 chassis {
122 platform: PLT_GENERIC_BAREFOOT_TOFINO
123 name: "leaf-1"
124 }
125 nodes {
126 id: 1
127 slot: 1
128 index: 1
129 }
130 singleton_ports {
131 id: 1
132 name: "1/0"
133 slot: 1
134 port: 1
135 speed_bps: 100000000000 # 100G
136 config_params {
137 admin_state: ADMIN_STATE_ENABLED
138 autoneg: TRI_STATE_FALSE
139 }
140 node: 1
141 }
142 singleton_ports {
143 id: 200
144 name: "2/0"
145 slot: 1
146 port: 2
147 channel: 1
148 speed_bps: 10000000000 # 10G
149 config_params {
150 admin_state: ADMIN_STATE_ENABLED
151 autoneg: TRI_STATE_TRUE
152 }
153 node: 1
154 }
155 singleton_ports {
156 id: 201
157 name: "2/1"
158 slot: 1
159 port: 2
160 channel: 2
161 speed_bps: 10000000000 # 10G
162 config_params {
163 admin_state: ADMIN_STATE_ENABLED
164 autoneg: TRI_STATE_TRUE
165 }
166 node: 1
167 }
168 singleton_ports {
169 id: 202
170 name: "2/2"
171 slot: 1
172 port: 2
173 channel: 3
174 speed_bps: 10000000000 # 10G
175 config_params {
176 admin_state: ADMIN_STATE_ENABLED
177 autoneg: TRI_STATE_TRUE
178 }
179 node: 1
180 }
181 singleton_ports {
182 id: 203
183 name: "2/3"
184 slot: 1
185 port: 2
186 channel: 4
187 speed_bps: 10000000000 # 10G
188 config_params {
189 admin_state: ADMIN_STATE_ENABLED
190 autoneg: TRI_STATE_TRUE
191 }
192 node: 1
193 }