An introduction to SDN

Overview

What does SDN stand for?

SDN stands for Software-Defined Networking. But it is just a name. Don’t expect it to make any sense.

What is SDN?

SDN is about building networks. Networks are built using computers, switches, and routers. In a network, computers are connected to each other using switches and routers. Switches and routers determine the routing and flow of packets between computers. SDN is about how we configure switches to perform the routing we want.

SDN is a paradigm shift in how switches are configured. Before SDN, you would have to configure each switch in your network either manually or through a vendor specific interface. After SDN, all switchs provide a standard API for configuration. With this standard API, you would be able to configure all your switchs from one central place. You would do that by sending commands to and receiving events from them. For example, if you need to update the configuration of your switchs, you would send a standard API command to all of your switchs, and your switch configurations will update.

One such switch API is OpenFlow. OpenFlow aims to standardize the most common switchs commands through an API. One switch that implements OpenFlow is Open vSwitch. Open vSwitch is a popular virtual switch that is capable of talking the OpenFlow protocol.

Summary

The goal of SDN is to facilitate configuring switches via standard APIs and high-level software, as opposed to having to handle vendor specific interfaces on each switch.


Details

If you don’t know what SDN, OpenFlow, or Open vSwitch is, begin by reading the Overview section.

History

Software-defined networking (SDN) has several traces of history explained by Nick Feamster in his The Road to SDN. The most famous one, and the one I am familiar with, is OpenFlow (2008) which was a generalization of Ethane.

What is SDN? (again)

Routers devices perform 3 types of work. They are known as “planes” (read KR’s “4.3 What is Inside a Router?”):

  • Control plane: given a packet, decide which switch’s port in the switch to forward the signal to.
  • Data plane: when the output port is decided, perform the actual forwarding.
  • Management plane

Essentially, the goal of SDN (and NFV) is to simplify the management of networks by having the router/switch “control plane” configurations centeralized and in one place and by doing the configuration in normal software, as opposed to hardware or vendor-specific crap.

Before the SDN paradigm shift, these planes were coupled, and their API was controlled by vendors. The SDN philosophy is in order to facilitate innovation in networking, we should learn from other computer science disciplines, like programming languages, and define better abstractions, like layering.

SDN folks say we want switches that let us write readable control-plane software. In OpenFlow (spec, particularly the “The OpenFlow Switch Protocol” section and those three kinds of messages), the switch will ask an OpenFlow controller (a TCP server on port 6653 with TLS, both sides may send messages) what to do with this kind of packet with this source and destination (i.e., with this “flow”). So all switches in one network will ask this central controller what to do. In other words, we are centeralizing the control plane. This centeralizing makes it easier to reason about the network and make changes in one place for all, which is a great advantage. But it introduces a single point of failure. But fear not, because we can run a cluster of a distributed controller. The most famous one is Onix. Another one written in Go on top of Etcd is Beehive-netctrl (paper1, paper2). Yet another exciting controller is a unikernel image compiled with Mirage.

IMO, OpenFlow is too big and not well designed. It is a big bag of predefined TLVs (as opposed to general purpose ones).

What is an OpenFlow switch?

OpenFlow is an API specification for configuring switchs. An OpenFlow switch is a switch that implements this API. OpenFlow specifies the behavior of the switch. For example, the OpenFlow spec might say that whenever the switch receives a packet it should make a TCP call to a server (known as OpenFlow controller) to ask that server what to do about the packet it just received.

What is Open vSwitch?

Open vSwitch is a virtual switch (see NFV), which implements OpenFlow protocol as well (so you can control it using a software controller).

Why isn’t this routing done using a normal PC?

Because normal PCs have very few input/output ports, and their packet handling speed is very slow compared to the required line-rate.

What is NFV?

Network function virtualization (whitepaper) is virtualizing a switch, as opposed to a hardware switch device, and using it to create complicated networks of VMs. NFV is part of “softwarization” of networks.

What is P4?

P4 is a way to make it easy to modify the data-plane behavior using software! Recall that data plane’s responsibility has often been implemented in hardware. Because it needs to as fast as line-rate (ie giga or tera bit per second)

Is SDN the same as OpenFlow?

No. OpenFlow was one of the first famous solutions to a common problem (controlling switches using software). Other solutions are Cisco’s Open Network Environment (whitepaper). This document by Cisco, SDN: Why We Like It and How We Are Building On It, provides a great overview of SDN.

Why now?

Indeed. Network people, Scott Shenken says, like complexity. But the reason, I think, is the increase in use of virtual machines and the need to connect them using complex and configurable networks for them across multiple datacenters. So, in one word cloud computing is one of the motivations (although not the only one: e.g., OpenFlow was originally designed to control department networks at Stanford).