[ovs-discuss] Usermode pipeline processing
Nataliia Trifonova
trifonova.natalia at gmail.com
Sat Oct 25 08:47:57 UTC 2014
I am using OVS usermode and trying to pop MPLS and change IP packet headers:
Match incomimg MPLS packet in tabel 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)
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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20141025/7969e171/attachment-0002.html>
More information about the discuss
mailing list