openvswitch / ovs-issues

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

Command 'ovs-ofctl dump-tables br-int -O Openflow13' doesn't print table name #252

Closed hongliangl closed 2 years ago

hongliangl commented 2 years ago

The output of command ovs-ofctl dump-tables br-int -O Openflow13 is as the following. As we can see there is no table name.

oot@k8s-node-worker-1:/# ovs-ofctl dump-tables br-int -O Openflow13
OFPST_TABLE reply (OF1.3) (xid=0x2):
  table 0:
    active=4, lookup=1070, matched=1070

  table 1:
    active=0, lookup=0, matched=0

  tables 2...9: ditto

  table 10:
    active=8, lookup=1070, matched=1070

  table 11:
    active=0, lookup=0, matched=0

  tables 12...19: ditto

  table 20:
    active=3, lookup=0, matched=0

  table 21:
    active=4, lookup=0, matched=0

....

  table 110:
    active=4, lookup=1055, matched=1055

  table 111:
    active=0, lookup=0, matched=0

  tables 112...253: ditto

In the same OVS, the output of command ovs-ofctl dump-tables br-int is as the following.

root@k8s-node-worker-1:/# ovs-ofctl dump-tables br-int
OFPST_TABLE reply (xid=0x2):
  table 0 ("Classification"):
    active=4, lookup=1280, matched=1280
    max_entries=1000000
    matching:
      exact match or wildcard: in_port eth_{src,dst,type} vlan_{vid,pcp} ip_{src,dst} nw_{proto,tos} tcp_{src,dst}

  table 1:
    active=0, lookup=0, matched=0
    (same features)

  tables 2...9: ditto

  table 10 ("SpoofGuard"):
    active=8, lookup=1280, matched=1280
    (same features)

  table 11:
    active=0, lookup=0, matched=0
    (same features)

  tables 12...19: ditto

  table 20 ("ARPResponder"):
    active=3, lookup=0, matched=0
    (same features)

  table 21 ("IPv6"):
    active=4, lookup=0, matched=0
    (same features)

...

table 109:
    active=0, lookup=0, matched=0
    (same features)

  table 110 ("Output"):
    active=4, lookup=1265, matched=1265
    (same features)

  table 111:
    active=0, lookup=0, matched=0
    (same features)

  tables 112...253: ditto
igsilya commented 2 years ago

OpenFlow 1.3 breaks down the OFPST_TABLE request in two separate requests, OFPMT_TABLE only reports table statistics, and OFPMT_TABLE_FEATURES reports features, names, and some other things. See the A.3.5.4 Table Statistics section in OF1.2 and OF1.3 specs and the A.3.5.5 Table Features in the OF1.3 spec. So, since ovs-ofctl just directly implements OF commands, in order to get table names with OpenFlow 1.3 you need to use ovs-ofctl dump-table-features.

hongliangl commented 2 years ago

Thanks for explaining!