|
| 1 | +# SONiC PoE # |
| 2 | + |
| 3 | +## Table of Content |
| 4 | + |
| 5 | +- [Revision](#revision) |
| 6 | +- [Scope](#scope) |
| 7 | +- [Definition/Abbreviation](#definitions_abbreviations) |
| 8 | +- [Overview](#overview) |
| 9 | +- [Requirements](#requirements) |
| 10 | +- [Architecture Design](#architecture-design) |
| 11 | + - [PoE SYNCD](#poe-syncd) |
| 12 | + - [PoE Manager](#poe-manager) |
| 13 | +- [High-Level Design](#high-level-design) |
| 14 | + - [PoE flows](#poe-flows) |
| 15 | + - [PoE data collection](#poe-data-collection) |
| 16 | + - [PoE configuration](#poe-configuration) |
| 17 | +- [SAI API](#sai-api) |
| 18 | +- [PoE AI](#poe-abstraction-interface) |
| 19 | +- [Configuration and management](#configuration-and-management) |
| 20 | + - [CLI/YANG model Enhancements](#cli_yang-model-enhancements) |
| 21 | + - [Show commands](#show-commands) |
| 22 | + - [Config commands](#config-commands) |
| 23 | + - [Config DB Enhancements](#config-db-enhancements) |
| 24 | + - [State DB Enhancements](#state-db-enhancements) |
| 25 | +- [Restrictions/Limitations](#restrictions_limitations) |
| 26 | + |
| 27 | +### Revision |
| 28 | + |
| 29 | + | Rev | Date | Author | Change Description | |
| 30 | + |:---:|:----:|:--------------:|--------------------| |
| 31 | + | 0.1 | | Volodymyr Mytnyk | Initial version | |
| 32 | + |
| 33 | +### Scope |
| 34 | + |
| 35 | +This document provides general information about the PoE (Power over Ethernet) feature implementation in SONiC. |
| 36 | + |
| 37 | +### Definitions/Abbreviations |
| 38 | + |
| 39 | +| | | |
| 40 | +|--------------------------|--------------------------------| |
| 41 | +| PoE | Power over Ethernet | |
| 42 | + |
| 43 | +### Overview |
| 44 | + |
| 45 | +Ethernet switch (e.g. campus specific platforms) today often comes with Power over Ethernet (PoE) feature support. PoE functioalility itself is considered as an external functionality from NPU SAI/SDK point of view as it is configurable via external PoE controller. |
| 46 | + |
| 47 | + |
| 48 | +### Requirements |
| 49 | + |
| 50 | +- PoE feature can be enabled via compile option (disabled by default); |
| 51 | +- PoE config persistence during SONiC reboot; |
| 52 | +- Support CLI configurations as mentioned in [config section](#config-commands) and [show section](#show-commands); |
| 53 | +- Warm boot (future); |
| 54 | + |
| 55 | +### Architecture Design |
| 56 | + |
| 57 | +In order to isolate PoE functionality and complexity from existing SONiC design, the following main changes are made: |
| 58 | + |
| 59 | +- Add separate container for PoE control plane routine configuration. |
| 60 | +- Introduce separate SYNCD container to support external PoE Abstraction Interface. |
| 61 | +- Add new PoE tables into database container. |
| 62 | + |
| 63 | +The following diagram explains the changes needed in existing SONiC architecture. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +#### PoE interaction |
| 68 | + |
| 69 | +This section describes the detail interaction of PoE componnents, DB and PoE hardware (controller) in SONiC subsytem. |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +#### PoE SYNCD |
| 74 | + |
| 75 | +New PoE SYNCD container componnents: |
| 76 | +- *poesyncd* - syncd poe configuration between db and poe pse devices |
| 77 | +- *poe sai api* - PoE Abstraction interface to configure PoE controller (see [PoE AI section](#poe-abstraction-interface)) |
| 78 | +- *poe library*- library that has low level poe logic and the transportation to and from the hardware |
| 79 | + |
| 80 | +##### PoE library |
| 81 | + |
| 82 | +The PoE library has lower level PoE software logic, and the transportation to and from the PoE hardware. This includes reading and/or writing PoE information such as power consumption, PSE temperatures, port status, port admin state and more. |
| 83 | +As long as the library supports the saipoe.h file, it can be changed per board/vendor, and the functionality will stay the same. |
| 84 | + |
| 85 | +#### PoE manager |
| 86 | + |
| 87 | +PoE manager consists of a daemon that implements the following functionality: |
| 88 | + |
| 89 | +- Making sure that the PSEs are functional; |
| 90 | +- Collect variable PoE data periodically; |
| 91 | + - PoE status; |
| 92 | + - PoE protocol and class; |
| 93 | + - PoE power, current and voltage; |
| 94 | + - PSE information; |
| 95 | +- apply PoE controller configuration; |
| 96 | +- track changes in config, appl DB; |
| 97 | + |
| 98 | +### High-Level Design |
| 99 | + |
| 100 | +This section covers the high level design of the built-in SONiC PoE feature. |
| 101 | + |
| 102 | +This section covers the following points in detail. |
| 103 | + |
| 104 | + - Existing moduels are not modified by this design. |
| 105 | + - Repositories that will be changed: sonic-buildimage, ... |
| 106 | + - Module/sub-module interfaces and dependencies. |
| 107 | + - SWSS and Syncd are not changed. |
| 108 | + - This design doesn't change existing DB Schema, only new are added. |
| 109 | + - Linux dependencies and interface |
| 110 | + - Fastboot requirements & dependencies |
| 111 | + - Scalability and performance requirements/impact |
| 112 | + - Memory requirements |
| 113 | + - Docker dependency |
| 114 | + - Build dependency if any |
| 115 | + - Management interfaces - SNMP, CLI, RestAPI, etc., |
| 116 | + - Serviceability and Debug (logging, counters, trace etc) related design |
| 117 | + - Is this change specific to any platform? Are there dependencies for platforms to implement anything to make this feature work? If yes, explain in detail and inform community in advance. |
| 118 | + - SAI API requirements, CLI requirements, ConfigDB requirements. Design is covered in following sections. |
| 119 | + |
| 120 | +##### PoE flows |
| 121 | + |
| 122 | +###### PoE data collection |
| 123 | + |
| 124 | +"Show" flow: |
| 125 | + 1. Get PoE controller information; |
| 126 | + 2. Update application DB with the PoE status; |
| 127 | + 3. Repeat step 1-2 each seconds (optional); |
| 128 | + 4. SONiC CLI read and display PoE infomation from application DB; |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | +###### PoE configuration |
| 133 | + |
| 134 | +Configuration flow: |
| 135 | + 1. Configure PoE using SONiC CLI; |
| 136 | + 2. Update Config DB accordingly; |
| 137 | + 3. Poemgrd subscribe to related tables in Config DB; |
| 138 | + 4. Call PoE AI for related configuration; |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | +### SAI API |
| 144 | + |
| 145 | +- SAI object types extended to support PoE |
| 146 | +- SAI API list is extended to supprot PoE |
| 147 | +- New PoE switch type added |
| 148 | + |
| 149 | +### PoE Abstraction Interface |
| 150 | + |
| 151 | +The PoE Manager uses a new SAI PoE library that implements the PoE Abstraction Interface. |
| 152 | + |
| 153 | +#### Device Capabilities |
| 154 | + |
| 155 | +| Capabilities | SAI attributes | |
| 156 | +| ----------------- | ------------------------------------- | |
| 157 | +| Hardware Info | SAI_POE_DEVICE_ATTR_HARDWARE_INFO | |
| 158 | +| PSE List | SAI_POE_DEVICE_ATTR_POE_PSE_LIST | |
| 159 | +| PoE List | SAI_POE_DEVICE_ATTR_POE_PORT_LIST | |
| 160 | +| Total Power | SAI_POE_DEVICE_ATTR_TOTAL_POWER | |
| 161 | +| Power Consumption | SAI_POE_DEVICE_ATTR_POWER_CONSUMPTION | |
| 162 | +| Version | SAI_POE_DEVICE_ATTR_VERSION | |
| 163 | +| Power Limit Mode | SAI_POE_DEVICE_ATTR_POWER_LIMIT_MODE | |
| 164 | + |
| 165 | + |
| 166 | +#### PSE Capabilities |
| 167 | + |
| 168 | +| Capabilities | SAI attributes | |
| 169 | +| --------------- | ------------------------------------- | |
| 170 | +| PSE ID | SAI_POE_PSE_ATTR_ID | |
| 171 | +| PSE SW Version | SAI_POE_PSE_ATTR_PSE_SOFTWARE_VERSION | |
| 172 | +| PSE HW Version | SAI_POE_PSE_ATTR_PSE_HARDWARE_VERSION | |
| 173 | +| PSE Temperature | SAI_POE_PSE_ATTR_TEMPERATURE | |
| 174 | +| PSE Status | SAI_POE_PSE_ATTR_PSE_STATUS | |
| 175 | + |
| 176 | +#### Port Capabilities |
| 177 | + |
| 178 | +| Capabilities | SAI attributes | |
| 179 | +| ------------------ | ------------------------------------- | |
| 180 | +| Front Panel ID | SAI_POE_PORT_ATTR_FRONT_PANEL_ID | |
| 181 | +| Standard | SAI_POE_PORT_ATTR_STANDARD | |
| 182 | +| Admin Enable State | SAI_POE_PORT_ATTR_ADMIN_ENABLED_STATE | |
| 183 | +| Power Limit | SAI_POE_PORT_ATTR_POWER_LIMIT | |
| 184 | +| Power Priority | SAI_POE_PORT_ATTR_POWER_PRIORITY | |
| 185 | +| Power Consumption | SAI_POE_PORT_ATTR_CONSUMPTION | |
| 186 | +| Status | SAI_POE_PORT_ATTR_STATUS | |
| 187 | +| Detailed Status | SAI_POE_PORT_ATTR_DETAILED_STATUS | |
| 188 | + |
| 189 | + |
| 190 | +### Configuration and management |
| 191 | + |
| 192 | +#### Manifest (if the feature is an Application Extension) |
| 193 | +Feature is not an Application Extension |
| 194 | + |
| 195 | +#### CLI/YANG model Enhancements |
| 196 | + |
| 197 | +##### Show commands |
| 198 | +- show poe status |
| 199 | + |
| 200 | +``` |
| 201 | +PoE system information |
| 202 | +================================ |
| 203 | +Status : ready |
| 204 | +Total PoE Ports : 48 |
| 205 | +
|
| 206 | +Total Power : 714.500 W |
| 207 | +Power Consumption : 12.500 W |
| 208 | +Power Available : 702.000 W |
| 209 | +
|
| 210 | + ``` |
| 211 | + |
| 212 | +- show poe interface \<ifname\> |
| 213 | +``` |
| 214 | +
|
| 215 | +Port Status En/Dis Priority Protocol Class PWR Consump PWR Limit Voltage Current |
| 216 | +------------ ----------- ------- -------- ------------- ----- ------------ ---------- --------- --------- |
| 217 | +Ethernet0 delivering enable high 802.3BT/High 4 6.100 W 80.600 W 54.000 V 0.113 A |
| 218 | +Ethernet1 delivering enable crit 802.3BT/High 4 6.500 W 80.600 W 54.000 V 0.120 A |
| 219 | +Ethernet2 searching enable low 802.3BT/High 0 0.000 W 80.600 W 0.000 V 0.000 A |
| 220 | +Ethernet3 searching enable crit 802.3BT/High 0 0.000 W 80.600 W 0.000 V 0.000 A |
| 221 | +``` |
| 222 | + |
| 223 | +##### Config commands |
| 224 | + |
| 225 | +- config poe interface status \<ifname\> {enable | disable} |
| 226 | +- config poe interface priority \<ifname\> {crit | high | low} |
| 227 | +- config poe interface power_limit \<ifname\> {power_limit} |
| 228 | + |
| 229 | +Examples: |
| 230 | +``` |
| 231 | +$ config poe interface status Ethernet0 enable |
| 232 | +$ config poe interface priority Ethernet0 high |
| 233 | +$ config poe interface power_limit Ethernet0 20.4 |
| 234 | +``` |
| 235 | + |
| 236 | +**TODO**: update CLI reference https://github.com/sonic-net/sonic-utilities/blob/master/doc/Command-Reference.md |
| 237 | + |
| 238 | +#### Config DB Enhancements |
| 239 | + |
| 240 | +New table has been added to the config database to store related PoE configuration parameters: |
| 241 | + |
| 242 | +##### POE_PORT_TABLE |
| 243 | +~~~ |
| 244 | + ;Stores PoE port configuration |
| 245 | + key = POE_PORT|ifname ; ifname with prefix POE_PORT |
| 246 | + ; field = value |
| 247 | + enabled = "enable" / "disable" ; enable/disable PoE on port, default "disable" |
| 248 | + power_limit = 1*3.1DIGIT ; power limit on PoE port |
| 249 | + priority = "crit" / "high" / "low" ; port priority level, default "high" |
| 250 | +~~~ |
| 251 | + |
| 252 | +#### Application DB Enhancements |
| 253 | + |
| 254 | +In SONiC all the peripheral devices data (information relared to PoE) will be stored in application database in separated tables: |
| 255 | + |
| 256 | +#### POE_PSE_STATE_TABLE |
| 257 | +~~~ |
| 258 | + ; Defines information for a global PoE state |
| 259 | + key = POE_TABLE:GLOBAL ; key |
| 260 | + ; field = value |
| 261 | + platform_supported = BOOLEAN ; PoE platform support |
| 262 | + poe_status = "N/A" / "init" / "failed" / "ready" ; PoE status |
| 263 | + total_ports = 1*2DIGIT ; total PoE ports |
| 264 | + total_pwr = 1*4.3DIGIT ; total power |
| 265 | + pwr_consump = 1*4.3DIGIT ; total power consumption |
| 266 | + pwr_avail = 1*4.3DIGIT ; available power |
| 267 | + pse_sw_ver = STRING ; PSE software version |
| 268 | + pse_hw_ver = STRING ; PSE hardware version |
| 269 | + pse_temp = 1*3DIGIT ; PSE temperature |
| 270 | + pse_status = "active" / "fail" / "not present" ; PSE status |
| 271 | +~~~ |
| 272 | + |
| 273 | +#### POE_PORT_STATE_TABLE |
| 274 | + ; Defines information for a PoE port state |
| 275 | + key = POE_PORT_STATE|ifname ; ifname with prefix POE_PORT_STATE |
| 276 | + ; field = value |
| 277 | + fp_port = 1*2DIGIT ; PoE front panel port (map PoE port num to ifname) |
| 278 | + status = BOOLEAN ; presence state of the PoE |
| 279 | + enabled = "enable" / "disable" ; PoE enabled on port |
| 280 | + priority = "crit" / "high" / "low" ; port priority level |
| 281 | + protocol = STRING ; name of PoE protocol |
| 282 | + class = 1*DIGIT ; power class |
| 283 | + pwr_consump = 1*3.3DIGIT ; the power of the PoE |
| 284 | + pwr_limit = 1*3.3DIGIT ; power capacity of the PoE port |
| 285 | + voltage = 1*3.3DIGIT ; output voltage of the PoE port |
| 286 | + current = 1*3.3DIGIT ; the current of the PoE port |
| 287 | + |
| 288 | + |
| 289 | +### Warmboot and Fastboot Design Impact |
| 290 | +Future |
| 291 | + |
| 292 | +### Memory Consumption |
| 293 | +This sub-section covers the memory consumption analysis for the new feature: no memory consumption is expected when the feature is disabled via compilation and no growing memory consumption while feature is disabled by configuration. |
| 294 | + |
| 295 | +### Restrictions/Limitations |
| 296 | + |
| 297 | +### Testing Requirements/Design |
| 298 | + |
| 299 | +Testing of PoE functionality are covered by unit & system testing. |
| 300 | + |
| 301 | +#### Unit Test cases |
| 302 | + |
| 303 | +PoE components (like PoE syncd, REDIS API) can be validated and covered by mocking PoE SAI API. The existing syncd unit tests can be extended to cover PoE functionality. |
| 304 | + |
| 305 | +#### System Test cases |
| 306 | + |
| 307 | +System testing can be done only on systems with PoE hardware support. |
| 308 | + |
| 309 | +TBD |
| 310 | + |
| 311 | +### Open/Action items - if any |
| 312 | +None |
| 313 | + |
| 314 | +NOTE: All the sections and sub-sections given above are mandatory in the design document. Users can add additional sections/sub-sections if required. |
0 commit comments