[ovs-dev] How to set my own ttl value to mpls flows.
Pynbiang Hadem
pynbiang.hadem at yahoo.com
Tue Feb 9 13:04:28 UTC 2016
Dear Ben,I have tried to make the changes to openvswitch to introduce the set_field action for MPLS TTL field as below:
sudo ovs-ofctl -O OpenFlow13 add-flow s1 "table=0,in_port=1,eth_type=0x800,actions=push_mpls:0x8847,set_field:100->mpls_label,set_field:60->mpls_ttl,output:2"mininet at mininet-vm:~$ sudo ovs-ofctl -O OpenFlow13 dump-flows s1OFPST_FLOW reply (OF1.3) (xid=0x2):
I have made the changes to the following files:/lib/flow.h, lib/meta-flow.c, lib/match.c, /lib/meta-flow.h and lib/ofp-actions.c
However the flow is not getting installed using ovs-ofctl add-flow. Please help. i'm using openvswitch 2.4
RegardsHadem
On Friday, 15 January 2016 11:25 AM, Ben Pfaff <blp at ovn.org> wrote:
On Fri, Jan 15, 2016 at 05:41:24AM +0000, Pynbiang Hadem wrote:
> ok so ovs does'nt support this operation by default. Is it possible to
> modify ovs to incorporate this operation?.
The FAQ says:
### Q: How do I add support for a new field or header?
A: Add new members for your field to "struct flow" in lib/flow.h, and
add new enumerations for your new field to "enum mf_field_id" in
lib/meta-flow.h, following the existing pattern. Also, add support
to miniflow_extract() in lib/flow.c for extracting your new field
from a packet into struct miniflow. Then recompile and fix all of
the new warnings, implementing new functionality for the new field
or header as needed. (If you configure with --enable-Werror, as
described in [INSTALL.md], then it is impossible to miss any
warnings.)
If you want kernel datapath support for your new field, you also
need to modify the kernel module for the operating systems you are
interested in. This isn't mandatory, since fields understood only
by userspace work too (with a performance penalty), so it's
reasonable to start development without it. If you implement
kernel module support for Linux, then the Linux kernel "netdev"
mailing list is the place to submit that support first; please read
up on the Linux kernel development process separately. The Windows
datapath kernel module support, on the other hand, is maintained
within the OVS tree, so patches for that can go directly to
ovs-dev.
More information about the dev
mailing list