FY23H2 - PVT - DAY 1 - Innovations in Programmability & Automation On Catalyst IOS XE Platforms
FY23H2 - PVT - DAY 1 - Innovations in Programmability & Automation On Catalyst IOS XE Platforms
Automation
On Catalyst IOS-XE Platforms
Renata Correa
Systems Engineer
June 2023
© 2023 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Introduction & Overview
IOS XE Device 1 Intro to Programmability
Programmability Innovations 17.x
Programmability
Model Driven Telemetry
TIG_MDT Container Update
Tooling
3 YANG Suite 3.0: SNMP-to-YANG mappings
Terraform for 2023 end-to-end IPsec use case
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Device
DeviceFeatures
Features
SNMP
SNMP
Interface
Interface
BGP
BGP QoS
QoS ACL
ACL …
…
Cisco-IOS-XE-native running-config
Cisco-IOS-XE-{feature}-rpc Actions
https://github.com/YangModels/yang/tree/master/vendor/cisco/xe
Management Interfaces
gNMI client
WebUI Cisco and Non-Cisco controllers gnmib process confd process
API
No – standard path
Gather-Point
mapped path JSON <--> XML
Proxy ?
Confd IOS Config DB Yes – Config
JSON <-->
fast path DB
convert data
Dial Out: Telemetry is pushed from the device to the collector based off configuration (push)
Publication / Subscription
Di HT DDi ia
al TP gR a l
Di
ov
PC l In
er
GE
al
In Tu In
T
Ou
nn
el
t
NETCONF
NETCONF
RESTCONF
RESTCONF gNMI
gNMI gRPC
gRPC XML, JSON, proto and kvGPB
YANG Data Models encoding
YANG Data Models
Intent-based Open
OpenConfig NativeNative
Cisco
Network Infrastructure
Consistent YANG data models
between interfaces
Configuration
Configurationand
andOperation
Operation
Storage
Time Series Database
Monitoring
and Visualizations
https://hub.docker.com/r/jeremycohoe/tig_mdt https://github.com/jeremycohoe/cisco-ios-xe-mdt
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/179/b_179_programmability_cg/m_179_prog_ietf_telemetry.html
© 2023 Cisco Systems, Inc. All rights reserved.
Updated TIG_MDT container now available! Updated April 2023
Upgrade coming to Telegraf, Influx, and Grafana Model Driven Telemetry
(TIG_MDT) Docker container
Making it easier to consume telemetry in production
Collector/Receiver
Decodes to text
Storage
Time Series Database
Monitoring
and Visualizations
https://hub.docker.com/r/jeremycohoe/tig_mdt https://github.com/jeremycohoe/cisco-ios-xe-mdt
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/179/b_179_programmability_cg/m_179_prog_ietf_telemetry.html
© 2023 Cisco Systems, Inc. All rights reserved.
Model Driven Telemetry Interface Comparison
NETCONF gRPC (Dial-Out) gNMI
• Cisco Secure Network Analytics (Stealthwatch) UDP Director (UDPD) replicates UDP traffic to
multiple destinations.
• Cisco Telemetry Broker
• Builds upon UDPD
• Optimizes telemetry pipelines for the hybrid cloud
• Simplifies the consumption of telemetry data for customers’ business-critical tools by
brokering hybrid cloud data, filtering unneeded data, and transforming data to a usable
format
This demonstrates that even when SNMP is only measuring Interfaces the load is still significantly higher
than YANG which is measuring significantly more YANG data
© 2023 Cisco Systems, Inc. All rights reserved.
Wireless – Programmable support
Platform x feature EWC C9800-CL C9800-L C9800-40/80
ZTP / Guest Shell N/A N/A 17.8 17.3.2a
17.7*
(data port only)
gNOI OS.proto
gNOI reset.proto
NETCONF Dial-In 16.8 16.7 17.3 16.10 17.4 16.7 16.8 17.3
gRPC Dial-Out 16.10 16.10 17.3 16.10 17.4 16.10 16.10 17.3
gNMI Dial-In MDT 17.8 17.8 17.2 17.2 17.3
gNOI OS.proto
gNOI reset.proto
NETCONF Dial-In 16.6 17.8 16.9 16.9 16.9 16.6 16.6 16.8 16.11
gRPC Dial-Out MDT 17.8 16.10 16.10 16.10 16.10 16.10 16.10 16.11
gNMI Dial-In MDT 17.8 16.12 16.12 16.12 16.12 16.12 16.12 16.12
Sockets
Tunnel Server
Di
+
gR
In GE In
al
PC
T Tu
written in Go.
Ou
nn
el
t
Customer request: “to create a transparent, bi-directional TCP-
NETCONF RESTCONF gNMI gRPC over-gRPC tunnel supporting gNMI services and other potential
YANG Data Models
protocols such as gNOI in the future”
Sockets
Tunnel Server
Without gRPC Tunnel, the gNMI client must connect With gRPC Tunnel the Cisco IOS XE device will
directly into the Cisco IOS XE gNMI listening port. create an outbound connection to the Tunnel
Server Host. From there, the gNMI client can
connect into the Cisco IOS XE device within the
Q: What is the gNMI Client: tunnel.
A: YANG Suite’s gNMI plugin can be used as the gNMI client for
GET/SET/Subscribe – however YANG Suite does not yet support gRPC
Tunnel Server
Q: What is the gNMI Tunnel Server Host software?
A: Currently gNMIc is the recommended tooling for tunnel server testing
and validation
© 2023 Cisco Systems, Inc. All rights reserved.
gRPC Tunnel quick start - configuration
#1
1. Install gnmic tooling bash -c "$ (curl -sL https://get-
2. Configure gnmic for tunnel server gnmic.openconfig.net)"
3. Enable the gnmic tunnel server #2
4. Enable gNMI API on IOS XE 17.11+ ! tunnel_server_config.yaml
5. Configure and enable gRPC tunnel
insecure: false
#4 conf t skip-verify: true
gnxi log: true
gnxi secure-init username: admin
service internal password: put_yours_here
gnxi secure-allow-self-signed-trustpoint
tunnel-server:
#5 address: ":4000"
gnxi grpctunnel dest ubuntuvm target-wait-time: "10s"
address 10.1.1.3
port 4000 #3
!source-vrf Mgmt-vrf gnmic --config ./tunnel_server_config.yaml
enable --use-tunnel-server subscribe
gnxi grpctunnel target GNMI_GNOI --path system/config/hostname -i 10s
enable --stream-mode sample
Match the port 4000 between the tunnel-server and the grpctunnel config
Update the IP, VRF, and credentials as needed for the environment
Secure gNXI configuration example included with self-signed certificates that are not validated
© 2023 Cisco Systems, Inc. All rights reserved.
gRPC Tunnel quick start - example
1. Install gnmic as tunnel server
2. Configure gnmic for tunnel service
3. Enable the gnmic server
4. Enable gNMI API #1
5. Configured and enable gRPC tunnel
#2
#4
#3
! tunnel_server_config.yaml
insecure: false
skip-verify: true
log: true
username: admin
password: put_yours_here
tunnel-server:
address: ":4000"
target-wait-time: "10s"
https://github.com/jeremycohoe/cisco-ios-xe-mdt/blob/master/telegraf-gnmi-proto.conf#L5
https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/179/b_179_programmability_cg/m_178_prog_gnmi.html
© 2023 Cisco Systems, Inc. All rights reserved.
PROTO encoding for gNMI GET/SET example
ZTP
Complete
https://www.youtube.com/watch?v=EAXnftG6odg
https://blogs.cisco.com/developer/device-provisioning-with-ios-xe-zero-touch-provisioning
https://devnetsandbox.cisco.com/RM/Diagram/Index/f2e2c0ad-844f-4a73-8085-00b5b28347a1?diagramType=Topology
© 2023 Cisco Systems, Inc. All rights reserved.
Secure ZTP (SZTP) workflow (based on RFC8572)
DHCP Server
ZTP Artifacts
ZTP Server
• Image Download
(Bootstrap Server 1) • CLI Configuration
• ZTP script:
6 Ø Native Python scripts
13
4/v6 143/ Web Server Ø Native bash scripts,
v Restconf Server
CP ion Ø Golang/c++/ pyinstaller
l DH opt (Artifacts) binaries
ti a w
Ini – Ne
e s
g
ssa
Me
1
2 M
ion
Bo ult
eract o ip
de l in t se tst le
AN G mo rv rap
ZTP Y er
IOS-XE s
d
wnl oade
rti fa ct do
A
Reference: https://tools.ietf.org/html/rfc8572
© 2023 Cisco Systems, Inc. All rights reserved. 36
17.11
RFC8572 Secure ZTP
RFC details: https://www.rfc-editor.org/rfc/rfc8572.html
1. Conveyed Information: used to encode the redirect information and onboarding information (switch config)
2. Ownership Certificate: used by a device to verify the signature over the conveyed information
3. Ownership Voucher: used to verify a device owner as defined by the manufacturer (from the MASA)
Bootstrapping Artifacts:
• Ownership Voucher
• Owner Certificate
• Conveyed Information
Some security requirements for classic ZTP are resolved using Secure ZTP: Validate Server
As part of the SZTP RFC, the device supports image upgrade as part of the conveyed information
road map
Server
TLS Handshake; SUDI Client Certificate Validate client
Server Certificate using SUDI
Event Notifications:
Cisco-IOS-XE-spanning-tree-events
Cisco-IOS-XE-logging-ios-actions
renamed from
Cisco-IOS-XE-exec-ios-actions-rpc
In order to programmatically generate Syslog notification messages
Cisco-IOS-XE-spanning-tree-events
newly introduced event notifications for STP interface guard events
Config:
Cisco-IOS-XE-cloud-services-cfg
https://pubhub.devnetcloud.com/media/yang-suite/docs/YANGSuite%20TDM%20-%20Communities.pdf
© 2023 Cisco Systems, Inc. All rights reserved. TDM = Technical Decision Maker
What’s Included
Core plugins
• Initial Release:
• Plugin Manager
• YANG File Manager
• Device Manager
• NETCONF (Python), gRPC Telemetry
• Docker install support with HTTPS
• Second Release:
• RESTCONF
• gNMI
• Python Integrations Additional plugins
• Third Release:
• gRPC Telemetry with TLS Support
• SNMP OID to YANG Xpath Mapping
• Ansible Integrations
• Pip install support
© 2023 Cisco Systems, Inc. All rights reserved.
SNMP OID to YANG Xpath demo
• This plugin allows mapping of SNMP OID’s to Xpaths
• Engineering resources are currently mapping various feature Xpath’s to OID’s
• This mapping will be included with YANG Suite in future releases
https://blogs.cisco.com/develop
er/363-yangsuite-01
https://www.youtube.co https://www.youtube
m/watch?v=PkbAOzZ1vN https://www.youtube.c
om/watch?v=soyWPr0f .com/watch?v=zVsOO
k 9_6rAU
J0s
https://blogs.cisco.com/developer/l
everageyangsuite01?dtid=osscdc00 Additional Resources
0283
https://blogs.cisco.com/developer/ https://github.com/CiscoDevNet/yangsuite/
yangallthetime01 https://developer.cisco.com/yangsuite/
https://eurl.io/#MaW78CelS YANG Suite General (external)
https://salesconnect.cisco.com/#/content-detail/fa072157-
b099-494b-8ec5-2522c6ab2bf6
Website: https://www.cisco.com/c/en/us/products/collateral/switches/catalyst-9300-series-switches/nb-06-catalyst-programmability-automation-wp.html
PDF: https://www.cisco.com/c/en/us/products/collateral/switches/catalyst-9300-series-switches/nb-06-catalyst-programmability-automation-wp.pdf
Webinar with live demos & examples: https://www.youtube.com/watch?v=LdcK5PnPu2I
http://cs.co/apiwppdf
© 2023 Cisco Systems, Inc. All rights reserved.
Cisco IOS XE Programmability – Booksprint Book
http://cs.co/programmabilitybook OR https://www.cisco.com/c/dam/en/us/products/collateral/enterprise-networks/nb-06-ios-xe-prog-ebook-cte-en.pdf
Table of Contents
Authors Telemetry
Acknowledgments Overview
About this Book Operational Data
Introduction Flow Data
Why Programmability Matters Use Cases
Lifecycle of Network Device Operations Subscription Tools
Use Cases Data Collectors
Operational Approaches Python
Next Steps Overview
General Concepts Python WebUI Sandbox
Cisco IOS XE On-Box Python
What is Programmability? Advanced On-Box Python
Application Programming Interfaces (APIs) Common Issues
Programming Languages Guest Shell
Structured Data Introduction
Data Encoding Formats Security
Day 0 Device Onboarding Confuration and Updates
Introduction Resource Allocation
Zero-Touch Provisioning (ZTP) Scenarios Use Cases
Basic ZTP Workow Next Steps
Advanced ZTP Workows Application Hosting
Considerations Introduction
Next Steps Cisco Application-Hosting Framework
YANG Containers and Virtual Machines
Overview Use Case
YANG Concepts Next Steps
YANG Native vs Open Data Models Controllers
YANG Data Model Highlights Introduction
YANG Tools Common Controllers
Network Device APIs Why Use a Controller?
Overview DevOps and NetDevOps
NETCONF Introduction
RESTCONF Continuous Integration and Delivery
Comparison of NETCONF and DevOps Tools
RESTCONF Next Steps
Next Steps Appendices
Additional Resources
Acronyms
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/1710/b_1710_programmability_cg.html
developer.cisco.com
https://salesconnect.cisco.com/EnterpriseNetworking/s/programmability-and-automation