port number with port name:
# ovs-ofctl dump-ports-desc <ovs bridge>
dump flows:
# ovs-ofctl dump-flows <ovs bridge>
Dump OVSDB table:
# ovsdb-client dump
Obtain schema of OVSDB:
# ovsdb-client get-schema --pretty
Some background info on OVSDB from Brent Salisbury's Blog: Getting Started with OVSDB As Introduction to Open vSwitch says:
Like OSPF, OpenFlow directly influences the forwarding behavior of a networking devices (albeit way differently than OSPF) but isn’t able to actually change the configuration of that device. OSPF cannot disable a router’s interface, or create a GRE tunnel, for instance. For that, we need a management plane protocol.
In the world of OVS, this role is filled by OVSDB. This allows us to use well-understood wire protocols (namely JSON-RPC) to send commands to an OVS instance to do things like create tunnels, turn on/off certain features, get configuration data, and more.
I have wondered about the 'tcp' vs 'ptcp' syntax. Well the answer:
“Manager” refers to an OVSDB client. The “ptcp::" syntax means that OVS is passively listening on that port and local address for incoming JSON-RPC data.
“Controller” refers to an OpenFlow controller. The “tcp:" syntax means that OVS proactively reaches out to a controller at that address to establish the relationship. (Standard port of 6633)
2018/01/20:
ovs-vsctl get Interface <iface> status
2018/03/29
ovsdb-client -f list dump
2018/06/11
# ovs-appctl dpctl/show system@ovs-system: lookups: hit:393756304 missed:4746333 lost:0 flows: 31 masks: hit:1365293746 total:4 hit/pkt:3.43 port 0: ovs-system (internal) port 1: ovsbr0 (internal) port 2: enp5s0 port 3: vlan20 (internal) port 4: enp1s0 port 5: enp2s0 port 6: enp3s0 port 7: vlan30 (internal) port 8: wlp4s0 port 9: vlan40 (internal) port 10: vlan50 (internal)
# ovs-ofctl show ovsbr0 OFPT_FEATURES_REPLY (xid=0x2): dpid:0000000ec4d20451 n_tables:254, n_buffers:0 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst 1(enp5s0): addr:00:0e:c4:d2:04:54 config: 0 state: 0 current: 100MB-FD COPPER AUTO_NEG advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE speed: 100 Mbps now, 1000 Mbps max 2(vlan20): addr:a2:58:96:ce:5c:40 config: 0 state: 0 speed: 0 Mbps now, 0 Mbps max 3(enp1s0): addr:00:0e:c4:d2:04:51 config: 0 state: 0 current: 100MB-FD COPPER AUTO_NEG advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE speed: 100 Mbps now, 1000 Mbps max .... ....
2018/06/21
# ovs-appctl dpif/dump-flows ovsbr0 recirc_id(0),in_port(9),eth(src=e6:64:dc:6f:7d:87,dst=44:80:eb:1c:1b:69),eth_type(0x0800),ipv4(frag=no), packets:1, bytes:54, used:8.756s, flags:R., actions:8 recirc_id(0),in_port(13),eth(src=0a:00:40:50:00:ce,dst=b6:4d:8d:6b:37:5a),eth_type(0x0806), packets:0, bytes:0, used:never, actions:10 recirc_id(0),in_port(2),eth(src=84:2b:2b:47:2e:4f,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=199.68.195.98,tip=199.68.195.107,op=1/0xff), packets:2, bytes:120, used:0.836s, actions:push_vlan(vid=20,pcp=0),1,pop_vlan,3 recirc_id(0),in_port(7),eth(src=7e:00:6a:f3:12:91,dst=80:fa:5b:43:c6:db),eth_type(0x0800),ipv4(frag=no), packets:2341, bytes:1954768, used:0.008s, flags:SFPR., actions:5 recirc_id(0),in_port(5),eth(src=80:fa:5b:43:c6:db,dst=7e:00:6a:f3:12:91),eth_type(0x0806), packets:0, bytes:0, used:never, actions:7 ....