Merge changes If0630105,I9d2d5e61,I1cea2a32,Icc05b6a7,Ic57eb4f8, ...
[packetcable.git] / packetcable-policy-model / src / main / yang / packetcable.yang
1 module packetcable
2 {
3     namespace "urn:packetcable";
4     prefix "pcmm";
5
6     import ietf-yang-types      { prefix yang; }
7     import ietf-inet-types      { prefix inet; }
8
9     description "This module contains the PCMM Converged Cable Access Platform (CCAP) definitions";
10     organization "OpenDaylight Project";
11
12     revision 2015-03-27 {
13         description "Initial revision of PCMM CCAP definitions";
14     }
15
16
17         // Global typedefs
18         typedef service-class-name {
19         type string { length "2..16"; }
20         description "The Service Class Name is MUST be 2-16 bytes.";
21     }
22     typedef service-flow-direction {
23             type enumeration {
24                       enum us {
25                         value "1";
26                         description "Upstream service flow.";
27                       }
28                       enum ds {
29                         value "2";
30                         description "Downstream service flow.";
31                       }
32                 }
33         description "This value represents the service flow direction.";
34         }
35         typedef tp-protocol {
36                 type uint16 {range "0..257";}
37             description "This value represents the IP transport protocol (or Next Header) where 256 is any protocol and 257 is TCP or UDP";
38          }
39          typedef tos-byte {
40                 type uint8;
41                 description "TOS/TC byte or mask";
42          }
43
44
45         // CCAP devices
46         container ccap {
47                 list ccaps {
48                         description "
49                                 CCAP devices are known by their network name which is any string.
50                                 Each CCAP device has a network address:port, a list of subscriber IP subnets,
51                                 and a list of available Service Class Names.
52                                 ";
53                     key "ccapId";
54                         leaf ccapId {
55                             type string;
56                                 description "CCAP Identity";
57                             }
58                     uses ccap-attributes;
59             }
60     }
61
62         grouping ccap-attributes {
63                 description "
64                         Each CCAP device has a COPS connection address:port,
65                         a list of subscriber IP subnets, and
66                         a list of available Service Class Names.
67                         ";
68                 container connection {
69                         leaf ipAddress {
70                         type inet:ip-address;
71                         description "IP Address of CCAP";
72                 }
73                 leaf port {
74                         type inet:port-number;
75                         description "COPS session TCP port number";
76                         default 3918;
77                 }
78         }
79         container amId {
80                 leaf am-tag {
81                         type uint16;
82                         description "Application Manager Tag -- unique for this operator";
83                 }
84                 leaf am-type {
85                         type uint16;
86                         description "Application Manager Type -- unique for this AM tag";
87                 }
88         }
89                 leaf-list subscriber-subnets {
90                         type inet:ip-prefix;
91                 }
92                 leaf-list upstream-scns {
93                         type service-class-name;
94                 }
95                 leaf-list downstream-scns {
96                         type service-class-name;
97                 }
98         leaf response {
99             type string;
100             description "HTTP response from the PUT operation provided by the API";
101         }
102         }
103
104         // PCMM QoS Gates
105     container qos {
106         description "
107                 PCMM QoS Gates are organized as a tree by Application/Subscriber/Gate:
108                         Each Application is known by its appId which is any string.
109                         Each Subscriber is known by its subId which is a CPE IP address in either IPv4 or IPv6 format.
110                         Each Gate is known by its gateId which is any string.
111
112                 The subscriber's CPE IP address is used to locate the CCAP device that is currently hosting the
113                 the Cable Modem that is connected to the subscriber's device. Therefore, it is not necessary
114                 for the PCMM applications to know the topology of the CCAP devices and CMs in the network path
115                 to their subscriber devices.
116
117                 Note that each CCAP entry contains a list of connected subscriber IP subnets as well as a list
118                 of all Service Class Names (SCNs) available on the CCAP device.
119                 ";
120                 uses pcmm-qos-gates;
121     }
122
123     grouping pcmm-qos-gates {
124         list apps {
125             key "appId";
126                     leaf appId {
127                         type string;
128                         description "Application Identity";
129                     }
130             list subs {
131                 key "subId";
132                             leaf subId {
133                             type string;
134                                 description "Subscriber Identity -- must be a CM or CPE IP address";
135                             }
136                     list gates {
137                         key "gateId";
138                                     leaf gateId {
139                                         type string;
140                                         description "Qos Gate Identity";
141                                     }
142                                     uses pcmm-qos-gate-attributes;
143                     }
144             }
145         }
146     }
147
148     grouping pcmm-qos-gate-attributes {
149         uses pcmm-qos-gate-spec;
150         uses pcmm-qos-traffic-profile;
151                 uses pcmm-qos-classifier;
152                 uses pcmm-qos-ext-classifier;
153                 uses pcmm-qos-ipv6-classifier;
154                 leaf response {
155             type string;
156             description "HTTP response from the PUT operation provided by the API";
157         }
158     }
159
160     grouping pcmm-qos-gate-spec {
161         container gate-spec {
162                         leaf direction {
163                                 type service-flow-direction;
164                                 description "Gate Direction (ignored for traffic profile SCN)";
165                         }
166                         leaf dscp-tos-overwrite {
167                                 type tos-byte;
168                                 description "Optional DSCP/TOS overwrite value";
169                         }
170                         leaf dscp-tos-mask {
171                                 type tos-byte;
172                                 description "Optional DSCP/TOS overwrite AND mask";
173                         }
174                 }
175     }
176
177     grouping pcmm-qos-traffic-profile {
178         container traffic-profile {
179                     leaf service-class-name {
180                         type service-class-name;
181                         description "The Service Class Name (SCN). This SCN must be pre-provisioned on the target CCAP";
182                     }
183                 }
184     }
185
186     grouping tp-port-match-ranges {
187         leaf srcPort-start {
188             type inet:port-number;
189             description "TCP/UDP source port range start.";
190         }
191         leaf srcPort-end {
192             type inet:port-number;
193             description "TCP/UDP source port range end.";
194         }
195         leaf dstPort-start {
196             type inet:port-number;
197             description "TCP/UDP destination port range start.";
198         }
199         leaf dstPort-end {
200             type inet:port-number;
201             description "TCP/UDP destination port range end.";
202         }
203     }
204
205     grouping pcmm-qos-classifier {
206         container classifier {
207                 leaf srcIp {
208                         type inet:ipv4-address;
209                         description "Source IPv4 address (exact match)";
210                         }
211                 leaf dstIp {
212                         type inet:ipv4-address;
213                         description "Destination IPv4 address (exact match)";
214                         }
215                         leaf tos-byte {
216                                 type tos-byte;
217                                 description "TOS/DSCP match";
218                         }
219                         leaf tos-mask {
220                                 type tos-byte;
221                                 description "TOS/DSCP mask";
222                         }
223                 leaf protocol {
224                         type tp-protocol;
225                         description "IPv4 transport protocol";
226                         }
227                         leaf srcPort {
228                         type inet:port-number;
229                         description "TCP/UDP source port (exact match).";
230                         }
231                         leaf dstPort {
232                         type inet:port-number;
233                         description "TCP/UDP destination port (exact match).";
234                         }
235                 }
236     }
237
238     grouping pcmm-qos-ext-classifier {
239         container ext-classifier {
240                 leaf srcIp {
241                         type inet:ipv4-address;
242                         description "Source IPv4 address match";
243                         }
244                 leaf srcIpMask {
245                         type inet:ipv4-address;
246                         description "Source IPv4 mask";
247                         }
248                 leaf dstIp {
249                         type inet:ipv4-address;
250                         description "Destination IPv4 address match";
251                         }
252                 leaf dstIpMask {
253                         type inet:ipv4-address;
254                         description "Destination IPv4 mask";
255                         }
256                         leaf tos-byte {
257                                 type tos-byte;
258                                 description "TOS/DSCP match";
259                         }
260                         leaf tos-mask {
261                                 type tos-byte;
262                                 description "TOS/DSCP mask";
263                         }
264                 leaf protocol {
265                         type tp-protocol;
266                         description "IPv4 transport protocol";
267                         }
268                         uses tp-port-match-ranges;
269                 }
270     }
271
272     grouping pcmm-qos-ipv6-classifier {
273         container ipv6-classifier {
274                 leaf srcIp6 {
275                         type inet:ipv6-prefix;
276                         description "Source IPv6 prefix match in  <address/len> notation";
277                         }
278                 leaf dstIp6 {
279                         type inet:ipv6-prefix;
280                         description "Destination IPv6 prefix match in <address/len> notation";
281                         }
282                         leaf tc-low {
283                                 type tos-byte;
284                                 description "TC low range match";
285                         }
286                         leaf tc-high {
287                                 type tos-byte;
288                                 description "TC high range match";
289                         }
290                         leaf tc-mask {
291                                 type tos-byte;
292                                 description "TC mask";
293                         }
294                 leaf next-hdr {
295                         type tp-protocol;
296                         description "IPv6 Next Header";
297                         }
298                         leaf flow-label {
299                                 type uint32 {
300                                         range "0 .. 1048575";
301                                 }
302                                 description "IPv6 Flow Label (20 bits)";
303                         }
304                         uses tp-port-match-ranges;
305                 }
306     }
307
308 }
309