1 module openflow-extensible-match {
2 namespace "urn:openflowopenflow:oxm";
7 import ietf-yang-types {prefix yang;}
8 import ietf-inet-types {prefix inet;}
9 import openflow-types {prefix oft;}
12 revision "2013-07-31" {
13 description "Initial model";
16 identity oxm-match-type {
18 "The OpenFlow Extensible Match type must be supported by all OpenFlow
25 description "Base identity for OXM classes";
29 identity nxm-0-class {
30 description "Backward compatibility with NXM";
33 identity nxm-1-class {
34 description "Backward compatibility with NXM";
37 identity openflow-basic-class {
38 description "Basic class for OpenFlow";
41 identity experimenter-class {
43 "Marks Experimenter match type class.
44 All experimenter match classes MUST use this class as a base.";
52 identity match-field {
53 description "Base identity for OXM Fields";
58 description "Match for Switch input port.";
60 identity in_phy_port {
62 description "Match for Switch physical input port.";
66 description "Match for Metadata passed between tables.";
70 description "Match for Ethernet destination address.";
74 description "Match for Ethernet source address.";
78 description "Match for Ethernet frame type.";
82 description "Match for VLAN id.";
86 description "Match for VLAN priority.";
90 description "Match for IP DSCP (6 bits in ToS field).";
94 description "Match for IP ECN (2 bits in ToS field).";
98 description "Match for IP protocol.";
102 description "Match for IPv4 source address.";
106 description "Match for IPv4 destination address.";
110 description "Match for TCP source port.";
114 description "Match for TCP destination port.";
118 description "Match for UDP source port.";
122 description "Match for UDP destination port.";
126 description "Match for SCTP source port.";
130 description "Match for SCTP destination port.";
132 identity icmpv4_type {
134 description "Match for ICMP type.";
136 identity icmpv4_code {
138 description "Match for ICMP code.";
142 description "Match for ARP opcode.";
146 description "Match for ARP source IPv4 address.";
150 description "Match for ARP target IPv4 address.";
154 description "Match for ARP source hardware address.";
158 description "Match for ARP target hardware address.";
162 description "Match for IPv6 source address.";
166 description "Match for IPv6 destination address.";
168 identity ipv6_flabel {
170 description "Match for IPv6 Flow Label";
172 identity icmpv6_type {
174 description "Match for ICMPv6 type.";
176 identity icmpv6_code {
178 description "Match for ICMPv6 code.";
180 identity ipv6_nd_target {
182 description "Match for Target address for ND.";
184 identity ipv6_nd_sll {
186 description "Match for Source link-layer for ND.";
188 identity ipv6_nd_tll {
190 description "Match for Target link-layer for ND.";
192 identity mpls_label {
194 description "Match for MPLS label.";
198 description "Match for MPLS TC.";
202 description "Match for MPLS BoS bit.";
206 description "Match for PBB I-SID.";
210 description "Match for Logical Port Metadata";
212 identity ipv6_exthdr {
214 description "Match for IPv6 Extension Header pseudo-field";
217 // Abstract definitions of fields structure
221 "Ingress port. Numerical representation of incoming port, starting at 1. This may be a physical or switch-defined logical port.";
223 type oft:port-number;
226 grouping in_phy_port {
227 description "Physical port. In ofp_packet_in messages, underlying physical port when packet received on a logical port.";
229 type oft:port-number;
233 description "Metadata passed between tables.";
242 description "Ethernet destination address.";
244 type yang:mac-address;
248 description "Ethernet source address.";
250 type yang:mac-address;
257 description "Ethernet frame type.";
259 type oft:ether-type; // Needs to define that as general model
266 description "VLAN id.";
268 type uint16; // TODO: Define proper vlan id type.
275 description "VLAN priority.";
277 type uint8; // TODO: Define PCP type
281 description "IP DSCP (6 bits in ToS field).";
284 type inet:dscp; // TODO: Define DSCP type
288 description "IP ECN (2 bits in ToS field).";
290 type uint8; // TODO define ECN
294 description "IP protocol.";
295 leaf protocol-number {
296 type uint8; // TODO define IP protocol number
300 description "IPv4 source address.";
302 type inet:ipv4-prefix;
306 description "IPv4 destination address.";
308 type inet:ipv4-prefix;
312 description "TCP source port.";
314 type inet:port-number;
318 description "TCP destination port.";
320 type inet:port-number;
324 description "UDP source port.";
326 type inet:port-number;
330 description "UDP destination port.";
332 type inet:port-number;
336 description "SCTP source port.";
338 type inet:port-number;
342 description "SCTP destination port.";
344 type inet:port-number;
347 grouping icmpv4_type {
348 description "ICMP type.";
350 type uint8; // Define ICMP Type
353 grouping icmpv4_code {
354 description "ICMP code.";
356 type uint8; // Define ICMP Code
360 description "ARP opcode.";
366 description "ARP source IPv4 address.";
368 type inet:ipv4-prefix;
372 description "ARP target IPv4 address.";
374 type inet:ipv4-prefix;
378 description "ARP source hardware address.";
380 type yang:mac-address;
387 description "ARP target hardware address.";
389 type yang:mac-address;
396 description "IPv6 source address.";
398 type inet:ipv6-prefix;
402 description "IPv6 destination address.";
404 type inet:ipv6-prefix;
407 grouping ipv6_flabel {
408 description "IPv6 Flow Label";
410 type inet:ipv6-flow-label;
413 grouping icmpv6_type {
414 description "ICMPv6 type.";
419 grouping icmpv6_code {
420 description "ICMPv6 code.";
425 grouping ipv6_nd_target {
426 description "Target address for ND.";
428 type inet:ipv6-address;
431 grouping ipv6_nd_sll {
432 description "Source link-layer for ND.";
434 type yang:mac-address;
437 grouping ipv6_nd_tll {
438 description "Target link-layer for ND.";
440 type yang:mac-address;
443 grouping mpls_label {
444 description "MPLS label.";
446 type uint32; // TODO define type
450 description "MPLS TC.";
456 description "MPLS BoS bit.";
462 description "PBB I-SID.";
471 description "Logical Port Metadata.";
479 grouping ipv6_exthdr {
480 description "IPv6 Extension Header pseudo-field";
484 description "<No next header> encountered.";
488 description "Encrypted Sec Payload header present.";
492 description "Authentication header present.";
496 description "1 or 2 dest headers present.";
500 description "Fragment header present.";
504 description "Router header present.";
508 description "Hop-by-hop header present.";
512 description "Unexpected repeats encountered.";
516 description "Unexpected sequencing encountered.";
526 /* Basic Match Fields :
527 - Maybe it will be better to split into several groupings
528 based on protocol types:
536 Maybe this works belongs to other module.
539 grouping basic-match-fields {
545 container in_phy_port {
635 container icmpv4_type {
640 container icmpv4_code {
680 container ipv6_flabel {
685 container icmpv6_type {
690 container icmpv6_code {
695 container ipv6_nd_target {
700 container ipv6_nd_sll {
705 container ipv6_nd_tll {
710 container mpls_label {
730 container tunnel_id {
735 container ipv6_exthdr {