openvswitch / ovs-issues

Issue tracker repo for Open vSwitch
10 stars 3 forks source link

How to interpret ovs-appctl dpctl/dump-flows's output? #248

Closed jshen28 closed 2 years ago

jshen28 commented 2 years ago

Hello,

I am sorry if this is not the place to ask a question.. I am trying to investigate a performance issue and uses ovs-appctl dpctl/dump-flows to inspect datapaths. this commands yields the following output

recirc_id(0),in_port(11),skb_mark(0),eth(src=fa:16:3e:8b:45:66,dst=fa:16:3e:6d:d9:53),eth_type(0x0800),ipv4(tos=0/0x3,frag=no), packets:18588510, bytes:1078134039, used:0.001s, flags:SFP., actions:set(tunnel(tun_id=0x2,src=192.168.4.13,dst=192.168.4.12,ttl=64,tp_dst=4792,flags(df|key))),3,36,push_vlan(vid=2,pcp=0),12,pop_vlan,33,21,7
recirc_id(0),tunnel(tun_id=0x2,src=192.168.4.12,dst=192.168.4.13,flags(-df-csum+key)),in_port(3),eth(src=fa:16:3e:6d:d9:53,dst=fa:16:3e:8b:45:66),eth_type(0x0800),ipv4(frag=no), packets:8, bytes:520, used:6.613s, flags:SP., actions:11

I would like to ask what does actions:set mean? thank you

igsilya commented 2 years ago

set() action updates some of the packet headers or packet metadata. In your case it updates the packet tunnel metadata before sending packet to the tunnel for encapsulation. I'm guessing that port number 3 is a tunnel device in your case, but you may confirm by adding --names to your dpctl/dump-flows command, or by comparing the number with the output of dpctl/show command.

jshen28 commented 2 years ago

thank you for reply. but it looks like ovs-appctl dpctl/dump-flows does not accept --names? besides, is 36 another vxlan tunnel device? what does the following push_vlan do? thank you.

igsilya commented 2 years ago

ovs-appctl dpctl/dump-flows --names should work starting from OVS 2.9. 36 is unlikely to be another tunnel, unless you have 2 equal tunnels; and that doesn't make much sense. push_vlan pushes vlan, i.e. adds a vlan header to the packet.

jshen28 commented 2 years ago

thank you append --names to the end works! by the way, does set(tunnel(tun_id=0x2,src=192.168.4.13,dst=192.168.4.12,ttl=64,tp_dst=4792,flags(df|key))),3,36 means tunnelled traffic will go to device 3 and normal vlan traffic will go to device 36?

igsilya commented 2 years ago

set(tunnel(...)) only updates the tunnel metadata, actual encapsulation is performed by the tunnel port 3 after the output. So, yes, original unmodified packet (without a tunnel header) will be sent to port 36. This packet doesn't have a vlan header though (eth type is 0x0800), vlan will be pushed later

jshen28 commented 2 years ago

thank you!