blob: 11b433a1248a9dca5443da9c128a79feb7c94e50 [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**
Charles Chana937f772022-02-23 16:24:35 -080080
81 .. note::
82 We recommend using the following naming convention for both ONOS network config and Stratum chassis config:
83 - For unchannelized ports, use the **front panel port** number directly.
84 - For channelized ports, use the **front panel port number * 100 + channel id**.
85 For example, we can use port id ``2903`` for port ``29/3`` (port 29 channel 3).
86 - Note that we use **zero-based** channel number for singleton port ``id``
87 but the ``channel`` field described below uses **one-based** channel number.
88
Carmelo Cascone43989982021-10-12 00:01:19 -070089* ``name``: An optional user friendly name for the port (e.g., ``10/1`` to identify channel
90 1 of front-panel port 10). **Required**
Yi Tseng22e7dbc2021-09-28 14:32:15 -070091
Carmelo Cascone43989982021-10-12 00:01:19 -070092 ONOS obtains this name via gNMI and uses it internally to represent ports.
Yi Tseng22e7dbc2021-09-28 14:32:15 -070093
94* ``slot``: The 1-base index of the slot (aka linecard) of the port. **Required**
95* ``port``: The 1-base index of the singleton port on the slot. **Required**
96* ``channel``: The 1-base channel index. Absence or zero means non-channelized. **Optional**
97* ``speed_bps``: The speed of the port in bps. **Required**
98* ``node``: The id of the corresponding node that the port belongs to. **Required**
Carmelo Cascone43989982021-10-12 00:01:19 -070099* ``config_params``: **Optional**
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700100
Carmelo Cascone43989982021-10-12 00:01:19 -0700101 * ``admin_state``: The initial admin state for this port, disabled by default.
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700102
103 * Choose from ``ADMIN_STATE_DISABLED`` or ``ADMIN_STATE_ENABLED``.
104
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700105 * ``autoneg``: Whether auto-negotiation is enabled or not for this port.
106
107 * Choose from ``TRI_STATE_FALSE`` or ``TRI_STATE_TRUE``
108 * The initial configuration might be different if this field is empty, based on the
109 platform or the connector you are using.
110
Carmelo Cascone43989982021-10-12 00:01:19 -0700111 * ``fec_mode``: Forward Error Correction (FEC) mode
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700112
113 * Choose from ``FEC_MODE_ON``, ``FEC_MODE_OFF``, or ``FEC_MODE_AUTO``
114
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700115Example chassis config
116----------------------
117
Carmelo Cascone43989982021-10-12 00:01:19 -0700118In this example, we want to set up a **Tofino-based switch** with only one node, one slot,
119and two ports:
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700120
Carmelo Cascone43989982021-10-12 00:01:19 -0700121* Port 1: 100G port without channelization, enabled by default, without auto-negotiation.
122* Port 2: break out port with four 10G channels, enabled by default, with auto-negotiation.
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700123
124.. image:: ../images/chassis-config-example.svg
125 :width: 500px
126
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700127.. code-block::
128
129 description: "A chassis config example."
130 chassis {
131 platform: PLT_GENERIC_BAREFOOT_TOFINO
132 name: "leaf-1"
133 }
134 nodes {
135 id: 1
136 slot: 1
137 index: 1
138 }
139 singleton_ports {
140 id: 1
141 name: "1/0"
142 slot: 1
143 port: 1
144 speed_bps: 100000000000 # 100G
145 config_params {
146 admin_state: ADMIN_STATE_ENABLED
147 autoneg: TRI_STATE_FALSE
148 }
149 node: 1
150 }
151 singleton_ports {
152 id: 200
153 name: "2/0"
154 slot: 1
155 port: 2
156 channel: 1
157 speed_bps: 10000000000 # 10G
158 config_params {
159 admin_state: ADMIN_STATE_ENABLED
160 autoneg: TRI_STATE_TRUE
161 }
162 node: 1
163 }
164 singleton_ports {
165 id: 201
166 name: "2/1"
167 slot: 1
168 port: 2
169 channel: 2
170 speed_bps: 10000000000 # 10G
171 config_params {
172 admin_state: ADMIN_STATE_ENABLED
173 autoneg: TRI_STATE_TRUE
174 }
175 node: 1
176 }
177 singleton_ports {
178 id: 202
179 name: "2/2"
180 slot: 1
181 port: 2
182 channel: 3
183 speed_bps: 10000000000 # 10G
184 config_params {
185 admin_state: ADMIN_STATE_ENABLED
186 autoneg: TRI_STATE_TRUE
187 }
188 node: 1
189 }
190 singleton_ports {
191 id: 203
192 name: "2/3"
193 slot: 1
194 port: 2
195 channel: 4
196 speed_bps: 10000000000 # 10G
197 config_params {
198 admin_state: ADMIN_STATE_ENABLED
199 autoneg: TRI_STATE_TRUE
200 }
201 node: 1
202 }