dscp.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2024 Pengutronix, Oleksij Rempel <kernel@pengutronix.de> */
  3. #ifndef __DSCP_H__
  4. #define __DSCP_H__
  5. /*
  6. * DSCP Pools and Codepoint Space Division:
  7. *
  8. * The Differentiated Services (Diffserv) architecture defines a method for
  9. * classifying and managing network traffic using the DS field in IPv4 and IPv6
  10. * packet headers. This field can carry one of 64 distinct DSCP (Differentiated
  11. * Services Code Point) values, which are divided into three pools based on
  12. * their Least Significant Bits (LSB) patterns and intended usage. Each pool has
  13. * a specific registration procedure for assigning DSCP values:
  14. *
  15. * Pool 1 (Standards Action Pool):
  16. * - Codepoint Space: xxxxx0
  17. * This pool includes DSCP values ending in '0' (binary), allocated via
  18. * Standards Action. It is intended for globally recognized traffic classes,
  19. * ensuring interoperability across the internet. This pool encompasses
  20. * well-known DSCP values such as CS0-CS7, AFxx, EF, and VOICE-ADMIT.
  21. *
  22. * Pool 2 (Experimental/Local Use Pool):
  23. * - Codepoint Space: xxxx11
  24. * Reserved for DSCP values ending in '11' (binary), this pool is designated
  25. * for Experimental or Local Use. It allows for private or temporary traffic
  26. * marking schemes not intended for standardized global use, facilitating
  27. * testing and network-specific configurations without impacting
  28. * interoperability.
  29. *
  30. * Pool 3 (Preferential Standardization Pool):
  31. * - Codepoint Space: xxxx01
  32. * Initially reserved for experimental or local use, this pool now serves as
  33. * a secondary standardization resource should Pool 1 become exhausted. DSCP
  34. * values ending in '01' (binary) are assigned via Standards Action, with a
  35. * focus on adopting new, standardized traffic classes as the need arises.
  36. *
  37. * For pool updates see:
  38. * https://www.iana.org/assignments/dscp-registry/dscp-registry.xhtml
  39. */
  40. /* Pool 1: Standardized DSCP values as per [RFC8126] */
  41. #define DSCP_CS0 0 /* 000000, [RFC2474] */
  42. /* CS0 is some times called default (DF) */
  43. #define DSCP_DF 0 /* 000000, [RFC2474] */
  44. #define DSCP_CS1 8 /* 001000, [RFC2474] */
  45. #define DSCP_CS2 16 /* 010000, [RFC2474] */
  46. #define DSCP_CS3 24 /* 011000, [RFC2474] */
  47. #define DSCP_CS4 32 /* 100000, [RFC2474] */
  48. #define DSCP_CS5 40 /* 101000, [RFC2474] */
  49. #define DSCP_CS6 48 /* 110000, [RFC2474] */
  50. #define DSCP_CS7 56 /* 111000, [RFC2474] */
  51. #define DSCP_AF11 10 /* 001010, [RFC2597] */
  52. #define DSCP_AF12 12 /* 001100, [RFC2597] */
  53. #define DSCP_AF13 14 /* 001110, [RFC2597] */
  54. #define DSCP_AF21 18 /* 010010, [RFC2597] */
  55. #define DSCP_AF22 20 /* 010100, [RFC2597] */
  56. #define DSCP_AF23 22 /* 010110, [RFC2597] */
  57. #define DSCP_AF31 26 /* 011010, [RFC2597] */
  58. #define DSCP_AF32 28 /* 011100, [RFC2597] */
  59. #define DSCP_AF33 30 /* 011110, [RFC2597] */
  60. #define DSCP_AF41 34 /* 100010, [RFC2597] */
  61. #define DSCP_AF42 36 /* 100100, [RFC2597] */
  62. #define DSCP_AF43 38 /* 100110, [RFC2597] */
  63. #define DSCP_EF 46 /* 101110, [RFC3246] */
  64. #define DSCP_VOICE_ADMIT 44 /* 101100, [RFC5865] */
  65. /* Pool 3: Standardized assignments, previously available for experimental/local
  66. * use
  67. */
  68. #define DSCP_LE 1 /* 000001, [RFC8622] */
  69. #define DSCP_MAX 64
  70. #endif /* __DSCP_H__ */