Computer Networking › Section E · The network layer: control plane › Topic E.4

The SDN control plane

Generalised forwarding gave switches flexible match-plus-action tables. Someone still has to decide what goes in them. In software-defined networking that someone is a controller: software with a view of the whole network, running applications that program every switch.

Four features of SDN

Software-defined networking rests on four ideas. First, flow-based forwarding: switches forward using the match-plus-action flow tables of Generalized forwarding and SDN, not just destination addresses. Second, separation of the data plane, the switches, from the control plane, the software that computes their tables. Third, control functions live outside the switches, in a logically centralised controller, which may itself run on many servers. Fourth, the network is programmable: routing, access control and load balancing are network-control applications written against the controller's interfaces. Compare this with the per-router control plane of OSPF and BGP, where every router runs its own protocol software.

The controller's three layers

An SDN controller can be pictured as three layers. At the bottom, a communication layer talks to the switches over a southbound interface; OpenFlow is the classic protocol here. In the middle, a network-wide state layer holds what the controller knows: links and their status, hosts, switch flow tables and their counters. At the top, a northbound interface, often a REST-style API, lets network-control applications read that state, be told of events and request changes. Applications, such as a routing app that runs Dijkstra or a firewall app, sit above the controller. Open-source controllers include OpenDaylight and ONOS.

Southbound messages

OpenFlow runs over TCP between switch and controller, and is often protected with TLS. Important controller-to-switch messages include: configuration, to query and set switch parameters; modify-state, to add, delete or change flow-table entries and set port properties; read-state, to collect counters from flow tables and ports; and send-packet, to make the switch transmit a packet supplied by the controller. Switch-to-controller messages include: packet-in, which passes the controller a packet that matched no entry, or an entry whose action says so; flow-removed, reporting that an entry expired or was deleted; and port-status, reporting that a port went up or down.

Worked example: a new flow arrives

A laptop sends the first packet of a connection to a server, and the access switch has no matching entry. 1. The table-miss entry sends the packet to the controller in a packet-in message. 2. The controller's state layer learns the laptop's address and port, and the event goes to the routing application. 3. The application computes a path to the server across three switches. 4. The controller sends a modify-state message to each switch, installing a match on this flow and a forward action out of the right port. 5. It returns the first packet with send-packet. Check: later packets of the flow are forwarded entirely in switch hardware; only the first one involved the controller.

Reacting to a failure

Failures follow a similar loop. When a link goes down, the switches at either end send port-status messages. The controller updates its network-wide link state, and applications that registered interest in link changes, such as the routing application, are notified. The routing application recomputes paths around the failure, and the controller sends modify-state messages to every switch whose table must change, perhaps also deleting entries that pointed at the dead link. The same pattern serves security: an application that spots a compromised host can ask the controller to install high-priority drop rules for that host's address on every edge switch within moments.

Centralised traffic engineering

A global view lets SDN do things distributed routing finds hard. Google's B4 network, described in 2013, links its data centres and uses central software to divide link capacity among traffic classes by priority, running links close to full. Plain OSPF routes all traffic for a destination along its least-cost path, so a single shortest path can overload while alternatives sit idle; changing weights moves everything at once. A controller can instead split one destination's traffic across paths and give each class a set rate. SD-WAN products apply the same idea to connect branch offices over several internet links, and cloud providers use SDN to build customers' virtual networks.

Worked example: sharing two paths

Data centre 1 sends to data centre 2 over a direct 100 Gbps path or a 40 Gbps path through data centre 3. Demands: high priority 70 Gbps, low priority 60 Gbps. 1. Shortest-path routing puts both on the direct path: 130 Gbps on a 100 Gbps link, so 30 Gbps must be dropped or queued. 2. The controller places the high-priority 70 Gbps on the direct path, leaving 30 Gbps spare. 3. It gives the low-priority class 30 Gbps on the direct path and 30 Gbps via data centre 3. 4. Result: direct path 100 Gbps, full; second path 30 of 40 Gbps, 75% used. Check: \(70 + 30 = 100\) and \(30 + 30 = 60\), so both demands are met.

Challenges

Centralisation brings its own problems. A controller is a single point of failure and a valuable target, so production controllers are replicated across servers, which then need consensus protocols to agree on the network state. Control traffic must be authenticated and encrypted, or an intruder could rewrite every table. Updates must be consistent: if some switches get new rules before others, packets can briefly loop or be dropped, so controllers stage changes carefully. Very large networks may need hierarchical or distributed controllers. Many real networks combine SDN with traditional protocols, for example running BGP at their borders.

Common mistakes to avoid

First, imagining the controller forwards every packet; switches forward in hardware, and only table misses or flagged packets reach it. Second, reading logically centralised as one physical machine; controllers are usually replicated. Third, confusing the southbound interface, to switches, with the northbound interface, to applications. Fourth, thinking SDN abolishes routing algorithms; a routing application still runs one, often Dijkstra, on the controller's view. Fifth, assuming a rule change takes effect everywhere at the same instant; inconsistent updates can cause brief loops. Sixth, mixing up packet-in, from switch to controller, with send-packet, from controller to switch.

Key takeaways

SDN uses flow-based forwarding, separates data and control planes, moves control into a logically centralised controller and makes the network programmable. A controller has a southbound communication layer, often OpenFlow over TCP, a network-wide state layer and a northbound API for applications such as routing and firewalls. OpenFlow messages include modify-state, read-state, configuration and send-packet from the controller, and packet-in, flow-removed and port-status from switches. A global view enables traffic engineering, as in Google's B4. Controllers must be replicated, secured and updated consistently.

Flashcards

Flashcard

SDN's four features

Flow-based forwarding, separated planes, external control, programmability

Contrast with per-router control.

Test your understanding

Question 1 of 5

A switch receives a packet that matches only its table-miss entry, which points to the controller. Which OpenFlow message carries the packet to the controller?

Question 2 of 5

What is the northbound interface of an SDN controller?

Question 3 of 5

A direct 100 Gbps path and a 40 Gbps alternative join two data centres. Demands are 70 Gbps (high priority) and 60 Gbps (low priority). How much low-priority traffic must use the alternative?

Question 4 of 5

Why are production SDN controllers usually run on several replicated servers?

Question 5 of 5

A link fails in an SDN network. Which sequence is correct?

← Previous topicNext topic →