diff options
author | Jarno Rajahalme <jarno.rajahalme@nsn.com> | 2013-05-09 15:24:16 +0300 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-05-10 10:50:06 -0700 |
commit | 0ad90c845b7e82090a846fbe9f927e8d1c84cfc9 (patch) | |
tree | 37cdc628cc8bcb1344075a54de68d1a62620a04c /include/openflow/nicira-ext.h | |
parent | 500d243dad40ff667710aca1d099d97c38e6a62d (diff) | |
download | openvswitch-0ad90c845b7e82090a846fbe9f927e8d1c84cfc9.tar.gz |
OpenFlow-level flow-based tunneling support.
Adds tun_src and tun_dst match and set capabilities via new NXM fields
NXM_NX_TUN_IPV4_SRC and NXM_NX_TUN_IPV4_DST. This allows management of
large number of tunnels via the flow tables, without requiring the tunnels
to be pre-configured.
Flow-based tunnels can be configured with options remote_ip=flow and
local_ip=flow. local_ip=flow requires remote_ip=flow. When set, the
tunnel remote IP address and/or local IP address is set from the flow,
instead of the tunnel configuration.
Example:
$ ovs-vsctl add-port br0 gre -- set Interface gre ofport_request=1 type=gre options:remote_ip=flow options:key=flow
$ ovs-ofctl add-flow br0 "in_port=LOCAL actions=set_tunnel:1,set_field:192.168.0.1->tun_dst,output:1"
$ ovs-ofctl add-flow br0 "in_port=1 tun_src=192.168.0.1 tun_id=1 actions=LOCAL"
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/openflow/nicira-ext.h')
-rw-r--r-- | include/openflow/nicira-ext.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index 8c9fab1e1..5ca343e1a 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -478,6 +478,8 @@ OFP_ASSERT(sizeof(struct nx_action_pop_queue) == 16); * - NXM_NX_ND_SLL * - NXM_NX_ND_TLL * - NXM_NX_REG(idx) for idx in the switch's accepted range. + * - NXM_NX_TUN_IPV4_SRC + * - NXM_NX_TUN_IPV4_DST * * The following nxm_header values are potentially acceptable as 'dst': * @@ -503,8 +505,10 @@ OFP_ASSERT(sizeof(struct nx_action_pop_queue) == 16); * adds or modifies the 802.1Q header appropriately, setting the TCI field * to the field's new value (with the CFI bit masked out). * - * - NXM_NX_TUN_ID. Modifying this value modifies the tunnel ID used for the - * packet's next tunnel encapsulation. + * - NXM_NX_TUN_ID, NXM_NX_TUN_IPV4_SRC, NXM_NX_TUN_IPV4_DST. Modifying + * any of these values modifies the corresponding tunnel header field used + * for the packet's next tunnel encapsulation, if allowed by the + * configuration of the output tunnel port. * * A given nxm_header value may be used as 'src' or 'dst' only on a flow whose * nx_match satisfies its prerequisites. For example, NXM_OF_IP_TOS may be @@ -1748,6 +1752,21 @@ OFP_ASSERT(sizeof(struct nx_action_output_reg) == 24); #define NXM_NX_COOKIE NXM_HEADER (0x0001, 30, 8) #define NXM_NX_COOKIE_W NXM_HEADER_W(0x0001, 30, 8) +/* The source or destination address in the outer IP header of a tunneled + * packet. + * + * For non-tunneled packets, the value is 0. + * + * Prereqs: None. + * + * Format: 32-bit integer in network byte order. + * + * Masking: Fully maskable. */ +#define NXM_NX_TUN_IPV4_SRC NXM_HEADER (0x0001, 31, 4) +#define NXM_NX_TUN_IPV4_SRC_W NXM_HEADER_W(0x0001, 31, 4) +#define NXM_NX_TUN_IPV4_DST NXM_HEADER (0x0001, 32, 4) +#define NXM_NX_TUN_IPV4_DST_W NXM_HEADER_W(0x0001, 32, 4) + /* ## --------------------- ## */ /* ## Requests and replies. ## */ /* ## --------------------- ## */ |