blob: b740369640add7cbc9154ac713ac9e8151942f47 [file] [log] [blame]
Thomas Vachuska6655bee2017-08-24 16:12:59 -07001submodule openconfig-aft-common {
2 belongs-to "openconfig-aft" {
3 prefix "oc-aft";
4 }
5
6 import openconfig-interfaces { prefix "oc-if"; }
7 import openconfig-extensions { prefix "oc-ext"; }
8 import openconfig-yang-types { prefix "oc-yang"; }
9 import openconfig-inet-types { prefix "oc-inet"; }
10 import openconfig-mpls-types { prefix "oc-mplst"; }
11 import openconfig-policy-types { prefix "oc-pol-types"; }
12 import openconfig-aft-types { prefix "oc-aftt"; }
13
14 oc-ext:openconfig-version "0.3.0";
15
16 organization
17 "OpenConfig working group";
18
19 contact
20 "OpenConfig working group
21 www.openconfig.net";
22
23 description
24 "Submodule containing definitions of groupings that are re-used
25 across multiple contexts within the AFT model.";
26
27 revision 2017-05-10 {
28 description
29 "Refactor to provide concretised per-AF schemas per AFT.";
30 reference "0.3.0";
31 }
32
33 grouping aft-common-nhop-structural {
34 description
35 "Structural grouping describing a next-hop entry.";
36
37 container next-hops {
38 description
39 "The list of next-hops that are to be used for entry within
40 the AFT table. The structure of each next-hop is address
41 family independent, such that it is possible to resolve fully
42 how the next-hop is treated. For example:
43
44 - Where ingress IPv4 unicast packets are to be forwarded via
45 an MPLS LSP, the next-hop list should indicate the MPLS
46 label stack that is used to the next-hop.
47 - Where ingress MPLS labelled packets are to be forwarded to
48 an IPv6 nexthop (for example, a CE within a VPN, then the
49 popped label stack, and IPv6 next-hop address should be
50 indicated).";
51
52 list next-hop {
53 key "index";
54
55 description
56 "A next-hop associated with the forwarding instance. The
57 entries within the next-hop list should only reflect
58 next-hops that are actively used by the local system.
59 That is to say inactive, backup or FRR next-hops should
60 not be included within this list.";
61
62 leaf index {
63 type leafref {
64 path "../config/index";
65 }
66 description
67 "A unique index identifying the next-hop entry for the
68 AFT entry";
69
70 }
71
72 container config {
73 description
74 "Configuration parameters relating to the AFT next-hop
75 entry";
76
77 uses aft-common-entry-nexthop-config;
78 }
79
80 container state {
81 config false;
82 description
83 "Operational state parameters relating to the AFT
84 next-hop entry";
85
86 uses aft-common-entry-nexthop-config;
87 uses aft-common-entry-nexthop-state;
88 }
89
90 uses oc-if:interface-ref;
91 }
92 }
93 }
94
95 grouping aft-common-entry-state {
96 description
97 "Operational state parameters relating to a forwarding entry";
98
99 leaf packets-forwarded {
100 type oc-yang:counter64;
101 description
102 "The number of packets which have matched, and been forwarded,
103 based on the AFT entry.";
104 }
105
106 leaf octets-forwarded {
107 type oc-yang:counter64;
108 description
109 "The number of octets which have matched, and been forwarded,
110 based on the AFT entry";
111 }
112 }
113
114 grouping aft-common-entry-nexthop-config {
115 description
116 "Configuration parameters relating to a next-hop entry for a AFT
117 entry";
118
119 leaf index {
120 type uint64;
121 description
122 "A unique entry for the next-hop.";
123 }
124 }
125
126 grouping aft-common-entry-nexthop-state {
127 description
128 "Parameters relating to a next-hop within the AFT entry";
129
130 leaf weight {
131 type uint32;
132 description
133 "The weight of the next-hop. Traffic is balanced according to
134 the ratio described by the relative weights of the next hops
135 that exist for the AFT entry. Note that all next-hops that are
136 specified are assumed to be active next-hops and therefore
137 eligible (and selected) to be installed in the FIB, and hence
138 used for packet forwarding.";
139 }
140
141 leaf ip-address {
142 type oc-inet:ip-address;
143 description
144 "The IP address of the next-hop system.";
145 }
146
147 leaf mac-address {
148 type oc-yang:mac-address;
149 description
150 "The MAC address of the next-hop if resolved by the local
151 network instance.";
152 }
153
154 leaf-list popped-mpls-label-stack {
155 type oc-mplst:mpls-label;
156 description
157 "The MPLS label stack to be popped from the packet when
158 switched by the system. The stack is encoded as a leaf-list
159 such that the first entry is the label that is outer-most (i.e.,
160 furthest from the bottom of the stack) label
161 stack to be popped.
162
163 If the local system pops the outer-most label 400, then the
164 value of this list is [400,]. If the local system removes two
165 labels, the outer-most being 500, and the second of which is
166 400, then the value of the list is [500, 400].
167
168 A swap operation is reflected by entries in the
169 popped-mpls-label-stack and pushed-mpls-label-stack nodes.";
170 }
171
172 leaf-list pushed-mpls-label-stack {
173 type oc-mplst:mpls-label;
174 ordered-by user;
175 description
176 "The MPLS label stack imposed when forwarding packets to the
177 next-hop
178 - the stack is encoded as a leaf list whereby the order of the
179 entries is such that the first entry in the list is the
180 label at the bottom of the stack to be pushed.
181
182 To this end, a packet which is to forwarded to a device using
183 a service label of 42, and a transport label of 8072 will be
184 represented with a label stack list of [42, 8072].
185
186 The MPLS label stack list is ordered by the user, such that no
187 system re-ordering of leaves is permitted by the system.
188
189 A swap operation is reflected by entries in the
190 popped-mpls-label-stack and pushed-mpls-label-stack nodes.";
191
192 }
193
194 leaf decapsulate-header {
195 type oc-aftt:encapsulation-header-type;
196 description
197 "When forwarding a packet to the specified next-hop, the local
198 system performs a decapsulation of the packet - removing the
199 specified header type. In the case that no next-hop is
200 specified, the packet header is removed, and a subsequent
201 forwarding lookup is performed on the packet encapsulated
202 within the header, matched within the relevant AFT within the
203 specified network-instance.";
204 }
205
206 leaf encapsulate-header {
207 type oc-aftt:encapsulation-header-type;
208 description
209 "When forwarding a packet to the specified next-hop the local
210 system performs an encapsulation of the packet - adding the
211 specified header type.";
212 }
213
214 leaf origin-protocol {
215 type identityref {
216 base "oc-pol-types:INSTALL_PROTOCOL_TYPE";
217 }
218 description
219 "The protocol from which the AFT entry was learned.";
220 }
221 }
222}