[ovs-dev] [PATCH] tunnel: ToS and TTL inheritance for MPLS tunneled traffic

Ben Pfaff blp at ovn.org
Thu Aug 3 18:15:40 UTC 2017


On Fri, Jul 21, 2017 at 01:08:34PM +0000, Miklós Pelyva wrote:
> When a new outermost MPLS label is added to 'flow' the 'flow''s
> Ethernet type is changed to 'mpls_eth_type'. After the new label is
> set, the 'flow''s MPLS stack is updated, and the L3/4 fields are
> cleared to mark them invalid. This results in loosing the values of
> the 'nw_tos' and the 'nw_ttl' fields from the struct 'flow'.
> 
> Hence, it is impossible to use the ToS and TTL 'inherit' feature in
> case of MPLS tunneled traffic, because currently the values to be
> inherited are coming from the cleared (invalidated) variables of
> struct 'flow'.
> 
> To support inheriting the ToS field to the outer tunnel header even
> in the presence of an MPLS shim header, this patch introduces a new
> variable in the context structure, called 'latest_nw_tos', which is
> used for storing the up-to-date 'nw_tos' value during the flow
> translation, and is referred in the 'tnl_port_send()' function.
> 
> Besides, for every MPLS packet the MPLS TTL field is copied to the
> TTL field of the outer tunnel header, if inheritance is configured.
> 
> Two new unit tests are created for checking the ToS and TTL
> inheritance for IP, and non-IP packets sent over MPLS over IP
> tunnels. The ECN inheritance is not applied in that case, because
> the related RFC 5129 does not describe an individual way, just
> options for ECN in MPLS.
> 
> Signed-off-by: Miklos Pelyva <miklos.pelyva at ericsson.com>
> Signed-off-by: Jan Scheurich <jan.scheurich at ericsson.com>
> Co-authored-by: Jan Scheurich <jan.scheurich at ericsson.com>

Thanks for working on improving OVS support for MPLS.  It's definitely
an OVS weak spot and we all appreciate the help.

Can you help me better understand the relationship between flow->nw_tos
and latest_nw_tos?  It looks to me like latest_nw_tos is very literally
copied from flow->nw_tos whenever the latter changes.  So, when do they
differ?  If they are always the same, then there's no need to have both.

Thanks,

Ben.


More information about the dev mailing list