Sie sind auf Seite 1von 8

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

Openvswitch and ovsdb

In this blog, I will provide an overview of ovsdb, this is mainly a collection of information from various

locations.

Openvswitch is a virtual switch targeted for virtualized environments to switch traffic between VMs. Its integrated into the latest Linux kernel.

Following are the critical components of Openvswitch.

ovs-vswitchd, a daemon that implements the switch, along with a companion Linux kernel module for flow-based switching. We can talk to ovs-switchd using Openflow protocol.Following are the critical components of Openvswitch. ovsdb-server, a lightweight database server that

ovsdb-server, a lightweight database server that ovs-vswitchd queries to obtain its configuration. External clients can talk to ovsdb-server using ovsdb management protocol.We can talk to ovs-switchd using Openflow protocol. control and management cluster contains client tools to

control and management cluster contains client tools to talk to ovsdb-server and ovs-vswitchd.can talk to ovsdb-server using ovsdb management protocol. +----------------------+ | Control& | |

+----------------------+

|

Control&

|

|

Management

|

|

Cluster

|

+----------------------+

|

\

|OVSDB

\OpenFlow

|Mgmt

\

|

\

+============================================+

+--------------+ | |

|

||ovsdb-server|-------|ovs-vswitchd| |

||

|+--------------+

|

|

||

|

|

|

|

|+--------------+

+--------------+ | |

|

|

|

+----------------+ |

|

|ForwardingPath| |

|

 

+----------------+ |

 

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

Follow “Sreenivas Makam's Blog” Get every new post delivered to your Inbox. Enter your email
Follow “Sreenivas
Makam's Blog”
Get every new post
delivered to your Inbox.
Enter your email addres
Sign me up
Pow ered by WordPress.com

+============================================+

Following are some notes on the internals:

ovsdb-server maintains the switch table database and external clients can talk to ovsdb-serverFollowing are some notes on the internals: using json rpc and json being the data format.

using json rpc and json being the data format.

ovsdb database currently contains around 13 tables and these can be extended further.ovsdb-server using json rpc and json being the data format. Bridge – Bridge configuration. Port –

Bridge – Bridge configuration.contains around 13 tables and these can be extended further. Port – Port configuration. Interface –

Port – Port configuration.can be extended further. Bridge – Bridge configuration. Interface – One physical network de vice in

Interface – One physical network de vice in a Port. – One physical network device in a Port.

Flow_Table – OpenFlow table configurationInterface – One physical network de vice in a Port. QoS – Quality of Service configuration

QoS – Quality of Service configurationvice in a Port. Flow_Table – OpenFlow table configuration Queue – QoS output queue. Mirror –

Queue – QoS output queue.configuration QoS – Quality of Service configuration Mirror – Port mirroring. Controller – OpenFlow

Mirror – Port mirroring.of Service configuration Queue – QoS output queue. Controller – OpenFlow controller configuration. Manager

Controller – OpenFlow controller configuration.Queue – QoS output queue. Mirror – Port mirroring. Manager – OVSDB management connection. NetFlow –

Manager – OVSDB management connection.Controller – OpenFlow controller configuration. NetFlow – NetFlow configuration. SSL – SSL

NetFlow – NetFlow configuration.configuration. Manager – OVSDB management connection. SSL – SSL configuration. sFlow – sFlow configuration.

SSL – SSL configuration.management connection. NetFlow – NetFlow configuration. sFlow – sFlow configuration. IPFIX – IPFIX

sFlow – sFlow configuration.– NetFlow configuration. SSL – SSL configuration. IPFIX – IPFIX configuration ovsdb clients can use the

IPFIX – IPFIX configurationSSL – SSL configuration. sFlow – sFlow configuration. ovsdb clients can use the ovsdb management protocol

ovsdb clients can use the ovsdb management protocol can manipulate the above tables.– sFlow configuration. IPFIX – IPFIX configuration Following are the different json rpc methods specified by

Following are the different json rpc methods specified by the protocol.ovsdb management protocol can manipulate the above tables. list_dbs – List databases get_schema – Get schema

list_dbs – List databasesthe different json rpc methods specified by the protocol. get_schema – Get schema transact – operations

get_schema – Get schemaspecified by the protocol. list_dbs – List databases transact – operations on database cancel – cancel

transact – operations on databaselist_dbs – List databases get_schema – Get schema cancel – cancel transact request monitor – monitor

cancel – cancel transact request– Get schema transact – operations on database monitor – monitor certain table columns update –

monitor – monitor certain table columnsoperations on database cancel – cancel transact request update – sent by server to client for

update – sent by server to client for tables that are monitoredtransact request monitor – monitor certain table columns monitor_cancel – cancelling monitor request lock, steal,

monitor_cancel – cancelling monitor request– sent by server to client for tables that are monitored lock, steal, unlock – locking,

lock, steal, unlock – locking, unlocking operations on databaseare monitored monitor_cancel – cancelling monitor request echo – to check liveliness Using the transact rpc

echo – to check livelinesssteal, unlock – locking, unlocking operations on database Using the transact rpc method, different database operations

Using the transact rpc method, different database operations like select, insert, delete can be done.operations on database echo – to check liveliness Following are some client tools that Open vswitch

Following are some client tools that Open vswitch provides:

ovs-dpctl, a tool for configuring the switch kernel module.Following are some client tools that Open vswitch provides: ovs-ofctl, to list implemented flows in the

ovs-ofctl, to list implemented flows in the OVS kernel moduleovs-dpctl, a tool for configuring the switch kernel module. ovs-vsctl, a utility for querying and updating

ovs-vsctl, a utility for querying and updating the configuration of ovs-vswitchd.to list implemented flows in the OVS kernel module ovs-appctl, a utility that sends commands to

ovs-appctl, a utility that sends commands to running Open vSwitch daemons.for querying and updating the configuration of ovs-vswitchd. ovsdb-client, a command line utility to ovsdb server.

ovsdb-client, a command line utility to ovsdb server.utility that sends commands to running Open vSwitch daemons. Mininet uses openvswitch and ovsdb internally.

Mininet uses openvswitch and ovsdb internally.

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

To illustrate some of the theory above, I created following simple Mininet topology.

sudomn--controller=remote,ip=192.168.56.101--topo=linear,3

This is a 3 node linear topology.

Now, lets try to look at the contents of the database

mininet@mininet-vm:~$sudoovsdb-clientlist-dbs

Open_vSwitch

mininet@mininet-vm:~$sudoovsdb-clientlist-tables

Table

------------

Capability

SSL

Bridge

Controller

NetFlow

Port

Mirror

Queue

QoS

Interface

Open_vSwitch

sFlow

Manager

Above, we see the database and tables. Now, lets try to look at columns in bridge table:

mininet@mininet-vm:~$sudoovsdb-clientlist-columnsBridge

Column

----------------------------------------------------------------

---------------------------

status

Type

{"key":"string","max":"unlimited","min":0,"value":"string"}

fail_mode {"key":{"enum":["set",

["secure","standalone"]],"type":"string"},"min":0}

other_config

{"key":"string","max":"unlimited","min":0,"value":"string"}

_version

"uuid"

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

name

datapath_type"string"

"string"

netflow

{"key":

{"refTable":"NetFlow","type":"uuid"},"min":0}

ports

{"key":

{"refTable":"Port","type":"uuid"},"max":"unlimited","min":0}

external_ids

{"key":"string","max":"unlimited","min":0,"value":"string"}

flood_vlans {"key":

{"maxInteger":4095,"minInteger":0,"type":"integer"},"max":4096,"m

in":0}

_uuid

"uuid"

controller {"key":

{"refTable":"Controller","type":"uuid"},"max":"unlimited","min":0

}

datapath_id {"key":"string","min":0}

stp_enable "boolean"

mirrors

{"key":

{"refTable":"Mirror","type":"uuid"},"max":"unlimited","min":0}

sflow

{"key":{"refTable":"sFlow","type":"uuid"},"min":0}

Now, lets try to dump the contents of bridge table.

Now, lets try to dump the contents of bridge table.

mininet@mininet-vm:~$sudoovsdb-clientdumpOpen_vSwitch

Bridgetable

_uuid

controller

datapath_id

datapath_typeexternal_idsfail_mode

flood_vlansmirrorsnamenetflowother_config

ports

sflowstatusstp_enable

----------------------------------------------------------------

----------------------------------------------------------------

----------------------------------------------------------

---------------------------------------------------------------

-----------------------------------------------------------------

----------------------------------------------------------------

--------------------

4aa95bd1-6e44-48c3-9836-a634a2b3bee9[56efde50-b9a5-4696-98a9-

f632438ec860,80454ec0-b75b-4ba1-83aa-c87c80e3c409]

"0000000000000001"""

{}

secure

[]

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

[] "s1"[]

{datapath-id="0000000000000001"}[1ecfc08a-

cccb-432b-a6f2-a88b6953b27b,20338ec9-a7ed-4275-9a1a-

4dce0d17f9d0,d026cd6a-c6e5-418c-bfae-8912beccbab8]

[] {}

false

31ade9d7-3a84-4809-a067-21d6ab13d3a0[c309252b-384e-4120-9180-

8c6f3e21d52d,df9f8e75-32a0-4bab-81ae-22161e5d8ce5]

"0000000000000002"""

{}

secure

[]

[] "s2"[]

{datapath-id="0000000000000002"}[4a304026-

d090-4163-8328-0d9c1f55ef51,504ea36c-2ec6-4010-91d5-

ff9ebe6d792f,8ddd5e79-9b74-48f2-b251-d8ee521146e4,c8e82b90-

41d5-4834-aa9b-05d6faf0baf4][] {} false

0a3f793d-4958-44a5-9639-a36384927f58[9e921896-32e9-4f4e-b1e2-

332fb2339f76,fc81e564-6aa5-4ad0-9518-58ce3094451b]

"0000000000000003"""

{}

secure

[]

[] "s3"[]

{datapath-id="0000000000000003"}[0c5005d8-

b999-4c6b-bf6e-a638032737f8,25c8166d-28d8-47f5-b1fc-

69940ec42960,cc54c4d5-32b9-4e0e-9aff-42dd4fdcd1a5]

[] {}

false

Above, we see the 3 bridges along with their properties.

Now, lets try to change some properties of this topology using ovs-vsctl. Lets try to delete 1 of the ports in the bridge.

sudoovs-vsctldel-ports2s2-eth2

When we look at the controller for the topology now, we should see the link between s2 and s1 go away. Once we add it back,

sudoovs-vsctladd-ports2s2-eth2

Link should show back on the controller topology.

Following is the generic format for ovs-vsctl.

ovs-vsctl<command><tablename><recordname><setting=value>

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

Lets say, we want to mirror packets from s2-eth2 interface of bridge s2 and send towards interface s2- eth3, we can execute the following command. This will modify the bridge and mirror table appropriately.

sudoovs-vsctlsetbridges2mirrors=@m----id=@eth2getport

s2-eth2----id=@eth3getPorts2-eth3----id=@mcreatemirror

name=mymirrorselect-dst-port=@eth2select-src-port=@eth2output-

port=@eth3

Do a “pingall” from Mininet and allow simpleforwarding controller application to install flows. To dump the flow table, we can use ovs-ofctl. Flows can also be dumped using raw dump of the flow table from ovs-vsctl or ovsdb-client.

mininet@mininet-vm:~$sudoovs-ofctldump-flowss2

NXST_FLOWreply(xid=0x4):

cookie=0x0,duration=79.866s,table=0,n_packets=1,n_bytes=98,

priority=1,ip,nw_dst=10.0.0.3actions=output:3

cookie=0x0,duration=79.898s,table=0,n_packets=4,n_bytes=392,

priority=1,ip,nw_dst=10.0.0.1actions=output:5

cookie=0x0,duration=79.884s,table=0,n_packets=2,n_bytes=196,

priority=1,ip,nw_dst=10.0.0.2

actions=mod_dl_dst:d2:87:9b:ac:c0:9f,output:4

We can also create a network and configure the network without using Mininet. Following is an example for doing this:

sudoovs-vsctladd-brs1

sudoovs-vsctladd-brs2

sudoovs-vsctladd-brs3

sudoovs-vsctladd-ports1patch-s1

sudoovs-vsctlsetinterfacepatch-s1type=patch

sudoovs-vsctlsetinterfacepatch-s1options:peer=patch-s2

sudoovs-vsctladd-ports2patch-s2

sudoovs-vsctlsetinterfacepatch-s2type=patch

sudoovs-vsctlsetinterfacepatch-s2options:peer=patch-s1

sudoovs-vsctlset-controllertcp:192.168.56.101:6633

sudoovs-vsctlset-controllers1tcp:192.168.56.101:6633

sudoovs-vsctlset-controllers2tcp:192.168.56.101:6633

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

The above set of commands will create a linear 2 node topology with a patch connection between the 2 nodes. Its not clear to me how mininet creates connection between nodes since I did not observe a patch connection with Mininet created topology.

Opendaylight and ovsdb:

As part of Opendaylight Hydrogen release planned early 2014, ovsdb southbound plugin will be introduced. This can allow the controller to manage vswitch using ovsdb protocol. Openflow plugin was already supported which allowed openflow flows to be installed. There is also a Openstack+Opendaylight integration project happening that will allow the Openstack to use the ML2 plugin of ODL for the networking stuff. ML2 plugin will talk to ovsdb southbound plugin. More details on this later once I understand this better.

Following link captures more details on the integration of ovsdb with Opendaylight. I have tried this tutorial which shows a practical example of ovsdb integration with Opendaylight. This would need us to compile ovsdb code and copy to controller. Instructions for this is present in the tutorial as well.

References:

You May Like

with OVSDB Open Vswitch project About these ads You May Like 1. Share this:  Twitter

1.

OVSDB Open Vswitch project About these ads You May Like 1. Share this:  Twitter 

Share this:

 Like
Like

Be the first to like this.

6/4/2014

Openvswitch and ovsdb | Sreenivas Makam's Blog

Related

In "Opendaylight"

In "Openflow"

Openflow history and some hands-on In "Openflow" Tools used with Opendaylight In "Opendaylight"

In "Opendaylight"