Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[mininet-discuss] Does OVS in Mininet 2.2.1 support modify the packet's IP address and the output this packet?

Shawn Lin x.shawn.lin at
Wed Jul 13 06:46:52 PDT 2016

Hi Muryphy,

Thanks for your reply. And I solved this problem by your advice. I should
be more careful!

*OFPP_IN_PORT = 0xfffffff8, /* Send the packet out the input port. This
reserved port must be explicitly used in order to send back out of the
input port. */ *

Only thing I need to do is to change *actions=output:1 into actions=in_port*

*mininet> sh ovs-ofctl add-flow s1 in_port=2,actions=in_port -O OpenFlow13*
*mininet> sh ovs-appctl ofproto/trace s1 in_port=2*
Rule: table=0 cookie=0 in_port=2
OpenFlow actions=IN_PORT

Final flow: unchanged
Relevant fields: skb_priority=0,in_port=2,dl_type=0x0000,nw_frag=no
*Datapath actions: 6*

Shawn Lin

On Tue, Jul 12, 2016 at 6:06 AM, Murphy McCauley <murphy.mccauley at>

> It seems to me that you are trying to have the switch turn the packets
> around.  That is, you're expecting h1 to be sending them to h2, but having
> them arrive back at h1 again.  If that's correct, then...
> Given that, you should see each packet *twice* on the port you're
> sniffing.  Once on the way to the switch (with h2's addresses as the dst)
> and once on the way back from from the switch (with the addresses
> rewritten).
> But I'm guessing you're only seeing it once because the switch is dropping
> it rather than forwarding back out of the input port... because switches
> generally refuse to do this.   Have you looked at OFPP_IN_PORT in the
> OpenFlow specification and carefully read over the actions section of the
> ovs-ofctl man page?
> -- Murphy
> On Mon, Jul 11, 2016 at 6:52 AM, Shawn Lin <x.shawn.lin at> wrote:
>> Hi all,
>> I am trying to use OpenvSwitch to exchange the source IP address and the
>> destination IP address of a packet, and then forward this packet out to a
>> host in Mininet.
>> I do this test in *Mininet(2.2.1) *and *OpenvSwitch(2.0.2)*, And below
>> is the command:
>> Topology in Mininet is quite simple,
>> *h1-s1-h2*
>> I use this command to add the flow.
>> *mininet> sh ovs-ofctl add-flow s1
>> dl_type=0x0800,dl_type=0x0800,nw_dst=,actions=mod_dl_src:00:00:00:00:00:02,mod_dl_dst:00:00:00:00:00:01,mod_nw_src:,mod_nw_dst=,output:1
>> -O OpenFlow13*
>> And then I could see the result when I show flows in the switch s1,
>> *mininet>* *sh ovs-ofctl dump-flows s1 -O OpenFlow13*
>> OFPST_FLOW reply (OF1.3) (xid=0x2):
>> * cookie=0x0, duration=418.133s, table=0, n_packets=1813,
>> n_bytes=2731190, ip,nw_dst=
>> actions=mod_dl_src:00:00:00:00:00:02,mod_dl_dst:00:00:00:00:00:01,mod_nw_src:,mod_nw_dst:,output:1
>>      *
>> * In my understanding, this flow would change the packets' src IP, dst
>> IP, src Mac, dst Mac, and then forward it out port 1 which is s1-eth1.  *
>>  cookie=0x2b0000000000000f, duration=2982.739s, table=0, n_packets=1,
>> n_bytes=42, priority=2,in_port=1 actions=output:2,CONTROLLER:65535
>>  cookie=0x2b0000000000000e, duration=2982.739s, table=0, n_packets=1,
>> n_bytes=42, priority=2,in_port=2 actions=output:1,CONTROLLER:65535
>>  cookie=0x2b0000000000000f, duration=2986.774s, table=0, n_packets=0,
>> n_bytes=0, priority=100,dl_type=0x88cc actions=CONTROLLER:65535
>>  cookie=0x2b0000000000000f, duration=2986.774s, table=0, n_packets=0,
>> n_bytes=0, priority=0 actions=drop
>> And then in terminal, I use tcpdump to catch the packets through s1-eth1,
>> *tcpdump -i s1-eth1 -w result.pcap*
>> I scan all packets and find that these packets are all with *src IP
>>, and dst IP*
>> At the same time, the *n_bytes* in flow shows that this flow has been
>> hit.
>> So Am I doing some wrong configuration? Or which version of OVS support
>> this feature? Any suggestions or comments are welcomed!
>> I am looking forward to hearing from you!
>> Bests,
>> Shawn Lin
>> _______________________________________________
>> mininet-discuss mailing list
>> mininet-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the mininet-discuss mailing list