Convert Figma logo to code with AI

openvswitch logoovs

Open vSwitch

3,534
1,899
3,534
1

Top Related Projects

19,712

eBPF-based Networking, Security, and Observability

3,197

The FRRouting Protocol Suite

3,598

BGP implemented in the Go Programming Language

1,176

Open Network Operating System

Quick Overview

Open vSwitch (OVS) is an open-source, multilayer virtual switch designed to enable massive network automation through programmatic extension. It supports standard management interfaces and protocols, and is designed to support distribution across multiple physical servers.

Pros

  • High performance and scalability for large-scale network virtualization
  • Extensive support for network protocols and standards
  • Highly programmable and customizable through OpenFlow and other APIs
  • Active community and continuous development

Cons

  • Steep learning curve for beginners
  • Complex configuration for advanced features
  • Can be resource-intensive in large deployments
  • Limited documentation for some advanced use cases

Code Examples

  1. Creating a bridge and adding ports:
ovs-vsctl add-br br0
ovs-vsctl add-port br0 eth0
ovs-vsctl add-port br0 vnet0

This example creates a new bridge named br0 and adds two ports (eth0 and vnet0) to it.

  1. Setting OpenFlow controller:
ovs-vsctl set-controller br0 tcp:192.168.1.1:6633

This command sets an OpenFlow controller for the br0 bridge.

  1. Configuring QoS:
ovs-vsctl set port eth0 qos=@newqos -- \
--id=@newqos create qos type=linux-htb \
queues:0=@q0 queues:1=@q1 -- \
--id=@q0 create queue other-config:max-rate=1000000 -- \
--id=@q1 create queue other-config:min-rate=1000000

This example sets up Quality of Service (QoS) on the eth0 port with two queues.

Getting Started

To get started with Open vSwitch:

  1. Install OVS:

    sudo apt-get update
    sudo apt-get install openvswitch-switch
    
  2. Create a bridge:

    sudo ovs-vsctl add-br ovs-br0
    
  3. Add physical interface to the bridge:

    sudo ovs-vsctl add-port ovs-br0 eth0
    
  4. Configure IP address on the bridge:

    sudo ip addr add 192.168.1.1/24 dev ovs-br0
    sudo ip link set ovs-br0 up
    

These steps will set up a basic Open vSwitch bridge with a physical interface. For more advanced configurations, refer to the official documentation.

Competitor Comparisons

19,712

eBPF-based Networking, Security, and Observability

Pros of Cilium

  • Advanced network security features with eBPF-based filtering and policy enforcement
  • Native Kubernetes integration and support for service mesh functionality
  • Better performance and scalability for cloud-native environments

Cons of Cilium

  • Steeper learning curve due to eBPF complexity
  • Less widespread adoption compared to OVS
  • May require kernel updates for full feature support

Code Comparison

OVS (C):

static void
ofproto_rule_destroy__(struct rule *rule)
{
    if (rule) {
        cls_rule_destroy(CONST_CAST(struct cls_rule *, &rule->cr));
        ofproto_rule_destructor__(rule);
        free(rule);
    }
}

Cilium (Go):

func (e *Endpoint) Delete(conf DeleteConfig) error {
    e.UnconditionalLock()
    defer e.Unlock()

    return e.delete(conf)
}

Both projects use different languages and architectures, making direct code comparison challenging. OVS is primarily written in C, focusing on traditional networking concepts, while Cilium is written in Go and leverages eBPF for modern, Kubernetes-centric networking.

3,197

The FRRouting Protocol Suite

Pros of FRR

  • Comprehensive routing protocol support (BGP, OSPF, IS-IS, etc.)
  • Active community with frequent updates and contributions
  • Designed for both traditional and software-defined networks

Cons of FRR

  • Steeper learning curve for network engineers unfamiliar with routing protocols
  • May require more system resources compared to OVS for basic networking tasks
  • Less focus on virtual networking and SDN features

Code Comparison

FRR configuration example:

router bgp 65000
 neighbor 192.168.1.1 remote-as 65001
 network 10.0.0.0/8

OVS configuration example:

ovs-vsctl add-br br0
ovs-vsctl add-port br0 eth0
ovs-vsctl add-port br0 vnet0

FRR focuses on routing protocol configuration, while OVS emphasizes virtual switch setup and port management. FRR's code is more oriented towards traditional networking concepts, whereas OVS is designed for software-defined networking and virtual environments.

Both projects are open-source and actively maintained, but they serve different purposes in the networking ecosystem. FRR is better suited for complex routing scenarios, while OVS excels in virtual networking and SDN applications.

3,598

BGP implemented in the Go Programming Language

Pros of GoBGP

  • Written in Go, offering better performance and easier deployment
  • Lightweight and modular design, suitable for embedding in other applications
  • Supports modern BGP extensions and features out of the box

Cons of GoBGP

  • Limited to BGP protocol, while OVS offers broader network virtualization capabilities
  • Smaller community and ecosystem compared to OVS
  • Less mature and battle-tested in large-scale production environments

Code Comparison

GoBGP example (configuring a BGP peer):

peer := &api.Peer{
    Conf: &api.PeerConf{
        NeighborAddress: "192.168.1.1",
        PeerAs:          65001,
    },
}
s.AddPeer(context.Background(), &api.AddPeerRequest{Peer: peer})

OVS example (configuring a bridge):

ovs_vsctl("add-br", "br0");
ovs_vsctl("add-port", "br0", "eth0");
ovs_vsctl("set", "bridge", "br0", "protocols=OpenFlow13");

Both repositories serve different purposes in the networking domain. GoBGP focuses on BGP protocol implementation, while OVS provides a broader set of network virtualization tools. The choice between them depends on specific use cases and requirements.

1,176

Open Network Operating System

Pros of ONOS

  • More comprehensive SDN controller platform with broader network management capabilities
  • Supports distributed architecture for improved scalability and fault tolerance
  • Provides a rich set of northbound and southbound APIs for extensibility

Cons of ONOS

  • Steeper learning curve due to its more complex architecture
  • Requires more resources to run compared to OVS
  • May be overkill for simpler network virtualization tasks

Code Comparison

ONOS (Java):

@Component(immediate = true)
public class MyAppComponent {
    @Activate
    protected void activate() {
        log.info("Started");
    }
}

OVS (C):

static void
ovs_vport_init(void)
{
    /* Initialize vport-related data structures. */
    ovs_mutex_init(&vport_mutex);
    hmap_init(&vport_table);
}

ONOS focuses on high-level network control and management, using Java and providing a component-based architecture. OVS, written in C, is more focused on low-level network virtualization and switching functionality. ONOS is better suited for large-scale SDN deployments, while OVS excels in creating virtual network devices and bridges within hosts or small networks.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

.. NOTE(stephenfin): If making changes to this file, ensure that the start-after/end-before lines found in 'Documentation/intro/what-is-ovs' are kept up-to-date.

============ Open vSwitch

.. image:: https://github.com/openvswitch/ovs/workflows/Build%20and%20Test/badge.svg :target: https://github.com/openvswitch/ovs/actions .. image:: https://ci.appveyor.com/api/projects/status/github/openvswitch/ovs?branch=main&svg=true&retina=true :target: https://ci.appveyor.com/project/blp/ovs/history .. image:: https://api.cirrus-ci.com/github/openvswitch/ovs.svg :target: https://cirrus-ci.com/github/openvswitch/ovs .. image:: https://readthedocs.org/projects/openvswitch/badge/?version=latest :target: https://docs.openvswitch.org/en/latest/

What is Open vSwitch?

Open vSwitch is a multilayer software switch licensed under the open source Apache 2 license. Our goal is to implement a production quality switch platform that supports standard management interfaces and opens the forwarding functions to programmatic extension and control.

Open vSwitch is well suited to function as a virtual switch in VM environments. In addition to exposing standard control and visibility interfaces to the virtual networking layer, it was designed to support distribution across multiple physical servers. Open vSwitch supports multiple Linux-based virtualization technologies including KVM, and VirtualBox.

The bulk of the code is written in platform-independent C and is easily ported to other environments. The current release of Open vSwitch supports the following features:

  • Standard 802.1Q VLAN model with trunk and access ports
  • NIC bonding with or without LACP on upstream switch
  • NetFlow, sFlow(R), and mirroring for increased visibility
  • QoS (Quality of Service) configuration, plus policing
  • Geneve, GRE, VXLAN, STT, ERSPAN, GTP-U, SRv6, Bareudp, and LISP tunneling
  • 802.1ag connectivity fault management
  • OpenFlow 1.0 plus numerous extensions
  • Transactional configuration database with C and Python bindings
  • High-performance forwarding using a Linux kernel module

Open vSwitch can also operate entirely in userspace without assistance from a kernel module. This userspace implementation should be easier to port than the kernel-based switch. OVS in userspace can access Linux or DPDK devices. Note Open vSwitch with userspace datapath and non DPDK devices is considered experimental and comes with a cost in performance.

What's here?

The main components of this distribution are:

  • ovs-vswitchd, a daemon that implements the switch, along with a companion Linux kernel module for flow-based switching.
  • ovsdb-server, a lightweight database server that ovs-vswitchd queries to obtain its configuration.
  • ovs-dpctl, a tool for configuring the switch kernel module.
  • Scripts and specs for building RPMs for Red Hat Enterprise Linux and deb packages for Ubuntu/Debian.
  • ovs-vsctl, a utility for querying and updating the configuration of ovs-vswitchd.
  • ovs-appctl, a utility that sends commands to running Open vSwitch daemons.

Open vSwitch also provides some tools:

  • ovs-ofctl, a utility for querying and controlling OpenFlow switches and controllers.
  • ovs-pki, a utility for creating and managing the public-key infrastructure for OpenFlow switches.
  • ovs-testcontroller, a simple OpenFlow controller that may be useful for testing (though not for production).
  • A patch to tcpdump that enables it to parse OpenFlow messages.

What other documentation is available?

.. TODO(stephenfin): Update with a link to the hosting site of the docs, once we know where that is

To install Open vSwitch on a regular Linux or FreeBSD host, please read the installation guide <Documentation/intro/install/general.rst>. For specifics around installation on a specific platform, refer to one of the other installation guides <Documentation/intro/install/index.rst>

For answers to common questions, refer to the FAQ <Documentation/faq>__.

To learn about some advanced features of the Open vSwitch software switch, read the tutorial <Documentation/tutorials/ovs-advanced.rst>__.

Each Open vSwitch userspace program is accompanied by a manpage. Many of the manpages are customized to your configuration as part of the build process, so we recommend building Open vSwitch before reading the manpages.

License

The following is a summary of the licensing of files in this distribution. As mentioned, Open vSwitch is licensed under the open source Apache 2 license. Some files may be marked specifically with a different license, in which case that license applies to the file in question.

Files under the datapath directory are licensed under the GNU General Public License, version 2.

File build-aux/cccl is licensed under the GNU General Public License, version 2.

The following files are licensed under the 2-clause BSD license. include/windows/getopt.h lib/getopt_long.c lib/conntrack-tcp.c

The following files are licensed under the 3-clause BSD-license include/windows/netinet/icmp6.h include/windows/netinet/ip6.h lib/strsep.c

Files lib/sflow*.[ch] are licensed under the terms of either the Sun Industry Standards Source License 1.1, that is available at: http://host-sflow.sourceforge.net/sissl.html or the InMon sFlow License, that is available at: http://www.inmon.com/technology/sflowlicense.txt

Contact

bugs@openvswitch.org