Software Defined Network
Software Defined Network (SDN) is a new type of network innovation architecture proposed by the Clean Slate research group at Stanford University in the United States. The core idea is to allow software applications to participate in network control and management, meet the needs of upper-layer businesses, and simplify network operation and maintenance through automated business deployment.
The three major features of SDN are:
- Control and forwarding separation
- Network virtualization
- Programmable interface

Open vSwitch
Also known as OVS, a type of virtual switch
- Convenient network management and monitoring. It is convenient for administrators to monitor the network status and data traffic in the entire cloud environment, such as analyzing the source of data packets in the network, which VM, OS, and user they come from, all of which can be achieved with the tools provided by OVS.
- Accelerate packet routing and forwarding. Compared to the simple MAC address-based forwarding rules of Bridge, OVS introduces a flow cache mechanism, which can speed up packet forwarding efficiency.
- Based on the SDN concept of control and data plane separation. The OVS control plane is responsible for flow table learning and issuance, while the specific forwarding actions are performed by the data plane. It has strong scalability.
- Support for tunnel protocols. Bridge only supports VxLAN, while OVS supports gre/vxlan/IPsec and other protocols.
- Suitable for multiple Hypervisors such as Xen, KVM, VirtualBox, and VMware.
OVS Structure
::: hljs-center

:::
As shown, OVS has implemented corresponding modules in both Linux user space and kernel space. The main components in user space include the database service ovsdb-server and the daemon process ovs-vswitchd. In kernel space, the datapath module is implemented. Among them, ovs-vswitchd and datapath together constitute the data plane of OVS, and the control plane is completed by the controller module. The controller generally refers to the OpenFlow controller, which can be completed by third-party support as long as it supports the OpenFlow protocol.
OpenFlow
OpenFlow is a protocol for communication between the control plane and the data plane. We often refer to switches that support the OpenFlow protocol as OpenFlow switches, and controllers as OpenFlow controllers. Well-known OpenFlow controllers in the industry include OpenDaylight and ONOS.
OpenFlow is an independent and complete flow table protocol that does not depend on OVS. OVS only supports the OpenFlow protocol, and with this support, it can use OpenFlow controllers to manage flow tables in OVS. OpenFlow not only supports virtual switches but also some hardware switches that support the OpenFlow protocol.
ovs-vswitchd
ovs-vswitchd is the core component of OVS, which, together with the kernel module datapath, constitutes the data plane of OVS. It uses the OpenFlow protocol to communicate with the OpenFlow controller, uses the OVSDB protocol to communicate with ovsdb-server, and uses netlink and the datapath kernel module to communicate.
ovsdb-server
ovsdb-server is a lightweight database service of OVS, used to store configuration information for the entire OVS, including interfaces, switching content, VLAN, and more. ovs-vswitchd works based on this configuration information.
OpenFlow Controller
The OpenFlow controller can connect to any switch that supports OpenFlow, such as OVS, through the OpenFlow protocol. The controller controls the direction of data flow by issuing flow table rules to the switch.
Kernel Datapath
The datapath kernel module and ovs-vswitchd work together. datapath is responsible for the actual packet reception and transmission, while ovs-vswitchd guides datapath on how to forward packets based on the flow table rules issued by the controller.
For example, when datapath receives a packet from the host's physical network card (NIC) or a virtual network card (vNIC) of a VM for the first time, datapath does not know how to process this packet. Therefore, it passes the packet to ovs-vswitchd. After ovs-vswitchd decides how to process the packet, it passes the decision back to datapath, which then performs the corresponding action, either discarding the packet or forwarding it from a specific port. At the same time, ovs-vswitchd instructs datapath to cache the action for this packet. The next time a similar packet arrives, datapath can directly execute the cached action, greatly improving the speed of data processing.
If it is not the first time a packet is received, the action is executed directly according to the previously cached action.
References
一文看懂SDN软件定义网络,概念、原理、架构及实现各环节介绍
从 Bridge 到 OVS,探索虚拟交换机
初学者的SDN学习之路
若无法加载请检查网络环境。
若无法加载请检查网络环境,或切回 Disqus 稍后再试。