In this sample chapter from CCNP and CCIE Security Core SCOR 350-701 Official Cert Guide, 2nd Edition, you will learn about Software-Defined Networking (SDN) and SDN Security, as well as an overview of network programmability and how networks are being managed using modern application programming interfaces (APIs) and other functions. This chapter covers SCOR 350-701 exam objectives 1.7-1.8.
This chapter covers the following topics:
Software-Defined Networking (SDN) and SDN Security
Network Programmability
This chapter starts with an introduction to SDN and different SDN security concepts, such as centralized policy management and micro-segmentation. This chapter also introduces SDN solutions such as Cisco ACI and modern networking environments such as Cisco DNA. You will also learn what network overlays are and what they are trying to solve.
The second part of this chapter provides an overview of network programmability and how networks are being managed using modern application programming interfaces (APIs) and other functions. This chapter also includes dozens of references that are available to enhance your learning.
The following SCOR 350-701 exam objectives are covered in this chapter:
Domain 1: Security Concepts
1.7 Explain northbound and southbound APIs in the SDN architecture
1.8 Explain DNA Center (DNAC) APIs for network provisioning, optimization, monitoring, and troubleshooting
“Do I Know This Already?” Quiz
The “Do I Know This Already?” quiz allows you to assess whether you should read this entire chapter thoroughly or jump to the “Exam Preparation Tasks” section. If you are in doubt about your answers to these questions or your own assessment of your knowledge of the topics, read the entire chapter. Table 3-1 lists the major headings in this chapter and their corresponding “Do I Know This Already?” quiz questions. You can find the answers in Appendix A, “Answers to the ‘Do I Know This Already?’ Quizzes and Q&A Sections.”
Table 3-1 “Do I Know This Already?” Section-to-Question Mapping
Foundation Topics Section |
Questions |
---|---|
Software-Defined Networking (SDN) and SDN Security |
1–5 |
Introduction to Network Programmability |
6–10 |
Which of the following are the three different “planes” in traditional networking?
The management, control, and data planes
The authorization, authentication, and accountability planes
The authentication, control, and data planes
None of these answers are correct.
Which of the following is true about Cisco ACI?
Spine nodes interconnect leaf devices, and they can also be used to establish connections from a Cisco ACI pod to an IP network or interconnect multiple Cisco ACI pods.
Leaf switches provide the Virtual Extensible LAN (VXLAN) tunnel endpoint (VTEP) function.
The APIC manages the distributed policy repository responsible for the definition and deployment of the policy-based configuration of the Cisco ACI infrastructure.
All of these answers are correct.
Which of the following is used to create network overlays?
SDN-Lane
VXLAN
VXWAN
None of these answers are correct.
Which of the following is an identifier or a tag that represents a logical segment?
VXLAN Network Identifier (VNID)
VXLAN Segment Identifier (VSID)
ACI Network Identifier (ANID)
Application Policy Infrastructure Controller (APIC)
Which of the following is network traffic between servers (virtual servers or physical servers), containers, and so on?
East-west traffic
North-south traffic
Micro-segmentation
Network overlays
Which of the following is an HTTP status code message range related to successful HTTP transactions?
Messages in the 100 range
Messages in the 200 range
Messages in the 400 range
Messages in the 500 range
Which of the following is a Python package that can be used to interact with REST APIs?
argparse
requests
rest_api_pkg
None of these answers are correct.
Which of the following is a type of API that exclusively uses XML?
APIC
REST
SOAP
GraphQL
Which of the following is a modern framework of API documentation and is now the basis of the OpenAPI Specification (OAS)?
SOAP
REST
Swagger
WSDL
Which of the following can be used to retrieve a network device configuration?
RESTCONF
NETCONF
SNMP
All of these answers are correct.
Software-Defined Networking (SDN) and SDN Security
In the last decade there have been several shifts in networking technologies. Some of these changes are due to the demand of modern applications in very diverse environments and the cloud. This complexity introduces risks, including network configuration errors that can cause significant downtime and network security challenges.
Subsequently, networking functions such as routing, optimization, and security have also changed. The next generation of hardware and software components in enterprise networks must support both the rapid introduction and the rapid evolution of new technologies and solutions. Network infrastructure solutions must keep pace with the business environment and support modern capabilities that help drive simplification within the network.
These elements have fueled the creation of software-defined networking (SDN). SDN was originally created to decouple control from the forwarding functions in networking equipment. This is done to use software to centrally manage and “program” the hardware and virtual networking appliances to perform forwarding.

Traditional Networking Planes
In traditional networking, there are three different “planes” or elements that allow network devices to operate: the management, control, and data planes. Figure 3-1 shows a high-level explanation of each of the planes in traditional networking.

Figure 3-1 The Management, Control, and Data Planes
The control plane has always been separated from the data plane. There was no central brain (or controller) that controlled the configuration and forwarding. Let’s take a look at the example shown in Figure 3-2. Routers, switches, and firewalls were managed by the command-line interface (CLI), graphical user interfaces (GUIs), and custom Tcl scripts. For instance, the firewalls were managed by the Adaptive Security Device Manager (ASDM), while the routers were managed by the CLI.

Figure 3-2 Traditional Network Management Solutions
Each device in Figure 3-2 has its “own brain” and does not really exchange any intelligent information with the rest of the devices.

So What’s Different with SDN?
SDN introduced the notion of a centralized controller. The SDN controller has a global view of the network, and it uses a common management protocol to configure the network infrastructure devices. The SDN controller can also calculate reachability information from many systems in the network and pushes a set of flows inside the switches. The flows are used by the hardware to do the forwarding. Here you can see a clear transition from a distributed “semi-intelligent brain” approach to a “central and intelligent brain” approach.
SDN changed a few things in the management, control, and data planes. However, the big change was in the control and data planes in software-based switches and routers (including virtual switches inside of hypervisors). For instance, the Open vSwitch project started some of these changes across the industry.
SDN provides numerous benefits in the management plane. These benefits are in both physical switches and virtual switches. SDN is now widely adopted in data centers. A great example of this is Cisco ACI.

Introduction to the Cisco ACI Solution
Cisco ACI provides the ability to automate setting networking policies and configurations in a very flexible and scalable way. Figure 3-3 illustrates the concept of a centralized policy and configuration management in the Cisco ACI solution.
The Cisco ACI scenario shown in Figure 3-3 uses a leaf-and-spine topology. Each leaf switch is connected to every spine switch in the network with no interconnection between leaf switches or spine switches.

Figure 3-3 Cisco APIC Configuration and Policy Management
The leaf switches have ports connected to traditional Ethernet devices (for example, servers, firewalls, routers, and so on). Leaf switches are typically deployed at the edge of the fabric. These leaf switches provide the Virtual Extensible LAN (VXLAN) tunnel endpoint (VTEP) function. VXLAN is a network virtualization technology that leverages an encapsulation technique (similar to VLANs) to encapsulate Layer 2 Ethernet frames within UDP packets (over UDP port 4789, by default).
In Cisco ACI, the IP address that represents the leaf VTEP is called the physical tunnel endpoint (PTEP). The leaf switches are responsible for routing or bridging tenant packets and for applying network policies.
Spine nodes interconnect leaf devices, and they can also be used to establish connections from a Cisco ACI pod to an IP network or to interconnect multiple Cisco ACI pods. Spine switches store all the endpoint-to-VTEP mapping entries. All leaf nodes connect to all spine nodes within a Cisco ACI pod. However, no direct connectivity is allowed between spine nodes or between leaf nodes.
The APIC can be considered a policy and a topology manager. APIC manages the distributed policy repository responsible for the definition and deployment of the policy-based configuration of the Cisco ACI infrastructure. APIC also manages the topology and inventory information of all devices within the Cisco ACI pod.

The following are additional functions of the APIC:
The APIC “observer” function monitors the health, state, and performance information of the Cisco ACI pod.
The “boot director” function is in charge of the booting process and firmware updates of the spine switches, leaf switches, and the APIC components.
The “appliance director” APIC function manages the formation and control of the APIC appliance cluster.
The “virtual machine manager (VMM)” is an agent between the policy repository and a hypervisor. The VMM interacts with hypervisor management systems (for example, VMware vCenter).
The “event manager” manages and stores all the events and faults initiated from the APIC and the Cisco ACI fabric nodes.
The “appliance element” maintains the inventory and state of the local APIC appliance.

VXLAN and Network Overlays
Modern networks and data centers need to provide load balancing, better scalability, elasticity, and faster convergence. Many organizations use the overlay network model. Deploying an overlay network allows you to tunnel Layer 2 Ethernet packets with different encapsulations over a Layer 3 network. The overlay network uses “tunnels” to carry the traffic across the Layer 3 fabric. This solution also needs to allow the “underlay” to separate network flows between different “tenants” (administrative domains). The solution also needs to switch packets within the same Layer 2 broadcast domain, route traffic between Layer 3 broadcast domains, and provide IP separation, traditionally done via virtual routing and forwarding (VRF).
There have been multiple IP tunneling mechanisms introduced throughout the years. The following are a few examples of tunneling mechanisms:
Virtual Extensible LAN (VXLAN)
Network Virtualization using Generic Routing Encapsulation (NVGRE)
Stateless Transport Tunneling (STT)
Generic Network Virtualization Encapsulation (GENEVE)
All of the aforementioned tunneling protocols carry an Ethernet frame inside an IP frame. The main difference between them is in the type of the IP frame used. For instance, VXLAN uses UDP, and STT uses TCP.
The use of UDP in VXLAN enables routers to apply hashing algorithms on the outer UDP header to load balance network traffic. Network traffic that is riding the overlay network tunnels is load balanced over multiple links using equal-cost multi-path routing (ECMP). This introduces a better solution compared to traditional network designs. In traditional network designs, access switches connect to distribution switches. This causes redundant links to block due to spanning tree.
VXLAN uses an identifier or a tag that represents a logical segment that is called the VXLAN Network Identifier (VNID). The logical segment identified with the VNID is a Layer 2 broadcast domain that is tunneled over the VTEP tunnels.
Figure 3-4 shows an example of an overlay network that provides Layer 2 capabilities.

Figure 3-4 Overlay Network Providing Layer 2 Capabilities
Figure 3-5 shows an example of an overlay network that provides Layer 3 routing capabilities.

Figure 3-5 Overlay Network Providing Layer 3 Routing Capabilities
Figure 3-6 illustrates the VXLAN frame format for your reference.

Figure 3-6 VXLAN Frame Format

Micro-Segmentation
For decades, servers were assigned subnets and VLANs. Sounds pretty simple, right? Well, this introduced a lot of complexities because application segmentation and policies were physically restricted to the boundaries of the VLAN within the same data center (or even in “the campus”). In virtual environments, the problem became harder. Nowadays applications can move around between servers to balance loads for performance or high availability upon failures. They also can move between different data centers and even different cloud environments.
Traditional segmentation based on VLANs constrains you to maintain the policies of which application needs to talk to which application (and who can access such applications) in centralized firewalls. This is ineffective because most traffic in data centers is now “East-West” traffic. A lot of that traffic does not even hit the traditional firewall. In virtual environments, a lot of the traffic does not even leave the physical server.

Let’s define what people refer to as “East-West” traffic and “North-South” traffic. “East-West” traffic is network traffic between servers (virtual servers or physical servers, containers, and so on).
“North-South” traffic is network traffic flowing in and outside the data center. Figure 3-7 illustrates the concepts of “East-West” and “North-South” traffic.

Figure 3-7 “East-West” and “North-South” Traffic
Many vendors have created solutions where policies applied to applications are independent from the location or the network tied to the application.
For example, let’s suppose that you have different applications running in separate VMs and those applications also need to talk to a database (as shown in Figure 3-8).

Figure 3-8 Applications in VMs
You need to apply policies to restrict if application A needs or does not need to talk to application B, or which application should be able to talk to the database. These policies should not be bound by which VLAN or IP subnet the application belongs to and whether it is in the same rack or even in the same data center. Network traffic should not make multiple trips back and forth between the applications and centralized firewalls to enforce policies between VMs.
Containers make this a little harder because they move and change more often. Figure 3-9 illustrates a high-level representation of applications running inside of containers (for example, Docker containers).

Figure 3-9 Applications in Containers
The ability to enforce network segmentation in those environments is called “micro-segmentation.” Micro-segmentation is at the VM level or between containers regardless of a VLAN or a subnet. Micro-segmentation solutions need to be “application aware.” This means that the segmentation process starts and ends with the application itself.
Most micro-segmentation environments apply a “zero-trust model.” This model dictates that users cannot talk to applications, and applications cannot talk to other applications unless a defined set of policies permits them to do so.

Open-Source Initiatives
Several open-source projects are trying to provide micro-segmentation and other modern networking benefits. Examples include the following:
Neutron from OpenStack
Open vSwitch (OVS)
Open Virtual Network (OVN)
OpenDaylight (ODL)
Open Platform for Network Function Virtualization (OPNFV)
Contiv
The concept of SDN is very broad, and every open-source provider and commercial vendor takes it in a different direction. The networking component of OpenStack is called Neutron. Neutron is designed to provide “networking as a service” in private, public, and hybrid cloud environments. Other OpenStack components, such as Horizon (Web UI) and Nova (compute service), interact with Neutron using a set of APIs to configure the networking services. Neutron uses plug-ins to deliver advanced networking capabilities and allow third-party vendor integration. Neutron has two main components: the neutron server and a database that handles persistent storage and plug-ins to provide additional services. Additional information about Neutron and OpenStack can be found at .
OVN was originally created by the folks behind Open vSwitch (OVS) for the purpose of bringing an open-source solution for virtual network environments and SDN. Open vSwitch is an open-source implementation of a multilayer virtual switch inside the hypervisor.
OVN is often used in OpenStack implementations with the use of OVS. You can also use OVN with the OpenFlow protocol. OpenStack Neutron uses OVS as the default “control plane.”
OpenDaylight (ODL) is another popular open-source project that is focused on the enhancement of SDN controllers to provide network services across multiple vendors. OpenDaylight participants also interact with the OpenStack Neutron project and attempt to solve the existing inefficiencies.
OpenDaylight interacts with Neutron via a northbound interface and manages multiple interfaces southbound, including the Open vSwitch Database Management Protocol (OVSDB) and OpenFlow.

So, what is a northbound and southbound API? In an SDN architecture, southbound APIs are used to communicate between the SDN controller and the switches and routers within the infrastructure. These APIs can be open or proprietary.
Southbound APIs enable SDN controllers to dynamically make changes based on real-time demands and scalability needs. OpenFlow and Cisco OpFlex provide southbound API capabilities.
Northbound APIs (SDN northbound APIs) are typically RESTful APIs that are used to communicate between the SDN controller and the services and applications running over the network. Such northbound APIs can be used for the orchestration and automation of the network components to align with the needs of different applications via SDN network programmability. In short, northbound APIs are basically the link between the applications and the SDN controller. In modern environments, applications can tell the network devices (physical or virtual) what type of resources they need and, in turn, the SDN solution can provide the necessary resources to the application.
Cisco has the concept of intent-based networking. On different occasions, you may see northbound APIs referred to as “intent-based APIs.”

More About Network Function Virtualization
Network virtualization is used for logical groupings of nodes on a network. The nodes are abstracted from their physical locations so that VMs and any other assets can be managed as if they are all on the same physical segment of the network. This is not a new technology. However, it is still one that is key in virtual environments where systems are created and moved despite their physical location.
Network Functions Virtualization (NFV) is a technology that addresses the virtualization of Layer 4 through Layer 7 services. These include load balancing and security capabilities such as firewall-related features. In short, with NFV, you convert certain types of network appliances into VMs. NFV was created to address the inefficiencies that were introduced by virtualization.
NFV allows you to create a virtual instance of a virtual node such as a firewall that can be deployed where it is needed, in a flexible way that’s similar to what you do with a traditional VM.
Open Platform for Network Function Virtualization (OPNFV) is an open-source solution for NFV services. It aims to be the base infrastructure layer for running virtual network functions. You can find detailed information about OPNFV at opnfv.org.
NFV nodes such as virtual routers and firewalls need an underlying infrastructure:
A hypervisor to separate the virtual routers, switches, and firewalls from the underlying physical hardware. The hypervisor is the underlying virtualization platform that allows the physical server (system) to operate multiple VMs (including traditional VMs and network-based VMs).
A virtual forwarder to connect individual instances.
A network controller to control all of the virtual forwarders in the physical network.
A VM manager to manage the different network-based VMs.
Figure 3-10 demonstrates the high-level components of the NFV architecture.

Figure 3-10 NFV Architecture
Several NFV infrastructure components have been created in open community efforts. On the other hand, traditionally, the actual integration has so far remained a “private” task. You’ve either had to do it yourself, outsource it, or buy a pre-integrated system from some vendor, keeping in mind that the systems integration undertaken is not a one-time task. OPNFV was created to change the NFV ongoing integration task from a private solution into an open community solution.
NFV MANO
NFV changes the way networks are managed. NFV management and network orchestration (MANO) is a framework and working group within the European Telecommunications Standards Institute (ETSI) Industry Specification Group for NFV (ETSI ISG NFV). NFV MANO is designed to provide flexible onboarding of network components. NFV MANO is divided into the three functional components listed in Figure 3-11.

Figure 3-11 NFV MANO Functional Components
The NFV MANO architecture is integrated with open application program interfaces (APIs) in the existing systems. The MANO layer works with templates for standard VNFs. It allows implementers to pick and choose from existing NFV resources to deploy their platform or element.
Contiv
Contiv is an open-source project that allows you to deploy micro-segmentation policy-based services in container environments. It offers a higher level of networking abstraction for microservices by providing a policy framework. Contiv has built-in service discovery and service routing functions to allow you to scale out services.
With Contiv you can assign an IP address to each container. This feature eliminates the need for host-based port NAT. Contiv can operate in different network environments such as traditional Layer 2 and Layer 3 networks, as well as overlay networks.
Contiv can be deployed with all major container orchestration platforms (or schedulers) such as Kubernetes and Docker Swarm. For instance, Kubernetes can provide compute resources to containers and then Contiv provides networking capabilities.
The Netmaster and Netplugin (Contiv host agent) are the two major components in Contiv. Figure 3-12 illustrates how the Netmaster and the Netplugin interact with all the underlying components of the Contiv solution.

Figure 3-12 Contiv Netmaster and Netplugin (Contiv Host Agent) Components
ThousandEyes Integration
ThousandEyes, the leading network intelligence Software as a Service (SaaS) platform, has taken its partnership with Cisco to the next level. The integration of ThousandEyes into the Cisco Nexus 9000 Series data center switches, powered by NX-OS/Data Center Network Manager (DCNM), and its integration into Cisco ACI fabrics, delivers a powerful combination of network visibility and control.
With the Cisco ThousandEyes Enterprise Agent (TEA), users can now monitor their network’s performance from a global perspective, utilizing a range of tests to assess BGP routing, DNS resolution, browser response times, network pathing and connectivity, routing status, and VoIP streaming quality. This integration offers unparalleled insight and control to help organizations optimize their network performance. ThousandEyes provides numerous monitoring capabilities including the following:
API Monitoring
BGP Monitoring
CDN Monitoring
Customer Digital Experience
DDoS Monitoring
DNS Monitoring
Enterprise Digital Experience
Hybrid WAN Monitoring
Network Device Monitoring
Network Monitoring
IaaS Monitoring
ISP Monitoring
Multi-cloud Monitoring
SaaS Monitoring
SD-WAN Monitoring
VPN Monitoring
Website Monitoring
Wi-Fi and LAN Monitoring
Cisco Digital Network Architecture (DNA)
Cisco DNA is a solution created by Cisco that is often referred to as the “intent-based networking” solution. Cisco DNA provides automation and assurance services across campus networks, wide area networks (WANs), and branch networks. Cisco DNA is based on an open and extensible platform and provides the policy, automation, and analytics capabilities, as illustrated in Figure 3-13.

Figure 3-13 Cisco DNA High-Level Architecture
The heart of the Cisco DNA solution is Cisco DNA Center (DNAC). DNAC is a command-and-control element that provides centralized management via dashboards and APIs. Figure 3-14 shows one of the many dashboards of Cisco DNA Center (the Network Hierarchy dashboard).

Figure 3-14 Cisco DNA Center Network Hierarchy Dashboard
Cisco DNA Center can be integrated with external network and security services such as the Cisco Identity Services Engine (ISE). Figure 3-15 shows how the Cisco ISE is configured as an authentication, authorization, and accounting (AAA) server in the Cisco DNA Center Network Settings screen.

Figure 3-15 Cisco DNA Center Integration with Cisco ISE for AAA Services
Cisco DNA Policies
The following are the policies you can create in the Cisco DNA Center:
Group-based access control policies
IP-based access control policies
Application access control policies
Traffic copy policies
Figure 3-16 shows the Cisco DNA Center Policy Overview dashboard matrix visualization. Here, you can see the number of active policies based on the security groups, Cisco Identity Services Engine (ISE) profiles, and Cisco Secure Network Analytics (formerly known as Stealthwatch) host groups. Using the dashboard shown in Figure 3-16, you can create new policies.

Figure 3-16 Cisco DNA Center Policy Overview Dashboard
Figure 3-17 shows the policy analytics for the ISE profiles. Cisco DNA Center empowers you with intelligence and analytics to make informed decisions about your network. With its visual representation of communication between assets, you can easily create group-based policies, evaluate the effects of new access controls, and determine the precise protocols that should be included in your policies. This comprehensive solution provides you with a clear understanding of your network, enabling you to take control and optimize its performance.

Figure 3-17 Policy Analytics for the ISE Profiles in DNA Center
Figure 3-18 shows the policy matrix. The matrix view enables you to have a comprehensive overview of all the source and destination policies and grasp the overall policy structure. You can view, create, and modify access control policies from the policy matrix view itself.

Figure 3-18 DNA Center Policy Matrix
The matrix view has two components:
Source axis: The vertical axis displays a list of all the source security groups.
Destination axis: The horizontal axis presents a list of all the destination security groups.
By hovering over a cell, you can view the policy for a specific combination of source and destination security groups. The color of a cell represents the policy that is in effect, with the following color coding:
Allow: Green
Block: Red
Custom: Gold
Default: Gray
Cisco DNA Group-Based Access Control Policy
When you configure group-based access control policies, you need to integrate the Cisco ISE with Cisco DNA Center, as you learned previously in this chapter. In Cisco ISE, you configure the work process setting as “Single Matrix” so that there is only one policy matrix for all devices in the TrustSec network. You will learn more about Cisco TrustSec and Cisco ISE in Chapter 4, “Authentication, Authorization, Accounting (AAA) and Identity Management.”
Depending on your organization’s environment and access requirements, you can segregate your groups into different virtual networks to provide further segmentation.
After Cisco ISE is integrated in Cisco DNA Center, the scalable groups that exist in Cisco ISE are propagated to Cisco DNA Center. If a scalable group that you need does not exist, you can create it in Cisco ISE.
Cisco DNA Center has the concept of access control contracts. A contract specifies a set of rules that allow or deny network traffic based on such traffic matching particular protocols or ports. Figure 3-19 shows a new contract being created in Cisco DNA Center to allow SSH access (TCP port 22).
To create a contract, navigate to Policy > Group-Based Access Control > Access Contract and click Add Contract. The dialog box shown in Figure 3-19 will be displayed.

Figure 3-19 Adding a Cisco DNA Center Contract
Figure 3-20 shows an example of how to create a group-based access control policy.

Figure 3-20 Adding a Cisco DNA Center Group-Based Access Control Policy
In Figure 3-20, an access control policy named omar_policy_1 is configured to deny traffic from all users and related devices in the group called Guests to any user or device in the Finance group.
Cisco DNA IP-Based Access Control Policy
You can also create IP-based access control policies in Cisco DNA Center. To create IP-based access control policies, navigate to Policy > IP Based Access Control > IP Based Access Control Policies, as shown in Figure 3-21.

Figure 3-21 Adding a Cisco DNA Center IP-Based Access Control Policy
In the example shown in Figure 3-21, a policy is configured to permit Omar’s PC to communicate with h4cker.org.
You can also associate these policies to specific wireless SSIDs. The corp-net SSID is associated to the policy entry in Figure 3-21.
Cisco DNA Application Policies
Application policies can be configured in Cisco DNA Center to provide Quality of Service (QoS) capabilities. The following are the Application Policy components you can configure in Cisco DNA Center:
Applications
Application sets
Application policies
Queuing profiles
Applications in Cisco DNA Center are the software programs or network signaling protocols that are being used in your network.
Applications can be grouped into logical groups called application sets. These application sets can be assigned a business relevance within a policy.
You can also map applications to industry standard-based traffic classes, as defined in RFC 4594.
Cisco DNA Traffic Copy Policy
You can also use an Encapsulated Remote Switched Port Analyzer (ERSPAN) configuration in Cisco DNA Center so that the IP traffic flow between two entities is copied to a given destination for monitoring or troubleshooting. In order for you to configure ERSPAN using Cisco DNA Center, you need to create a traffic copy policy that defines the source and destination of the traffic flow you want to copy. To configure a traffic copy policy, navigate to Policy > Traffic Copy > Traffic Copy Policies, as shown in Figure 3-22.

Figure 3-22 Adding a Traffic Copy Policy
You can also define a traffic copy contract that specifies the device and interface where the copy of the traffic is sent.
Cisco DNA Center Assurance Solution
The Cisco DNA Center Assurance solution allows you to get contextual visibility into network functions with historical, real-time, and predictive insights across users, devices, applications, and the network. The goal is to provide automation capabilities to reduce the time spent on network troubleshooting.
Figure 3-23 shows the Cisco DNA Center Assurance Overall Health dashboard.

Figure 3-23 The Cisco DNA Center Assurance Overall Health Dashboard
The Cisco DNA Center Assurance solution allows you to investigate different networkwide (global) issues, as shown in Figure 3-24.

Figure 3-24 The Cisco DNA Center Assurance Top 10 Issues Types
The Cisco DNA Center Assurance solution also allows you to configure sensors to test the health of wireless networks. A wireless network includes access point (AP) radios, WLAN configurations, and wireless network services. Sensors can be dedicated or on-demand sensors. A dedicated sensor is when an AP is converted into a sensor, and it stays in sensor mode (is not used by wireless clients) unless it is manually converted back into AP mode. An on-demand sensor is when an AP is temporarily converted into a sensor to run tests. After the tests are complete, the sensor goes back to AP mode. Figure 3-25 shows statistics about wired and wireless clients.

Figure 3-25 The Cisco DNA Center Wireless and Wired Client Statistics

Cisco DNA Center APIs
One of the key benefits of the Cisco DNA Center is the comprehensive available APIs (aka Intent APIs). The Intent APIs are northbound REST APIs that expose specific capabilities of the Cisco DNA Center platform. These APIs provide policy-based abstraction of business intent, allowing you to focus on an outcome to achieve instead of struggling with the mechanisms that implement that outcome. The APIs conform to the REST API architectural style and are simple, extensible, and secure to use.
Cisco DNA Center also has several integration APIs. These integration capabilities are part of westbound interfaces. Cisco DNA Center also allows administrators to manage their non-Cisco devices. Multivendor support comes to Cisco DNA Center through the use of an SDK that can be used to create device packages for third-party devices. A device package enables Cisco DNA Center to communicate with third-party devices by mapping Cisco DNA Center features to their southbound protocols.
Cisco DNA Center also has several events and notifications services that allow you to capture and forward Cisco DNA Assurance and Automation (SWIM) events to third-party applications via a webhook URL.
All Cisco DNA Center APIs conform to the REST API architectural styles.
You can view information about all the Cisco DNA Center APIs by clicking the Platform tab and navigating to Developer Toolkit > APIs.

Cisco is always expanding the capabilities of the Cisco DNA Center APIs. Please study and refer to the following API documentation and tutorials for the most up-to-date capabilities: and .

Cisco DNA Security Solution
The Cisco DNA Security solution supports several other security products and operations that allow you to detect and contain cybersecurity threats. One of the components of the Cisco DNA Security solution is the Encrypted Traffic Analytics (ETA) solution. Cisco ETA allows you to detect security threats in encrypted traffic without decrypting the packets. It is able to do this by using machine learning and other capabilities. To use Encrypted Traffic Analytics, you need one of the following network devices along with Cisco Secure Network Analytics (formerly known as Stealthwatch):
Catalyst 9000 switches
ASR 1000 Series routers
ISR 4000 Series routers
CSR 1000V Series virtual routers
ISR 1000 Series routers
Catalyst 9800 Series wireless controllers
Cisco Secure Network Analytics provides network visibility and security analytics to rapidly detect and contain threats. You will learn more about the Cisco Secure Network Analytics solution in Chapter 5, “Network Visibility and Segmentation.”
As you learned in previous sections of this chapter, the Cisco TrustSec solution and Cisco ISE enable you to control networkwide access, enforce security policies, and help meet compliance requirements.
Cisco DNA Multivendor Support
Cisco DNA Center now allows customers to manage their non-Cisco devices. Multivendor support comes to Cisco DNA Center through the use of an SDK that can be used to create device packages for third-party devices. A device package enables Cisco DNA Center to communicate with third-party devices by mapping Cisco DNA Center features to their southbound protocols. Multivendor support capabilities are based on southbound interfaces. These interfaces interact directly with network devices by means of CLI, SNMP, or NETCONF.
Introduction to Network Programmability
As you were able to see in previous sections of this chapter, learning to code and work with programmable infrastructures is very important in today’s environment. You saw the value of using APIs. Whether you have configured large networks in the past or are just getting started, you know that this probably involved a lot of clicking, typing, copying-and-pasting, and many repetitive tasks. Nowadays, modern APIs enable you to complete powerful tasks, reduce all the repetitive work, and save time.
Using APIs, you can make requests like the ones shown in Figure 3-26 in a very simple way.

Figure 3-26 Using Network Infrastructure Device APIs

Modern Programming Languages and Tools
Modern programming languages like JavaScript, Python, Go, Swift, and others are more flexible and easier to learn than their predecessors. You might wonder what programming language you should learn first. Python is one of the programming languages recommended to learn first—not only for network programmability, but for many other scenarios.
Combining programming capabilities with developer tools like Git (GitHub or GitLab repositories), package management systems, virtual environments, and integrated development environments (IDEs) allows you to create your own set of powerful tools and workflows.
Another amazing thing is the power of code reuse and online communities. In the past, when you wanted to create some program, you often had to start “from scratch.” For example, if you wanted to just make an HTTPS web request, you had to create code to open a TCP connection over port 443, perform the TLS negotiation, exchange and validate certificates, and format and interpret HTTP requests and responses.
Nowadays, you can just use open-source software in GitHub or simply use packages such as the Python requests package, as shown in Figure 3-27.

Figure 3-27 Installing the Python Requests Package Using pip
In Figure 3-27, the Python package called requests is installed using the package manager for Python called pip (). The requests library allows you to make HTTP/HTTPS requests in Python very easily.
Now that you have the requests package installed, you can start making HTTP requests, as shown in Figure 3-28.

Figure 3-28 Using the Python Requests Package
In Figure 3-28, the interactive Python shell (interpreter) is used to use (import) the requests package and send an HTTP GET request to the website at . The HTTP GET request is successful and the 200 message/response is shown.
Additional information about the Python interpreter can be found at and .
When HTTP servers and browsers communicate with each other, they perform interactions based on headers as well as body content. The HTTP Request has the following structure:
The METHOD, which in this example is an HTTP GET. However, the HTTP methods can be the following:
GET: Retrieves information from the server.
HEAD: Basically, this is the same as a GET, but it returns only HTTP headers and no document body.
POST: Sends data to the server (typically using HTML forms, API requests, and the like).
TRACE: Does a message loopback test along the path to the target resource.
PUT: Uploads a representation of the specified URI.
DELETE: Deletes the specified resource.
OPTIONS: Returns the HTTP methods that the server supports.
CONNECT: Converts the request connection to a transparent TCP/IP tunnel.
The URI and the path-to-resource field represent the path portion of the requested URL.
The request version-number field specifies the version of HTTP used by the client.
The user agent is Chrome in this example, and it was used to access the website. In the packet capture, you see the following:
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36\r\n.
Next, you see several other fields like accept, accept-language, accept encoding, and others.
The server, after receiving this request, generates a response.
The server response has a three-digit status code and a brief human-readable explanation of the status code. Then below you see the text data (which is the HTML code coming back from the server and displaying the website contents).

DevNet
DevNet is a platform created by Cisco that has numerous resources for network and application developers. DevNet is an amazing resource that includes many tutorials, free video courses, sandboxes, learning paths, and sample code to interact with many APIs. You can access DevNet at .
If you are new to programming and network programmability, you can take advantage of the following DevNet tutorials and learning paths:
Introduction to Coding and APIs:
Network Programmability Basics Video Course:
Parsing JSON using Python:
DevNet GitHub Repositories:
DevNet Developer Videos:
DevNet Git Tutorials:
DevNet ACI Programmability:
Build Applications with Cisco:
IOS-XE Programmability:
Network Programmability for Network Engineers:

Getting Started with APIs
APIs are used everywhere these days. A large number of modern applications use some type of APIs because they make access available to other systems to interact with the application. There are few methods or technologies behind modern APIs:
Simple Object Access Protocol (SOAP): SOAP is a standards-based web services access protocol that was originally developed by Microsoft and has been used by numerous legacy applications for many years. SOAP exclusively uses XML to provide API services. XML-based specifications are governed by XML Schema Definition (XSD) documents. SOAP was originally created to replace older solutions such as the Distributed Component Object Model (DCOM) and Common Object Request Broker Architecture (CORBA). You can find the latest SOAP specifications at .
Representational State Transfer (REST): REST is an API standard that is easier to use than SOAP. It uses JSON instead of XML, and it uses standards like Swagger and the OpenAPI Specification () for ease of documentation and to help with adoption.
GraphQL and queryable APIs: This is another query language for APIs that provides many developer tools. GraphQL is now used for many mobile applications and online dashboards. Many languages support GraphQL. You can learn more about GraphQL at .
APIs often provide a roadmap describing the underlying implementation of an application. API documentation can provide a great level of detail that can be very valuable to security professionals. These types of documentation include the following:
Swagger (OpenAPI): Swagger is a modern framework of API documentation and is now the basis of the OpenAPI Specification (OAS). Additional information about Swagger can be obtained at . The OAS specification is available at .
Web Services Description Language (WSDL) documents: WSDL is an XML-based language that is used to document the functionality of a web service. The WSDL specification can be accessed at .
Web Application Description Language (WADL) documents: WADL is also an XML-based language for describing web applications. The WADL specification can be obtained from .

REST APIs
Let’s take a look at a quick example of a REST API. There is a sample API you can use to perform several tests at . In Figure 3-29, the Linux curl utility is used to retrieve a “new deck of cards” from the Deck of Cards API. The API “shuffles” a deck of cards for you. The deck ID (deck_id) is wkc12q20frlh in this example.

Figure 3-29 Using curl to Obtain Information from an API
Suppose that you want to draw a random card from the deck. Since you have the deck ID, you can easily use the command shown in Figure 3-30 to draw a random card.

Figure 3-30 Using curl to Obtain Additional Information from the Deck of Cards API
You can see the response (in JSON), including the remaining number of cards and the card that was retrieved (the 9 of spades). Other information, such as the code, suit, value, and images of the card, is also included in the JSON output.
Example 3-1 shows a Python script that you can use to interact with the Deck of Cards API.
Example 3-1 Sample Python Script to Interact with the Deck of Cards API
#!/usr/bin/python import requests deck_id = None def create_deck(): global deck_id deck_url = "none" deck_response = requests.get(deck_url) deck_data = deck_response.json() deck_id = deck_data['deck_id'] print("New deck created with ID:", deck_id) def shuffle_deck(): shuffle_url = f"https://deckofcardsapi.com/api/deck/{deck_id}/shuffle/" requests.get(shuffle_url) print("Deck shuffled") def draw_card(): draw_url = f"https://deckofcardsapi.com/api/deck/{deck_id}/draw/?count=1" draw_response = requests.get(draw_url) draw_data = draw_response.json() if len(draw_data['cards']) > 0: card = draw_data['cards'][0] print("The card is a {} of {}".format(card['value'], card['suit'])) else: print("No more cards in the deck") def add_jokers(): jokers_url = f"https://deckofcardsapi.com/api/deck/{deck_id}/jokers/?count=2" requests.get(jokers_url) print("Jokers added to the deck") # Display the menu while True: print("Omar's Example with the Deck of Cards API. Please select from the following menu:") print("1. Create a new deck") print("2. Shuffle the deck") print("3. Draw a card") print("4. Add jokers to the deck") print("5. Quit") choice = input("Enter your choice: ") if choice == "1": create_deck() elif choice == "2": shuffle_deck() elif choice == "3": draw_card() elif choice == "4": add_jokers() elif choice == "5": print("Goodbye!") break else: print("Invalid choice. Please try again.")
The script in Example 3-1 starts by importing the requests module, which is used to send HTTP requests to the Deck of Cards API. If you do not have the requests module installed, you can easily install it with the pip3 install requests command. The script defines a global variable called deck_id, which will store the ID of the deck that the user creates. It also defines four functions: create_deck(), shuffle_deck(), draw_card(), and add_jokers(). Each function corresponds to one of the actions that the user can select from the menu.
The create_deck() function sends an HTTP GET request to the API endpoint to create a new deck of cards. It then extracts the ID of the deck from the JSON response and saves it in the deck_id variable. The shuffle_deck() function sends an HTTP GET request to the API endpoint https://deckofcardsapi.com/api/deck/{deck_id}/shuffle/ to shuffle the deck. The draw_card() function sends an HTTP GET request to the API endpoint https://deckofcardsapi.com/api/deck/{deck_id}/draw/?count=1 to draw a single card from the deck. It extracts information about the card from the JSON response and prints it to the console. The add_jokers() function sends an HTTP GET request to the API endpoint https://deckofcardsapi.com/api/deck/{deck_id}/jokers/?count=2 to add two jokers to the deck.
The script defines a menu that displays the available actions to the user and prompts the user to enter a choice. It uses a while loop to repeatedly display the menu to the user until the user chooses to quit. When the user selects an action from the menu, the script executes the appropriate function based on the user’s choice. After sending the HTTP request, each function extracts information from the JSON response, if necessary, and prints a message to the console indicating that the action was completed. If the user enters an invalid choice, the script prints an error message to the console and displays the menu again.
Using Network Device APIs
Earlier in this chapter you learned that there are several API resources available in many Cisco solutions such as the Cisco DNA Center. The following are a few basic available API resources on the Cisco DNA Center Platform (10.1.1.1 is the IP address of the Cisco DNA Center):
: Used to get and encapsulate user identity and role information as a single value.
: Used to get the list of the first 500 network devices sorted lexicographically based on host name.
: Used to get information about every interface on every network device.
: Used to get the name of a host, the ID of the VLAN that the host uses, the IP address of the host, the MAC address of the host, the IP address of the network device to which the host is connected, and more.
: Used to trace a path between two IP addresses. The function will wait for analysis to complete, and return the results.
There are a dozen (or dozens?) more APIs that you can use and interact with Cisco DNA Center at . Many other Cisco products include APIs that can be used to integrate third-party applications, obtain information similar to the preceding examples, as well as change the configuration of the device, apply policies, and more. Many of those APIs are also documented in DevNet (developer.cisco.com).
Modern networking devices support programmable capabilities such as NETCONF, RESTCONF, and YANG models. The following sections provide details about these technologies.

YANG Models
YANG is an API contract language used in many networking devices. In other words, you can use YANG to write a specification for what the interface between a client and networking device (server) should be on a particular topic. YANG was originally defined in RFC 6020 ().
A YANG model typically concentrates on the data that a client processes using standardized operations.
Figure 3-31 shows an example of a network management application (client) interacting with a router (server) using YANG as the API contract.

Figure 3-31 A Basic YANG Example
A YANG-based server (as shown in Figure 3-31) publishes a set of YANG modules, which taken together form the system’s YANG model. The YANG modules specify what a client can do. The following are a few examples of what a client can do using different YANG models:
Configure: For example, enabling a routing protocol or a particular interface.
Receive notifications: An example of notifications can be repeated login failures, interface failures, and so on.
Monitor status: For example, retrieving information about CPU and memory utilization, packet counters, and so on.
Invoke actions: For instance, resetting packet counters, rebooting the system, and so on.
The YANG language provides flexibility and extensibility capabilities that are not present in other model languages. When you create new YANG modules, you can leverage the data hierarchies defined in other modules. YANG also permits new statements to be defined, allowing the language itself to be expanded in a consistent way.

NETCONF
NETCONF is defined in RFCs 6241 and 6242. NETCONF was created to overcome the challenges in legacy Simple Network Management Protocol (SNMP) implementations.
A NETCONF client typically has the role of a network management application. The NETCONF server is a managed network device (router, switch, and so on). You can also have intermediate systems (often called “controllers”) that control a particular aspect or domain. Controllers can act as a server to its managers and as a client to its networking devices, as shown in Figure 3-32.

Figure 3-32 NETCONF Clients, Servers, and Controllers
In Figure 3-32, a node called a “Manager” manages a NETCONF server (router) and two “Controllers,” which are both a server for the Manager and a client for the other network devices (routers).
NETCONF sessions established from a NETCONF client to a NETCONF server consist of a sequence of messages. Both parties send a “hello” message when they initially connect. All message exchanges are initiated by the NETCONF client. The hello message includes which NETCONF protocol version(s) the devices support. The server states which optional capabilities it supports.
NETCONF messages are either a remote procedure call (RPC) or an “rpc-reply.” Each RPC is a request from the client to the server to execute a given operation. The NETCONF rpc-reply is sent by the server when it has completed or failed to complete the request. Some NETCONF rpc-replies are short answers to a simple query, or just an OK that the order was executed. Some are long and may contain the entire device configuration or status. NETCONF rpc-replies to subscriptions consist of a message that technically never ends. Other information of the rpc-reply is generated by the server. A NETCONF rpc-reply may also be a NETCONF rpc-error, indicating that the requested operation failed.
NETCONF messages are encoded in an XML-based structure defined by the NETCONF standard. The NETCONF communication is done over Secure Shell (SSH), but using a default TCP port 830. This can be configured to a different port.
SSH supports a subsystem concept. NETCONF has its own subsystem: netconf. Figure 3-33 shows how you can connect to a networking device (in this case, a CSR-1000v router configured with the hostname ios-xe-mgmt.cisco.com). The username of the router is root. You are also asked to provide a password. The router is configured for NETCONF over TCP port 10000.

Figure 3-33 Using the NETCONF SSH Subsystem
An open-source Python library for NETCONF clients called ncclient is available on GitHub at . You can install it using Python pip, as shown here:
pip install ncclient
There are several sample scripts at the DevNet GitHub repositories that can help you get started at .

RESTCONF
You already learned that REST is a type of modern API. Many network administrators wanted to have the capabilities of NETCONF over “REST.” This is why a REST-based variant of NETCONF was created. RESTCONF is now supported in many networking devices in the industry.
RESTCONF is defined in RFC 8040 and it follows the REST principles. However, not all REST-based APIs are compatible or even comparable to RESTCONF.
The RESTCONF interface is built around a small number of standardized requests (GET, PUT, POST, PATCH, and DELETE). Several of the REST principles are similar to NETCONF:
The client-server model
The layered system principle
The first two uniform interface principles
One of the differences between RESTCONF and NETCONF is the stateless server principle. NETCONF is based on clients establishing a session to the server (which is not stateless). NETCONF clients frequently connect and then manipulate the candidate datastore with a number of edit-config operations. The NETCONF clients may also send a validation call to NETCONF servers. This is different in RESTCONF.
RESTCONF requires the server to keep some client state. Any request the RESTCONF client sends is acted upon by the server immediately. You cannot send any transactions that span multiple RESTCONF messages. Subsequently, some of the key features of NETCONF (including networkwide transactions) are not possible in RESTCONF.
Let’s take a look at a quick example of using RESTCONF. Example 3-2 shows a Python script that is used to obtain the details of all interfaces in a networking device using RESTCONF.
Example 3-2 Python Script to Retrieve Interface Details from a Networking Device Using RESTCONF
#!/usr/bin/python import requests import sys # disable warnings from SSL/TLS certificates requests.packages.urllib3.disable_warnings() # the IP address or hostname of the networking device HOST = 'ios-xe-mgmt.cisco.com' # use your user credentials to access the networking device USER = 'root' PASS = 'supersecretpassword' # create a main() method def main(): """Main method that retrieves the interface details from a networking device via RESTCONF.""" # RESTCONF url of the networking device url="https://{h}:9443/restconf/data/ietf- interfaces:interfaces".format(h=HOST) # RESTCONF media types for REST API headers headers = {'Content-Type': 'application/yang-data+json', 'Accept': 'application/yang-data+json'} # this statement performs a GET on the specified url response = requests.get(url, auth=(USER, PASS), headers=headers, verify=False) # print the json that is returned print(response.text) if __name__ == '__main__': sys.exit(main())
Figure 3-34 shows the output of the Python script, including the information of all the interfaces in that networking device (ios-xe-mgmt.cisco.com).

Figure 3-34 Using Python to Obtain Information from a Network Device Using RESTCONF
OpenConfig and gNMI
The OpenConfig consortium () is a collaborative effort to provide vendor-neutral data models (in YANG) for network devices. OpenConfig uses the gRPC Network Management Interface (gNMI). The following GitHub repository includes detailed information about gNMI, as well as sample code ().
The gNMI protocol is similar to NETCONF and RESTCONF. gNMI uses YANG models, but it can be used with other interface description languages (IDLs). The OpenConfig consortium defined several standard YANG models to go with the protocols. These YANG models describe many essential networking features such as interface configuration, routing protocols, QoS, Wi-Fi configurations, and more.
Exam Preparation Tasks
As mentioned in the section “Book Features” in the Introduction, you have a couple of choices for exam preparation: the exercises here, Chapter 12, “Final Preparation,” and the exam simulation questions in the Pearson Test Prep Software Online.
Review All Key Topics
Review the most important topics in this chapter, noted with the Key Topic icon in the outer margin of the page. Table 3-2 lists these key topics and the page numbers on which each is found.

Table 3-2 Key Topics for Chapter 3
Key Topic Element |
Description |
Page Number |
---|---|---|
Section |
Traditional Networking Planes |
113 |
Section |
So What’s Different with SDN? |
114 |
Section |
Introduction to the Cisco ACI Solution |
114 |
List |
Understand the functions of the APIC |
116 |
Section |
VXLAN and Network Overlays |
116 |
Paragraph |
Understand what is micro-segmentation |
118 |
Paragraph |
Understand “east-west” traffic and “north-south” traffic |
118 |
Section |
Open-Source Initiatives |
120 |
Paragraph |
Understand northbound and southbound APIs |
121 |
Section |
More About Network Function Virtualization |
121 |
Section |
Cisco DNA Center APIs |
135 |
Tip |
Cisco DNA Center APIs in DevNet |
135 |
Section |
Cisco DNA Security Solution |
135 |
Section |
Modern Programming Languages and Tools |
137 |
Section |
DevNet |
140 |
Section |
Getting Started with APIs |
140 |
Section |
REST APIs |
141 |
Section |
YANG Models |
145 |
Section |
NETCONF |
147 |
Section |
RESTCONF |
149 |
Define Key Terms
Define the following key terms from this chapter and check your answers in the glossary:
Representational State Transfer (REST)
Simple Object Access Protocol (SOAP)
Contiv
Network Functions Virtualization (NFV)
Neutron
Open vSwitch
OpenDaylight (ODL)
YANG
NETCONF
RESTCONF
Review Questions
The RESTCONF interface is built around a small number of standardized requests. Which of the following are requests supported by RESTCONF?
GET
PUT
PATCH
All of these answers are correct.
NETCONF messages are encoded in a(n) ________ structure defined by the NETCONF standard.
JSON
XML
OWASP
RESTCONF
Which of the following is a Cisco resource where you can learn about network programmability and obtain sample code?
APIC
ACI
DevNet
NETCONF
A YANG-based server publishes a set of YANG modules, which taken together form the system’s _________.
YANG model
NETCONF model
RESTCONF model
gRPC model
Which of the following HTTP methods sends data to the server typically used in HTML forms and API requests?
POST
GET
TRACE
PUT
Which of the following is a solution that allows you to detect security threats in encrypted traffic without decrypting the packets?
ETA
Cisco Secure Email (formerly known as ESA)
Cisco Secure Web Appliance (formerly known as WSA)
None of these answers are correct.
Which of the following is an open-source project that allows you to deploy micro-segmentation policy-based services in container environments?
OVS
Contiv
ODL
All of these answers are correct.
NFV nodes such as virtual routers and firewalls need which of the following components as an underlying infrastructure?
A hypervisor
A virtual forwarder to connect individual instances
A network controller
All of these answers are correct.
There have been multiple IP tunneling mechanisms introduced throughout the years. Which of the following are examples of IP tunneling mechanisms?
VXLAN
SST
NVGRE
All of these answers are correct.
Which of the following is true about SDN?
SDN provides numerous benefits in the management plane. These benefits are in both physical switches and virtual switches.
SDN changed a few things in the management, control, and data planes. However, the big change was in the control and data planes in software-based switches and routers (including virtual switches inside of hypervisors).
SDN is now widely adopted in data centers.
All of these answers are correct.