The Difference between ovs-vsctl and ovs-dpctl
Asked Answered
J

2

5

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.

Jepum answered 8/8, 2015 at 1:11 Comment(2)
this sounds like it should be on Server FaultUpend
Well I was hoping for a programmer's perspective instead of a sysadmin perspective but whatever.Jepum
L
8

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.

Linnealinnean answered 10/8, 2015 at 14:57 Comment(0)
K
5

ovs-vsctl is used to manage the openvswitch and ovs-dpctl can be used to manage datapaths within an openvswitch.

A relevant comment explaining datapaths can be found in dpif-provider.h:

A datapath is a collection of physical or virtual ports that are
exposed over OpenFlow as a single switch.  Datapaths and the 
collections of ports that they contain may be fixed or dynamic.

Openvswitch provides the capability for different datapath implementations. The following diagram from the OVS porting guide shows how different datapaths fit into the OVS architecture.

            _
           |   +-------------------+
           |   |    ovs-vswitchd   |<-->ovsdb-server
           |   +-------------------+
           |   |      ofproto      |<-->OpenFlow controllers
           |   +--------+-+--------+  _
           |   | netdev | |ofproto-|   |
 userspace |   +--------+ |  dpif  |   |
           |   | netdev | +--------+   |
           |   |provider| |  dpif  |   |
           |   +---||---+ +--------+   |
           |       ||     |  dpif  |   | implementation of
           |       ||     |provider|   | ofproto provider
           |_      ||     +---||---+   |
                   ||         ||       |
            _  +---||-----+---||---+   |
           |   |          |datapath|   |
    kernel |   |          +--------+  _|
           |   |                   |
           |_  +--------||---------+
                        ||
                     physical
                       NIC
Karlakarlan answered 25/8, 2016 at 11:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.