|
| 1 | +# MPLS TC to TC map |
| 2 | + |
| 3 | +## 1. Table of Content |
| 4 | + |
| 5 | +- [MPLS TC to TC map](#mpls-tc-to-tc-map) |
| 6 | + - [1. Table of Content](#1-table-of-content) |
| 7 | + - [2. Revision](#2-revision) |
| 8 | + - [3. Scope](#3-scope) |
| 9 | + - [4. Definitions/Abbreviations](#4-definitionsabbreviations) |
| 10 | + - [5. Overview](#5-overview) |
| 11 | + - [6. Requirements](#6-requirements) |
| 12 | + - [7. Architecture Design](#7-architecture-design) |
| 13 | + - [8. High-Level Design](#8-high-level-design) |
| 14 | + - [8.1. DB](#81-db) |
| 15 | + - [8.2. sonic-swss-common](#82-sonic-swss-common) |
| 16 | + - [8.3. sonic-swss](#83-sonic-swss) |
| 17 | + - [8.4. sonic-utilities](#84-sonic-utilities) |
| 18 | + - [8.5. Other implications](#85-other-implications) |
| 19 | + - [9. SAI API](#9-sai-api) |
| 20 | + - [10. Configuration and management](#10-configuration-and-management) |
| 21 | + - [10.1. CLI/YANG model Enhancements](#101-cliyang-model-enhancements) |
| 22 | + - [10.2. Config DB Enhancements](#102-config-db-enhancements) |
| 23 | + - [11. Warmboot and Fastboot Design Impact](#11-warmboot-and-fastboot-design-impact) |
| 24 | + - [12. Restrictions/Limitations](#12-restrictionslimitations) |
| 25 | + - [13. Testing Requirements/Design](#13-testing-requirementsdesign) |
| 26 | + - [13.1. Unit Test cases](#131-unit-test-cases) |
| 27 | + - [13.2. System Test cases](#132-system-test-cases) |
| 28 | + - [14. Open/Action items - if any](#14-openaction-items---if-any) |
| 29 | + |
| 30 | +## 2. Revision |
| 31 | + |
| 32 | +| Rev | Date | Author | Change Description | |
| 33 | +|:---:|:-----------:|:-----------------------:|--------------------------------------------| |
| 34 | +| 0.1 | 16/08/2021 | Alexandru Banu | Initial version | |
| 35 | +| 0.2 | 21/09/2021 | Alexandru Banu | Renamed MPLS EXP to MPLS TC per RFC 5462 | |
| 36 | +| 0.3 | 22/09/2021 | Alexandru Banu | Added per-port binding configuration | |
| 37 | + |
| 38 | +## 3. Scope |
| 39 | + |
| 40 | +This HLD extends SONiC to support MPLS TC to TC mappings. |
| 41 | + |
| 42 | +## 4. Definitions/Abbreviations |
| 43 | + |
| 44 | +TC = Traffic Class |
| 45 | +QoS = Quality of Service |
| 46 | + |
| 47 | +## 5. Overview |
| 48 | + |
| 49 | +This new enhancement adds support to SONiC for MPLS TC to TC map which allows QoS to work on MPLS packets. |
| 50 | + |
| 51 | +## 6. Requirements |
| 52 | + |
| 53 | +User can configure MPLS TC to TC map at start-of-day via configuration file. CLI support will exist to offer the same amount of support as for DSCP to TC map. |
| 54 | + |
| 55 | +## 7. Architecture Design |
| 56 | + |
| 57 | +The overall SONiC architecture will not be changed and no new sub-modules will be introduced. |
| 58 | + |
| 59 | +## 8. High-Level Design |
| 60 | + |
| 61 | +### 8.1. DB |
| 62 | + |
| 63 | +The CONFIG DB will be updated to include a new "MPLS_TC_TO_TC_MAP" similar to the existing "DSCP_TO_TC_MAP". This will have the following format: |
| 64 | +``` |
| 65 | +### MPLS_TC_TO_TC_MAP |
| 66 | + ; MPLS TC to TC map |
| 67 | + ;SAI mapping - qos_map object with SAI_QOS_MAP_ATTR_TYPE == sai_qos_map_type_t::SAI_QOS_MAP_MPLS_EXP_TO_TC |
| 68 | + key = "MPLS_TC_TO_TC_MAP|"name |
| 69 | + ;field value |
| 70 | + mpls_tc_value = 1*DIGIT |
| 71 | + tc_value = 1*DIGIT |
| 72 | +
|
| 73 | + Example: |
| 74 | + 127.0.0.1:6379> hgetall "MPLS_TC_TO_TC_MAP|Mpls_tc_to_tc_map1" |
| 75 | + 1) "3" ;mpls tc |
| 76 | + 2) "3" ;tc |
| 77 | + 3) "6" |
| 78 | + 4) "5" |
| 79 | + 5) "7" |
| 80 | + 6) "5" |
| 81 | +``` |
| 82 | + |
| 83 | +In order to allow a user to bind such a map to a port, the existing `PORT_QOS_MAP` table will be enhanced to allow a new field-value pair, where the field is going to be named `mpls_tc_to_tc_map` and the value will be the `MPLS_TC_TO_TC_MAP.key` of the map to use. |
| 84 | + |
| 85 | +### 8.2. sonic-swss-common |
| 86 | + |
| 87 | +sonic-swss-common's schema will be updated to include a CFG_MPLS_TC_TO_TC_MAP_TABLE_NAME define for the new table name. |
| 88 | + |
| 89 | +### 8.3. sonic-swss |
| 90 | + |
| 91 | +sonic-swss's QoS orch will be updated to include a new handler for MPLS TC to TC map, similar to the existing DSCP to TC map but with extra input validations, checking that the values are in the correct numeric range and that no MPLS TC value is mapped to more than one TC value. Among debugging logs, appropriate error logs will be introduced to let the user know if they miss-configured a map. |
| 92 | + |
| 93 | +Also, the QoS orch will be enhanced to configure the new field-value pair in `PORT_QOS_MAP` mentioned at section 8.1. |
| 94 | + |
| 95 | +### 8.4. sonic-utilities |
| 96 | + |
| 97 | +sonic-utilities will be updated to offer the same amount of support for CLI commands that DSCP to TC map already provide. |
| 98 | + |
| 99 | +### 8.5. Other implications |
| 100 | + |
| 101 | +There are no other implications. SAI and sairedis already support for MPLS TC to TC map. In terms of warm restart / fastboot / scalability / performance and so on, this should not represent an impact. |
| 102 | + |
| 103 | +## 9. SAI API |
| 104 | + |
| 105 | +MPLS TC to TC map are already supported in SAI. |
| 106 | + |
| 107 | +## 10. Configuration and management |
| 108 | + |
| 109 | +### 10.1. CLI/YANG model Enhancements |
| 110 | + |
| 111 | +CLI config commands will be updated to include the same level of support for MPLS TC to TC maps as for DSCP to TC maps. Namely, `config reload` and `config clear` will be updated to include the new mapping table as well. |
| 112 | + |
| 113 | +### 10.2. Config DB Enhancements |
| 114 | + |
| 115 | +The relevant changes have been described in HLD's DB sub-section. |
| 116 | + |
| 117 | +## 11. Warmboot and Fastboot Design Impact |
| 118 | + |
| 119 | +Not impacted by the changes. |
| 120 | + |
| 121 | +## 12. Restrictions/Limitations |
| 122 | + |
| 123 | +- User can't configure MPLS TC to TC map via CLI (only via reload command). |
| 124 | +- User can't configure per-switch or per-inseg MPLS TC to TC maps. |
| 125 | + |
| 126 | +## 13. Testing Requirements/Design |
| 127 | + |
| 128 | +### 13.1. Unit Test cases |
| 129 | + |
| 130 | +The QoS UTs present in sonic-swss will be extended to accommodate the new MPLS TC to TC map. These will largely follow the DSCP to TC map example but will add input validation checks as well. The new code will have full code coverage as far as the UT framework allows it. |
| 131 | + |
| 132 | +### 13.2. System Test cases |
| 133 | + |
| 134 | +No system test cases will be added. |
| 135 | + |
| 136 | +## 14. Open/Action items - if any |
| 137 | + |
| 138 | +N/A |
0 commit comments