The Difference between ovs-vsctl and ovs-dpctl

AlanObject picture AlanObject · Aug 8, 2015 · Viewed 7k times · Source

If I am setting up an switch device to be controlled via OpenFlow, what are the conditions to use ovs-dpctl versus ovs-vsctl? The man page for ovs-dpctl says to use ovs-vsctl if ovs-vswitchd is used.

So what circumstances would you uses ovs-dpctl? What does it do that you can't do otherwise?

One follow-up question is where the OF "datapath" value comes from. This would be the 64-bit number in the OF spec that the OF controller uses to identify OF switches. Is this value automatically computed or do you have to enter it?

Thanks for any help with this.

Answer

Ehsan Ab picture Ehsan Ab · Aug 10, 2015

ovs-dpctl:

A tool to create, modify, and delete Open vSwitch data‐paths. Here are some examples (commands are random):

– ovs-dpctl add-dp dp1
– ovs-dpctl add-if dp1 eth0
– ovs-dpctl show
– ovs-dpctl dump-flows

ovs-vsctl:

A utility for querying and updating the configuration of ovs-vswitchd (with the help of ovsdb-server). Port configuration, bridge additions/deletions, bonding, and VLAN tagging are just some of the options that are available with this command.

Here are some examples (commands are random):

– ovs-vsctl –V : Prints the current version of openvswitch.
– ovs-vsctl show : Prints a brief overview of the switch database configuration.
– ovs-vsctl list-br : Prints a list of configured bridges
– ovs-vsctl list-ports <bridge> : Prints a list of ports on a specific bridge.
– ovs-vsctl list interface : Prints a list of interfaces.
– ovs-vsctl add-br <bridge> : Creates a bridge in the switch database.

ovs-ofctl:

I think it worth mentioning this tool too. A command line tool for monitoring and administering OpenFlow switches. It is used to list implemented flows in the OVS kernel module

- ovs-ofctl add-flow <bridge> <flow>
- ovs-ofctl add-flow <bridge> <match-field> actions=all
- ovs-ofctl del-flows <bridge> <flow>

To me it seems that ovs-vsctl is used to configure the open vswitch itself like configuring ports, bridges, etc. While ovs-dpctl is used to work with datapaths and interfaces.

Sources:

  1. openvswitch and ovsdb
  2. OpenVSwitch slides
  3. openvswitch cheat sheet

Your second question -> OF datapath: To me datapath in context of openflow is an object denoting the connection between controller and switch. I believe OF controller figures that out but it depend on the OF controller.