blob: 75eb155397cc792519d6fb789691e7c746cffaa9 [file] [log] [blame]
Thomas Vachuska8ca75a22017-08-24 16:12:59 -07001submodule openconfig-rib-bgp-attributes {
2
3 belongs-to openconfig-rib-bgp {
4 prefix "oc-rib-bgp";
5 }
6
7
8 // import some basic types
9 import ietf-inet-types { prefix inet; }
10 import openconfig-bgp-types { prefix oc-bgpt; }
11 import openconfig-extensions { prefix oc-ext; }
12
13 // meta
14 organization "OpenConfig working group";
15
16 contact
17 "OpenConfig working group
18 www.openconfig.net";
19
20 description
21 "This submodule contains common data definitions for BGP
22 attributes for use in BGP RIB tables.";
23
24
25 oc-ext:openconfig-version "0.3.0";
26
27 revision "2016-10-17" {
28 description
29 "OpenConfig BGP RIB refactor";
30 reference "0.3.0";
31 }
32
33
34 grouping bgp-as-path-attr-state {
35 description
36 "Data for representing BGP AS-PATH attribute";
37
38 leaf type {
39 type oc-bgpt:as-path-segment-type;
40 description
41 "The type of AS-PATH segment";
42 }
43
44 leaf-list member {
45 type inet:as-number;
46 description
47 "List of the AS numbers in the AS-PATH segment";
48 }
49 }
50
51 grouping bgp-as-path-attr-top {
52 description
53 "Top-level grouping for AS-PATH attribute data";
54
55 container as-path {
56 description
57 "Enclosing container for the list of AS path segments.
58
59 In the Adj-RIB-In or Adj-RIB-Out, this list should show
60 the received or sent AS_PATH, respectively. For
61 example, if the local router is not 4-byte capable, this
62 value should consist of 2-octet ASNs or the AS_TRANS
63 (AS 23456) values received or sent in route updates.
64
65 In the Loc-RIB, this list should reflect the effective
66 AS path for the route, e.g., a 4-octet value if the
67 local router is 4-octet capable.";
68 reference
69 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)
70 RFC 6793 - BGP Support for Four-octet AS Number Space
71 RFC 5065 - Autonomous System Confederations for BGP";
72
73 list segment {
74 description
75 "Unkeyed list of AS PATH segments";
76
77 container state {
78 config false;
79 description
80 "Opstate data for AS-PATH segments";
81
82 uses bgp-as-path-attr-state;
83 }
84 }
85 }
86 }
87
88 grouping bgp-as4-path-attr-top {
89 description
90 "Top-level grouping for AS4-PATH attribute data";
91
92 container as4-path {
93 description
94 "This is the path encoded with 4-octet
95 AS numbers in the optional transitive AS4_PATH attribute.
96 This value is populated with the received or sent attribute
97 in Adj-RIB-In or Adj-RIB-Out, respectively. It should not
98 be populated in Loc-RIB since the Loc-RIB is expected to
99 store the effective AS-Path in the as-path leaf regardless
100 of being 4-octet or 2-octet.";
101 reference
102 "RFC 6793 - BGP Support for Four-octet AS Number Space";
103
104 list segment {
105 description
106 "Unkeyed list of AS PATH segments";
107
108 container state {
109 config false;
110 description
111 "Opstate data for AS-PATH segments";
112
113 uses bgp-as-path-attr-state;
114 }
115 }
116 }
117 }
118
119 grouping bgp-community-attr-state {
120 description
121 "Common definition of BGP community attributes";
122
123 leaf-list community {
124 type union {
125 type oc-bgpt:bgp-well-known-community-type;
126 type oc-bgpt:bgp-std-community-type;
127 }
128 description
129 "List of standard or well-known BGP community
130 attributes.";
131 }
132 }
133
134 grouping bgp-extended-community-attr-state {
135 description
136 "Common definition of BGP extended community attribute";
137
138 leaf-list ext-community {
139 type oc-bgpt:bgp-ext-community-recv-type;
140 description
141 "List of BGP extended community attributes. The received
142 extended community may be an explicitly modeled
143 type or unknown, represented by an 8-octet value
144 formatted according to RFC 4360.";
145 reference
146 "RFC 4360 - BGP Extended Communities Attribute";
147 }
148
149 }
150
151 grouping bgp-aggregator-attr-state {
152 description
153 "Operational state data for the BGP aggregator
154 attribute";
155
156 leaf as {
157 type inet:as-number;
158 description
159 "AS number of the autnonomous system that performed the
160 aggregation.";
161 }
162
163 leaf as4 {
164 type inet:as-number;
165 description
166 "AS number of the autnonomous system that performed the
167 aggregation (4-octet representation). This value is
168 populated if an upstream router is not 4-octet capable.
169 Its semantics are similar to the AS4_PATH optional
170 transitive attribute";
171 reference
172 "RFC 6793 - BGP Support for Four-octet AS Number Space";
173 }
174
175 leaf address {
176 type inet:ipv4-address;
177 description
178 "IP address of the router that performed the
179 aggregation.";
180 }
181 }
182
183
184 grouping bgp-aggregator-attr-top {
185 description
186 "Common definition of the BGP aggregator attribute";
187
188 container aggregator {
189 description
190 "BGP attribute indicating the prefix has been aggregated by
191 the specified AS and router.";
192
193 container state {
194 config false;
195 description
196 "Operational state data for BGP aggregator attribute";
197
198 uses bgp-aggregator-attr-state;
199 }
200 }
201 }
202
203 grouping bgp-shared-common-attr-state {
204 description
205 "Route attributes shared across route table entries,
206 common to both LOC-Rib and Adj-RIB";
207
208
209 leaf origin {
210 type oc-bgpt:bgp-origin-attr-type;
211 description
212 "BGP attribute defining the origin of the path information.";
213 }
214
215 leaf atomic-aggregate {
216 type boolean;
217 description
218 "BGP attribute indicating that the prefix is an atomic
219 aggregate, i.e., the peer selected a less specific
220 route without selecting a more specific route that is
221 included in it.";
222 }
223
224 leaf next-hop {
225 type inet:ip-address;
226 description
227 "BGP next hop attribute defining the IP address of the router
228 that should be used as the next hop to the destination";
229 }
230
231 leaf med {
232 type uint32;
233 description
234 "BGP multi-exit discriminator attribute used in BGP route
235 selection process";
236 }
237
238 leaf local-pref {
239 type uint32;
240 description
241 "BGP local preference attribute sent to internal peers to
242 indicate the degree of preference for externally learned
243 routes. The route with the highest local preference value
244 is preferred.";
245 }
246
247 leaf originator-id {
248 type inet:ipv4-address;
249 description
250 "BGP attribute that provides the id as an IPv4 address
251 of the originator of the announcement.";
252 reference
253 "RFC 4456 - BGP Route Reflection: An Alternative to Full
254 Mesh Internal BGP (IBGP)";
255 }
256
257 leaf-list cluster-list {
258 type inet:ipv4-address;
259 description
260 "Represents the reflection path that the route has passed.";
261 reference
262 "RFC 4456 - BGP Route Reflection: An Alternative to Full
263 Mesh Internal BGP (IBGP)";
264 }
265
266 leaf aigp {
267 type uint64;
268 description
269 "BGP path attribute representing the accumulated IGP metric
270 for the path";
271 reference
272 "RFC 7311 - The Accumulated IGP Metric Attribute for BGP";
273 }
274 }
275
276 grouping bgp-unknown-attr-flags-state {
277 description
278 "Operational state data for path attribute flags";
279
280 leaf optional {
281 type boolean;
282 description
283 "Defines whether the attribute is optional (if
284 set to true) or well-known (if set to false).
285 Set in the high-order bit of the BGP attribute
286 flags octet.";
287 reference
288 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
289 }
290
291 leaf transitive {
292 type boolean;
293 description
294 "Defines whether an optional attribute is transitive
295 (if set to true) or non-transitive (if set to false). For
296 well-known attributes, the transitive flag MUST be set to
297 true. Set in the second high-order bit of the BGP attribute
298 flags octet.";
299 reference
300 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
301 }
302
303 leaf partial {
304 type boolean;
305 description
306 "Defines whether the information contained in the optional
307 transitive attribute is partial (if set to true) or complete
308 (if set to false). For well-known attributes and for
309 optional non-transitive attributes, the partial flag
310 must be set to false. Set in the third high-order bit of
311 the BGP attribute flags octet.";
312 reference
313 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
314 }
315
316 leaf extended {
317 type boolean;
318 description
319 "Defines whether the attribute length is one octet
320 (if set to false) or two octets (if set to true). Set in
321 the fourth high-order bit of the BGP attribute flags
322 octet.";
323 reference
324 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
325 }
326 }
327
328 grouping bgp-unknown-attr-state {
329 description
330 "Operational state data for path attributes not shared
331 across route entries, common to LOC-RIB and Adj-RIB";
332
333 leaf attr-type {
334 type uint8;
335 description
336 "1-octet value encoding the attribute type code";
337 reference
338 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
339 }
340
341 leaf attr-len {
342 type uint16;
343 description
344 "One or two octet attribute length field indicating the
345 length of the attribute data in octets. If the Extended
346 Length attribute flag is set, the length field is 2 octets,
347 otherwise it is 1 octet";
348 reference
349 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
350 }
351
352 leaf attr-value {
353 type binary {
354 length 1..65535;
355 }
356 description
357 "Raw attribute value, not including the attribute
358 flags, type, or length. The maximum length
359 of the attribute value data is 2^16-1 per the max value
360 of the attr-len field (2 octets).";
361 reference
362 "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)";
363 }
364 }
365
366 grouping bgp-unknown-attr-top {
367 description
368 "Unknown path attributes that are not expected to be shared
369 across route entries, common to LOC-RIB and Adj-RIB";
370
371 container unknown-attributes {
372 description
373 "Unknown path attributes that were received in the UPDATE
374 message which contained the prefix.";
375
376 list unknown-attribute {
377 key "attr-type";
378 description
379 "This list contains received attributes that are unrecognized
380 or unsupported by the local router. The list may be empty.";
381
382 leaf attr-type {
383 type leafref {
384 path "../state/attr-type";
385 }
386 description
387 "Reference to the list key";
388 }
389
390 container state {
391 description
392 "Operational state for unknown route attributes";
393
394 uses bgp-unknown-attr-flags-state;
395 uses bgp-unknown-attr-state;
396 }
397 }
398 }
399 }
400
401 grouping bgp-loc-rib-attr-state {
402 description
403 "Path attributes that are not expected to be shared across
404 route entries, specific to LOC-RIB";
405
406 }
407
408 grouping bgp-adj-rib-attr-state {
409 description
410 "Path attributes that are not expected to be shared across
411 route entries, specific to Adj-RIB";
412
413 leaf path-id {
414 type uint32;
415 description
416 "When the BGP speaker supports advertisement of multiple
417 paths for a prefix, the path identifier is used to
418 uniquely identify a route based on the combination of the
419 prefix and path id. In the Adj-RIB-In, the path-id value is
420 the value received in the update message. In the Loc-RIB,
421 if used, it should represent a locally generated path-id
422 value for the corresponding route. In Adj-RIB-Out, it
423 should be the value sent to a neighbor when add-paths is
424 used, i.e., the capability has been negotiated.";
425 reference
426 "draft-ietf-idr-add-paths - Advertisement of Multiple Paths
427 in BGP";
428 }
429 }
430}