On Fri, Aug 01, 2014 at 05:42:55PM +0200, Ronald van der Pol wrote:
> Please help me debug this problem. I have an OVS with two ports.
> A packet enters the bridge with VLAN 103 and leaves with VLAN 3.
> I do not understand why. There seems to be no flow rule for this.
> It should not be changed.

...

> rvdp@lithium:~$ sudo ovs-ofctl show br-of
> OFPT_FEATURES_REPLY (xid=0x2): dpid:00000002c9ee01d0
> n_tables:254, n_buffers:256
> capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
> actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST 
> SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
>  1(eth2): addr:00:02:c9:ee:01:d1
>      config:     0
>      state:      0
>      current:    COPPER
>      advertised: 10GB-FD COPPER
>      supported:  10GB-FD COPPER
>      speed: 0 Mbps now, 10000 Mbps max
>  5(phy-br-of): addr:52:92:c1:84:d9:99
>      config:     0
>      state:      0
>      current:    10GB-FD COPPER
>      speed: 10000 Mbps now, 0 Mbps max
>  7(eth1): addr:00:02:c9:ee:01:d0
>      config:     0
>      state:      0
>      current:    10GB-FD COPPER
>      advertised: 10GB-FD COPPER
>      supported:  10GB-FD COPPER
>      speed: 10000 Mbps now, 10000 Mbps max
>  LOCAL(br-of): addr:00:02:c9:ee:01:d0
>      config:     0
>      state:      0
>      speed: 0 Mbps now, 0 Mbps max

...

> rvdp@lithium:~$ sudo ovs-ofctl dump-flows br-of
> NXST_FLOW reply (xid=0x4):
>  cookie=0x0, duration=19204.821s, table=0, n_packets=14388, n_bytes=604592, 
> idle_age=1, priority=4,in_port=5,dl_vlan=3 actions=mod_vlan_vid:101,NORMAL
>  cookie=0x0, duration=19205.755s, table=0, n_packets=6, n_bytes=268, 
> idle_age=11353, priority=4,in_port=5,dl_vlan=2 actions=mod_vlan_vid:103,NORMAL
>  cookie=0x0, duration=19210.085s, table=0, n_packets=236, n_bytes=15528, 
> idle_age=162, priority=2,in_port=5 actions=drop
>  cookie=0x0, duration=19210.713s, table=0, n_packets=1778506, 
> n_bytes=160065556, idle_age=15259, priority=1 actions=NORMAL
> rvdp@lithium:~$
> 
> --------------------------------------
> 
> Counters on the flow rule "in_port=5,dl_vlan=3" increase.
> 
> ofproto/trace gives:
> 
> 
> rvdp@lithium:~$ sudo ovs-appctl ofproto/trace br-of 
> in_port=7,dl_vlan=103,dl_src=fa:16:3e:e4:a0:7f,dl_dst=ff:ff:ff:ff:ff:ff,arp,arp_spa=10.101.0.2,arp_tpa=10.101.0.5,arp_sha=fa:16:3e:e4:a0:7f,arp_tha=00:00:00:00:00:00
> Flow: 
> arp,metadata=0,in_port=7,dl_vlan=103,dl_vlan_pcp=0,dl_src=fa:16:3e:e4:a0:7f,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=10.101.0.2,arp_tpa=10.101.0.5,arp_sha=fa:16:3e:e4:a0:7f,arp_tha=00:00:00:00:00:00
> Rule: table=0 cookie=0 priority=1
> OpenFlow actions=NORMAL
> no learned MAC for destination, flooding
> 
> Final flow: unchanged
> Relevant fields: 
> skb_priority=0,arp,in_port=7,dl_vlan=103,dl_src=fa:16:3e:e4:a0:7f,dl_dst=ff:ff:ff:ff:ff:ff,nw_frag=no
> Datapath actions: 4,6,8
> rvdp@lithium:~$
> 
> This is what should happen. This is what I expect. But the tshark
> shows that the vlan id has changed from 103 to 3.
> 
> Is in_port=7 the correct port? If I use in_port=5 the packet gets dropped.

For a packet ingressing on eth1, the in_port should be 5 because this
form of ofproto/trace uses OpenFlow port numbers and we can see from
"ovs-ofctl show br-of" above that eth1 has OpenFlow port 5.

If you use OpenFlow port 5 then the packet gets dropped because that's
what your OpenFlow table says to do: this packet with VLAN 103 doesn't
match the rules that say in_port=5,dl_vlan=2 or in_port=5,dl_vlan=3 and
therefore falls back to the lower-priority in_port=5 rule that just says
actions=drop.

> These are the flow rules:
> 
> 
> rvdp@lithium:~$ ovs-dpctl show
> system@ovs-system:
>       lookups: hit:88297643 missed:237835 lost:5824
>       flows: 23
>       port 0: ovs-system (internal)
>       port 1: br-p2p2 (internal)
>       port 2: p2p2
>       port 3: br-int (internal)
>       port 4: br-of (internal)
>       port 5: eth1
>       port 6: eth2
>       port 7: int-br-of
>       port 8: phy-br-of
>       port 9: int-br-p2p2
>       port 10: phy-br-p2p2
>       port 11: qvoee503507-d4
>       port 12: qvoec91ac92-65
>       port 13: qvof3111da3-1e
>       port 14: qvoc571d286-66
>       port 15: qvo90426bbe-76
>       port 16: qvo9db2c337-d9
>       port 17: qvoc8335d24-bb
>       port 18: qvo41c98397-fd

"ovs-dpctl" shows internal details that aren't really relevant for
debugging OpenFlow.  The port numbers there aren't ones that you should
generally need to know.
_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to