Introduction to REST API in SDN
REST (Representational State Transfer) is a type of API that allows applications running on different hosts to exchange data using HTTP messages. In a controller-based networking environment, administrators use it to communicate with the northbound interface of the SDN.
There are two types of networking environments: traditional and controller-based. The traditional networking environment uses a flat network architecture. To configure or manage a device, you have to access it directly. The controller-based networking environment uses a hierarchical network architecture. It uses a controller device or software to configure or manage network devices. Since it uses software to manage networking devices, it is also called software-defined networking (SDN).
The controller software or device takes instructions from administrators and implements them on the network devices. It has two key components: a northbound interface and a southbound interface. It uses the southbound interface to connect to the network devices. It uses the northbound interface to connect to the administrator's application. The northbound interface uses the REST API to get instructions from the administrator's application.
REST (Representational State Transfer) is a resource-based API. It transfers a resource's state between a client and a server. The client requests a resource's state. The server provides the requested resource's state. Each offer includes all the information the client needs to complete the operation. REST API uses HTTP Verbs to receive and send data. An HTTP Verb is a command that performs a specific action. The following table lists the HTTP Verbs the REST API uses.
| HTTP Verb | Action | Description |
| POST | Create | Used to create a new record within the data. |
| GET | Read | Used to perform a call that reads data from the source. |
| PUT | Update/Replace | Used to update an existing record within the data. |
| DELETE | Delete | Used to delete a record from the data. |
REST API Example
The following image shows a simple SDN network.

The administrator sends HTTP GET requests to the SDN controller. On the Internet, browsers use HTTP GET requests to retrieve web pages. However, in SDN implementation, the application uses HTTP GET requests to identify an object on the SDN controller, typically a data structure that the application needs to learn and then process. For example, it might identify an object that lists physical interfaces on a specific network device along with the status of each. The controller sends back an HTTP GET response message with the object. The response message includes the information the application needs.
The main difference between a browser and an SDN application's HTTP requests is the format of the data they retrieve. Browsers receive web pages, while SDN applications receive structured data. Structured data contains variable names and their values in a format that the requesting application can easily use. JSON (JavaScript Object Notation) and XML (Extensible Markup Language) are standard data formats that applications use for network programmability.
There are six criteria for an API to be considered a RESTful API.
Client/Server
A RESTful API uses a client/server model to exchange information. Only clients can initiate connections and request something from a server.
Stateless
The server does not store any information from previous requests.
Cacheable
The server response includes a version number. Clients use it to decide whether they should use the cached information or make a new request.
Uniform Interface
Each resource must have its own unique URI and support resource representation. Resource representation describes how the server will transfer it to the clients. Usually, it uses JSON or XML to describe resources.
Layered System
It must support the layer system. It should allow administrators to add additional layers between the API and the server data, such as a firewall or a load balancer, without impacting operations.
Code on Demand
It should allow the server to send executable code responses to the client.
This tutorial is part of the tutorial "Network Automation and Programmability.". Other parts of this tutorial are as follows:
Chapter 01 Explain how automation impacts network management
Chapter 02 Compare traditional networks with controller-based networking
Chapter 03 Describe controller-based and software-defined architectures (overlay, underlay, and fabric)
Chapter 04 Separation of control plane and data plane
Chapter 05 North-bound and south-bound APIs
Chapter 06 Compare traditional campus device management with Cisco DNA Center-enabled device management
Chapter 07 Describe characteristics of REST-based APIs (CRUD, HTTP verbs, and data encoding)
Chapter 08 Recognize the capabilities of configuration management mechanisms Puppet, Chef, and Ansible
Chapter 09 Interpret JSON encoded data
Conclusion
RESTful APIs play a crucial role in facilitating communication within software-defined networking (SDN) environments. It uses HTTP messages for data exchange. A hierarchical architecture, client/server model, stateless interactions, and resource-based structure are a few other notable features of it. It provides the flexibility and scalability needed for modern networking solutions. Understanding its core components and how it works allows you to manage and configure devices efficiently.
Author Laxmi Goswami Updated on 2025-10-15