aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-pf-srte.yang
blob: 07e6cc5c65698450cd8bf659331ccccb1a9b0446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
module openconfig-pf-srte {
  yang-version "1";
  namespace "http://openconfig.net/yang/policy-forwarding/sr-te";
  prefix "oc-pf-srte";

  import openconfig-extensions { prefix "oc-ext"; }
  import openconfig-network-instance { prefix "oc-ni"; }
  import openconfig-mpls-types { prefix "oc-mplst"; }
  import openconfig-inet-types { prefix "oc-inet"; }
  import openconfig-segment-routing { prefix "oc-sr"; }

  organization
    "OpenConfig working group";

  contact
    "OpenConfig Working group
    www.openconfig.net";

  description
    "This module defines extensions to the OpenConfig policy forwarding
    module to support static segment routing traffic engineering policy
    definitions. Extensions are provided to match:

      - Ingress binding SIDs, such that traffic can be mapped based on
        an ingress label.
      - A colour community and endpoint combination, such that the
        routes can be resolved according to the policy forwarding
        entries that are to be installed.

    In addition, policy forwarding actions associated with next-hops are
    added to the model. The next-hop set to be forwarded to is augmented
    to cover a set of lists of segments. The most common application of
    such segment lists is to express stacks of MPLS labels which are used
    as SR segments. In addition, they may be used to expressed segments
    in the form of IPv6 addresses.";

  oc-ext:openconfig-version "0.1.0";

  revision 2017-10-01 {
    description
      "Initial revision of the SR-TE policy SAFI model.";
    reference "0.1.0";
  }

  grouping oc-pf-srte-match-top {
    description
      "Top-level grouping used for SR-TE policy match criteria within
      a policy forwarding rule.";

    container srte {
      description
        "Match criteria associated with Segment Routing Traffic Engineering
        policies.";

      container config {
        description
          "Configuration parameters associated with SR-TE policies.";
        uses oc-pf-srte-match-config;
      }

      container state {
        config false;
        description
          "Operational state parameters associated with SR-TE policies.";
        uses oc-pf-srte-match-config;
      }
    }
  }

  grouping oc-pf-srte-match-config {
    description
      "Configuration parameters specific to Segment Routing traffic
      Engineering.";

    leaf mpls-bsid {
      type oc-mplst:mpls-label;
      description
        "The Binding SID (BSID) to be matched expressed as an MPLS label. Packets
        that are ingress to the system with the top-most label matching
        the SID value specified in this leaf should be forwarded according
        to the policy. The top-most label (the specified Binding SID)
        must be popped from the label stack by the system.";
    }

    leaf srte-endpoint {
      type oc-inet:ip-address;
      description
        "When the policy forwarding rule is used for RIB resolution
        to a Segment Routing Traffic Engineering path, the policy is used
        when the required endpoint (which may be the protocol next-hop)
        matches the endpoint address specified in this
        leaf. When the leaf is set to all zeros (0.0.0.0 or ::), the endpoint
        acts as a wildcard in the policy resolution.";
    }

    leaf srte-color {
      type uint32;
      description
        "When the policy forwarding rule is used for RIB resolution to a
        specific Segment Routing Traffic Engineering path, the policy is
        used when the colour required in the policy (which may be specified
        based on the value of a BGP extended colour community) matches the
        value of this leaf. The colour being set to 0 indicates that the
        colour is a wildcard in the policy resolution.";
    }

    leaf srte-preference {
      type uint32;
      description
        "When there are multiple policy forwarding rules specified for
        a particular SR-TE endpoint. The preference is used to resolve
        between them. These rules may be learnt from a dynamic routing
        protocol, or interface to the device, or from other static
        entries configured on the system.";
    }
  }

  grouping oc-pf-srte-segment-list-top {
    description
      "Top-level grouping for specifying segment lists under a policy
      forwarding action.";

    container segment-lists {
      description
        "A list of SR-TE segment lists that should be applied as an
        action within this policy. Where a system selects the SR-TE
        policy to be used, the list of segment lists that is specified
        should be used as forwarding next-hops.";

      list segment-list {
        key "index";
        description
          "An individual segment list within the list of segment
          lists used for SR-TE policies.";

        leaf index {
          type leafref {
            path "../config/index";
          }
          description
            "Reference to the index leaf which act as a key to the
            segment-list list.";
        }

        container config {
          description
            "Configuration parameters for the SR-TE segment list.";
          uses oc-pf-srte-segment-list-config;
        }

        container state {
          config false;
          description
            "Operational state parameters relating to the SR-TE
            segment list.";
          uses oc-pf-srte-segment-list-config;
        }

        container sids {
          description
            "Surrounding container for the list of SIDs that makes up the
            segment list.";

          list sid {
            key "index";

            description
              "List of SIDs that make up the segment list. The segment list
              is formed by ordering the set of SIDs that are specified by
              their index in ascending numerical order.";

            leaf index {
              type leafref {
                path "../config/index";
              }
              description
                "Reference to the SID's index within the segment list which
                acts as the key of the list.";
            }

            container config {
              description
                "Configuration parameters relating to the SID within the
                segment list.";
              uses oc-pf-srte-segment-list-sid-config;
            }

            container state {
              config false;
              description
                "Operational state parameters relating to the SID within
                the segment list.";
              uses oc-pf-srte-segment-list-sid-config;
            }
          }
        }
      }
    }
  }

  grouping oc-pf-srte-segment-list-config {
    description
      "Configuration parameters relating to a segment list.";

    leaf index {
      type uint64;
      description
        "Unique integer identifying the segment list within the set
        of segment lists used for the SR-TE policy action.";
    }

    leaf weight {
      type uint32;
      description
        "The weight of the segment list within the set of segment lists
        specified for the policy. The traffic that is forwarded according
        to the policy is distributed across the set of paths such that
        each list receives weight/(sum of all weights) traffic.";
    }
  }

  grouping oc-pf-srte-segment-list-sid-config {
    description
      "Configuration parameters relating to a SID within an SR-TE segment
      list";

    leaf index {
      type uint64;
      description
        "The index of the SID within the segment list. The segment list is
        applied by ordering the SID entries in ascending numerical order
        beginning at 0.";
    }

    leaf value {
      type oc-sr:sr-sid-type;
      description
        "The value of the SID that is to be used. Specified as an MPLS
        label or IPv6 address.";
    }

    leaf mpls-ttl {
      type uint8;
      default 0;
      description
        "The TTL to be set if the type of the SID is an MPLS label. If the
        value of the TTL is set to be 0, the value is picked by the local
        implementation.";
    }

    leaf mpls-tc {
      type uint8 {
        range "0..7";
      }
      default 0;
      description
        "The value of the MPLS Traffic Class (TC) bits to be used if the
        value of the SID is an MPLS label. In the case that the value is
        set to 0, then the local implementation should choose the value.";
    }
  }

  augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:policy-forwarding/" +
          "oc-ni:policies/oc-ni:policy/oc-ni:rules/oc-ni:rule" {
    description
      "Add the SR-TE specific policy forwarding match criteria to the
      policy forwarding model.";

    uses oc-pf-srte-match-top;
  }

  augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:policy-forwarding/" +
          "oc-ni:policies/oc-ni:policy/oc-ni:rules/oc-ni:rule/oc-ni:action" {
    description
      "Add the SR-TE specific policy forwarding actions to the
      policy forwarding model.";

    uses oc-pf-srte-segment-list-top;
  }
}