summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-03-08 15:40:23 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-03-20 22:32:50 +0900
commit684b665290c91d9ac1b1f6f9865506c6a655b1aa (patch)
tree3c1760d9fc7c81b4105830b8409ac40901da368a
parent0841f3f253a4a6479dabfcd2bbd29e92d2fa7896 (diff)
nicira_ext: Support Network Service Header match
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/packet/ether_types.py1
-rw-r--r--ryu/ofproto/nicira_ext.py38
-rw-r--r--ryu/ofproto/ofproto_common.py1
-rw-r--r--ryu/ofproto/oxm_fields.py4
4 files changed, 44 insertions, 0 deletions
diff --git a/ryu/lib/packet/ether_types.py b/ryu/lib/packet/ether_types.py
index e8287d3b..ff2ba67b 100644
--- a/ryu/lib/packet/ether_types.py
+++ b/ryu/lib/packet/ether_types.py
@@ -26,3 +26,4 @@ ETH_TYPE_LLDP = 0x88cc
ETH_TYPE_8021AH = 0x88e7
ETH_TYPE_IEEE802_3 = 0x05dc
ETH_TYPE_CFM = 0x8902
+ETH_TYPE_NSH = 0x894f # RFC8300
diff --git a/ryu/ofproto/nicira_ext.py b/ryu/ofproto/nicira_ext.py
index 9e0f8873..94f38fc1 100644
--- a/ryu/ofproto/nicira_ext.py
+++ b/ryu/ofproto/nicira_ext.py
@@ -590,6 +590,29 @@ tun_ipv6_dst IPv6 address Tunnel IPv6 destination address.
eth_type_nxm = 0x86dd (IPv6)
_recirc_id Integer 32bit ID for recirculation.
_dp_hash Integer 32bit Flow hash computed in Datapath.
+nsh_flags Integer 8bit Flags field in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_mdtype Integer 8bit Metadata Type in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_np Integer 8bit Next Protocol type in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_spi Integer 32bit Service Path Identifier in NSH Service Path
+ Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_si Integer 8bit Service Index in NSH Service Path Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_c<N> Integer 32bit Context fields in NSH Context Header.
+ <N> is a number of 1-4.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.8.
+nsh_ttl Integer 8bit TTL field in NSH Base Header.
+ Requires eth_type_nxm = 0x894f (NSH).
+ Since OpenFlow 1.3 and OVS v2.9.
reg<idx> Integer 32bit Packet register.
<idx> is register number 0-15.
xxreg<idx> Integer 128bit Packet extended-extended register.
@@ -684,6 +707,21 @@ oxm_types = [
# in wild.
oxm_fields.NiciraExperimenter('_dp_hash', 0, type_desc.Int4),
+ # Nicira Experimenter for Network Service Header
+ oxm_fields.NiciraNshExperimenter('nsh_flags', 1, type_desc.Int1),
+ oxm_fields.NiciraNshExperimenter('nsh_mdtype', 2, type_desc.Int1),
+ oxm_fields.NiciraNshExperimenter('nsh_np', 3, type_desc.Int1),
+ # aka "nsp"
+ oxm_fields.NiciraNshExperimenter('nsh_spi', 4, type_desc.Int4),
+ # aka "nsi"
+ oxm_fields.NiciraNshExperimenter('nsh_si', 5, type_desc.Int1),
+ # aka "nshc<N>"
+ oxm_fields.NiciraNshExperimenter('nsh_c1', 6, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_c2', 7, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_c3', 8, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_c4', 9, type_desc.Int4),
+ oxm_fields.NiciraNshExperimenter('nsh_ttl', 10, type_desc.Int1),
+
# Support for matching/setting NX registers 0-15
oxm_fields.NiciraExtended1('reg0', 0, type_desc.Int4),
oxm_fields.NiciraExtended1('reg1', 1, type_desc.Int4),
diff --git a/ryu/ofproto/ofproto_common.py b/ryu/ofproto/ofproto_common.py
index 4f0d9956..ffdf1a4a 100644
--- a/ryu/ofproto/ofproto_common.py
+++ b/ryu/ofproto/ofproto_common.py
@@ -32,5 +32,6 @@ OFP_SSL_PORT_OLD = 6633
# Vendor/Experimenter IDs
# https://rs.opennetworking.org/wiki/display/PUBLIC/ONF+Registry
NX_EXPERIMENTER_ID = 0x00002320 # Nicira
+NX_NSH_EXPERIMENTER_ID = 0x005ad650 # Nicira Ext for Network Service Header
BSN_EXPERIMENTER_ID = 0x005c16c7 # Big Switch Networks
ONF_EXPERIMENTER_ID = 0x4f4e4600 # OpenFlow Extensions for 1.3.X Pack 1
diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py
index d2bea495..f978f5b1 100644
--- a/ryu/ofproto/oxm_fields.py
+++ b/ryu/ofproto/oxm_fields.py
@@ -132,6 +132,10 @@ class NiciraExperimenter(_Experimenter):
experimenter_id = ofproto_common.NX_EXPERIMENTER_ID
+class NiciraNshExperimenter(_Experimenter):
+ experimenter_id = ofproto_common.NX_NSH_EXPERIMENTER_ID
+
+
class NiciraExtended0(_OxmClass):
"""Nicira Extended Match (NXM_0)