Hi,
As awkward as it is, this is also according to the spec. It says that for set 
field actions: “The match of the flow entry must contain the OXM prerequisite 
corresponding to the field to be set, otherwise an error must be generated.”. 
Now obviously you can’t match on eth_type=0x8847 in this flow entry, so the 
set_field won’t work for you.
I understand this is somewhat inconvenient, so I will raise a ticket on whether 
we should allow exemption from this rule for set fields following push actions.
Until this is resolved you can either go with the workarounds I suggested, if 
you want to keep working in the standard way. If not, you can simply remove the 
consistency check from the source code at: 
https://github.com/CPqD/ofsoftswitch13/blob/master/udatapath/dp_actions.c#L1077,
 and continue experimenting.
Regards,
Zoltan

From: bruce.lo...@gmail.com [mailto:bruce.lo...@gmail.com]
Sent: Tuesday, January 14, 2014 9:51 AM
To: Zoltán Lajos Kis; openflow-discuss
Subject: Re: RE: [openflow-discuss] Pushing mpls tags

Hi,Zoltan,
Thanks for your quick reply.
I am using CPqD ofsoftswitch13 from https://github.com/CPqD/ofsoftswitch13. I 
use dpctl to insert flows.Here is its output.
***************
bl@ubuntu:~$<mailto:bl@ubuntu:~$> sudo dpctl unix:/tmp/s1 flow-mod 
cmd=add,table=0 in_port=1,eth_type=0x0800,ip_dst=192.168.0.10 
apply:push_mpls=0x8847,output=2

SENDING:
flow_mod{table="0", cmd="add", cookie="0x0", mask="0x0", idle="0", hard="0", 
prio="32768", buf="none", port="any", group="any", flags="0x0", 
match=oxm{in_port="1", eth_type="0x800", ipv4_dst="192.168.0.10"}, 
insts=[apply{acts=[mpls_psh{eth="0x8847"}, out{port="2"}]}]}

OK.
***************
bl@ubuntu:~$<mailto:bl@ubuntu:~$> sudo dpctl unix:/tmp/s1 flow-mod 
cmd=add,table=0 in_port=1,eth_type=0x0800,ip_dst=192.168.0.10 
apply:push_mpls=0x8847,set_field=mpls_label:1,output=2

SENDING:
flow_mod{table="0", cmd="add", cookie="0x0", mask="0x0", idle="0", hard="0", 
prio="32768", buf="none", port="any", group="any", flags="0x0", 
match=oxm{in_port="1", eth_type="0x800", ipv4_dst="192.168.0.10"}, 
insts=[apply{acts=[mpls_psh{eth="0x8847"}, set_field{field:mpls_label="1"}, 
out{port="2"}]}]}

RECEIVED:
error{type="BAD_ACTION", code="MATCH_INCONSISTENT", dlen="128"}
**************
It's very strange if we need to push mpls_label and set it in different tables.
________________________________
Regards,
Bruce
From: Zoltán Lajos Kis<mailto:zoltan.lajos....@ericsson.com>
Date: 2014-01-14 16:26
To: bruce.lo...@gmail.com<mailto:bruce.lo...@gmail.com>; 
openflow-discuss<mailto:openflow-discuss@lists.stanford.edu>
Subject: RE: [openflow-discuss] Pushing mpls tags
Hi Bruce,
That is the only way to push MPLS on packets: first you need to push a label, 
which creates a zero label (unless there is already a label on the packet, in 
which case that label is copied), and then you need a set action to specify the 
label you want. This is described in 5.12.1 of [1].
Can you tell which switch you are using? It would help figuring out the cause. 
Without that I can only suggest possible workarounds: 1) use write actions / 
action set to execute these commands, or 2) use a separate table (e.g., table 
1) to set the label.
Regards,
Zoltan
[1] 
https://www.opennetworking.org/images/stories/downloads/sdn-resources/onf-specifications/openflow/openflow-spec-v1.3.3.pdf

_______________________________________________
openflow-discuss mailing list
openflow-discuss@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to