[ovs-discuss] Can OVS support masked set action for MPLS?

Zijie Pan zijie.pan at 6wind.com
Mon Sep 9 07:28:16 UTC 2019

Hello all,

I want to decrease the MPLS TTL for the traffics that MPLS traffic class field is 0. I find only the first traffic can be processed properly.

Here are the steps:
1: Add a rule:
# ovs-ofctl add-flow ovsbr0 "priority=42,mpls,vlan_tci=0x1000/0x1000,mpls_tc=0 actions=dec_mpls_ttl,output:2"

2: Send a traffic that MPLS label is 493. The OVS flow is:
# ovs-dpctl dump-flows
recirc_id(0),in_port(2),eth(),eth_type(0x8100),vlan(),encap(eth_type(0x8847),mpls(label=0/0x0,tc=0/7,ttl=255/0xff,bos=0/0)), packets:200, bytes:16400, used:0.000s, actions:set(mpls(label=493,tc=0,ttl=254,bos=0)),3
<== the match fields have mask, while the action does not have mask. That means no mater what label or bos is, OVS will modify the traffic to (label=493,tc=0,ttl=254,bos=0).

3: Send another traffic that MPLS label is 500. We can see the label is changed to 493.

The dec_mpls_ttl openflow action should ideally translate to set(mpls(ttl=254)). It should not touch the label, tc or bos fields as it does in current code, because the values for the other field of the mpls set are taken from the first packet that goes through the vswitch, which will break the next packets by writing a wrong value in the label, tc and bos fields.

The function execute_masked_set_action() in the datapath supports masked set action for MPLS. While from the function commit_odp_actions() we can see that some actions support to be masked, but MPLS does not support it.

Are we planning to support masked set action for MPLS?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20190909/20a6a4e4/attachment.html>

More information about the discuss mailing list