[ovs-discuss] Usermode pipeline processing

Nataliia Trifonova trifonova.natalia at gmail.com
Sat Oct 25 08:59:45 UTC 2014


I am using OVS usermode 2.3 and trying to pop MPLS and change IP packet headers:
1) Macth incoming MPLS packet in table 0:

match = self.ofp_parser.OFPMatch(eth_type = 0x8847, mpls_label = 102)			
actions = [ofp_parser.OFPActionPopMpls(0x0800), ]
instructions = [ofp_parser.OFPInstructionActions(ofp.OFPIT_APPLY_ACTIONS,
actions), ofp_parser.OFPInstructionGotoTable(1)]
req =  ofp_parser.OFPFlowMod(dp, cookie, cookie_mask, 0, cmd,
idle_timeout, hard_timeout, prio, buffer_id, out_port, out_group,
flags, match, instructions)
self.dp.send_msg(req)

2) Match resulting IPv4 packet in table 1:

match = self.ofp_parser.OFPMatch(eth_type = 0x0800) #, metadata = 1)
#, ipv4_src = mapping.sst, ipv4_dst = mapping.dst)
actions = [ofp_parser.OFPActionSetField(self.set_field_eth_dst(hostb_lan0)), ]
actions.append(ofp_parser.OFPActionSetField(self.set_field_eth_src(cesb_lan0)))
actions.append(ofp_parser.OFPActionSetField(self.set_field_ipv4_src(mapping.pipb)))
actions.append(ofp_parser.OFPActionSetField(self.set_field_ipv4_dst(mapping.ipb)))
actions.append(ofp_parser.OFPActionOutput(1))
instructions = [ofp_parser.OFPInstructionActions(ofp.OFPIT_APPLY_ACTIONS,
actions), ]
req =  ofp_parser.OFPFlowMod(dp, cookie, cookie_mask, 1, cmd,
idle_timeout, hard_timeout, prio, buffer_id, out_port, out_group,
flags, match, instructions)
self.dp.send_msg(req)

3) This results in corerct flows:

$ sudovs-ofctl --protocol=OpenFlow12,OpenFlow13 dump-flows ovsbr0
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=680.792s, table=0, n_packets=7, n_bytes=714,
priority=0 actions=CONTROLLER:65535
 cookie=0x0, duration=75.634s, table=0, n_packets=73, n_bytes=7446,
hard_timeout=100, priority=1,mpls,mpls_label=102
actions=pop_mpls:0x0800,goto_table:1
 cookie=0x0, duration=75.634s, table=1, n_packets=73, n_bytes=7446,
hard_timeout=100, priority=1,ip
actions=set_field:08:00:27:5f:b2:af->eth_dst,set_field:08:00:27:e0:32:91->eth_src,set_field:10.10.0.31->ip_src,set_field:10.10.0.110->ip_dst,output:1

4) However, outgoing packet still has the initial IPs. Moreover, in
the syslog I see the following:

ovs|20724|dpif(revalidator58)|DBG|netdev at ovs-netdev: flow_dump
skb_priority(0),skb_mark(0/0),recirc_id(0),in_port(5),eth(src=08:00:27:fd:52:aa,dst=08:00:27:aa:a1:01),eth_type(0x8847),mpls(label=102,tc=0,ttl=64,bos=1),
packets:8, bytes:816, used:0.879s,
actions:set(eth(src=08:00:27:e0:32:91,dst=08:00:27:5f:b2:af)),pop_mpls(eth_type=0x800),2

It looks like all actions are applied at once and since eth_type is
still MPLS, IP headers are ignored.

Thank you.

Regards,
Nataliia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20141025/6e8f0c93/attachment-0002.html>


More information about the discuss mailing list