in network

OpenvSwitch ovs-ofctl and OF-DPA

Objective

Remote control and management OF-DPA via ovs-ofctl

Environment

Basic Command

ovs-ofctl show -O OpenFlow13 tcp:192.168.13.14:6653

Usage

Show port information

  • ovs-ofctl show -O OpenFlow13 tcp:192.168.13.14:6653
  • Output
$ ovs-ofctl show -O OpenFlow13 tcp:192.168.13.14:6653
OFPT_FEATURES_REPLY (OF1.3) (xid=0x2): dpid:000000000000da7a
n_tables:23, n_buffers:0
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
OFPST_PORT_DESC reply (OF1.3) (xid=0x3):
 1(port1): addr:cc:37:ab:d0:d6:30
     config:     0
     state:      LINK_DOWN
     current:    40GB-FD FIBER
     supported:  10MB-FD 100MB-FD 1GB-FD 10GB-FD 40GB-FD OTHER FIBER AUTO_NEG AUTO_PAUSE AUTO_PAUSE_ASYM
     speed: 40000 Mbps now, 40000 Mbps max
 2(port2): addr:cc:37:ab:d0:d6:30
     config:     0
     state:      LINK_DOWN
     current:    40GB-FD FIBER
     supported:  10MB-FD 100MB-FD 1GB-FD 10GB-FD 40GB-FD OTHER FIBER AUTO_NEG AUTO_PAUSE AUTO_PAUSE_ASYM
     speed: 40000 Mbps now, 40000 Mbps max
...

Show tables information

  • ovs-ofctl dump-tables
  • Output
$ ovs-ofctl dump-tables -O OpenFlow13 tcp:192.168.13.14:6653
OFPST_TABLE reply (OF1.3) (xid=0x2):
  table 0:
    active=0, lookup=0, matched=0

  table 5: ditto
  table 6: ditto
  table 7: ditto
  table 8: ditto
  table 10: ditto
  table 11: ditto
  table 13: ditto
  table 15: ditto
  table 16: ditto
  table 17: ditto
  table 20: ditto
  table 24: ditto
  table 28: ditto
  table 30: ditto
  table 40: ditto
  table 50: ditto
  table 60: ditto
  table 65: ditto
  table 210: ditto
  table 211: ditto
  table 230: ditto
  table 235: ditto

Add flow entry

  • ovs-ofctl add-flow -O OpenFlow13 tcp:192.168.13.14:6653 table=60,priority=40000,eth_type=0x0800,ip_dst=55.55.55.55,actions=controller

Show flow entries

  • ovs-ofctl dump-flows
  • Output
$ ovs-ofctl dump-flows -O OpenFlow13 tcp:192.168.13.14:6653
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=46.570s, table=60, n_packets=0, n_bytes=0, priority=40000,ip,nw_dst=55.55.55.55 actions=CONTROLLER:65535

Show queue stats

  • ovs-ofctl queue-stats
  • Output
$ ovs-ofctl queue-stats -O OpenFlow13 tcp:192.168.13.14:6653
OFPST_QUEUE reply (OF1.3) (xid=0x2): 256 queues
  port 1 queue 0: bytes=0, pkts=0, errors=0, duration=597.4294513152s
  port 1 queue 1: bytes=0, pkts=0, errors=0, duration=597.4294513152s
  port 1 queue 2: bytes=0, pkts=0, errors=0, duration=597.4294513152s
  port 1 queue 3: bytes=0, pkts=0, errors=0, duration=597.4294513152s
...

Show group information

  • ovs-ofctl dump-groups

Show ports information

  • ovs-ofcll dump-ports
  • Output
$ ovs-ofctl dump-ports -O OpenFlow13 tcp:192.168.13.14:6653
OFPST_PORT reply (OF1.3) (xid=0x2): 32 ports
  port  1: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
           tx pkts=0, bytes=0, drop=0, errs=?, coll=0
           duration=0s
  port  2: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
           tx pkts=0, bytes=0, drop=0, errs=?, coll=0
           duration=0s
  port  3: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
           tx pkts=0, bytes=0, drop=0, errs=?, coll=0
           duration=0s
  port  4: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
           tx pkts=0, bytes=0, drop=0, errs=?, coll=0
           duration=0s
...

Reference