Software-Defined Networks
Software Defined Networks
Traditional Computer Networks
In traditional computer networks, there are a few planes. At the bottom is the data plane which is responsible for packet processing (forward, filter, buffer, mark, rate-limit, measure packets). On top is the control plane which has the distribution algorithms. Tracks topology changes, compute routes, install forwarding rules.
Main frames have specialized applications, specialized operating systems, and specialized hardware. They are vertically integrated, closed proprietary, slow innovation, small industry, Then, when we switched to having apps, OSes, and microprocessors, each layer connected with an open interface, it lead to rapid innovation and a huge industry.
Routers/switches also started off with specialized features, specialized control plane, and specialized hardware. They were vertically integrated, closed, proprietary, and slow to innovate. Then, we switched to having layers: app, control plane, and merchant switching chips. This was a horizontal design, had open interface, and experienced rapid innovation.
Introduction to SDN
In software defined networking (SDN), the control plane is centralized, smart, and slow. It is connected to the data plane via an API (e.g., OpenFlow). The data plane is made up of switches and they are dumb, fast.
The controller is programmable. Input is events from switches (topology changes, traffic statistics, arriving packet) and the output is commands to switches ((un)install rules query statistics, send packet)
Are we really in control of network? Imagine if we wanted a new application for our data plane. When you need a new feature, it may takes years to update because:
- equipment vendor can't just send you a software upgrade
- new forwarding features take years to develop
- by then, you've figured out a kludge to work around it
- your network becomes more complicated, more brittle.
- eventually, when the upgrade is available, it either no longer solves your problem or you need a expensive, fork-lift upgrade.
Network systems are built "bottoms-up". E.g., the fixed-function switch says "this is how I process" and the OS has to deal with it. Now, network systems are starting to be programmed "top down". E.g., the switch OS tells the programmable switch "this is how you must process".
PISA
Domain specific processors are like how in computers, Java is run on CPUs; in graphics, OpenCL is run on GPU; in signal processing, MATLAB is run on DSP; in machine learning, TensorFlow is run on TPU; and in Networking, P4 runs on PISA.
Data plane functionalities have a common style: match-action packet processing. This includes:
- IP Prefix forwarding
- access control (e.g., anything that comes from point 80 should be dropped)
- load balancing (this is an alternative to having a big server to handle the load balancing. You can just say, if the destination is x send it to y. )
PISA stands for "Protocol Independent Switch Architecture."

- The programmable parser runs a parser program; i.e., what data are you looking for in the IP header?
- The programmable match-action pipeline will run header and data declarations and table and controls. This step will perform the match action on each of these headers in parallel because there are these pipelines.
- The last step is put it to put it through serialization and leave the switch.
Programmability
Number 1: Programmability reduces complexity.
- In fixed-control switches, you must include all the protocols that could be used. However, if its a programmable switch that doesn't need IPv6, then you don't have to include it.
- Implement only the functionality you need.
Number 2: Programmability enables the addition of proprietary features.
- A switch today has way more flow logic. Traditional switch logic is very simple.
Some example of new features include:
- new encapsulations and tunnels
- new ways to tag packets for special treatment
- new approaches to routing: e.g., source routing
- new approaches to congestion control
- new ways to process packets. E.g., processor ticker-symbols.
Some examples of new applications:
- Layer-4 load balancer replaced 100 servers or 10 dedicated boxes with one programmable switch. Can track and maintain mapping for 5-10 million Http flows
- Fast stateless firewall: add/delete/track 100s of thousands of new connections per second.
- cache for key-value store: Memcache in network cache for 100 servers. 1-2B operations per second.
Number 3: Between the Remote Control Plane and the Top of Rack P4 Switches is the P4 runtime API, which is program and silicon independent.
- This means you don't have to rely on big companies like Cisco. If you need a feature, you don't have to wait for those companies to develop it because you can just program your own.
Number 4: Programmability also introduces network telemetry. We can ask questions like:
- which path did my packet take?
- which rules did my packet follow?
- how long did my packet queue at each switch?
- who did my packet share the queue with?
- how long did my packet queue at each switch
- who did my packet share the queue with?
A programmable device can answer questions at line rate. Questions like the following:
- which path did my packet take?
- which rules did my packet follow?
- how long did it queue at each switch?
- who did it share the queues with?
It helps with debugging and optimizing.
INT: inband network telemetry.

P4 Language
P4 is similar to C. P4 programs are composed of various components.
P4 Language Elements

- Parsers and controls are the main controllable blocks. They are implemented through various data types and expressions by the programmer
- Parsers are implemented as a state machine and their sole purpose is to extract header fields in some user-defined way
- Controls are responsible for the main match-action processing. Define and apply your tables and actions to manipulate packet headers and metadata.
- On the other hand, the orange blocks are provided by the vendor.
- The architecture description specifies a particular configuration of programmable parsers, control blocks, and vendor specific blocks
- "externs" provide functionality that is not implementable in P4.

- once the user supplies the P4 program, it is compiled into a target-specific configuration binary.
- it will be loaded onto the target.m
The V1Model Architecture is implemented on top of the Bmv2's simple_switch target (a software switch developed by P4 for testing P4 programs).
- This architecture consists of a P4 programmable parser and deparser, a block to verify checksums on incoming packets, a block to update checksums on outgoing packets, separate ingress and egress pipelines of match-action processing, and a traffic manager (not programmable, but it performs the task of scheduling and replicating packets between input and output ports).
- Also has a set of standard metadata fields used by P4 program to direct the packet.
- There are other architectures that is supported Bmv2, but this is the one used by this class.
Linked from Computer Networks